Home | History | Annotate | Download | only in nawk-20071023

Lines Matching refs:tp

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