• Home
  • Raw
  • Download

Lines Matching refs:ht

31 	nl_hash_table_t *ht;  in nl_hash_table_alloc()  local
33 ht = calloc(1, sizeof (*ht)); in nl_hash_table_alloc()
34 if (!ht) in nl_hash_table_alloc()
37 ht->nodes = calloc(size, sizeof (*ht->nodes)); in nl_hash_table_alloc()
38 if (!ht->nodes) { in nl_hash_table_alloc()
39 free(ht); in nl_hash_table_alloc()
43 ht->size = size; in nl_hash_table_alloc()
45 return ht; in nl_hash_table_alloc()
56 void nl_hash_table_free(nl_hash_table_t *ht) in nl_hash_table_free() argument
60 for(i = 0; i < ht->size; i++) { in nl_hash_table_free()
61 nl_hash_node_t *node = ht->nodes[i]; in nl_hash_table_free()
72 free(ht->nodes); in nl_hash_table_free()
73 free(ht); in nl_hash_table_free()
86 struct nl_object* nl_hash_table_lookup(nl_hash_table_t *ht, in nl_hash_table_lookup() argument
92 nl_object_keygen(obj, &key_hash, ht->size); in nl_hash_table_lookup()
93 node = ht->nodes[key_hash]; in nl_hash_table_lookup()
117 int nl_hash_table_add(nl_hash_table_t *ht, struct nl_object *obj) in nl_hash_table_add() argument
122 nl_object_keygen(obj, &key_hash, ht->size); in nl_hash_table_add()
123 node = ht->nodes[key_hash]; in nl_hash_table_add()
134 obj, ht, key_hash); in nl_hash_table_add()
143 node->next = ht->nodes[key_hash]; in nl_hash_table_add()
144 ht->nodes[key_hash] = node; in nl_hash_table_add()
161 int nl_hash_table_del(nl_hash_table_t *ht, struct nl_object *obj) in nl_hash_table_del() argument
166 nl_object_keygen(obj, &key_hash, ht->size); in nl_hash_table_del()
167 prev = node = ht->nodes[key_hash]; in nl_hash_table_del()
174 " hash 0x%x\n", obj, ht, key_hash); in nl_hash_table_del()
176 if (node == ht->nodes[key_hash]) in nl_hash_table_del()
177 ht->nodes[key_hash] = node->next; in nl_hash_table_del()