14 h = ((
h << 5) +
h) ^ ch;
27 set->
first = (
int *) alloc(
sizeof(
int) * (set->
mask + 1));
28 if (!set->
first)
return 0;
30 if (!set->
p) { alloc_free(set->
first);
return 0; }
31 set->
x = (
char **) alloc(
sizeof(
char *) * set->
a);
32 if (!set->
x) { alloc_free(set->
p); alloc_free(set->
first);
return 0; }
34 for (
h = 0;
h <= set->
mask; ++
h)
54 if (!str_diff(xi,s))
return xi;
74 newa = n + 10 + (n >> 3);
77 newx = (
char **) alloc(
sizeof(
char *) * newa);
78 if (!newx) { alloc_free(newp);
return 0; }
81 byte_copy(newx,
sizeof(
char *) * n,set->
x);
88 if (n + n + n > set->
mask) {
95 newfirst = (
int *) alloc(
sizeof(
int) * (newmask + 1));
96 if (!newfirst)
return 0;
98 for (
h = 0;
h <= newmask; ++
h)
101 for (i = 0; i < n; ++i) {
104 sl->
next = newfirst[
h];
108 alloc_free(set->
first);
109 set->
first = newfirst;
void h(char *, char *, int, int, int)
char * strset_in(strset *set, char *s)
int strset_add(strset *set, char *s)
uint32 strset_hash(char *s)
int strset_init(strset *set)