gnode.h File Reference

API published in:
API deprecated in:


#include <_ansi.h>
#include <glib/gmem.h>

Go to the source code of this file.


Data Structures

struct   _GNode

Defines

#define  G_NODE_IS_ROOT(node)
#define  G_NODE_IS_LEAF(node)   (((GNode*) (node))->children == NULL)
#define  g_node_append(parent, node)   g_node_insert_before ((parent), NULL, (node))
#define  g_node_insert_data(parent, position, data)   g_node_insert ((parent), (position), g_node_new (data))
#define  g_node_insert_data_before(parent, sibling, data)   g_node_insert_before ((parent), (sibling), g_node_new (data))
#define  g_node_prepend_data(parent, data)   g_node_prepend ((parent), g_node_new (data))
#define  g_node_append_data(parent, data)   g_node_insert_before ((parent), NULL, g_node_new (data))
#define  g_node_prev_sibling(node)
#define  g_node_next_sibling(node)
#define  g_node_first_child(node)

Typedefs

typedef typedefG_BEGIN_DECLS
struct _GNode 
GNode
typedef gboolean(*  GNodeTraverseFunc )(GNode *node, gpointer data)
typedef void(*  GNodeForeachFunc )(GNode *node, gpointer data)
typedef gpointer(*  GCopyFunc )(gconstpointer src, gpointer data)

Enumerations

enum   GTraverseFlags {
  G_TRAVERSE_LEAVES = 1 << 0, G_TRAVERSE_NON_LEAVES = 1 << 1, G_TRAVERSE_ALL = G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES, G_TRAVERSE_MASK = 0x03,
  G_TRAVERSE_LEAFS = G_TRAVERSE_LEAVES, G_TRAVERSE_NON_LEAFS = G_TRAVERSE_NON_LEAVES
}
enum   GTraverseType { G_IN_ORDER, G_PRE_ORDER, G_POST_ORDER, G_LEVEL_ORDER }

Functions

IMPORT_C GNode g_node_new (gpointer data)
IMPORT_C void  g_node_destroy (GNode *root)
IMPORT_C void  g_node_unlink (GNode *node)
IMPORT_C GNode g_node_copy_deep (GNode *node, GCopyFunc copy_func, gpointer data)
IMPORT_C GNode g_node_copy (GNode *node)
IMPORT_C GNode g_node_insert (GNode *parent, gint position, GNode *node)
IMPORT_C GNode g_node_insert_before (GNode *parent, GNode *sibling, GNode *node)
IMPORT_C GNode g_node_insert_after (GNode *parent, GNode *sibling, GNode *node)
IMPORT_C GNode g_node_prepend (GNode *parent, GNode *node)
IMPORT_C guint  g_node_n_nodes (GNode *root, GTraverseFlags flags)
IMPORT_C GNode g_node_get_root (GNode *node)
IMPORT_C gboolean  g_node_is_ancestor (GNode *node, GNode *descendant)
IMPORT_C guint  g_node_depth (GNode *node)
IMPORT_C GNode g_node_find (GNode *root, GTraverseType order, GTraverseFlags flags, gpointer data)
IMPORT_C void  g_node_traverse (GNode *root, GTraverseType order, GTraverseFlags flags, gint max_depth, GNodeTraverseFunc func, gpointer data)
IMPORT_C guint  g_node_max_height (GNode *root)
IMPORT_C void  g_node_children_foreach (GNode *node, GTraverseFlags flags, GNodeForeachFunc func, gpointer data)
IMPORT_C void  g_node_reverse_children (GNode *node)
IMPORT_C guint  g_node_n_children (GNode *node)
IMPORT_C GNode g_node_nth_child (GNode *node, guint n)
IMPORT_C GNode g_node_last_child (GNode *node)
IMPORT_C GNode g_node_find_child (GNode *node, GTraverseFlags flags, gpointer data)
IMPORT_C gint  g_node_child_position (GNode *node, GNode *child)
IMPORT_C gint  g_node_child_index (GNode *node, gpointer data)
IMPORT_C GNode g_node_first_sibling (GNode *node)
IMPORT_C GNode g_node_last_sibling (GNode *node)
IMPORT_C void  g_node_push_allocator (gpointer dummy)
IMPORT_C void  g_node_pop_allocator (void)

Define Documentation

#define g_node_append parent,
node   )     g_node_insert_before ((parent), NULL, (node))
 
#define g_node_append_data parent,
data   )     g_node_insert_before ((parent), NULL, g_node_new (data))
 
