+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
+Thu Nov 26 01:36:20 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h:
+ * ghash.c: reverted the g_hash_table_set_key_freefunc() addition,
+ since it's to specialized and needs to be resolved in a generic
+ fashion.
+
Tue Nov 24 18:57:59 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981120-0, change log appended below.
GHashNode **nodes;
GHashFunc hash_func;
GCompareFunc key_compare_func;
- GFreeFunc *free_func;
};
gconstpointer key);
static GHashNode* g_hash_node_new (gpointer key,
gpointer value);
-static void g_hash_node_destroy (GHashNode *hash_node,
- GFreeFunc *free_func);
-static void g_hash_nodes_destroy (GHashNode *hash_node,
- GFreeFunc *free_func);
+static void g_hash_node_destroy (GHashNode *hash_node);
+static void g_hash_nodes_destroy (GHashNode *hash_node);
static GMemChunk *node_mem_chunk = NULL;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
hash_table->key_compare_func = key_compare_func;
hash_table->nodes = g_new (GHashNode*, hash_table->size);
- hash_table->free_func = NULL;
for (i = 0; i < hash_table->size; i++)
hash_table->nodes[i] = NULL;
g_return_if_fail (hash_table != NULL);
for (i = 0; i < hash_table->size; i++)
- g_hash_nodes_destroy (hash_table->nodes[i], hash_table->free_func);
+ g_hash_nodes_destroy (hash_table->nodes[i]);
g_free (hash_table->nodes);
g_free (hash_table);
{
dest = *node;
(*node) = dest->next;
- g_hash_node_destroy (dest, hash_table->free_func);
+ g_hash_node_destroy (dest);
hash_table->nnodes--;
}
if (prev)
{
prev->next = node->next;
- g_hash_node_destroy (node, hash_table->free_func);
+ g_hash_node_destroy (node);
node = prev;
}
else
{
hash_table->nodes[i] = node->next;
- g_hash_node_destroy (node, hash_table->free_func);
+ g_hash_node_destroy (node);
goto restart;
}
}
return hash_table->nnodes;
}
-void
-g_hash_table_set_key_freefunc (GHashTable *hash_table, GFreeFunc *free_func)
-{
- hash_table->free_func = free_func;
-}
-
static void
g_hash_table_resize (GHashTable *hash_table)
{
}
static void
-g_hash_node_destroy (GHashNode *hash_node, GFreeFunc *free_func)
+g_hash_node_destroy (GHashNode *hash_node)
{
- if (free_func) (*free_func)(hash_node->key);
hash_node->next = node_free_list;
node_free_list = hash_node;
}
static void
-g_hash_nodes_destroy (GHashNode *hash_node, GFreeFunc *free_func)
+g_hash_nodes_destroy (GHashNode *hash_node)
{
GHashNode *node;
node = hash_node;
while (node->next)
- {
- if (free_func) (*free_func)(node->key);
- node = node->next;
- }
+ node = node->next;
node->next = node_free_list;
node_free_list = hash_node;
GHRFunc func,
gpointer user_data);
gint g_hash_table_size (GHashTable *hash_table);
-void g_hash_table_set_key_freefunc (GHashTable *hash_table,
- GFreeFunc *free_func);
/* Caches
GHashNode **nodes;
GHashFunc hash_func;
GCompareFunc key_compare_func;
- GFreeFunc *free_func;
};
gconstpointer key);
static GHashNode* g_hash_node_new (gpointer key,
gpointer value);
-static void g_hash_node_destroy (GHashNode *hash_node,
- GFreeFunc *free_func);
-static void g_hash_nodes_destroy (GHashNode *hash_node,
- GFreeFunc *free_func);
+static void g_hash_node_destroy (GHashNode *hash_node);
+static void g_hash_nodes_destroy (GHashNode *hash_node);
static GMemChunk *node_mem_chunk = NULL;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
hash_table->key_compare_func = key_compare_func;
hash_table->nodes = g_new (GHashNode*, hash_table->size);
- hash_table->free_func = NULL;
for (i = 0; i < hash_table->size; i++)
hash_table->nodes[i] = NULL;
g_return_if_fail (hash_table != NULL);
for (i = 0; i < hash_table->size; i++)
- g_hash_nodes_destroy (hash_table->nodes[i], hash_table->free_func);
+ g_hash_nodes_destroy (hash_table->nodes[i]);
g_free (hash_table->nodes);
g_free (hash_table);
{
dest = *node;
(*node) = dest->next;
- g_hash_node_destroy (dest, hash_table->free_func);
+ g_hash_node_destroy (dest);
hash_table->nnodes--;
}
if (prev)
{
prev->next = node->next;
- g_hash_node_destroy (node, hash_table->free_func);
+ g_hash_node_destroy (node);
node = prev;
}
else
{
hash_table->nodes[i] = node->next;
- g_hash_node_destroy (node, hash_table->free_func);
+ g_hash_node_destroy (node);
goto restart;
}
}
return hash_table->nnodes;
}
-void
-g_hash_table_set_key_freefunc (GHashTable *hash_table, GFreeFunc *free_func)
-{
- hash_table->free_func = free_func;
-}
-
static void
g_hash_table_resize (GHashTable *hash_table)
{
}
static void
-g_hash_node_destroy (GHashNode *hash_node, GFreeFunc *free_func)
+g_hash_node_destroy (GHashNode *hash_node)
{
- if (free_func) (*free_func)(hash_node->key);
hash_node->next = node_free_list;
node_free_list = hash_node;
}
static void
-g_hash_nodes_destroy (GHashNode *hash_node, GFreeFunc *free_func)
+g_hash_nodes_destroy (GHashNode *hash_node)
{
GHashNode *node;
node = hash_node;
while (node->next)
- {
- if (free_func) (*free_func)(node->key);
- node = node->next;
- }
+ node = node->next;
node->next = node_free_list;
node_free_list = hash_node;
GHRFunc func,
gpointer user_data);
gint g_hash_table_size (GHashTable *hash_table);
-void g_hash_table_set_key_freefunc (GHashTable *hash_table,
- GFreeFunc *free_func);
/* Caches