Lines Matching refs:entries
56 * Initializes a hash table that can hold table_size number of entries,
73 tbl->entries = calloc(sizeof(hashtable_entry *), table_size);
74 if (tbl->entries == NULL)
119 * On hash collision entries are inserted at the next free space,
125 if (tbl->entries[hash] == NULL)
127 else if (memcmp(tbl->entries[hash]->key, key, tbl->key_size) == 0)
129 memcpy(tbl->entries[hash]->value, value, tbl->value_size);
140 tbl->entries[hash] = malloc(sizeof(hashtable_entry));
141 if (tbl->entries[hash] == NULL)
147 tbl->entries[hash]->key = malloc(tbl->key_size);
148 if (tbl->entries[hash]->key == NULL)
154 tbl->entries[hash]->value = malloc(tbl->value_size);
155 if (tbl->entries[hash]->value == NULL)
161 memcpy(tbl->entries[hash]->key, key, tbl->key_size);
162 memcpy(tbl->entries[hash]->value, value, tbl->value_size);
170 free(tbl->entries[hash]->key);
172 free(tbl->entries[hash]);
187 if (tbl->entries[hash] == NULL)
189 else if (memcmp(key, tbl->entries[hash]->key, tbl->key_size) == 0)
192 return (&tbl->entries[hash]);
260 if ((tbl->entries[i] != NULL))
262 free(tbl->entries[i]->key);
263 free(tbl->entries[i]->value);
266 free(tbl->entries);