]> granicus.if.org Git - imagemagick/blob - magick/hashmap.h
(no commit message)
[imagemagick] / magick / hashmap.h
1 /*
2   Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization
3   dedicated to making software imaging solutions freely available.
4   
5   You may not use this file except in compliance with the License.
6   obtain a copy of the License at
7   
8     http://www.imagemagick.org/script/license.php
9   
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.
15
16   MagickCore hash methods.
17 */
18 #ifndef _MAGICKCORE_HASHMAP_H
19 #define _MAGICKCORE_HASHMAP_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #define SmallHashmapSize  17
26 #define MediumHashmapSize  509
27 #define LargeHashmapSize  8191
28 #define HugeHashmapSize  131071
29
30 typedef struct _HashmapInfo
31   HashmapInfo;
32
33 typedef struct _LinkedListInfo
34   LinkedListInfo;
35
36 extern MagickExport HashmapInfo
37   *DestroyHashmap(HashmapInfo *),
38   *NewHashmap(const unsigned long,size_t (*)(const void *),
39     MagickBooleanType (*)(const void *,const void *),void *(*)(void *),
40     void *(*)(void *));
41
42 extern MagickExport LinkedListInfo
43   *DestroyLinkedList(LinkedListInfo *,void *(*)(void *)),
44   *NewLinkedList(const unsigned long);
45
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 *);
57
58 extern MagickExport size_t
59   HashPointerType(const void *),
60   HashStringType(const void *),
61   HashStringInfoType(const void *);
62
63 extern MagickExport unsigned long
64   GetNumberOfElementsInLinkedList(const LinkedListInfo *),
65   GetNumberOfEntriesInHashmap(const HashmapInfo *);
66
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 *);
81
82 #if defined(__cplusplus) || defined(c_plusplus)
83 }
84 #endif
85
86 #endif