axlHash* axl_hash_copy ( axlHash hash,
axlHashItemCopy  key_copy,
axlHashItemCopy  value_copy 
)

Allows to copy the provided hash, providing the copy function used to duplicate key and value items stored.

The function are optional, so, if they are null, the same value is stored in the hash (for the key and the value). In this case, if the source hash has defined destroy function for either key or values, they will not be configured in the returning hash.

If function are provided, axl_hash_copy will use it to get a duplicated version for either the key or the value. In this case, if the source hash has defined the destroy function either for the key or the value, it will be configured in the returning hash.

Parameters:
hash The axlHash that will work as data source.
key_copy The function to be used to duplicate keys.
value_copy The function used to duplicate values.
Returns:
A newly allocated reference to a axlHash containing all values from the source hash. The function will fail if the hash provided is a null reference or copy functions aren't provided.