eyBuildLib API Reference : eyBuildLib
ebhash - eybuild hash table
ebHashCreate( ) - create a hash table
ebHashCount( ) - get the number of elements in hash table
ebHashAdd( ) - add an key-value pair into hash table
ebHashGet( ) - get the value by key from hash table
ebHashDelete( ) - delete an key-value pair from hash table
ebHashDestroy( ) - destroy a hash table
eybuild hash table operation library
ebhash.h
ebHashCreate( ) - create a hash table
EBHASH * ebHashCreate ( size_t minsize )
This routine is to create a hash table. Parameter minsize is the minimal size of the hash table.
pointer to new created hash table, or NULL if lack memory
ebHashCount( ) - get the number of elements in hash table
unsigned int ebHashCount ( EBHASH * hash )
This routine is to get the number of elements in hash table.
number of elements in hash table
ebHashAdd( ) - add an key-value pair into hash table
int ebHashAdd ( EBHASH * hash, const char * key, void * value )
This routine is to add an key-value pair into hash table. The key must be \0 terminaled string.
OK, or ERROR if lack memory
ebHashGet( ) - get the value by key from hash table
void * ebHashGet ( EBHASH * hash, const char * key )
This routine is to add an key-value pair into hash table. The key must be \0 terminaled string.
pointer to value, or NULL if not found
ebHashDelete( ) - delete an key-value pair from hash table
void * ebHashDelete ( EBHASH * hash, const char * key )
This routine is to delete an key-value pair from hash table. The key must be \0 terminaled string.
OK, or ERROR if lack memory
ebHashDestroy( ) - destroy a hash table
void ebHashDestroy ( EBHASH * hash, BOOL free_values )
This routine is to destroy a hash table. Parameter free_values specifis automatically free values of key-value pair or not internally.
N/A