X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=glib%2Fgnode.h;h=763ac909f405230720d4012dddda2ec5e89493b4;hb=ea4f9ce8a060d53cbc299e4c384089f6cc926caa;hp=f68e8b3cc803c712f8192f3dafe869d45260d48a;hpb=69801f8dc84c0c9403df6802eccc5d03328cd3ae;p=platform%2Fupstream%2Fglib.git
diff --git a/glib/gnode.h b/glib/gnode.h
index f68e8b3..763ac90 100644
--- a/glib/gnode.h
+++ b/glib/gnode.h
@@ -12,9 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see .
*/
/*
@@ -24,13 +22,13 @@
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
-#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
-#error "Only can be included directly."
-#endif
-
#ifndef __G_NODE_H__
#define __G_NODE_H__
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only can be included directly."
+#endif
+
#include
G_BEGIN_DECLS
@@ -112,30 +110,44 @@ struct _GNode
*/
#define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL)
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_new (gpointer data);
+GLIB_AVAILABLE_IN_ALL
void g_node_destroy (GNode *root);
+GLIB_AVAILABLE_IN_ALL
void g_node_unlink (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_copy_deep (GNode *node,
GCopyFunc copy_func,
gpointer data);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_copy (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_insert (GNode *parent,
gint position,
GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_insert_before (GNode *parent,
GNode *sibling,
GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_insert_after (GNode *parent,
GNode *sibling,
GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_prepend (GNode *parent,
GNode *node);
+GLIB_AVAILABLE_IN_ALL
guint g_node_n_nodes (GNode *root,
GTraverseFlags flags);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_get_root (GNode *node);
+GLIB_AVAILABLE_IN_ALL
gboolean g_node_is_ancestor (GNode *node,
GNode *descendant);
+GLIB_AVAILABLE_IN_ALL
guint g_node_depth (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_find (GNode *root,
GTraverseType order,
GTraverseFlags flags,
@@ -169,6 +181,19 @@ GNode* g_node_find (GNode *root,
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
* @sibling: the sibling #GNode to place the new #GNode before
@@ -205,11 +230,12 @@ GNode* g_node_find (GNode *root,
#define g_node_append_data(parent, data) \
g_node_insert_before ((parent), NULL, g_node_new (data))
-/* traversal function, assumes that `node' is root
- * (only traverses `node' and its subtree).
+/* traversal function, assumes that 'node' is root
+ * (only traverses 'node' and its subtree).
* this function is just a high level interface to
* low level traversal functions, optimized for speed.
*/
+GLIB_AVAILABLE_IN_ALL
void g_node_traverse (GNode *root,
GTraverseType order,
GTraverseFlags flags,
@@ -217,31 +243,42 @@ void g_node_traverse (GNode *root,
GNodeTraverseFunc func,
gpointer data);
-/* return the maximum tree height starting with `node', this is an expensive
+/* return the maximum tree height starting with 'node', this is an expensive
* operation, since we need to visit all nodes. this could be shortened by
- * adding `guint height' to struct _GNode, but then again, this is not very
+ * adding 'guint height' to struct _GNode, but then again, this is not very
* often needed, and would make g_node_insert() more time consuming.
*/
+GLIB_AVAILABLE_IN_ALL
guint g_node_max_height (GNode *root);
+GLIB_AVAILABLE_IN_ALL
void g_node_children_foreach (GNode *node,
GTraverseFlags flags,
GNodeForeachFunc func,
gpointer data);
+GLIB_AVAILABLE_IN_ALL
void g_node_reverse_children (GNode *node);
+GLIB_AVAILABLE_IN_ALL
guint g_node_n_children (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_nth_child (GNode *node,
guint n);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_last_child (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_find_child (GNode *node,
GTraverseFlags flags,
gpointer data);
+GLIB_AVAILABLE_IN_ALL
gint g_node_child_position (GNode *node,
GNode *child);
+GLIB_AVAILABLE_IN_ALL
gint g_node_child_index (GNode *node,
gpointer data);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_first_sibling (GNode *node);
+GLIB_AVAILABLE_IN_ALL
GNode* g_node_last_sibling (GNode *node);
/**
@@ -250,7 +287,8 @@ GNode* g_node_last_sibling (GNode *node);
*
* Gets the previous sibling of a #GNode.
*
- * Returns: the previous sibling of @node, or %NULL if @node is %NULL
+ * Returns: the previous sibling of @node, or %NULL if @node is the first
+ * node or %NULL
*/
#define g_node_prev_sibling(node) ((node) ? \
((GNode*) (node))->prev : NULL)
@@ -261,7 +299,8 @@ GNode* g_node_last_sibling (GNode *node);
*
* Gets the next sibling of a #GNode.
*
- * Returns: the next sibling of @node, or %NULL if @node is %NULL
+ * Returns: the next sibling of @node, or %NULL if @node is the last node
+ * or %NULL
*/
#define g_node_next_sibling(node) ((node) ? \
((GNode*) (node))->next : NULL)
@@ -278,11 +317,6 @@ GNode* g_node_last_sibling (GNode *node);
#define g_node_first_child(node) ((node) ? \
((GNode*) (node))->children : NULL)
-#ifndef G_DISABLE_DEPRECATED
-void g_node_push_allocator (gpointer dummy);
-void g_node_pop_allocator (void);
-#endif
-
G_END_DECLS
#endif /* __G_NODE_H__ */