Lines Matching refs:tp
145 Cell **tp; in makesymtab() local
148 tp = (Cell **) calloc(n, sizeof(Cell *)); in makesymtab()
149 if (ap == NULL || tp == NULL) in makesymtab()
153 ap->tab = tp; in makesymtab()
160 Array *tp; in freesymtab() local
165 tp = (Array *) ap->sval; in freesymtab()
166 if (tp == NULL) in freesymtab()
168 for (i = 0; i < tp->size; i++) { in freesymtab()
169 for (cp = tp->tab[i]; cp != NULL; cp = temp) { in freesymtab()
175 tp->nelem--; in freesymtab()
177 tp->tab[i] = 0; in freesymtab()
179 if (tp->nelem != 0) in freesymtab()
181 free(tp->tab); in freesymtab()
182 free(tp); in freesymtab()
187 Array *tp; in freeelem() local
191 tp = (Array *) ap->sval; in freeelem()
192 h = hash(s, tp->size); in freeelem()
193 for (p = tp->tab[h]; p != NULL; prev = p, p = p->cnext) in freeelem()
196 tp->tab[h] = p->cnext; in freeelem()
203 tp->nelem--; in freeelem()
208 Cell *setsymtab(const char *n, const char *s, Awkfloat f, unsigned t, Array *tp) in setsymtab() argument
213 if (n != NULL && (p = lookup(n, tp)) != NULL) { in setsymtab()
227 tp->nelem++; in setsymtab()
228 if (tp->nelem > FULLTAB * tp->size) in setsymtab()
229 rehash(tp); in setsymtab()
230 h = hash(n, tp->size); in setsymtab()
231 p->cnext = tp->tab[h]; in setsymtab()
232 tp->tab[h] = p; in setsymtab()
247 void rehash(Array *tp) /* rehash items in small table into big one */ in rehash() argument
252 nsz = GROWTAB * tp->size; in rehash()
256 for (i = 0; i < tp->size; i++) { in rehash()
257 for (cp = tp->tab[i]; cp; cp = op) { in rehash()
264 free(tp->tab); in rehash()
265 tp->tab = np; in rehash()
266 tp->size = nsz; in rehash()
269 Cell *lookup(const char *s, Array *tp) /* look for s in tp */ in lookup() argument
274 h = hash(s, tp->size); in lookup()
275 for (p = tp->tab[h]; p != NULL; p = p->cnext) in lookup()