Lines Matching defs:pos
35 * Hash_position_t* pos;
37 * pos = hashscan(tab, flags);
38 * while (b = hashnext(&pos)) ...;
39 * hashdone(pos);
43 * return pos for scan on table
49 register Hash_position_t* pos;
53 if (!(pos = newof(0, Hash_position_t, 1, 0))) return(0);
54 pos->tab = tab->root->last.table = tab;
55 pos->bucket = ∅
56 pos->slot = tab->table - 1;
57 pos->limit = tab->table + tab->size;
60 pos->flags = HASH_SCOPE;
75 tab = pos->tab;
77 else pos->flags = 0;
79 return(pos);
87 hashnext(register Hash_position_t* pos)
91 if (!pos) return(pos->tab->root->last.bucket = 0);
92 b = pos->bucket;
99 if (++pos->slot >= pos->limit)
101 pos->tab->frozen--;
102 if (!pos->flags || !pos->tab->scope) return(0);
103 pos->tab = pos->tab->scope;
104 pos->tab->root->last.table = pos->tab;
105 pos->limit = (pos->slot = pos->tab->table) + pos->tab->size;
106 pos->tab->frozen++;
108 } while (!(b = *pos->slot));
110 if (!(b->hash & HASH_DELETED) && (!(pos->tab->flags & HASH_VALUE) || b->value) && (!pos->flags || !(b->hash & (HASH_HIDDEN|HASH_HIDES)))) break;
123 return(pos->tab->root->last.bucket = pos->bucket = b);
131 hashdone(register Hash_position_t* pos)
133 if (pos)
135 if (pos->tab->frozen)
136 pos->tab->frozen--;
137 free(pos);