|
WizardsToolkit
1.0.7
|
#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"
Go to the source code of this file.
Data Structures | |
| struct | _ElementInfo |
| struct | _EntryInfo |
| struct | _LinkedListInfo |
| struct | _HashmapInfo |
Defines | |
| #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 HashmapInfo * | DestroyHashmap (HashmapInfo *hashmap_info) |
| WizardExport LinkedListInfo * | DestroyLinkedList (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 HashmapInfo * | NewHashmap (const size_t capacity, size_t(*hash)(const void *), WizardBooleanType(*compare)(const void *, const void *), void *(*relinquish_key)(void *), void *(*relinquish_value)(void *)) |
| WizardExport LinkedListInfo * | NewLinkedList (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) |
| #define MaxCapacities 20 |
Referenced by IncreaseHashmapCapacity().
| typedef struct _ElementInfo ElementInfo |
| typedef struct _EntryInfo EntryInfo |
| WizardExport WizardBooleanType AppendValueToLinkedList | ( | LinkedListInfo * | list_info, |
| const void * | value | ||
| ) |
Definition at line 155 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, _LinkedListInfo::capacity, AcquireWizardMemory(), _ElementInfo::value, _ElementInfo::next, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, _LinkedListInfo::head, _LinkedListInfo::tail, UnlockSemaphoreInfo(), and WizardTrue.
Referenced by GetConfigureOptions(), GetConfigurePaths(), LoadConfigureList(), LoadConfigureLists(), ThrowException(), LoadLogList(), LoadLogLists(), and LoadMimeList().
| WizardExport void ClearLinkedList | ( | LinkedListInfo * | list_info, |
| void *(*)(void *) | relinquish_value | ||
| ) |
Definition at line 211 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::value, _ElementInfo::next, RelinquishWizardMemory(), _LinkedListInfo::tail, _LinkedListInfo::next, _LinkedListInfo::elements, and UnlockSemaphoreInfo().
| WizardExport WizardBooleanType CompareHashmapString | ( | const void * | target, |
| const void * | source | ||
| ) |
Definition at line 267 of file hashmap.c.
References WizardTrue, and WizardFalse.
| WizardExport WizardBooleanType CompareHashmapStringInfo | ( | const void * | target, |
| const void * | source | ||
| ) |
Definition at line 305 of file hashmap.c.
References CompareStringInfo(), WizardTrue, and WizardFalse.
| WizardExport HashmapInfo* DestroyHashmap | ( | HashmapInfo * | hashmap_info | ) |
Definition at line 339 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::capacity, _HashmapInfo::map, _LinkedListInfo::next, _LinkedListInfo::head, GetNextValueInLinkedList(), _HashmapInfo::relinquish_key, _EntryInfo::key, _HashmapInfo::relinquish_value, _EntryInfo::value, DestroyLinkedList(), RelinquishWizardMemory(), UnlockSemaphoreInfo(), and DestroySemaphoreInfo().
| WizardExport LinkedListInfo* DestroyLinkedList | ( | LinkedListInfo * | list_info, |
| void *(*)(void *) | relinquish_value | ||
| ) |
Definition at line 409 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::value, _ElementInfo::next, RelinquishWizardMemory(), UnlockSemaphoreInfo(), and DestroySemaphoreInfo().
Referenced by ConfigureComponentTerminus(), DestroyConfigureOptions(), GetConfigureOptions(), DestroyExceptionInfo(), DestroyHashmap(), LogComponentTerminus(), and MimeComponentTerminus().
| WizardExport void* GetLastValueInLinkedList | ( | LinkedListInfo * | list_info | ) |
Definition at line 460 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::tail, _ElementInfo::value, and UnlockSemaphoreInfo().
Referenced by ThrowException().
| WizardExport void* GetNextKeyInHashmap | ( | HashmapInfo * | hashmap_info | ) |
Definition at line 499 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::next, _HashmapInfo::capacity, _HashmapInfo::map, _HashmapInfo::head_of_list, _LinkedListInfo::next, _LinkedListInfo::head, WizardTrue, GetNextValueInLinkedList(), _EntryInfo::key, and UnlockSemaphoreInfo().
| WizardExport void* GetNextValueInHashmap | ( | HashmapInfo * | hashmap_info | ) |
Definition at line 562 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::next, _HashmapInfo::capacity, _HashmapInfo::map, _HashmapInfo::head_of_list, _LinkedListInfo::next, _LinkedListInfo::head, WizardTrue, GetNextValueInLinkedList(), _EntryInfo::value, and UnlockSemaphoreInfo().
| WizardExport void* GetNextValueInLinkedList | ( | LinkedListInfo * | list_info | ) |
Definition at line 625 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, UnlockSemaphoreInfo(), _ElementInfo::value, and _ElementInfo::next.
Referenced by GetConfigureInfo(), GetConfigureInfoList(), GetConfigureList(), GetConfigureOptions(), LoadConfigureLists(), CatchException(), InheritException(), DestroyHashmap(), GetNextKeyInHashmap(), GetNextValueInHashmap(), GetValueFromHashmap(), PutEntryInHashmap(), RemoveEntryFromHashmap(), GetLogInfo(), GetLogInfoList(), GetLogList(), LoadLogLists(), GetMimeInfo(), GetMimeInfoList(), GetMimeList(), and LoadMimeLists().
| WizardExport size_t GetNumberOfElementsInLinkedList | ( | const LinkedListInfo * | list_info | ) |
Definition at line 702 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, and _LinkedListInfo::elements.
Referenced by GetConfigureInfoList(), GetConfigureList(), GetConfigureOptions(), GetLogInfoList(), GetLogList(), GetMimeInfoList(), and GetMimeList().
| WizardExport size_t GetNumberOfEntriesInHashmap | ( | const HashmapInfo * | hashmap_info | ) |
Definition at line 668 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, and _HashmapInfo::entries.
| WizardExport void* GetValueFromHashmap | ( | HashmapInfo * | hashmap_info, |
| const void * | key | ||
| ) |
Definition at line 736 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::hash, _HashmapInfo::map, _HashmapInfo::capacity, _LinkedListInfo::next, _LinkedListInfo::head, GetNextValueInLinkedList(), _EntryInfo::hash, WizardTrue, _HashmapInfo::compare, _EntryInfo::key, _EntryInfo::value, and UnlockSemaphoreInfo().
| WizardExport void* GetValueFromLinkedList | ( | LinkedListInfo * | list_info, |
| const size_t | index | ||
| ) |
Definition at line 815 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::value, UnlockSemaphoreInfo(), _LinkedListInfo::tail, and _ElementInfo::next.
Referenced by GetConfigureInfo(), GetLogInfo(), SetLogEventMask(), and GetMimeInfo().
| WizardExport size_t HashPointerType | ( | const void * | pointer | ) |
Definition at line 877 of file hashmap.c.
Referenced by NewHashmap().
| WizardExport size_t HashStringInfoType | ( | const void * | string | ) |
Definition at line 971 of file hashmap.c.
References GetStringInfoDatum(), and GetStringInfoLength().
| WizardExport size_t HashStringType | ( | const void * | string | ) |
Definition at line 913 of file hashmap.c.
References AcquireHashInfo(), CRC64Hash, InitializeHash(), StringToStringInfo(), UpdateHash(), FinalizeHash(), GetHashDigest(), GetStringInfoDatum(), GetStringInfoLength(), and DestroyHashInfo().
| static WizardBooleanType IncreaseHashmapCapacity | ( | HashmapInfo * | hashmap_info | ) | [static] |
Definition at line 1452 of file hashmap.c.
References MaxCapacities, _HashmapInfo::capacity, WizardFalse, AcquireQuantumMemory(), ResetWizardMemory(), _HashmapInfo::map, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::next, _ElementInfo::value, _EntryInfo::hash, NewLinkedList(), _LinkedListInfo::next, _LinkedListInfo::elements, _LinkedListInfo::signature, WizardSignature, UnlockSemaphoreInfo(), DestroySemaphoreInfo(), RelinquishWizardMemory(), and WizardTrue.
Referenced by PutEntryInHashmap().
| WizardExport WizardBooleanType InsertValueInLinkedList | ( | LinkedListInfo * | list_info, |
| const size_t | index, | ||
| const void * | value | ||
| ) |
Definition at line 1021 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, _LinkedListInfo::capacity, AcquireWizardMemory(), _ElementInfo::value, _ElementInfo::next, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, _LinkedListInfo::head, _LinkedListInfo::tail, UnlockSemaphoreInfo(), and WizardTrue.
Referenced by GetConfigureInfo(), PutEntryInHashmap(), GetLogInfo(), and GetMimeInfo().
| WizardExport WizardBooleanType InsertValueInSortedLinkedList | ( | LinkedListInfo * | list_info, |
| int(*)(const void *, const void *) | compare, | ||
| void ** | replace, | ||
| const void * | value | ||
| ) |
Definition at line 1124 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, _LinkedListInfo::capacity, AcquireWizardMemory(), _ElementInfo::value, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _ElementInfo::next, _LinkedListInfo::head, RelinquishWizardMemory(), _LinkedListInfo::tail, UnlockSemaphoreInfo(), and WizardTrue.
| WizardExport WizardBooleanType IsHashmapEmpty | ( | const HashmapInfo * | hashmap_info | ) |
Definition at line 1211 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _HashmapInfo::entries, and WizardTrue.
| WizardExport WizardBooleanType IsLinkedListEmpty | ( | const LinkedListInfo * | list_info | ) |
Definition at line 1242 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, and WizardTrue.
Referenced by GetConfigureInfo(), GetLogInfo(), IsEventLogging(), GetMimeInfo(), and LoadMimeLists().
| WizardExport WizardBooleanType LinkedListToArray | ( | LinkedListInfo * | list_info, |
| void ** | array | ||
| ) |
Definition at line 1277 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::value, _ElementInfo::next, UnlockSemaphoreInfo(), and WizardTrue.
| 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 | ||
| ) |
Definition at line 1346 of file hashmap.c.
References AcquireWizardMemory(), ThrowWizardFatalError, CacheDomain, MemoryError, ResetWizardMemory(), _HashmapInfo::hash, HashPointerType(), _HashmapInfo::compare, _HashmapInfo::relinquish_key, _HashmapInfo::relinquish_value, _HashmapInfo::entries, _HashmapInfo::capacity, _HashmapInfo::map, AcquireQuantumMemory(), _HashmapInfo::debug, IsEventLogging(), _HashmapInfo::semaphore, AllocateSemaphoreInfo(), _HashmapInfo::signature, and WizardSignature.
| WizardExport LinkedListInfo* NewLinkedList | ( | const size_t | capacity | ) |
Definition at line 1403 of file hashmap.c.
References AcquireWizardMemory(), ThrowWizardFatalError, CacheDomain, MemoryError, ResetWizardMemory(), _LinkedListInfo::capacity, _LinkedListInfo::elements, _LinkedListInfo::head, _LinkedListInfo::tail, _LinkedListInfo::next, _LinkedListInfo::debug, WizardFalse, _LinkedListInfo::semaphore, AllocateSemaphoreInfo(), _LinkedListInfo::signature, and WizardSignature.
Referenced by GetConfigureOptions(), GetConfigurePaths(), LoadConfigureList(), LoadConfigureLists(), GetExceptionInfo(), IncreaseHashmapCapacity(), PutEntryInHashmap(), LoadLogList(), LoadLogLists(), and LoadMimeList().
| WizardExport WizardBooleanType PutEntryInHashmap | ( | HashmapInfo * | hashmap_info, |
| const void * | key, | ||
| const void * | value | ||
| ) |
Definition at line 1533 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, AcquireWizardMemory(), LockSemaphoreInfo(), _HashmapInfo::semaphore, _EntryInfo::hash, _HashmapInfo::hash, _EntryInfo::key, _EntryInfo::value, _HashmapInfo::map, _HashmapInfo::capacity, NewLinkedList(), _LinkedListInfo::next, _LinkedListInfo::head, GetNextValueInLinkedList(), WizardTrue, _HashmapInfo::compare, RemoveElementFromLinkedList(), _HashmapInfo::relinquish_key, _HashmapInfo::relinquish_value, RelinquishWizardMemory(), InsertValueInLinkedList(), UnlockSemaphoreInfo(), _LinkedListInfo::elements, IncreaseHashmapCapacity(), and _HashmapInfo::entries.
| WizardExport void* RemoveElementByValueFromLinkedList | ( | LinkedListInfo * | list_info, |
| const void * | value | ||
| ) |
Definition at line 1637 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::head, _ElementInfo::value, _LinkedListInfo::next, _ElementInfo::next, RelinquishWizardMemory(), UnlockSemaphoreInfo(), and _LinkedListInfo::tail.
Referenced by GetConfigureInfo(), GetConfigurePaths(), GetLogInfo(), and GetMimeInfo().
| WizardExport void* RemoveElementFromLinkedList | ( | LinkedListInfo * | list_info, |
| const size_t | index | ||
| ) |
Definition at line 1711 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, _LinkedListInfo::head, _ElementInfo::next, _ElementInfo::value, RelinquishWizardMemory(), _LinkedListInfo::tail, and UnlockSemaphoreInfo().
Referenced by PutEntryInHashmap(), and RemoveEntryFromHashmap().
| WizardExport void* RemoveEntryFromHashmap | ( | HashmapInfo * | hashmap_info, |
| const void * | key | ||
| ) |
Definition at line 1785 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::hash, _HashmapInfo::map, _HashmapInfo::capacity, _LinkedListInfo::next, _LinkedListInfo::head, GetNextValueInLinkedList(), _EntryInfo::hash, WizardTrue, _HashmapInfo::compare, _EntryInfo::key, RemoveElementFromLinkedList(), UnlockSemaphoreInfo(), _HashmapInfo::relinquish_key, _EntryInfo::value, RelinquishWizardMemory(), and _HashmapInfo::entries.
| WizardExport void* RemoveLastElementFromLinkedList | ( | LinkedListInfo * | list_info | ) |
Definition at line 1874 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, _LinkedListInfo::elements, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, _LinkedListInfo::tail, _LinkedListInfo::head, _ElementInfo::value, RelinquishWizardMemory(), _ElementInfo::next, and UnlockSemaphoreInfo().
Referenced by ClearWizardException().
| WizardExport void ResetHashmapIterator | ( | HashmapInfo * | hashmap_info | ) |
Definition at line 1935 of file hashmap.c.
References _HashmapInfo::signature, WizardSignature, _HashmapInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _HashmapInfo::semaphore, _HashmapInfo::next, _HashmapInfo::head_of_list, and UnlockSemaphoreInfo().
| WizardExport void ResetLinkedListIterator | ( | LinkedListInfo * | list_info | ) |
Definition at line 1971 of file hashmap.c.
References _LinkedListInfo::signature, WizardSignature, _LinkedListInfo::debug, WizardFalse, LogWizardEvent(), TraceEvent, GetWizardModule, LockSemaphoreInfo(), _LinkedListInfo::semaphore, _LinkedListInfo::next, _LinkedListInfo::head, and UnlockSemaphoreInfo().
Referenced by GetConfigureInfo(), GetConfigureInfoList(), GetConfigureList(), GetConfigureOptions(), CatchException(), InheritException(), GetLogInfo(), GetLogInfoList(), GetLogList(), GetMimeInfo(), GetMimeInfoList(), and GetMimeList().