add a bunch of functions for manipulating eet_node structs

SVN revision: 60957
This commit is contained in:
Mike Blumenkrantz 2011-07-04 03:47:03 +00:00
parent fc64fb5a71
commit c4349599a3
4 changed files with 97 additions and 0 deletions

View File

@ -10,3 +10,4 @@ Raphael Kubo da Costa <kubo@profusion.mobi>
Mathieu Taillefumier <mathieu.taillefumier@free.fr>
Albin "Lutin" Tonnerre <albin.tonnerre@gmail.com>
Adam Simpkins <adam@adamsimpkins.net>
Mike Blumenkrantz <mike@zentific.com>

View File

@ -509,3 +509,9 @@
2011-06-10 Cedric BAIL
* Add EET_DATA_DESCRIPTOR_ADD_LIST_STRING helper to define List of char *.
2011-07-04 Mike Blumenkrantz
* Add functions to manipulate nodes:
eet_node_children_get, eet_node_next_get, eet_node_parent_get,
eet_node_type_get, eet_node_value_get, eet_node_name_get

View File

@ -3744,6 +3744,35 @@ EAPI Eet_Node *
eet_node_struct_child_new(const char *parent,
Eet_Node *child);
/**
* @brief Get a node's child nodes
* @param node The node
* @return The first child node which contains a pointer to the
* next child node and the parent.
* @since 1.5
*/
EAPI Eet_Node *
eet_node_children_get(Eet_Node *node);
/**
* @brief Get the next node in a list of nodes
* @param node The node
* @return A node which contains a pointer to the
* next child node and the parent.
* @since 1.5
*/
EAPI Eet_Node *
eet_node_next_get(Eet_Node *node);
/**
* @brief Get the parent node of a node
* @param node The node
* @return The parent node of @p node
* @since 1.5
*/
EAPI Eet_Node *
eet_node_parent_get(Eet_Node *node);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
@ -3782,6 +3811,24 @@ eet_node_dump(Eet_Node *n,
Eet_Dump_Callback dumpfunc,
void *dumpdata);
/**
* @brief Return the type of a node
* @param node The node
* @return The node's type (EET_T_$TYPE)
* @since 1.5
*/
EAPI int
eet_node_type_get(Eet_Node *node);
/**
* @brief Return the node's data
* @param node The node
* @return The data contained in the node
* @since 1.5
*/
EAPI Eet_Node_Data *
eet_node_value_get(Eet_Node *node);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group

View File

@ -225,6 +225,27 @@ eet_node_struct_child_new(const char *parent,
return n;
} /* eet_node_struct_child_new */
Eet_Node *
eet_node_children_get(Eet_Node *node)
{
if (!node) return NULL;
return node->values;
}
Eet_Node *
eet_node_next_get(Eet_Node *node)
{
if (!node) return NULL;
return node->next;
}
Eet_Node *
eet_node_parent_get(Eet_Node *node)
{
if (!node) return NULL;
return node->parent;
}
void
eet_node_list_append(Eet_Node *parent,
const char *name,
@ -330,6 +351,28 @@ eet_node_hash_add(Eet_Node *parent,
parent->values = nn;
} /* eet_node_hash_add */
int
eet_node_type_get(Eet_Node *node)
{
if (!node) return EET_T_UNKNOW;
return node->type;
}
Eet_Node_Data *
eet_node_value_get(Eet_Node *node)
{
if (!node) return NULL;
return &node->data;
}
const char *
eet_node_name_get(Eet_Node *node)
{
if (!node) return NULL;
return node->name;
}
void
eet_node_del(Eet_Node *n)
{