From e9725d165621c34f076ce3ae3bb1b2513aa7cf0d Mon Sep 17 00:00:00 2001 From: Ravi Sankar Guntur Date: Sat, 21 Jan 2012 22:17:18 +0530 Subject: [PATCH] Macro to insert a new GNode "after" the given sibling. https://bugzilla.gnome.org/show_bug.cgi?id=626258 Signed-off-by: Ravi Sankar Guntur --- docs/reference/glib/glib-sections.txt | 1 + glib/gnode.c | 5 +++-- glib/gnode.h | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 45b2e912b..37524b62e 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -2469,6 +2469,7 @@ g_node_prepend g_node_insert_data +g_node_insert_data_after g_node_insert_data_before g_node_append_data g_node_prepend_data diff --git a/glib/gnode.c b/glib/gnode.c index 9fef8f7e6..b2c3226cd 100644 --- a/glib/gnode.c +++ b/glib/gnode.c @@ -53,8 +53,9 @@ * g_node_insert_before(), g_node_append() and g_node_prepend(). * * To create a new node and insert it into a tree use - * g_node_insert_data(), g_node_insert_data_before(), - * g_node_append_data() and g_node_prepend_data(). + * g_node_insert_data(), g_node_insert_data_after(), + * g_node_insert_data_before(), g_node_append_data() + * and g_node_prepend_data(). * * To reverse the children of a node use g_node_reverse_children(). * diff --git a/glib/gnode.h b/glib/gnode.h index 675b8b175..7ffdcbfc5 100644 --- a/glib/gnode.h +++ b/glib/gnode.h @@ -168,6 +168,19 @@ GNode* g_node_find (GNode *root, #define g_node_insert_data(parent, position, data) \ g_node_insert ((parent), (position), g_node_new (data)) +/** + * g_node_insert_data_after: + * @parent: the #GNode to place the new #GNode under + * @sibling: the sibling #GNode to place the new #GNode after + * @data: the data for the new #GNode + * + * Inserts a new #GNode after the given sibling. + * + * Returns: the new #GNode + */ + +#define g_node_insert_data_after(parent, sibling, data) \ + g_node_insert_after ((parent), (sibling), g_node_new (data)) /** * g_node_insert_data_before: * @parent: the #GNode to place the new #GNode under