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 size_t,size_t (*)(const void *),MagickBooleanType (*)
00039 (const void *,const void *),void *(*)(void *),void *(*)(void *));
00040
00041 extern MagickExport LinkedListInfo
00042 *DestroyLinkedList(LinkedListInfo *,void *(*)(void *)),
00043 *NewLinkedList(const size_t);
00044
00045 extern MagickExport MagickBooleanType
00046 AppendValueToLinkedList(LinkedListInfo *,const void *),
00047 CompareHashmapString(const void *,const void *),
00048 CompareHashmapStringInfo(const void *,const void *),
00049 InsertValueInLinkedList(LinkedListInfo *,const size_t,const void *),
00050 InsertValueInSortedLinkedList(LinkedListInfo *,
00051 int (*)(const void *,const void *),void **,const void *),
00052 IsHashmapEmpty(const HashmapInfo *),
00053 IsLinkedListEmpty(const LinkedListInfo *),
00054 LinkedListToArray(LinkedListInfo *,void **),
00055 PutEntryInHashmap(HashmapInfo *,const void *,const void *);
00056
00057 extern MagickExport size_t
00058 GetNumberOfElementsInLinkedList(const LinkedListInfo *),
00059 GetNumberOfEntriesInHashmap(const HashmapInfo *),
00060 HashPointerType(const void *),
00061 HashStringType(const void *),
00062 HashStringInfoType(const void *);
00063
00064 extern MagickExport void
00065 ClearLinkedList(LinkedListInfo *,void *(*)(void *)),
00066 *GetLastValueInLinkedList(LinkedListInfo *),
00067 *GetNextKeyInHashmap(HashmapInfo *),
00068 *GetNextValueInHashmap(HashmapInfo *),
00069 *GetNextValueInLinkedList(LinkedListInfo *),
00070 *GetValueFromHashmap(HashmapInfo *,const void *),
00071 *GetValueFromLinkedList(LinkedListInfo *,const size_t),
00072 *RemoveElementByValueFromLinkedList(LinkedListInfo *,const void *),
00073 *RemoveElementFromLinkedList(LinkedListInfo *,const size_t),
00074 *RemoveEntryFromHashmap(HashmapInfo *,const void *),
00075 *RemoveLastElementFromLinkedList(LinkedListInfo *),
00076 ResetHashmapIterator(HashmapInfo *),
00077 ResetLinkedListIterator(LinkedListInfo *);
00078
00079 #if defined(__cplusplus) || defined(c_plusplus)
00080 }
00081 #endif
00082
00083 #endif