4 static int hash(char *s
)
6 unsigned h
= 0x12345678;
8 h
^= (h
>> ((h
& 0xf) + 1));
10 h
^= (h
<< ((h
& 0xf) + 5));
16 void tab_add(struct tab
*t
, char *s
)
22 t
->next
[i
] = t
->head
[h
];
27 char *tab_get(struct tab
*t
, char *s
)
29 int h
= t
->head
[hash(s
)];
30 while (h
&& t
->data
[h
]) {
31 if (!strcmp(s
, t
->data
[h
]))
38 void tab_del(struct tab
*t
, char *s
)
42 while (h
&& t
->data
[h
]) {
43 if (!strcmp(s
, t
->data
[h
])) {
45 t
->next
[prev
] = t
->next
[h
];
47 t
->head
[h
] = t
->next
[h
];