00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef _MAGICKCORE_HASHMAP_H
00019 #define _MAGICKCORE_HASHMAP_H
00020 
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #define SmallHashmapSize  17
00026 #define MediumHashmapSize  509
00027 #define LargeHashmapSize  8191
00028 #define HugeHashmapSize  131071
00029 
00030 typedef struct _HashmapInfo
00031   HashmapInfo;
00032 
00033 typedef struct _LinkedListInfo
00034   LinkedListInfo;
00035 
00036 extern MagickExport HashmapInfo
00037   *DestroyHashmap(HashmapInfo *),
00038   *NewHashmap(const unsigned long,size_t (*)(const void *),
00039     MagickBooleanType (*)(const void *,const void *),void *(*)(void *),
00040     void *(*)(void *));
00041 
00042 extern MagickExport LinkedListInfo
00043   *DestroyLinkedList(LinkedListInfo *,void *(*)(void *)),
00044   *NewLinkedList(const unsigned long);
00045 
00046 extern MagickExport MagickBooleanType
00047   AppendValueToLinkedList(LinkedListInfo *,const void *),
00048   CompareHashmapString(const void *,const void *),
00049   CompareHashmapStringInfo(const void *,const void *),
00050   InsertValueInLinkedList(LinkedListInfo *,const unsigned long,const void *),
00051   InsertValueInSortedLinkedList(LinkedListInfo *,
00052     int (*)(const void *,const void *),void **,const void *),
00053   IsHashmapEmpty(const HashmapInfo *),
00054   IsLinkedListEmpty(const LinkedListInfo *),
00055   LinkedListToArray(LinkedListInfo *,void **),
00056   PutEntryInHashmap(HashmapInfo *,const void *,const void *);
00057 
00058 extern MagickExport size_t
00059   HashPointerType(const void *),
00060   HashStringType(const void *),
00061   HashStringInfoType(const void *);
00062 
00063 extern MagickExport unsigned long
00064   GetNumberOfElementsInLinkedList(const LinkedListInfo *),
00065   GetNumberOfEntriesInHashmap(const HashmapInfo *);
00066 
00067 extern MagickExport void
00068   ClearLinkedList(LinkedListInfo *,void *(*)(void *)),
00069   *GetLastValueInLinkedList(LinkedListInfo *),
00070   *GetNextKeyInHashmap(HashmapInfo *),
00071   *GetNextValueInHashmap(HashmapInfo *),
00072   *GetNextValueInLinkedList(LinkedListInfo *),
00073   *GetValueFromHashmap(HashmapInfo *,const void *),
00074   *GetValueFromLinkedList(LinkedListInfo *,const unsigned long),
00075   *RemoveElementByValueFromLinkedList(LinkedListInfo *,const void *),
00076   *RemoveElementFromLinkedList(LinkedListInfo *,const unsigned long),
00077   *RemoveEntryFromHashmap(HashmapInfo *,const void *),
00078   *RemoveLastElementFromLinkedList(LinkedListInfo *),
00079   ResetHashmapIterator(HashmapInfo *),
00080   ResetLinkedListIterator(LinkedListInfo *);
00081 
00082 #if defined(__cplusplus) || defined(c_plusplus)
00083 }
00084 #endif
00085 
00086 #endif