| 48 |
|
|
| 49 |
|
extern unsigned long |
| 50 |
|
lu_shash( /* hash a nul-terminated string */ |
| 51 |
< |
void *s |
| 51 |
> |
const void *s |
| 52 |
|
) |
| 53 |
|
{ |
| 54 |
|
static unsigned char shuffle[256] = { |
| 79 |
|
}; |
| 80 |
|
register int i = 0; |
| 81 |
|
register unsigned long h = 0; |
| 82 |
< |
register unsigned char *t = (unsigned char *)s; |
| 82 |
> |
register unsigned const char *t = (unsigned const char *)s; |
| 83 |
|
|
| 84 |
|
while (*t) |
| 85 |
|
h ^= (unsigned long)shuffle[*t++] << ((i+=11) & 0xf); |
| 91 |
|
extern LUENT * |
| 92 |
|
lu_find( /* find a table entry */ |
| 93 |
|
register LUTAB *tbl, |
| 94 |
< |
char *key |
| 94 |
> |
const char *key |
| 95 |
|
) |
| 96 |
|
{ |
| 97 |
|
unsigned long hval; |
| 147 |
|
extern void |
| 148 |
|
lu_delete( /* delete a table entry */ |
| 149 |
|
register LUTAB *tbl, |
| 150 |
< |
char *key |
| 150 |
> |
const char *key |
| 151 |
|
) |
| 152 |
|
{ |
| 153 |
|
register LUENT *le; |
| 165 |
|
|
| 166 |
|
extern int |
| 167 |
|
lu_doall( /* loop through all valid table entries */ |
| 168 |
< |
register LUTAB *tbl, |
| 169 |
< |
//int (*f)(LUENT *) |
| 168 |
> |
register const LUTAB *tbl, |
| 169 |
> |
//int (*f)(const LUENT *) |
| 170 |
|
lut_doallf_t *f, |
| 171 |
|
void *p |
| 172 |
|
) |
| 173 |
|
{ |
| 174 |
|
int rval = 0; |
| 175 |
< |
register LUENT *tp; |
| 175 |
> |
register const LUENT *tp; |
| 176 |
|
|
| 177 |
|
for (tp = tbl->tabl + tbl->tsiz; tp-- > tbl->tabl; ) |
| 178 |
|
if (tp->data != NULL) { |