10 |
|
#endif |
11 |
|
|
12 |
|
typedef void lut_free_t(void *p); |
13 |
< |
typedef unsigned long lut_hashf_t(const void *); |
14 |
< |
typedef int lut_keycmpf_t(const void *, const void *); |
13 |
> |
typedef unsigned long lut_hashf_t(const char *); |
14 |
> |
typedef int lut_keycmpf_t(const char *, const char *); |
15 |
|
|
16 |
|
typedef struct { |
17 |
|
char *key; /* key name */ |
20 |
|
} LUENT; |
21 |
|
|
22 |
|
typedef struct { |
23 |
< |
lut_hashf_t *hashf; /* key hash function */ |
24 |
< |
lut_keycmpf_t *keycmp; /* key comparison function */ |
23 |
> |
lut_hashf_t *hashf; /* key hash function */ |
24 |
> |
lut_keycmpf_t *keycmp; /* key comparison function */ |
25 |
|
lut_free_t *freek; /* free a key */ |
26 |
|
lut_free_t *freed; /* free the data */ |
27 |
|
int tsiz; /* current table size */ |
79 |
|
|
80 |
|
typedef int lut_doallf_t(const LUENT *e, void *p); |
81 |
|
|
82 |
– |
extern lut_keycmpf_t lu_strcmp; |
82 |
|
extern int lu_init(LUTAB *tbl, int nel); |
83 |
< |
extern unsigned long lu_shash(const void *s); |
83 |
> |
extern lut_hashf_t lu_shash; |
84 |
|
extern LUENT *lu_find(LUTAB *tbl, const char *key); |
85 |
|
extern void lu_delete(LUTAB *tbl, const char *key); |
86 |
|
extern int lu_doall(const LUTAB *tbl, lut_doallf_t *f, void *p); |
87 |
|
extern void lu_done(LUTAB *tbl); |
88 |
|
|
89 |
< |
#define LU_SINIT(fk,fd) {lu_shash,lu_strcmp,fk,fd,0,NULL,0} |
89 |
> |
#define LU_SINIT(fk,fd) {lu_shash,strcmp,fk,fd,0,NULL,0} |
90 |
|
|
91 |
|
#ifdef __cplusplus |
92 |
|
} |