Lines Matching defs:tb
22 hfetch(register HASH *tb, char *key)
29 if (!tb)
36 entry = tb->tbl_array[hash & tb->tbl_max];
48 hstore(register HASH *tb, char *key, STR *val)
56 if (!tb)
64 oentry = &(tb->tbl_array[hash & tb->tbl_max]);
87 tb->tbl_fill++;
88 if ((tb->tbl_fill * 100 / (tb->tbl_max + 1)) > FILLPCT)
89 hsplit(tb);
97 hdelete(register HASH *tb, char *key)
105 if (!tb)
113 oentry = &(tb->tbl_array[hash & tb->tbl_max]);
126 tb->tbl_fill--;
134 hsplit(HASH *tb)
136 int oldsize = tb->tbl_max + 1;
144 a = (HENT**) saferealloc((char*)tb->tbl_array, newsize * sizeof(HENT*));
146 tb->tbl_max = --newsize;
147 tb->tbl_array = a;
158 tb->tbl_fill++;
166 tb->tbl_fill--;
173 register HASH *tb = (HASH*)safemalloc(sizeof(HASH));
175 tb->tbl_array = (HENT**) safemalloc(8 * sizeof(HENT*));
176 tb->tbl_fill = 0;
177 tb->tbl_max = 7;
178 hiterinit(tb); /* so each() will start off right */
179 memset(tb->tbl_array, 0, 8 * sizeof(HENT*));
180 return tb;
184 hshow(register HASH *tb)
187 tb->tbl_max+1,
188 tb->tbl_fill,
189 tb->tbl_fill * 100 / (tb->tbl_max+1));
194 hiterinit(register HASH *tb)
196 tb->tbl_riter = -1;
197 tb->tbl_eiter = Null(HENT*);
198 return tb->tbl_fill;
202 hiternext(register HASH *tb)
206 entry = tb->tbl_eiter;
211 tb->tbl_riter++;
212 if (tb->tbl_riter > tb->tbl_max) {
213 tb->tbl_riter = -1;
216 entry = tb->tbl_array[tb->tbl_riter];
220 tb->tbl_eiter = entry;