#define g_node_first_child node   ) 
 

Value:

((node) ? \
                                         ((GNode*) (node))->children : NULL)
#define g_node_insert_data parent,
position,
data   )     g_node_insert ((parent), (position), g_node_new (data))
 
#define g_node_insert_data_before parent,
sibling,
data   )     g_node_insert_before ((parent), (sibling), g_node_new (data))
 
#define G_NODE_IS_LEAF node   )     (((GNode*) (node))->children == NULL)
 
#define G_NODE_IS_ROOT node   ) 
 

Value:

(((GNode*) (node))->parent == NULL && \
                                 ((GNode*) (node))->prev == NULL && \
                                 ((GNode*) (node))->next == NULL)
#define g_node_next_sibling node   ) 
 

Value:

((node) ? \
                                         ((GNode*) (node))->next : NULL)
#define g_node_prepend_data parent,
data   )     g_node_prepend ((parent), g_node_new (data))
 
#define g_node_prev_sibling node   ) 
 

Value:

((node) ? \
                                         ((GNode*) (node))->prev : NULL)

Typedef Documentation

typedef gpointer(* GCopyFunc)(gconstpointer src, gpointer data)
 
typedef typedefG_BEGIN_DECLS struct _GNode GNode
 
typedef void(* GNodeForeachFunc)(GNode *node, gpointer data)
 
typedef gboolean(* GNodeTraverseFunc)(GNode *node, gpointer data)
 

Enumeration Type Documentation

enum GTraverseFlags
 
Enumerator:
G_TRAVERSE_LEAVES 
G_TRAVERSE_NON_LEAVES 
G_TRAVERSE_ALL 
G_TRAVERSE_MASK 
G_TRAVERSE_LEAFS 
G_TRAVERSE_NON_LEAFS 
enum GTraverseType
 
Enumerator:
G_IN_ORDER 
G_PRE_ORDER 
G_POST_ORDER 
G_LEVEL_ORDER 

Function Documentation

IMPORT_C gint g_node_child_index GNode node,
gpointer  data
 
IMPORT_C gint g_node_child_position GNode node,
GNode child
 
IMPORT_C void g_node_children_foreach GNode node,
GTraverseFlags  flags,
GNodeForeachFunc  func,
gpointer  data
 
IMPORT_C GNode* g_node_copy GNode node  ) 
 
IMPORT_C GNode* g_node_copy_deep GNode node,
GCopyFunc  copy_func,
gpointer  data
 
IMPORT_C guint g_node_depth GNode node  ) 
 
IMPORT_C void g_node_destroy GNode root  ) 
 
IMPORT_C GNode* g_node_find GNode root,
GTraverseType  order,
GTraverseFlags  flags,
gpointer  data
 
IMPORT_C GNode* g_node_find_child GNode node,
GTraverseFlags  flags,
gpointer  data
 
IMPORT_C GNode* g_node_first_sibling GNode node  ) 
 
IMPORT_C GNode* g_node_get_root GNode node  ) 
 
IMPORT_C GNode* g_node_insert GNode parent,
gint  position,
GNode node
 
IMPORT_C GNode* g_node_insert_after GNode parent,
GNode sibling,
GNode node
 
IMPORT_C GNode* g_node_insert_before GNode parent,
GNode sibling,
GNode node
 
IMPORT_C gboolean g_node_is_ancestor GNode node,
GNode descendant
 
IMPORT_C GNode* g_node_last_child GNode node  ) 
 
IMPORT_C GNode* g_node_last_sibling GNode node  ) 
 
IMPORT_C guint g_node_max_height GNode root  ) 
 
IMPORT_C guint g_node_n_children GNode node  ) 
 
IMPORT_C guint g_node_n_nodes GNode root,
GTraverseFlags  flags
 
IMPORT_C GNode* g_node_new gpointer  data  ) 
 
IMPORT_C GNode* g_node_nth_child GNode node,
guint  n
 
IMPORT_C void g_node_pop_allocator void   ) 
 
IMPORT_C GNode* g_node_prepend GNode parent,
GNode node
 
IMPORT_C void g_node_push_allocator gpointer  dummy  ) 
 
IMPORT_C void g_node_reverse_children GNode node  ) 
 
IMPORT_C void g_node_traverse GNode root,
GTraverseType  order,
GTraverseFlags  flags,
gint  max_depth,
GNodeTraverseFunc  func,
gpointer  data
 
IMPORT_C void g_node_unlink GNode node  ) 
 

Copyright © Nokia Corporation 2001-2008
Back to top