* Boston, MA 02111-1307, USA.
*/
+/*
+ * Modified by the GLib Team and others 1997-1999. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
/*
* MT safe
*/
GNode *free_nodes; /* implementation specific */
};
-G_LOCK_DECLARE_STATIC (current_allocator);
+G_LOCK_DEFINE_STATIC (current_allocator);
static GAllocator *current_allocator = NULL;
/* HOLDS: current_allocator_lock */
}
GNode*
+g_node_copy (GNode *node)
+{
+ GNode *new_node = NULL;
+
+ if (node)
+ {
+ GNode *child;
+
+ new_node = g_node_new (node->data);
+
+ for (child = g_node_last_child (node); child; child = child->prev)
+ g_node_prepend (new_node, g_node_copy (child));
+ }
+
+ return new_node;
+}
+
+GNode*
g_node_insert (GNode *parent,
gint position,
GNode *node)
{
g_return_val_if_fail (node != NULL, NULL);
+ if (node->parent)
+ return node->parent->children;
+
while (node->prev)
node = node->prev;