str-table.c revision 087272dde587c41c2605fe59340d7fa7021b6892
5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen/* Copyright (c) 2014-2015 Dovecot authors, see the included COPYING file */
6daca8888bbf2b5bf26903cf397d5219ea752241Timo Sirainen hash_table_create(&table->hash, default_pool, 0, str_hash, strcmp);
f3e1593a7d9b02090575fb20db90a235e10145a5Timo Sirainenvoid str_table_deinit(struct str_table **_table)
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen while (hash_table_iterate(iter, table->hash, &key, &value))
acc8c0647873b1c847bfa362ddefd0d219d0aa91Timo Sirainenbool str_table_is_empty(struct str_table *table)
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainenconst char *str_table_ref(struct str_table *table, const char *str)
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen unsigned int ref;
2978aafcf8c306adc2e012aed00546a63c677784Timo Sirainen if (!hash_table_lookup_full(table->hash, str, &key, &value)) {
26bedc1f8aace67ff8f19f625a403a097017845aTimo Sirainen hash_table_update(table->hash, key, POINTER_CAST(ref));
2dc6cf8bad599bfe9129bb496539a08ee3631cc0Timo Sirainenvoid str_table_unref(struct str_table *table, const char **str)
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen unsigned int ref;
f3e1593a7d9b02090575fb20db90a235e10145a5Timo Sirainen if (!hash_table_lookup_full(table->hash, *str, &key, &value))