Unix
Mac OS X
Windows
Options
Unix
Windows

# Module hashmap Methods

## AppendValueToLinkedList

AppendValueToLinkedList() appends a value to the end of the linked-list.

The format of the AppendValueToLinkedList method is:

      WizardBooleanType AppendValueToLinkedList(LinkedListInfo *list_info,
        const void *value)

A description of each parameter follows:

##### list_info

The linked-list info.

##### value

The value.

## ClearLinkedList

ClearLinkedList() clears all the elements from the linked-list.

The format of the ClearLinkedList method is:

      void ClearLinkedList(LinkedListInfo *list_info,
        void *(*relinquish_value)(void *))

A description of each parameter follows:

##### list_info

The linked-list info.

##### relinquish_value

The value deallocation method; typically RelinquishWizardMemory().

## CompareHashmapString

CompareHashmapString() finds an entry in a hash-map based on the contents of a string.

The format of the CompareHashmapString method is:

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

A description of each parameter follows:

##### target

The target string.

##### source

The source string.

## CompareHashmapStringInfo

CompareHashmapStringInfo() finds an entry in a hash-map based on the contents of a string.

The format of the CompareHashmapStringInfo method is:

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

A description of each parameter follows:

##### target

The target string.

##### source

The source string.

## DestroyHashmap

DestroyHashmap() frees the hash-map and all associated resources.

