| 7 |
|
|
| 8 |
|
#include <stdio.h> |
| 9 |
|
#include <stdlib.h> |
| 10 |
+ |
#include <string.h> |
| 11 |
|
|
| 12 |
|
#include "lookup.h" |
| 13 |
|
|
| 13 |
– |
extern int |
| 14 |
– |
lu_strcmp( |
| 15 |
– |
const void *s1, |
| 16 |
– |
const void *s2 |
| 17 |
– |
) |
| 18 |
– |
{ |
| 19 |
– |
return strcmp((const char*)s1,(const char*)s2); |
| 20 |
– |
} |
| 14 |
|
|
| 15 |
< |
extern int |
| 15 |
> |
int |
| 16 |
|
lu_init( /* initialize tbl for at least nel elements */ |
| 17 |
|
register LUTAB *tbl, |
| 18 |
|
int nel |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
|
| 42 |
< |
extern unsigned long |
| 42 |
> |
unsigned long |
| 43 |
|
lu_shash( /* hash a nul-terminated string */ |
| 44 |
< |
const void *s |
| 44 |
> |
const char *s |
| 45 |
|
) |
| 46 |
|
{ |
| 47 |
|
static unsigned char shuffle[256] = { |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
|
| 84 |
< |
extern LUENT * |
| 84 |
> |
LUENT * |
| 85 |
|
lu_find( /* find a table entry */ |
| 86 |
|
register LUTAB *tbl, |
| 87 |
|
const char *key |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
|
| 140 |
< |
extern void |
| 140 |
> |
void |
| 141 |
|
lu_delete( /* delete a table entry */ |
| 142 |
|
register LUTAB *tbl, |
| 143 |
|
const char *key |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
|
| 159 |
< |
extern int |
| 159 |
> |
int |
| 160 |
|
lu_doall( /* loop through all valid table entries */ |
| 161 |
|
register const LUTAB *tbl, |
| 162 |
< |
//int (*f)(const LUENT *) |
| 162 |
> |
/* int (*f)(const LUENT *) */ |
| 163 |
|
lut_doallf_t *f, |
| 164 |
|
void *p |
| 165 |
|
) |
| 181 |
|
} |
| 182 |
|
|
| 183 |
|
|
| 184 |
< |
extern void |
| 184 |
> |
void |
| 185 |
|
lu_done( /* free table and contents */ |
| 186 |
|
register LUTAB *tbl |
| 187 |
|
) |