21 #ifndef ABC__misc__hash__hashPtr_h
22 #define ABC__misc__hash__hashPtr_h
69 #define Hash_PtrForEachEntry( pHash, pEntry, bin ) \
70 for(bin=-1, pEntry=NULL; bin < pHash->nBins; (!pEntry)?(pEntry=pHash->pArray[++bin]):(pEntry=pEntry->pNext)) \
98 for(i=0; i<nBins; i++)
126 if (pEntry->
key == key) {
129 pEntry = pEntry->
pNext;
155 pLast = &(p->
pArray[bin]);
158 if (pEntry->
key == key) {
162 pLast = &(pEntry->
pNext);
163 pEntry = pEntry->
pNext;
170 pEntry->
pNext = NULL;
198 pLast = &(p->
pArray[bin]);
201 if (pEntry->
key == key)
203 pLast = &(pEntry->
pNext);
204 pEntry = pEntry->
pNext;
212 pEntry->
pNext = NULL;
242 pLast = &(p->
pArray[bin]);
245 if (pEntry->
key == key)
246 return &(pEntry->
data);
247 pLast = &(pEntry->
pNext);
248 pEntry = pEntry->
pNext;
255 pEntry->
pNext = NULL;
259 return &(pEntry->
data);
283 pLast = &(p->
pArray[bin]);
286 if (pEntry->
key == key) {
289 *pLast = pEntry->
pNext;
292 pLast = &(pEntry->
pNext);
293 pEntry = pEntry->
pNext;
317 for(bin = 0; bin < p->
nBins; bin++) {
321 pEntry = pEntry->
pNext;
static int Hash_PtrExists(Hash_Ptr_t *p, int key)
static void ** Hash_PtrEntryPtr(Hash_Ptr_t *p, int key)
static Hash_Ptr_t * Hash_PtrAlloc(int nBins)
FUNCTION DEFINITIONS ///.
#define ABC_ALLOC(type, num)
struct Hash_Ptr_Entry_t_ * pNext
static void * Hash_PtrRemove(Hash_Ptr_t *p, int key)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static void * Hash_PtrEntry(Hash_Ptr_t *p, int key, int fCreate)
#define ABC_NAMESPACE_HEADER_END
ABC_NAMESPACE_HEADER_START int Hash_DefaultHashFunc(int key, int nBins)
INCLUDES ///.
static void Hash_PtrWriteEntry(Hash_Ptr_t *p, int key, void *data)
int(* fHash)(int key, int nBins)
static void Hash_PtrFree(Hash_Ptr_t *p)
Hash_Ptr_Entry_t ** pArray