2 * Copyright 1993, 1995 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
7 * hash.h - simple in-memory hashing routines
9 * 11/04/02 (seiwald) - const-ing for string literals
15 typedef struct hashdata HASHDATA
;
17 extern struct hash
*hashinit (int datalen
, const char *name
);
18 extern int hashitem (struct hash
*hp
, HASHDATA
**data
, int enter
);
19 extern void hashdone (struct hash
*hp
);
21 /* return !0 from itercb() to stop; returns result of itercb() */
22 typedef int (*HashIteratorCB
) (const void *hdata
, void *udata
);
23 extern int hashiterate (struct hash
*hp
, HashIteratorCB itercb
, void *udata
);
25 static inline int hashenter (struct hash
*hp
, HASHDATA
**data
) { return !hashitem(hp
, data
, !0); }
26 static inline int hashcheck (struct hash
*hp
, HASHDATA
**data
) { return hashitem(hp
, data
, 0); }
27 //#define hashenter(hp, data) (!hashitem(hp, data, !0))
28 //#define hashcheck(hp, data) (hashitem(hp, data, 0))