Added function to keep symetry with g_node_insert_before. 2000-09-29

2000-09-29  Jonathan Blandford  <jrb@redhat.com>

	* gnode.c (g_node_insert_after): Added function to keep symetry
	with g_node_insert_before.
2000-09-29  Jonathan Blandford  <jrb@redhat.com>

	* glib/tmpl/trees-nary.sgml: Add g_node_insert_after().
This commit is contained in:
Jonathan Blandford 2000-09-29 23:13:02 +00:00 committed by Jonathan Blandford
parent 79b416d023
commit b3ee868f94
16 changed files with 137 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,8 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* gnode.c (g_node_insert_after): Added function to keep symetry
with g_node_insert_before.
2000-09-30 Martin Baulig <baulig@suse.de>
* configure.in (HAVE_THREADS): New automake conditional.

View File

@ -1,3 +1,7 @@
2000-09-29 Jonathan Blandford <jrb@redhat.com>
* glib/tmpl/trees-nary.sgml: Add g_node_insert_after().
Thu Sep 7 12:35:35 2000 Owen Taylor <otaylor@redhat.com>
* Some further makefile improvement.

View File

@ -1319,6 +1319,7 @@ g_node_copy
<SUBSECTION>
g_node_insert
g_node_insert_before
g_node_insert_after
g_node_append
g_node_prepend

View File

@ -113,6 +113,18 @@ the node is inserted as the last child of @parent.
@Returns: the inserted #GNode.
<!-- ##### FUNCTION g_node_insert_after ##### -->
<para>
Inserts a #GNode beneath the parent after the given sibling.
</para>
@parent: the #GNode to place @node under.
@sibling: the sibling #GNode to place @node after. If sibling is NULL,
the node is inserted as the first child of @parent.
@node: the #GNode to insert.
@Returns: the inserted #GNode.
<!-- ##### MACRO g_node_append ##### -->
<para>
Inserts a #GNode as the last child of the given parent.

3
glib.h
View File

@ -1267,6 +1267,9 @@ GNode* g_node_insert (GNode *parent,
GNode* g_node_insert_before (GNode *parent,
GNode *sibling,
GNode *node);
GNode* g_node_insert_after (GNode *parent,
GNode *sibling,
GNode *node);
GNode* g_node_prepend (GNode *parent,
GNode *node);
guint g_node_n_nodes (GNode *root,

View File

@ -1267,6 +1267,9 @@ GNode* g_node_insert (GNode *parent,
GNode* g_node_insert_before (GNode *parent,
GNode *sibling,
GNode *node);
GNode* g_node_insert_after (GNode *parent,
GNode *sibling,
GNode *node);
GNode* g_node_prepend (GNode *parent,
GNode *node);
guint g_node_n_nodes (GNode *root,

View File

@ -280,6 +280,42 @@ g_node_insert_before (GNode *parent,
return node;
}
GNode*
g_node_insert_after (GNode *parent,
GNode *sibling,
GNode *node)
{
g_return_val_if_fail (parent != NULL, node);
g_return_val_if_fail (node != NULL, node);
g_return_val_if_fail (G_NODE_IS_ROOT (node), node);
if (sibling)
g_return_val_if_fail (sibling->parent == parent, node);
node->parent = parent;
if (sibling)
{
if (sibling->next)
{
sibling->next->prev = node;
}
node->next = sibling->next;
node->prev = sibling;
sibling->next = node;
}
else
{
if (parent->children)
{
node->next = parent->children;
parent->children->prev = node;
}
parent->children = node;
}
return node;
}
GNode*
g_node_prepend (GNode *parent,
GNode *node)

36
gnode.c
View File

@ -280,6 +280,42 @@ g_node_insert_before (GNode *parent,
return node;
}
GNode*
g_node_insert_after (GNode *parent,
GNode *sibling,
GNode *node)
{
g_return_val_if_fail (parent != NULL, node);
g_return_val_if_fail (node != NULL, node);
g_return_val_if_fail (G_NODE_IS_ROOT (node), node);
if (sibling)
g_return_val_if_fail (sibling->parent == parent, node);
node->parent = parent;
if (sibling)
{
if (sibling->next)
{
sibling->next->prev = node;
}
node->next = sibling->next;
node->prev = sibling;
sibling->next = node;
}
else
{
if (parent->children)
{
node->next = parent->children;
parent->children->prev = node;
}
parent->children = node;
}
return node;
}
GNode*
g_node_prepend (GNode *parent,
GNode *node)

View File

@ -338,9 +338,9 @@ static void
g_object_do_dispatch_param_changed (GObject *object,
GParamSpec *pspec)
{
g_message ("NOTIFICATION: parameter `%s' changed on object `%s'",
/* g_message ("NOTIFICATION: parameter `%s' changed on object `%s'",
pspec->name,
G_OBJECT_TYPE_NAME (object));
G_OBJECT_TYPE_NAME (object));*/
}
static gboolean