3 GHashTable* resources = NULL;
5 void resource_storage_init()
8 resources = g_hash_table_new_full(g_str_hash, g_str_equal,
9 (GDestroyNotify)g_free, (GDestroyNotify)g_object_unref);
12 void resource_storage_free()
14 if(resources == NULL) return;
15 g_hash_table_destroy(resources);
19 void resource_storage_add(const gchar* name, AtkObject* resource)
21 if(resources == NULL) return;
22 g_hash_table_insert(resources, g_strdup(name), g_object_ref(resource));
25 AtkObject* resource_storage_get(const gchar* name)
27 if(resources == NULL) return NULL;
28 return g_hash_table_lookup(resources, name);
30 void resources_storage_remove(const gchar* name)
32 if(resources == NULL) return;
33 g_hash_table_remove(resources, name);