Added g_hash_table_contains for glib < 2.32
This commit is contained in:
@@ -81,12 +81,21 @@ p_list_free_full(GList *items, GDestroyNotify free_func)
|
||||
gboolean
|
||||
p_hash_table_add(GHashTable *hash_table, gpointer key)
|
||||
{
|
||||
// doesn't handle when key exists, but value == NULL
|
||||
gpointer found = g_hash_table_lookup(hash_table, key);
|
||||
g_hash_table_replace(hash_table, key, key);
|
||||
|
||||
return (found == NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
p_hash_table_contains(GHashTable *hash_table, gconstpointer key)
|
||||
{
|
||||
// doesn't handle when key exists, but value == NULL
|
||||
gpointer found = g_hash_table_lookup(hash_table, key);
|
||||
return (found != NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
create_dir(char *name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user