# hashmap.h

Go to the documentation of this file.

    00001 /*
    00002   Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
    00003   dedicated to making software imaging solutions freely available.
    00004
    00005   You may not use this file except in compliance with the License.
    00006   obtain a copy of the License at
    00007
    00008     http://www.imagemagick.org/script/license.php
    00009
    00010   Unless required by applicable law or agreed to in writing, software
    00011   distributed under the License is distributed on an "AS IS" BASIS,
    00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013   See the License for the specific language governing permissions and
    00014   limitations under the License.
    00015
    00016   MagickCore hash methods.
    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