Lines Matching refs:tab
37 hashlook(register Hash_table_t* tab, const char* name, long flags, const char* value) in hashlook() argument
62 HASHMOD(tab, n); in hashlook()
63 for (b = tab->table[n]; b; b = b->next) in hashlook()
70 if (!(tab = tab->scope) || (flags & HASH_NOSCOPE)) in hashlook()
75 tab->root->accesses++; in hashlook()
76 top = tab; in hashlook()
77 last = &tab->root->last; in hashlook()
80 last->table = tab; in hashlook()
89 else if (tab->flags & HASH_HASHED) in hashlook()
95 else HASH(tab->root, name, n); in hashlook()
99 HASHMOD(tab, n); in hashlook()
100 for (prev = 0, b = tab->table[n]; b; prev = b, b = b->next) in hashlook()
104 if (!tab->root->local->compare) in hashlook()
109 if (tab->root->namesize) in hashlook()
111 register char* s3 = s1 + tab->root->namesize; in hashlook()
119 else if (tab->root->namesize) in hashlook()
121 if (!(*tab->root->local->compare)(hashname(b), name, tab->root->namesize)) goto found; in hashlook()
123 else if (!(*tab->root->local->compare)(hashname(b), name)) goto found; in hashlook()
125 tab->root->collisions++; in hashlook()
127 if (!tab->scope || (flags & (HASH_CREATE|HASH_INSTALL|HASH_NOSCOPE)) == HASH_NOSCOPE) break; in hashlook()
128 tab = tab->scope; in hashlook()
134 tab = last->table; in hashlook()
138 HASHMOD(tab, n); in hashlook()
146 if (prev && !tab->frozen) in hashlook()
153 b->next = tab->table[n]; in hashlook()
154 tab->table[n] = b; in hashlook()
161 if (tab != top && !(flags & HASH_SCOPE)) break; in hashlook()
167 if (tab == top || (flags & HASH_SCOPE)) in hashlook()
170 else if (!(tab->root->flags & HASH_BUCKET)) in hashlook()
172 if (tab->root->local->free && b->value) in hashlook()
174 (*tab->root->local->free)(b->value); in hashlook()
177 else if (tab->flags & HASH_VALUE) in hashlook()
183 tab->buckets--; in hashlook()
184 if (tab->frozen || (b->hash & HASH_OPAQUED)) b->hash |= HASH_DELETED; in hashlook()
187 tab->table[n] = b->next; in hashlook()
189 …if (tab->root->local->free && (tab->root->flags & HASH_BUCKET)) (*tab->root->local->free)((char*)b… in hashlook()
192 if (tab->root->local->region) (*tab->root->local->region)(tab->root->local->handle, b, 0, 0); in hashlook()
197 …if (tab->root->local->region) (*tab->root->local->region)(tab->root->local->handle, (char*)name, 0… in hashlook()
205 …if (tab != top || tab->frozen || (b->hash & (HASH_KEEP|HASH_OPAQUED)) || hashlook(top, value, (fla… in hashlook()
208 if (!(tab->flags & HASH_ALLOCATE)) b->name = (char*)value; in hashlook()
209 else if (b->name && tab->root->namesize) in hashlook()
211 memcpy(b->name, value, tab->root->namesize); in hashlook()
219 if (!(i = tab->bucketsize)) in hashlook()
231 …if (!(t = tab->root->local->region ? (char*)(*tab->root->local->region)(tab->root->local->handle, … in hashlook()
239 …if (tab->root->local->region) (*tab->root->local->region)(tab->root->local->handle, (char*)name, 0… in hashlook()
242 tab->buckets--; in hashlook()
243 tab->table[n] = b->next; in hashlook()
262 if (tab == top) prev = 0; in hashlook()
270 if (!(flags & HASH_SCOPE)) tab = top; in hashlook()
277 if (!tab->frozen && !(tab->flags & HASH_FIXED) && tab->buckets > tab->root->meanchain * tab->size) in hashlook()
278 hashsize(tab, tab->size << 1); in hashlook()
286 int m = tab->bucketsize * sizeof(char*); in hashlook()
290 tab->flags |= HASH_VALUE; in hashlook()
293 tab->bucketsize = (sizeof(Hash_bucket_t) + sizeof(char*) - 1) / sizeof(char*); in hashlook()
294 m = tab->bucketsize * sizeof(char*); in hashlook()
304 if (!prev && (tab->flags & HASH_ALLOCATE)) in hashlook()
306 m = tab->root->namesize ? tab->root->namesize : strlen(name) + 1; in hashlook()
307 if (tab->root->local->region) in hashlook()
309 if (!(b = (Hash_bucket_t*)(*tab->root->local->region)(tab->root->local->handle, NiL, n + m, 0))) in hashlook()
320 if (tab->root->local->region) in hashlook()
322 if (!(b = (Hash_bucket_t*)(*tab->root->local->region)(tab->root->local->handle, NiL, n, 0))) in hashlook()
332 HASHMOD(tab, n); in hashlook()
333 b->next = tab->table[n]; in hashlook()
334 tab->table[n] = b; in hashlook()
335 tab->buckets++; in hashlook()
338 tab->buckets--; in hashlook()
351 tab->buckets++; in hashlook()
354 last->table = tab; in hashlook()
358 …if (tab->root->local->free && !(tab->root->flags & HASH_BUCKET) && b->value) (*tab->root->local->f… in hashlook()
359 …if (value && tab->root->local->alloc) value = (*tab->root->local->alloc)((unsigned int)integralof(… in hashlook()