The format of the DestroyHashmap method is:

      HashmapInfo *DestroyHashmap(HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## DestroyLinkedList

DestroyLinkedList() frees the linked-list and all associated resources.

The format of the DestroyLinkedList method is:

      LinkedListInfo *DestroyLinkedList(LinkedListInfo *list_info,
        void *(*relinquish_value)(void *))

A description of each parameter follows:

##### list_info

The linked-list info.

##### relinquish_value

The value deallocation method; typically RelinquishWizardMemory().

## GetLastValueInLinkedList

GetLastValueInLinkedList() gets the last value in the linked-list.

The format of the GetLastValueInLinkedList method is:

      void *GetLastValueInLinkedList(LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked_list info.

## GetNextKeyInHashmap

GetNextKeyInHashmap() gets the next key in the hash-map.

The format of the GetNextKeyInHashmap method is:

      void *GetNextKeyInHashmap(HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## GetNextValueInHashmap

GetNextValueInHashmap() gets the next value in the hash-map.

The format of the GetNextValueInHashmap method is:

      void *GetNextValueInHashmap(HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## GetNextValueInLinkedList

GetNextValueInLinkedList() gets the next value in the linked-list.

The format of the GetNextValueInLinkedList method is:

      void *GetNextValueInLinkedList(LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked-list info.

## GetNumberOfEntriesInHashmap

GetNumberOfEntriesInHashmap() returns the number of entries in the hash-map.

The format of the GetNumberOfEntriesInHashmap method is:

      size_t GetNumberOfEntriesInHashmap(const HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## GetNumberOfElementsInLinkedList

GetNumberOfElementsInLinkedList() returns the number of entries in the linked-list.

The format of the GetNumberOfElementsInLinkedList method is:

      size_t GetNumberOfElementsInLinkedList(
        const LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked-list info.

## GetValueFromHashmap

GetValueFromHashmap() gets a value from the hash-map by its key.

The format of the GetValueFromHashmap method is:

      void *GetValueFromHashmap(HashmapInfo *hashmap_info,const void *key)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

##### key

The key.

## GetValueFromLinkedList

GetValueFromLinkedList() gets a vlaue from the linked-list by the specified location.

The format of the GetValueFromLinkedList method is:

      void *GetValueFromLinkedList(LinkedListInfo *list_info,
        const size_t index)

A description of each parameter follows:

##### list_info

The linked_list info.

##### index

The list index.

## HashPointerType

HashPointerType() finds an entry in a hash-map based on the address of a pointer.

The format of the HashPointerType method is:

      size_t HashPointerType(const void *pointer)

A description of each parameter follows:

##### pointer

compute the hash entry location from this pointer address.

## HashStringType

HashStringType() finds an entry in a hash-map based on the contents of a string.

The format of the HashStringType method is:

      size_t HashStringType(const void *string)

A description of each parameter follows:

##### string

compute the hash entry location from this string.

## HashStringInfoType

HashStringInfoType() finds an entry in a hash-map based on the contents of a string.

The format of the HashStringInfoType method is:

      size_t HashStringInfoType(const void *string)

A description of each parameter follows:

##### string

compute the hash entry location from this string.

## InsertValueInLinkedList

InsertValueInLinkedList() inserts an element in the linked-list at the specified location.

The format of the InsertValueInLinkedList method is:

      WizardBooleanType InsertValueInLinkedList(ListInfo *list_info,
        const size_t index,const void *value)

A description of each parameter follows:

##### list_info

The hashmap info.

##### index

The index.

##### value

The value.

## InsertValueInSortedLinkedList

InsertValueInSortedLinkedList() inserts a value in the sorted linked-list.

The format of the InsertValueInSortedLinkedList method is:

      WizardBooleanType InsertValueInSortedLinkedList(ListInfo *list_info,
        int (*compare)(const void *,const void *),void **replace,
        const void *value)

A description of each parameter follows:

##### list_info

The hashmap info.

##### index

The index.

##### compare

The compare method.

##### replace

return previous element here.

##### value

The value.

## IsHashmapEmpty

IsHashmapEmpty() returns WizardTrue if the hash-map is empty.

The format of the IsHashmapEmpty method is:

      WizardBooleanType IsHashmapEmpty(const HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## IsLinkedListEmpty

IsLinkedListEmpty() returns WizardTrue if the linked-list is empty.

The format of the IsLinkedListEmpty method is:

      WizardBooleanType IsLinkedListEmpty(LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked-list info.

## LinkedListToArray

LinkedListToArray() converts the linked-list to an array.

The format of the LinkedListToArray method is:

      WizardBooleanType LinkedListToArray(LinkedListInfo *list_info,
        void **array)

A description of each parameter follows:

##### list_info

The linked-list info.

##### array

The array.

## NewHashmap

NewHashmap() returns a pointer to a HashmapInfo structure initialized to default values. The capacity is an initial estimate. The hashmap will increase capacity dynamically as the demand requires.

The format of the NewHashmap method is:

      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 *))

A description of each parameter follows:

##### capacity

The initial number entries in the hash-map: typically SmallHashmapSize, MediumHashmapSize, or LargeHashmapSize. The hashmap will dynamically increase its capacity on demand.

##### hash

The hash method, typically HashPointerType(), HashStringType(), or HashStringInfoType().

##### compare

The compare method, typically NULL, CompareHashmapString(), or CompareHashmapStringInfo().

##### relinquish_key

The key deallocation method, typically RelinquishWizardMemory(), called whenever a key is removed from the hash-map.

##### relinquish_value

The value deallocation method; typically RelinquishWizardMemory(), called whenever a value object is removed from the hash-map.

## NewLinkedList

NewLinkedList() returns a pointer to a LinkedListInfo structure initialized to default values.

The format of the Acquirestruct LinkedListInfomethod is:

      LinkedListInfo *NewLinkedList(const size_t capacity)

A description of each parameter follows:

##### capacity

The maximum number of elements in the list.

## PutEntryInHashmap

PutEntryInHashmap() puts an entry in the hash-map. If the key already exists in the map it is first removed.

The format of the PutEntryInHashmap method is:

      WizardBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info,
        const void *key,const void *value)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

##### key

The key.

##### value

The value.

## RemoveElementByValueFromLinkedList

RemoveElementByValueFromLinkedList() removes an element from the linked-list by value.

The format of the RemoveElementByValueFromLinkedList method is:

      void *RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,
        const void *value)

A description of each parameter follows:

##### list_info

The list info.

##### value

The value.

## RemoveElementFromLinkedList

RemoveElementFromLinkedList() removes an element from the linked-list at the specified location.

The format of the RemoveElementFromLinkedList method is:

      void *RemoveElementFromLinkedList(LinkedListInfo *list_info,
        const size_t index)

A description of each parameter follows:

##### list_info

The linked-list info.

##### index

The index.

## RemoveEntryFromHashmap

RemoveEntryFromHashmap() removes an entry from the hash-map by its key.

The format of the RemoveEntryFromHashmap method is:

      void *RemoveEntryFromHashmap(HashmapInfo *hashmap_info,void *key)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

##### key

The key.

## RemoveLastElementFromLinkedList

RemoveLastElementFromLinkedList() removes the last element from the linked-list.

The format of the RemoveLastElementFromLinkedList method is:

      void *RemoveLastElementFromLinkedList(LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked-list info.

## ResetHashmapIterator

ResetHashmapIterator() resets the hash-map iterator. Use it in conjunction with GetNextKeyInHashmap() to iterate over all the keys in the hash-map.

The format of the ResetHashmapIterator method is:

      ResetHashmapIterator(HashmapInfo *hashmap_info)

A description of each parameter follows:

##### hashmap_info

The hashmap info.

## ResetLinkedListIterator

ResetLinkedListIterator() resets the lined-list iterator. Use it in conjunction with GetNextValueInLinkedList() to iterate over all the values in the linked-list.

The format of the ResetLinkedListIterator method is:

      ResetLinkedListIterator(LinkedListInfo *list_info)

A description of each parameter follows:

##### list_info

The linked-list info.

Discourse Server