Name
echash_replace — Replace the data associated with the specified key
Synopsis
#include "echash.h"
| int **echash_replace** (
| h, | |
| | k, | |
| | klen, | |
| | data, | |
| | keyfree, | |
| | datafree)
; | |
ec_hash_table * <var class="pdparam">h</var>
;
const char ** <var class="pdparam">k</var>
;
int * <var class="pdparam">klen</var>
;
void * <var class="pdparam">data</var>
;
ECHashFreeFunc <var class="pdparam">keyfree</var>
;
ECHashFreeFunc <var class="pdparam">datafree</var>
;
Description
Replace the data associated with the specified key.
- h
-
The hash table
- k
-
The key.
- klen
-
The length of the key
k
. - keyfree
-
The pointer to the hash table keyfree function.
- datafree
-
The pointer to the hash table datafree function.
Note
The keyfree and datafree functions are optional. If they do not exist, no function is invoked when data or keys are freed.
On success this function returns 1
.
It is legal to call this function in any thread.
The hash table data structure is not thread safe; any simultaneous access needs to be coordinated by the API consumer.