axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
typedef axlPointer(* axlHashItemCopy)(axlPointer key, axlDestroyFunc key_destroy, axlPointer data, axlDestroyFunc data_destroy)

Function handler definition for to allowing copying items at the hash by axl_hash_copy function.

The function receive both pointers the key and the data value but, only one of them must be copied. This is done to provide more control at the copy process, but only the required value must be returned. There is no indication to about which pointer must be returned, so, don't use the same function to copy both pointers.

The function also receive pointers to the current function deallocation associated to the key and value being copied. This could also work as information to know if the data must be replicated or not. Having the destroy function defined for the item is a clue to return an allocated item.

keyThe key to be copied if the function was provided to copy the key.
key_destroyThe key destroy function associated to the value being copied.
dataThe data to be copied if the function was provided to copy the data.
data_destroyThe data destroy function associated to the data value being copied.
A newly allocated reference representing the copy.