--- ray/src/common/lookup.h 1994/07/06 15:14:16 2.1 +++ ray/src/common/lookup.h 1998/06/02 15:01:43 2.4 @@ -22,6 +22,7 @@ typedef struct { int ndel; /* number of deleted entries */ } LUTAB; +#undef strcmp #define LU_SINIT(fk,fd) {lu_shash,strcmp,(void (*)())(fk),\ (void (*)())(fd),0,NULL,0} @@ -56,7 +57,15 @@ typedef struct { * The lu_delete routine frees an entry's data (if any) by calling * the freed member function, but does not free the key field. This * will be freed later during (or instead of) table reallocation. + * It is therefore an error to reuse or do anything with the key + * field after calling lu_delete. * + * The lu_doall routine loops through every filled table entry, calling + * the given function once on each entry. If a NULL pointer is passed + * for this function, then lu_doall simply returns the total number of + * active entries. Otherwise, it returns the sum of all the function + * evaluations. + * * The lu_done routine calls the given free function once for each * assigned table entry (i.e. each entry with an assigned key value). * The user must define these routines to free the key and the data @@ -67,6 +76,7 @@ typedef struct { extern int lu_init(); extern LUENT *lu_find(); extern void lu_delete(); +extern int lu_doall(); extern void lu_done(); extern long lu_shash();