Lines Matching refs:h

69 avtab_insert_node(struct avtab *h, int hvalue,  in avtab_insert_node()  argument
96 newnode->next = flex_array_get_ptr(h->htable, hvalue); in avtab_insert_node()
97 if (flex_array_put_ptr(h->htable, hvalue, newnode, in avtab_insert_node()
104 h->nel++; in avtab_insert_node()
108 static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert() argument
114 if (!h || !h->htable) in avtab_insert()
117 hvalue = avtab_hash(key, h->mask); in avtab_insert()
118 for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); in avtab_insert()
141 newnode = avtab_insert_node(h, hvalue, prev, cur, key, datum); in avtab_insert()
153 avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert_nonunique() argument
159 if (!h || !h->htable) in avtab_insert_nonunique()
161 hvalue = avtab_hash(key, h->mask); in avtab_insert_nonunique()
162 for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); in avtab_insert_nonunique()
180 return avtab_insert_node(h, hvalue, prev, cur, key, datum); in avtab_insert_nonunique()
183 struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *key) in avtab_search() argument
189 if (!h || !h->htable) in avtab_search()
192 hvalue = avtab_hash(key, h->mask); in avtab_search()
193 for (cur = flex_array_get_ptr(h->htable, hvalue); cur; in avtab_search()
219 avtab_search_node(struct avtab *h, struct avtab_key *key) in avtab_search_node() argument
225 if (!h || !h->htable) in avtab_search_node()
228 hvalue = avtab_hash(key, h->mask); in avtab_search_node()
229 for (cur = flex_array_get_ptr(h->htable, hvalue); cur; in avtab_search_node()
279 void avtab_destroy(struct avtab *h) in avtab_destroy() argument
284 if (!h || !h->htable) in avtab_destroy()
287 for (i = 0; i < h->nslot; i++) { in avtab_destroy()
288 cur = flex_array_get_ptr(h->htable, i); in avtab_destroy()
298 flex_array_free(h->htable); in avtab_destroy()
299 h->htable = NULL; in avtab_destroy()
300 h->nslot = 0; in avtab_destroy()
301 h->mask = 0; in avtab_destroy()
304 int avtab_init(struct avtab *h) in avtab_init() argument
306 h->htable = NULL; in avtab_init()
307 h->nel = 0; in avtab_init()
311 int avtab_alloc(struct avtab *h, u32 nrules) in avtab_alloc() argument
332 h->htable = flex_array_alloc(sizeof(struct avtab_node *), nslot, in avtab_alloc()
334 if (!h->htable) in avtab_alloc()
338 h->nel = 0; in avtab_alloc()
339 h->nslot = nslot; in avtab_alloc()
340 h->mask = mask; in avtab_alloc()
342 h->nslot, nrules); in avtab_alloc()
346 void avtab_hash_eval(struct avtab *h, char *tag) in avtab_hash_eval() argument
355 for (i = 0; i < h->nslot; i++) { in avtab_hash_eval()
356 cur = flex_array_get_ptr(h->htable, i); in avtab_hash_eval()
373 tag, h->nel, slots_used, h->nslot, max_chain_len, in avtab_hash_eval()