36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Quarks.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3393396" class="shortcut">Top</a>
41
<a href="#id3394452" class="shortcut">Description</a></nobr></td></tr>
40
<tr><td colspan="5" class="shortcuts">
41
<a href="#glib-N-ary-Trees.synopsis" class="shortcut">Top</a>
43
<a href="#glib-N-ary-Trees.description" class="shortcut">Description</a>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-N-ary-Trees"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
48
<a name="id3393396"></a><span class="refentrytitle">N-ary Trees</span>
50
<p>N-ary Trees — trees of data with any number of branches</p>
50
<h2><span class="refentrytitle"><a name="glib-N-ary-Trees.top_of_page"></a>N-ary Trees</span></h2>
51
<p>N-ary Trees — trees of data with any number of branches</p>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
56
<a name="glib-N-ary-Trees.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
58
59
#include <glib.h>
61
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>;
62
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-new">g_node_new</a> (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
63
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-copy">g_node_copy</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
64
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> (<a class="link" href="glib-N-ary-Trees.html#GCopyFunc">*GCopyFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> src,
65
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
66
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-copy-deep">g_node_copy_deep</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
67
<a class="link" href="glib-N-ary-Trees.html#GCopyFunc">GCopyFunc</a> copy_func,
68
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
70
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert">g_node_insert</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
71
<a class="link" href="glib-Basic-Types.html#gint">gint</a> position,
72
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
73
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert-before">g_node_insert_before</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
74
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *sibling,
75
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
76
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert-after">g_node_insert_after</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
77
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *sibling,
78
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
79
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append">g_node_append</a> (parent, node)
80
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-prepend">g_node_prepend</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
81
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
83
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data">g_node_insert_data</a> (parent, position, data)
84
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before">g_node_insert_data_before</a> (parent, sibling, data)
85
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append-data">g_node_append_data</a> (parent, data)
86
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data">g_node_prepend_data</a> (parent, data)
88
void <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children">g_node_reverse_children</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
89
void <a class="link" href="glib-N-ary-Trees.html#g-node-traverse">g_node_traverse</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root,
90
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType">GTraverseType</a> order,
91
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
92
<a class="link" href="glib-Basic-Types.html#gint">gint</a> max_depth,
93
<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc">GNodeTraverseFunc</a> func,
94
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
95
enum <a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a>;
96
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> (<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc">*GNodeTraverseFunc</a>) (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
97
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
98
void <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach">g_node_children_foreach</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
99
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
100
<a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc">GNodeForeachFunc</a> func,
101
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
102
void (<a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc">*GNodeForeachFunc</a>) (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
103
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
105
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-get-root">g_node_get_root</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
106
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-find">g_node_find</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root,
107
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType">GTraverseType</a> order,
108
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
109
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
110
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-find-child">g_node_find_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
111
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
112
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
113
<a class="link" href="glib-Basic-Types.html#gint">gint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-index">g_node_child_index</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
114
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
115
<a class="link" href="glib-Basic-Types.html#gint">gint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-position">g_node_child_position</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
116
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *child);
117
#define <a class="link" href="glib-N-ary-Trees.html#g-node-first-child">g_node_first_child</a> (node)
118
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-last-child">g_node_last_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
119
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-nth-child">g_node_nth_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
120
<a class="link" href="glib-Basic-Types.html#guint">guint</a> n);
121
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling">g_node_first_sibling</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
122
#define <a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling">g_node_next_sibling</a> (node)
123
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling">g_node_prev_sibling</a> (node)
124
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling">g_node_last_sibling</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
126
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF:CAPS">G_NODE_IS_LEAF</a> (node)
127
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT:CAPS">G_NODE_IS_ROOT</a> (node)
128
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-depth">g_node_depth</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
129
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes">g_node_n_nodes</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root,
130
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags);
131
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-children">g_node_n_children</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
132
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor">g_node_is_ancestor</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
133
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *descendant);
134
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-max-height">g_node_max_height</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root);
136
void <a class="link" href="glib-N-ary-Trees.html#g-node-unlink">g_node_unlink</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);
137
void <a class="link" href="glib-N-ary-Trees.html#g-node-destroy">g_node_destroy</a> (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root);
139
void <a class="link" href="glib-N-ary-Trees.html#g-node-push-allocator">g_node_push_allocator</a> (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> dummy);
140
void <a class="link" href="glib-N-ary-Trees.html#g-node-pop-allocator">g_node_pop_allocator</a> (void);
61
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>;
62
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-new" title="g_node_new ()">g_node_new</a> (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
63
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-copy" title="g_node_copy ()">g_node_copy</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
64
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> (<a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()">*GCopyFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> src,
65
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
66
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-copy-deep" title="g_node_copy_deep ()">g_node_copy_deep</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
67
<a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()">GCopyFunc</a> copy_func,
68
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
70
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert" title="g_node_insert ()">g_node_insert</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
71
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> position,
72
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
73
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert-before" title="g_node_insert_before ()">g_node_insert_before</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
74
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *sibling,
75
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
76
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-insert-after" title="g_node_insert_after ()">g_node_insert_after</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
77
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *sibling,
78
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
79
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append" title="g_node_append()">g_node_append</a> (parent, node)
80
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-prepend" title="g_node_prepend ()">g_node_prepend</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
81
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
83
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data" title="g_node_insert_data()">g_node_insert_data</a> (parent, position, data)
84
#define <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before" title="g_node_insert_data_before()">g_node_insert_data_before</a> (parent, sibling, data)
85
#define <a class="link" href="glib-N-ary-Trees.html#g-node-append-data" title="g_node_append_data()">g_node_append_data</a> (parent, data)
86
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data" title="g_node_prepend_data()">g_node_prepend_data</a> (parent, data)
88
void <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children" title="g_node_reverse_children ()">g_node_reverse_children</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
89
void <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()">g_node_traverse</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root,
90
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType">GTraverseType</a> order,
91
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
92
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> max_depth,
93
<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()">GNodeTraverseFunc</a> func,
94
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
95
enum <a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a>;
96
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()">*GNodeTraverseFunc</a>) (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
97
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
98
void <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()">g_node_children_foreach</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
99
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
100
<a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc" title="GNodeForeachFunc ()">GNodeForeachFunc</a> func,
101
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
102
void (<a class="link" href="glib-N-ary-Trees.html#GNodeForeachFunc" title="GNodeForeachFunc ()">*GNodeForeachFunc</a>) (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
103
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
105
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-get-root" title="g_node_get_root ()">g_node_get_root</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
106
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-find" title="g_node_find ()">g_node_find</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root,
107
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType">GTraverseType</a> order,
108
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
109
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
110
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-find-child" title="g_node_find_child ()">g_node_find_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
111
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
112
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
113
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-index" title="g_node_child_index ()">g_node_child_index</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
114
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
115
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-child-position" title="g_node_child_position ()">g_node_child_position</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
116
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *child);
117
#define <a class="link" href="glib-N-ary-Trees.html#g-node-first-child" title="g_node_first_child()">g_node_first_child</a> (node)
118
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-last-child" title="g_node_last_child ()">g_node_last_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
119
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-nth-child" title="g_node_nth_child ()">g_node_nth_child</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
120
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n);
121
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling" title="g_node_first_sibling ()">g_node_first_sibling</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
122
#define <a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling" title="g_node_next_sibling()">g_node_next_sibling</a> (node)
123
#define <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling" title="g_node_prev_sibling()">g_node_prev_sibling</a> (node)
124
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling" title="g_node_last_sibling ()">g_node_last_sibling</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
126
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF--CAPS" title="G_NODE_IS_LEAF()">G_NODE_IS_LEAF</a> (node)
127
#define <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT--CAPS" title="G_NODE_IS_ROOT()">G_NODE_IS_ROOT</a> (node)
128
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-depth" title="g_node_depth ()">g_node_depth</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
129
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes" title="g_node_n_nodes ()">g_node_n_nodes</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root,
130
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags);
131
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-n-children" title="g_node_n_children ()">g_node_n_children</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
132
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor" title="g_node_is_ancestor ()">g_node_is_ancestor</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
133
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *descendant);
134
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-N-ary-Trees.html#g-node-max-height" title="g_node_max_height ()">g_node_max_height</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root);
136
void <a class="link" href="glib-N-ary-Trees.html#g-node-unlink" title="g_node_unlink ()">g_node_unlink</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);
137
void <a class="link" href="glib-N-ary-Trees.html#g-node-destroy" title="g_node_destroy ()">g_node_destroy</a> (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root);
139
void <a class="link" href="glib-N-ary-Trees.html#g-node-push-allocator" title="g_node_push_allocator ()">g_node_push_allocator</a> (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> dummy);
140
void <a class="link" href="glib-N-ary-Trees.html#g-node-pop-allocator" title="g_node_pop_allocator ()">g_node_pop_allocator</a> (void);
143
143
<div class="refsect1" lang="en">
144
<a name="id3394452"></a><h2>Description</h2>
144
<a name="glib-N-ary-Trees.description"></a><h2>Description</h2>
146
The <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> struct and its associated functions provide a N-ary tree data
146
The <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> struct and its associated functions provide a N-ary tree data
147
147
structure, where nodes in the tree can contain arbitrary data.
150
To create a new tree use <a class="link" href="glib-N-ary-Trees.html#g-node-new"><code class="function">g_node_new()</code></a>.
153
To insert a node into a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-insert"><code class="function">g_node_insert()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-insert-before"><code class="function">g_node_insert_before()</code></a>,
154
<a class="link" href="glib-N-ary-Trees.html#g-node-append"><code class="function">g_node_append()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend"><code class="function">g_node_prepend()</code></a>.
157
To create a new node and insert it into a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data"><code class="function">g_node_insert_data()</code></a>,
158
<a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before"><code class="function">g_node_insert_data_before()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-append-data"><code class="function">g_node_append_data()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data"><code class="function">g_node_prepend_data()</code></a>.
161
To reverse the children of a node use <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children"><code class="function">g_node_reverse_children()</code></a>.
164
To find a node use <a class="link" href="glib-N-ary-Trees.html#g-node-get-root"><code class="function">g_node_get_root()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-find"><code class="function">g_node_find()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-find-child"><code class="function">g_node_find_child()</code></a>,
165
<a class="link" href="glib-N-ary-Trees.html#g-node-child-index"><code class="function">g_node_child_index()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-child-position"><code class="function">g_node_child_position()</code></a>,
166
<a class="link" href="glib-N-ary-Trees.html#g-node-first-child"><code class="function">g_node_first_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-last-child"><code class="function">g_node_last_child()</code></a>,
167
<a class="link" href="glib-N-ary-Trees.html#g-node-nth-child"><code class="function">g_node_nth_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling"><code class="function">g_node_first_sibling()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling"><code class="function">g_node_prev_sibling()</code></a>,
168
<a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling"><code class="function">g_node_next_sibling()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling"><code class="function">g_node_last_sibling()</code></a>.
171
To get information about a node or tree use <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF:CAPS"><code class="function">G_NODE_IS_LEAF()</code></a>,
172
<a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT:CAPS"><code class="function">G_NODE_IS_ROOT()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-depth"><code class="function">g_node_depth()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes"><code class="function">g_node_n_nodes()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-n-children"><code class="function">g_node_n_children()</code></a>,
173
<a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor"><code class="function">g_node_is_ancestor()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-max-height"><code class="function">g_node_max_height()</code></a>.
150
To create a new tree use <a class="link" href="glib-N-ary-Trees.html#g-node-new" title="g_node_new ()"><code class="function">g_node_new()</code></a>.
153
To insert a node into a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-insert" title="g_node_insert ()"><code class="function">g_node_insert()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-insert-before" title="g_node_insert_before ()"><code class="function">g_node_insert_before()</code></a>,
154
<a class="link" href="glib-N-ary-Trees.html#g-node-append" title="g_node_append()"><code class="function">g_node_append()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend" title="g_node_prepend ()"><code class="function">g_node_prepend()</code></a>.
157
To create a new node and insert it into a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-insert-data" title="g_node_insert_data()"><code class="function">g_node_insert_data()</code></a>,
158
<a class="link" href="glib-N-ary-Trees.html#g-node-insert-data-before" title="g_node_insert_data_before()"><code class="function">g_node_insert_data_before()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-append-data" title="g_node_append_data()"><code class="function">g_node_append_data()</code></a> and <a class="link" href="glib-N-ary-Trees.html#g-node-prepend-data" title="g_node_prepend_data()"><code class="function">g_node_prepend_data()</code></a>.
161
To reverse the children of a node use <a class="link" href="glib-N-ary-Trees.html#g-node-reverse-children" title="g_node_reverse_children ()"><code class="function">g_node_reverse_children()</code></a>.
164
To find a node use <a class="link" href="glib-N-ary-Trees.html#g-node-get-root" title="g_node_get_root ()"><code class="function">g_node_get_root()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-find" title="g_node_find ()"><code class="function">g_node_find()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-find-child" title="g_node_find_child ()"><code class="function">g_node_find_child()</code></a>,
165
<a class="link" href="glib-N-ary-Trees.html#g-node-child-index" title="g_node_child_index ()"><code class="function">g_node_child_index()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-child-position" title="g_node_child_position ()"><code class="function">g_node_child_position()</code></a>,
166
<a class="link" href="glib-N-ary-Trees.html#g-node-first-child" title="g_node_first_child()"><code class="function">g_node_first_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-last-child" title="g_node_last_child ()"><code class="function">g_node_last_child()</code></a>,
167
<a class="link" href="glib-N-ary-Trees.html#g-node-nth-child" title="g_node_nth_child ()"><code class="function">g_node_nth_child()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-first-sibling" title="g_node_first_sibling ()"><code class="function">g_node_first_sibling()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-prev-sibling" title="g_node_prev_sibling()"><code class="function">g_node_prev_sibling()</code></a>,
168
<a class="link" href="glib-N-ary-Trees.html#g-node-next-sibling" title="g_node_next_sibling()"><code class="function">g_node_next_sibling()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-last-sibling" title="g_node_last_sibling ()"><code class="function">g_node_last_sibling()</code></a>.
171
To get information about a node or tree use <a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-LEAF--CAPS" title="G_NODE_IS_LEAF()"><code class="function">G_NODE_IS_LEAF()</code></a>,
172
<a class="link" href="glib-N-ary-Trees.html#G-NODE-IS-ROOT--CAPS" title="G_NODE_IS_ROOT()"><code class="function">G_NODE_IS_ROOT()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-depth" title="g_node_depth ()"><code class="function">g_node_depth()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-n-nodes" title="g_node_n_nodes ()"><code class="function">g_node_n_nodes()</code></a>, <a class="link" href="glib-N-ary-Trees.html#g-node-n-children" title="g_node_n_children ()"><code class="function">g_node_n_children()</code></a>,
173
<a class="link" href="glib-N-ary-Trees.html#g-node-is-ancestor" title="g_node_is_ancestor ()"><code class="function">g_node_is_ancestor()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-max-height" title="g_node_max_height ()"><code class="function">g_node_max_height()</code></a>.
176
176
To traverse a tree, calling a function for each node visited in the
177
traversal, use <a class="link" href="glib-N-ary-Trees.html#g-node-traverse"><code class="function">g_node_traverse()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach"><code class="function">g_node_children_foreach()</code></a>.
177
traversal, use <a class="link" href="glib-N-ary-Trees.html#g-node-traverse" title="g_node_traverse ()"><code class="function">g_node_traverse()</code></a> or <a class="link" href="glib-N-ary-Trees.html#g-node-children-foreach" title="g_node_children_foreach ()"><code class="function">g_node_children_foreach()</code></a>.
180
To remove a node or subtree from a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-unlink"><code class="function">g_node_unlink()</code></a> or
181
<a class="link" href="glib-N-ary-Trees.html#g-node-destroy"><code class="function">g_node_destroy()</code></a>.
180
To remove a node or subtree from a tree use <a class="link" href="glib-N-ary-Trees.html#g-node-unlink" title="g_node_unlink ()"><code class="function">g_node_unlink()</code></a> or
181
<a class="link" href="glib-N-ary-Trees.html#g-node-destroy" title="g_node_destroy ()"><code class="function">g_node_destroy()</code></a>.
184
184
<div class="refsect1" lang="en">
185
<a name="id3394857"></a><h2>Details</h2>
185
<a name="glib-N-ary-Trees.details"></a><h2>Details</h2>
186
186
<div class="refsect2" lang="en">
187
<a name="id3394868"></a><h3>
188
<a name="GNode"></a>GNode</h3>
189
<a class="indexterm" name="id3394880"></a><pre class="programlisting">typedef struct {
187
<a name="GNode"></a><h3>GNode</h3>
188
<pre class="programlisting">typedef struct {
293
287
<div class="refsect2" lang="en">
294
<a name="id3395249"></a><h3>
295
<a name="GCopyFunc"></a>GCopyFunc ()</h3>
296
<a class="indexterm" name="id3395264"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> (*GCopyFunc) (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> src,
297
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
288
<a name="GCopyFunc"></a><h3>GCopyFunc ()</h3>
289
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> (*GCopyFunc) (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> src,
290
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
299
292
A function of this signature is used to copy the node data
300
293
when doing a deep-copy of a tree.</p>
304
296
<div class="variablelist"><table border="0">
305
297
<col align="left" valign="top">
308
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
300
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
309
301
<td> A pointer to the data which should be copied
313
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
305
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
314
306
<td> Additional data
318
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
310
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
319
311
<td> A pointer to the copy
325
<p class="since">Since 2.4
317
<p class="since">Since 2.4</p>
329
320
<div class="refsect2" lang="en">
330
<a name="id3395354"></a><h3>
331
<a name="g-node-copy-deep"></a>g_node_copy_deep ()</h3>
332
<a class="indexterm" name="id3395369"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_copy_deep (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
333
<a class="link" href="glib-N-ary-Trees.html#GCopyFunc">GCopyFunc</a> copy_func,
334
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
336
Recursively copies a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> and its data.</p>
321
<a name="g-node-copy-deep"></a><h3>g_node_copy_deep ()</h3>
322
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_copy_deep (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
323
<a class="link" href="glib-N-ary-Trees.html#GCopyFunc" title="GCopyFunc ()">GCopyFunc</a> copy_func,
324
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
326
Recursively copies a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> and its data.</p>
340
329
<div class="variablelist"><table border="0">
341
330
<col align="left" valign="top">
344
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
345
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
333
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
334
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
349
<td><p><span class="term"><em class="parameter"><code>copy_func</code></em> :</span></p></td>
338
<td><p><span class="term"><em class="parameter"><code>copy_func</code></em> :</span></p></td>
350
339
<td> the function which is called to copy the data inside each node,
351
or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to use the original data.
340
or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to use the original data.
355
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
344
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
356
345
<td> data to pass to <em class="parameter"><code>copy_func</code></em>
360
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
361
<td> a new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> containing copies of the data in <em class="parameter"><code>node</code></em>.
349
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
350
<td> a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> containing copies of the data in <em class="parameter"><code>node</code></em>.
367
<p class="since">Since 2.4
356
<p class="since">Since 2.4</p>
371
359
<div class="refsect2" lang="en">
372
<a name="id3395527"></a><h3>
373
<a name="g-node-insert"></a>g_node_insert ()</h3>
374
<a class="indexterm" name="id3395540"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_insert (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
375
<a class="link" href="glib-Basic-Types.html#gint">gint</a> position,
376
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);</pre>
378
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> beneath the parent at the given position.</p>
360
<a name="g-node-insert"></a><h3>g_node_insert ()</h3>
361
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_insert (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
362
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> position,
363
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);</pre>
365
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> beneath the parent at the given position.</p>
382
368
<div class="variablelist"><table border="0">
383
369
<col align="left" valign="top">
386
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
387
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
372
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
373
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
391
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
377
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
392
378
<td> the position to place <em class="parameter"><code>node</code></em> at, with respect to its siblings
393
379
If position is -1, <em class="parameter"><code>node</code></em> is inserted as the last child of <em class="parameter"><code>parent</code></em>
397
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
398
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to insert
402
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
403
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
410
<div class="refsect2" lang="en">
411
<a name="id3395701"></a><h3>
412
<a name="g-node-insert-before"></a>g_node_insert_before ()</h3>
413
<a class="indexterm" name="id3395714"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_insert_before (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
414
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *sibling,
415
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);</pre>
417
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> beneath the parent before the given sibling.</p>
421
<div class="variablelist"><table border="0">
422
<col align="left" valign="top">
425
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
426
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
430
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
431
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> before.
432
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the node is inserted as the last child of <em class="parameter"><code>parent</code></em>.
436
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
437
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to insert
441
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
442
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
449
<div class="refsect2" lang="en">
450
<a name="id3395888"></a><h3>
451
<a name="g-node-insert-after"></a>g_node_insert_after ()</h3>
452
<a class="indexterm" name="id3395901"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_insert_after (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
453
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *sibling,
454
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);</pre>
456
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> beneath the parent after the given sibling.</p>
460
<div class="variablelist"><table border="0">
461
<col align="left" valign="top">
464
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
465
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
469
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
470
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> after.
471
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the node is inserted as the first child of <em class="parameter"><code>parent</code></em>.
475
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
476
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to insert
480
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
481
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
488
<div class="refsect2" lang="en">
489
<a name="id3396074"></a><h3>
490
<a name="g-node-append"></a>g_node_append()</h3>
491
<a class="indexterm" name="id3396087"></a><pre class="programlisting">#define g_node_append(parent, node)</pre>
493
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> as the last child of the given parent.</p>
497
<div class="variablelist"><table border="0">
498
<col align="left" valign="top">
501
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
502
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
506
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
507
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to insert
511
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
512
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
519
<div class="refsect2" lang="en">
520
<a name="id3396189"></a><h3>
521
<a name="g-node-prepend"></a>g_node_prepend ()</h3>
522
<a class="indexterm" name="id3396202"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_prepend (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *parent,
523
<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);</pre>
525
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> as the first child of the given parent.</p>
529
<div class="variablelist"><table border="0">
530
<col align="left" valign="top">
533
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
534
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
538
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
539
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to insert
543
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
544
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
551
<div class="refsect2" lang="en">
552
<a name="id3396324"></a><h3>
553
<a name="g-node-insert-data"></a>g_node_insert_data()</h3>
554
<a class="indexterm" name="id3396338"></a><pre class="programlisting">#define g_node_insert_data(parent, position, data)</pre>
556
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> at the given position.</p>
560
<div class="variablelist"><table border="0">
561
<col align="left" valign="top">
564
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
565
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
569
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
570
<td> the position to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> at. If position is -1,
571
the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> is inserted as the last child of <em class="parameter"><code>parent</code></em>
575
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
576
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
580
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
581
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
588
<div class="refsect2" lang="en">
589
<a name="id3396476"></a><h3>
590
<a name="g-node-insert-data-before"></a>g_node_insert_data_before()</h3>
591
<a class="indexterm" name="id3396489"></a><pre class="programlisting">#define g_node_insert_data_before(parent, sibling, data)</pre>
593
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> before the given sibling.</p>
597
<div class="variablelist"><table border="0">
598
<col align="left" valign="top">
601
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
602
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
606
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
607
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> before
611
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
612
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
616
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
617
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
624
<div class="refsect2" lang="en">
625
<a name="id3396621"></a><h3>
626
<a name="g-node-append-data"></a>g_node_append_data()</h3>
627
<a class="indexterm" name="id3396634"></a><pre class="programlisting">#define g_node_append_data(parent, data)</pre>
629
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> as the last child of the given parent.</p>
633
<div class="variablelist"><table border="0">
634
<col align="left" valign="top">
637
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
638
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
642
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
643
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
647
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
648
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
655
<div class="refsect2" lang="en">
656
<a name="id3396735"></a><h3>
657
<a name="g-node-prepend-data"></a>g_node_prepend_data()</h3>
658
<a class="indexterm" name="id3396749"></a><pre class="programlisting">#define g_node_prepend_data(parent, data)</pre>
660
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> as the first child of the given parent.</p>
664
<div class="variablelist"><table border="0">
665
<col align="left" valign="top">
668
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
669
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> under
673
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
674
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
678
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
679
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
686
<div class="refsect2" lang="en">
687
<a name="id3396850"></a><h3>
688
<a name="g-node-reverse-children"></a>g_node_reverse_children ()</h3>
689
<a class="indexterm" name="id3396864"></a><pre class="programlisting">void g_node_reverse_children (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node);</pre>
691
Reverses the order of the children of a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>.
383
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
384
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to insert
388
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
389
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
396
<div class="refsect2" lang="en">
397
<a name="g-node-insert-before"></a><h3>g_node_insert_before ()</h3>
398
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_insert_before (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
399
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *sibling,
400
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);</pre>
402
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> beneath the parent before the given sibling.</p>
405
<div class="variablelist"><table border="0">
406
<col align="left" valign="top">
409
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
410
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
414
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
415
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> before.
416
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the node is inserted as the last child of <em class="parameter"><code>parent</code></em>.
420
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
421
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to insert
425
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
426
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
433
<div class="refsect2" lang="en">
434
<a name="g-node-insert-after"></a><h3>g_node_insert_after ()</h3>
435
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_insert_after (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
436
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *sibling,
437
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);</pre>
439
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> beneath the parent after the given sibling.</p>
442
<div class="variablelist"><table border="0">
443
<col align="left" valign="top">
446
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
447
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> under
451
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
452
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place <em class="parameter"><code>node</code></em> after.
453
If sibling is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the node is inserted as the first child of <em class="parameter"><code>parent</code></em>.
457
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
458
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to insert
462
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
463
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
470
<div class="refsect2" lang="en">
471
<a name="g-node-append"></a><h3>g_node_append()</h3>
472
<pre class="programlisting">#define g_node_append(parent, node)</pre>
474
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> as the last child of the given parent.</p>
477
<div class="variablelist"><table border="0">
478
<col align="left" valign="top">
481
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
482
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
486
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
487
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to insert
491
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
492
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
499
<div class="refsect2" lang="en">
500
<a name="g-node-prepend"></a><h3>g_node_prepend ()</h3>
501
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_prepend (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *parent,
502
<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);</pre>
504
Inserts a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> as the first child of the given parent.</p>
507
<div class="variablelist"><table border="0">
508
<col align="left" valign="top">
511
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
512
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
516
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
517
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to insert
521
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
522
<td> the inserted <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
529
<div class="refsect2" lang="en">
530
<a name="g-node-insert-data"></a><h3>g_node_insert_data()</h3>
531
<pre class="programlisting">#define g_node_insert_data(parent, position, data)</pre>
533
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> at the given position.</p>
536
<div class="variablelist"><table border="0">
537
<col align="left" valign="top">
540
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
541
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
545
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
546
<td> the position to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> at. If position is -1,
547
the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> is inserted as the last child of <em class="parameter"><code>parent</code></em>
551
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
552
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
556
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
557
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
564
<div class="refsect2" lang="en">
565
<a name="g-node-insert-data-before"></a><h3>g_node_insert_data_before()</h3>
566
<pre class="programlisting">#define g_node_insert_data_before(parent, sibling, data)</pre>
568
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> before the given sibling.</p>
571
<div class="variablelist"><table border="0">
572
<col align="left" valign="top">
575
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
576
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
580
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
581
<td> the sibling <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> before
585
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
586
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
590
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
591
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
598
<div class="refsect2" lang="en">
599
<a name="g-node-append-data"></a><h3>g_node_append_data()</h3>
600
<pre class="programlisting">#define g_node_append_data(parent, data)</pre>
602
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> as the last child of the given parent.</p>
605
<div class="variablelist"><table border="0">
606
<col align="left" valign="top">
609
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
610
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
614
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
615
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
619
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
620
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
627
<div class="refsect2" lang="en">
628
<a name="g-node-prepend-data"></a><h3>g_node_prepend_data()</h3>
629
<pre class="programlisting">#define g_node_prepend_data(parent, data)</pre>
631
Inserts a new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> as the first child of the given parent.</p>
634
<div class="variablelist"><table border="0">
635
<col align="left" valign="top">
638
<td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
639
<td> the <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> to place the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> under
643
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
644
<td> the data for the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
648
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
649
<td> the new <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
656
<div class="refsect2" lang="en">
657
<a name="g-node-reverse-children"></a><h3>g_node_reverse_children ()</h3>
658
<pre class="programlisting">void g_node_reverse_children (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node);</pre>
660
Reverses the order of the children of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>.
692
661
(It doesn't change the order of the grandchildren.)</p>
696
664
<div class="variablelist"><table border="0">
697
665
<col align="left" valign="top">
699
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
700
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>.
667
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
668
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>.
706
674
<div class="refsect2" lang="en">
707
<a name="id3396931"></a><h3>
708
<a name="g-node-traverse"></a>g_node_traverse ()</h3>
709
<a class="indexterm" name="id3396944"></a><pre class="programlisting">void g_node_traverse (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root,
710
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType">GTraverseType</a> order,
711
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
712
<a class="link" href="glib-Basic-Types.html#gint">gint</a> max_depth,
713
<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc">GNodeTraverseFunc</a> func,
714
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
675
<a name="g-node-traverse"></a><h3>g_node_traverse ()</h3>
676
<pre class="programlisting">void g_node_traverse (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root,
677
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType">GTraverseType</a> order,
678
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
679
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> max_depth,
680
<a class="link" href="glib-N-ary-Trees.html#GNodeTraverseFunc" title="GNodeTraverseFunc ()">GNodeTraverseFunc</a> func,
681
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
716
Traverses a tree starting at the given root <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>.
683
Traverses a tree starting at the given root <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>.
717
684
It calls the given function for each node visited.
718
The traversal can be halted at any point by returning <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> from <em class="parameter"><code>func</code></em>.</p>
685
The traversal can be halted at any point by returning <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> from <em class="parameter"><code>func</code></em>.</p>
722
688
<div class="variablelist"><table border="0">
723
689
<col align="left" valign="top">
726
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
727
<td> the root <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> of the tree to traverse
731
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
732
<td> the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER:CAPS"><code class="literal">G_IN_ORDER</code></a>,
733
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER:CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER:CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER:CAPS"><code class="literal">G_LEVEL_ORDER</code></a>.
737
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
692
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
693
<td> the root <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> of the tree to traverse
697
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
698
<td> the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER--CAPS"><code class="literal">G_IN_ORDER</code></a>,
699
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER--CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER--CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER--CAPS"><code class="literal">G_LEVEL_ORDER</code></a>.
703
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
738
704
<td> which types of children are to be visited, one of
739
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
705
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL--CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES--CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES--CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
743
<td><p><span class="term"><em class="parameter"><code>max_depth</code></em> :</span></p></td>
709
<td><p><span class="term"><em class="parameter"><code>max_depth</code></em> :</span></p></td>
744
710
<td> the maximum depth of the traversal. Nodes below this
745
711
depth will not be visited. If max_depth is -1 all nodes in
746
712
the tree are visited. If depth is 1, only the root is visited.
953
906
<div class="refsect2" lang="en">
954
<a name="id3398011"></a><h3>
955
<a name="g-node-find"></a>g_node_find ()</h3>
956
<a class="indexterm" name="id3398023"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_find (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *root,
957
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType">GTraverseType</a> order,
958
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
959
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
961
Finds a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> in a tree.</p>
965
<div class="variablelist"><table border="0">
966
<col align="left" valign="top">
969
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
970
<td> the root <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> of the tree to search
974
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
975
<td> the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER:CAPS"><code class="literal">G_IN_ORDER</code></a>,
976
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER:CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER:CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER:CAPS"><code class="literal">G_LEVEL_ORDER</code></a>
980
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
981
<td> which types of children are to be searched, one of
982
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
986
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
987
<td> the data to find
991
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
992
<td> the found <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the data is not found
999
<div class="refsect2" lang="en">
1000
<a name="id3398259"></a><h3>
1001
<a name="g-node-find-child"></a>g_node_find_child ()</h3>
1002
<a class="indexterm" name="id3398272"></a><pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a>* g_node_find_child (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
1003
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags">GTraverseFlags</a> flags,
1004
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
1006
Finds the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> with the given data.</p>
1010
<div class="variablelist"><table border="0">
1011
<col align="left" valign="top">
1014
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
1015
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
1019
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
1020
<td> which types of children are to be searched, one of
1021
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL:CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES:CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES:CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
1025
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1026
<td> the data to find
1030
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1031
<td> the found child <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the data is not found
1038
<div class="refsect2" lang="en">
1039
<a name="id3398444"></a><h3>
1040
<a name="g-node-child-index"></a>g_node_child_index ()</h3>
1041
<a class="indexterm" name="id3398457"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a> g_node_child_index (<a class="link" href="glib-N-ary-Trees.html#GNode">GNode</a> *node,
1042
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
1044
Gets the position of the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
907
<a name="g-node-find"></a><h3>g_node_find ()</h3>
908
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_find (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *root,
909
<a class="link" href="glib-Balanced-Binary-Trees.html#GTraverseType" title="enum GTraverseType">GTraverseType</a> order,
910
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
911
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
913
Finds a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> in a tree.</p>
916
<div class="variablelist"><table border="0">
917
<col align="left" valign="top">
920
<td><p><span class="term"><em class="parameter"><code>root</code></em> :</span></p></td>
921
<td> the root <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> of the tree to search
925
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
926
<td> the order in which nodes are visited - <a class="link" href="glib-Balanced-Binary-Trees.html#G-IN-ORDER--CAPS"><code class="literal">G_IN_ORDER</code></a>,
927
<a class="link" href="glib-Balanced-Binary-Trees.html#G-PRE-ORDER--CAPS"><code class="literal">G_PRE_ORDER</code></a>, <a class="link" href="glib-Balanced-Binary-Trees.html#G-POST-ORDER--CAPS"><code class="literal">G_POST_ORDER</code></a>, or <a class="link" href="glib-Balanced-Binary-Trees.html#G-LEVEL-ORDER--CAPS"><code class="literal">G_LEVEL_ORDER</code></a>
931
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
932
<td> which types of children are to be searched, one of
933
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL--CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES--CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES--CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
937
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
938
<td> the data to find
942
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
943
<td> the found <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> if the data is not found
950
<div class="refsect2" lang="en">
951
<a name="g-node-find-child"></a><h3>g_node_find_child ()</h3>
952
<pre class="programlisting"><a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a>* g_node_find_child (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
953
<a class="link" href="glib-N-ary-Trees.html#GTraverseFlags" title="enum GTraverseFlags">GTraverseFlags</a> flags,
954
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
956
Finds the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> with the given data.</p>
959
<div class="variablelist"><table border="0">
960
<col align="left" valign="top">
963
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
964
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
968
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
969
<td> which types of children are to be searched, one of
970
<a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-ALL--CAPS"><code class="literal">G_TRAVERSE_ALL</code></a>, <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-LEAVES--CAPS"><code class="literal">G_TRAVERSE_LEAVES</code></a> and <a class="link" href="glib-N-ary-Trees.html#G-TRAVERSE-NON-LEAVES--CAPS"><code class="literal">G_TRAVERSE_NON_LEAVES</code></a>
974
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
975
<td> the data to find
979
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
980
<td> the found child <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> if the data is not found
987
<div class="refsect2" lang="en">
988
<a name="g-node-child-index"></a><h3>g_node_child_index ()</h3>
989
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> g_node_child_index (<a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode">GNode</a> *node,
990
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
992
Gets the position of the first child of a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
1045
993
which contains the given data.</p>
1049
996
<div class="variablelist"><table border="0">
1050
997
<col align="left" valign="top">
1053
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
1054
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a>
1000
<td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
1001
<td> a <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a>
1058
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1005
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1059
1006
<td> the data to find
1063
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1010
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1064
1011
<td> the index of the child of <em class="parameter"><code>node</code></em> which contains
1065
1012
<em class="parameter"><code>data</code></em>, or -1 if the data is not found