21 #ifndef ABC__misc__hash__hashInt_h
22 #define ABC__misc__hash__hashInt_h
69 #define Hash_IntForEachEntry( 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++)
124 pLast = &(p->
pArray[bin]);
127 if (pEntry->
key == key) {
130 pLast = &(pEntry->
pNext);
131 pEntry = pEntry->
pNext;
157 pLast = &(p->
pArray[bin]);
160 if (pEntry->
key == key) {
164 pLast = &(pEntry->
pNext);
165 pEntry = pEntry->
pNext;
172 pEntry->
pNext = NULL;
200 pLast = &(p->
pArray[bin]);
203 if (pEntry->
key == key)
205 pLast = &(pEntry->
pNext);
206 pEntry = pEntry->
pNext;
214 pEntry->
pNext = NULL;
244 pLast = &(p->
pArray[bin]);
247 if (pEntry->
key == key)
248 return &(pEntry->
data);
249 pLast = &(pEntry->
pNext);
250 pEntry = pEntry->
pNext;
257 pEntry->
pNext = NULL;
261 return &(pEntry->
data);
280 for(bin = 0; bin < p->
nBins; bin++) {
284 pEntry = pEntry->
pNext;
static Hash_Int_t * Hash_IntAlloc(int nBins)
FUNCTION DEFINITIONS ///.
struct Hash_Int_Entry_t_ * pNext
static int * Hash_IntEntryPtr(Hash_Int_t *p, int key)
#define ABC_ALLOC(type, num)
static void Hash_IntFree(Hash_Int_t *p)
Hash_Int_Entry_t ** pArray
int(* fHash)(int key, int nBins)
static int Hash_IntExists(Hash_Int_t *p, int key)
ABC_NAMESPACE_HEADER_START int Hash_DefaultHashFunc(int key, int nBins)
INCLUDES ///.
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define ABC_NAMESPACE_HEADER_END
static void Hash_IntWriteEntry(Hash_Int_t *p, int key, int data)
static int Hash_IntEntry(Hash_Int_t *p, int key, int fCreate)