23 #include <lal/LALStdlib.h>
24 #include <lal/LALHashFunc.h>
113 const LALHashTbl *ht,
static size_t hash(const char *s)
static int cmp(REAL4Sequence *a, REAL4Sequence *b)
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead.
int XLALHashTblFind(const LALHashTbl *ht, const void *x, const void **y)
Find the element matching x in a hash table; if found, return in *y
LALHashTbl * XLALHashTblCreate2(LALHashTblDtorFcn dtor, LALHashTblHashParamFcn hash, void *hash_param, LALHashTblCmpParamFcn cmp, void *cmp_param)
Create a hash table with parameterised hash and comparison functions.
void(* LALHashTblDtorFcn)(void *x)
Function which free memory associated with hash table element x
UINT8(* LALHashTblHashParamFcn)(void *param, const void *x)
Hash function for the hash table element x, with a parameter param.
LALHashTbl * XLALHashTblCreate(LALHashTblDtorFcn dtor, LALHashTblHashFcn hash, LALHashTblCmpFcn cmp)
Create a hash table.
int(* LALHashTblCmpParamFcn)(void *param, const void *x, const void *y)
Function which compares hash table elements x and y, with a parameter param.
int XLALHashTblSize(const LALHashTbl *ht)
Return the size of a hash table.
int XLALHashTblAdd(LALHashTbl *ht, void *x)
Add an element to a hash table.
UINT8(* LALHashTblHashFcn)(const void *x)
Hash function for the hash table element x
int XLALHashTblExtract(LALHashTbl *ht, const void *x, void **y)
Find the element matching x in a hash table; if found, remove it and return in *y
int XLALHashTblRemove(LALHashTbl *ht, const void *x)
Find the element matching x in a hash table; if found, remove and destroy it.
void XLALHashTblDestroy(LALHashTbl *ht)
Destroy a hash table and its elements.
int XLALHashTblClear(LALHashTbl *ht)
Clear a hash table.
int(* LALHashTblCmpFcn)(const void *x, const void *y)
Function which compares hash table elements x and y
Generic hash table with elements of type void *