Inserts a key value into the provided hash table, allowing to provide deallocation functions for the key and the data to be stored.
NOTE: The insert operation will replace a previously inserted item with the same key. If no item is found, and insert will take place, otherwise previous item is replaced calling to the key destroy and data destroy defined.
- Parameters:
-
| hash | The hash table where the data will be added. |
| key | The key to store in the hash table. If the key is found, previous data is replaced, storing this new key and the value provided. |
| key_destroy | An optional destroy function that will be called to deallocate the key provided. |
| data | The data to store associated to the provided key. |
| data_destroy | An optional destroy function that will be called to deallocate the data provided. |