MagickCore 7.0.10
hashmap.c File Reference
#include "wizard/studio.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/hash.h"
#include "wizard/hashmap.h"
#include "wizard/memory_.h"
#include "wizard/semaphore.h"
#include "wizard/string_.h"
Include dependency graph for hashmap.c:

Go to the source code of this file.

Data Structures

struct  _ElementInfo
 
struct  _EntryInfo
 
struct  _LinkedListInfo
 
struct  _HashmapInfo
 

Macros

#define MaxCapacities   20
 

Typedefs

typedef struct _ElementInfo ElementInfo
 
typedef struct _EntryInfo EntryInfo
 

Functions

WizardExport WizardBooleanType AppendValueToLinkedList (LinkedListInfo *list_info, const void *value)
 
WizardExport void ClearLinkedList (LinkedListInfo *list_info, void *(*relinquish_value)(void *))
 
WizardExport WizardBooleanType CompareHashmapString (const void *target, const void *source)
 
WizardExport WizardBooleanType CompareHashmapStringInfo (const void *target, const void *source)
 
WizardExport HashmapInfoDestroyHashmap (HashmapInfo *hashmap_info)
 
WizardExport LinkedListInfoDestroyLinkedList (LinkedListInfo *list_info, void *(*relinquish_value)(void *))
 
WizardExport void * GetLastValueInLinkedList (LinkedListInfo *list_info)
 
WizardExport void * GetNextKeyInHashmap (HashmapInfo *hashmap_info)
 
WizardExport void * GetNextValueInHashmap (HashmapInfo *hashmap_info)
 
WizardExport void * GetNextValueInLinkedList (LinkedListInfo *list_info)
 
WizardExport size_t GetNumberOfEntriesInHashmap (const HashmapInfo *hashmap_info)
 
WizardExport size_t GetNumberOfElementsInLinkedList (const LinkedListInfo *list_info)
 
WizardExport void * GetValueFromHashmap (HashmapInfo *hashmap_info, const void *key)
 
WizardExport void * GetValueFromLinkedList (LinkedListInfo *list_info, const size_t index)
 
WizardExport size_t HashPointerType (const void *pointer)
 
WizardExport size_t HashStringType (const void *string)
 
WizardExport size_t HashStringInfoType (const void *string)
 
WizardExport WizardBooleanType InsertValueInLinkedList (LinkedListInfo *list_info, const size_t index, const void *value)
 
WizardExport WizardBooleanType InsertValueInSortedLinkedList (LinkedListInfo *list_info, int(*compare)(const void *, const void *), void **replace, const void *value)
 
WizardExport WizardBooleanType IsHashmapEmpty (const HashmapInfo *hashmap_info)
 
WizardExport WizardBooleanType IsLinkedListEmpty (const LinkedListInfo *list_info)
 
WizardExport WizardBooleanType LinkedListToArray (LinkedListInfo *list_info, void **array)
 
WizardExport HashmapInfoNewHashmap (const size_t capacity, size_t(*hash)(const void *), WizardBooleanType(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *))
 
WizardExport LinkedListInfoNewLinkedList (const size_t capacity)
 
static WizardBooleanType IncreaseHashmapCapacity (HashmapInfo *hashmap_info)
 
WizardExport WizardBooleanType PutEntryInHashmap (HashmapInfo *hashmap_info, const void *key, const void *value)
 
WizardExport void * RemoveElementByValueFromLinkedList (LinkedListInfo *list_info, const void *value)
 
WizardExport void * RemoveElementFromLinkedList (LinkedListInfo *list_info, const size_t index)
 
WizardExport void * RemoveEntryFromHashmap (HashmapInfo *hashmap_info, const void *key)
 
WizardExport void * RemoveLastElementFromLinkedList (LinkedListInfo *list_info)
 
WizardExport void ResetHashmapIterator (HashmapInfo *hashmap_info)
 
WizardExport void ResetLinkedListIterator (LinkedListInfo *list_info)
 

Macro Definition Documentation

◆ MaxCapacities

#define MaxCapacities   20

Typedef Documentation

◆ ElementInfo

typedef struct _ElementInfo ElementInfo

◆ EntryInfo

typedef struct _EntryInfo EntryInfo

Function Documentation

◆ AppendValueToLinkedList()

◆ ClearLinkedList()

◆ CompareHashmapString()

WizardExport WizardBooleanType CompareHashmapString ( const void *  target,
const void *  source 
)

Definition at line 257 of file hashmap.c.

References WizardFalse, and WizardTrue.

◆ CompareHashmapStringInfo()

WizardExport WizardBooleanType CompareHashmapStringInfo ( const void *  target,
const void *  source 
)

Definition at line 295 of file hashmap.c.

References CompareStringInfo(), WizardFalse, and WizardTrue.

◆ DestroyHashmap()

◆ DestroyLinkedList()

◆ GetLastValueInLinkedList()

◆ GetNextKeyInHashmap()

◆ GetNextValueInHashmap()

◆ GetNextValueInLinkedList()

◆ GetNumberOfElementsInLinkedList()

◆ GetNumberOfEntriesInHashmap()

WizardExport size_t GetNumberOfEntriesInHashmap ( const HashmapInfo hashmap_info)

Definition at line 646 of file hashmap.c.

References _HashmapInfo::entries, _HashmapInfo::signature, and WizardSignature.

◆ GetValueFromHashmap()

◆ GetValueFromLinkedList()

◆ HashPointerType()

WizardExport size_t HashPointerType ( const void *  pointer)

Definition at line 847 of file hashmap.c.

Referenced by NewHashmap().

◆ HashStringInfoType()

WizardExport size_t HashStringInfoType ( const void *  string)

Definition at line 941 of file hashmap.c.

References GetStringInfoDatum(), and GetStringInfoLength().

◆ HashStringType()

◆ IncreaseHashmapCapacity()

◆ InsertValueInLinkedList()

◆ InsertValueInSortedLinkedList()

◆ IsHashmapEmpty()

WizardExport WizardBooleanType IsHashmapEmpty ( const HashmapInfo hashmap_info)

◆ IsLinkedListEmpty()

WizardExport WizardBooleanType IsLinkedListEmpty ( const LinkedListInfo list_info)

◆ LinkedListToArray()

◆ NewHashmap()

WizardExport HashmapInfo * NewHashmap ( const size_t  capacity,
size_t(*)(const void *)  hash,
WizardBooleanType(*)(const void *, const void *)  compare,
void *(*)(void *)  relinquish_key,
void *(*)(void *)  relinquish_value 
)

◆ NewLinkedList()

◆ PutEntryInHashmap()

◆ RemoveElementByValueFromLinkedList()

◆ RemoveElementFromLinkedList()

◆ RemoveEntryFromHashmap()

◆ RemoveLastElementFromLinkedList()

◆ ResetHashmapIterator()

◆ ResetLinkedListIterator()