2 Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore hash methods.
18 #ifndef _MAGICKCORE_HASHMAP_H
19 #define _MAGICKCORE_HASHMAP_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #define SmallHashmapSize 17
26 #define MediumHashmapSize 509
27 #define LargeHashmapSize 8191
28 #define HugeHashmapSize 131071
30 typedef struct _HashmapInfo
33 typedef struct _LinkedListInfo
36 extern MagickExport HashmapInfo
37 *DestroyHashmap(HashmapInfo *),
38 *NewHashmap(const unsigned long,size_t (*)(const void *),
39 MagickBooleanType (*)(const void *,const void *),void *(*)(void *),
42 extern MagickExport LinkedListInfo
43 *DestroyLinkedList(LinkedListInfo *,void *(*)(void *)),
44 *NewLinkedList(const unsigned long);
46 extern MagickExport MagickBooleanType
47 AppendValueToLinkedList(LinkedListInfo *,const void *),
48 CompareHashmapString(const void *,const void *),
49 CompareHashmapStringInfo(const void *,const void *),
50 InsertValueInLinkedList(LinkedListInfo *,const unsigned long,const void *),
51 InsertValueInSortedLinkedList(LinkedListInfo *,
52 int (*)(const void *,const void *),void **,const void *),
53 IsHashmapEmpty(const HashmapInfo *),
54 IsLinkedListEmpty(const LinkedListInfo *),
55 LinkedListToArray(LinkedListInfo *,void **),
56 PutEntryInHashmap(HashmapInfo *,const void *,const void *);
58 extern MagickExport size_t
59 HashPointerType(const void *),
60 HashStringType(const void *),
61 HashStringInfoType(const void *);
63 extern MagickExport unsigned long
64 GetNumberOfElementsInLinkedList(const LinkedListInfo *),
65 GetNumberOfEntriesInHashmap(const HashmapInfo *);
67 extern MagickExport void
68 ClearLinkedList(LinkedListInfo *,void *(*)(void *)),
69 *GetLastValueInLinkedList(LinkedListInfo *),
70 *GetNextKeyInHashmap(HashmapInfo *),
71 *GetNextValueInHashmap(HashmapInfo *),
72 *GetNextValueInLinkedList(LinkedListInfo *),
73 *GetValueFromHashmap(HashmapInfo *,const void *),
74 *GetValueFromLinkedList(LinkedListInfo *,const unsigned long),
75 *RemoveElementByValueFromLinkedList(LinkedListInfo *,const void *),
76 *RemoveElementFromLinkedList(LinkedListInfo *,const unsigned long),
77 *RemoveEntryFromHashmap(HashmapInfo *,const void *),
78 *RemoveLastElementFromLinkedList(LinkedListInfo *),
79 ResetHashmapIterator(HashmapInfo *),
80 ResetLinkedListIterator(LinkedListInfo *);
82 #if defined(__cplusplus) || defined(c_plusplus)