Lines Matching defs:table
5 #include "str-table.h"
13 struct str_table *table;
15 table = i_new(struct str_table, 1);
16 hash_table_create(&table->hash, default_pool, 0, str_hash, strcmp);
17 return table;
22 struct str_table *table = *_table;
29 iter = hash_table_iterate_init(table->hash);
30 while (hash_table_iterate(iter, table->hash, &key, &value))
33 hash_table_destroy(&table->hash);
34 i_free(table);
37 bool str_table_is_empty(struct str_table *table)
39 return hash_table_count(table->hash) == 0;
42 const char *str_table_ref(struct str_table *table, const char *str)
48 if (!hash_table_lookup_full(table->hash, str, &key, &value)) {
56 hash_table_update(table->hash, key, POINTER_CAST(ref));
60 void str_table_unref(struct str_table *table, const char **str)
66 if (!hash_table_lookup_full(table->hash, *str, &key, &value))
72 hash_table_update(table->hash, key, POINTER_CAST(ref));
74 hash_table_remove(table->hash, key);