summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-04 03:47:03 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-04 03:47:03 +0000
commitc4349599a385056bdaee7965ac15b79e751ad353 (patch)
tree81b04bec36d513fbdeaea0d2c051b04ab3c4bdba
parentfc64fb5a7150a44a266ccaa54c75eda084433853 (diff)
add a bunch of functions for manipulating eet_node structs
SVN revision: 60957
-rw-r--r--legacy/eet/AUTHORS1
-rw-r--r--legacy/eet/ChangeLog6
-rw-r--r--legacy/eet/src/lib/Eet.h47
-rw-r--r--legacy/eet/src/lib/eet_node.c43
4 files changed, 97 insertions, 0 deletions
diff --git a/legacy/eet/AUTHORS b/legacy/eet/AUTHORS
index 6ec31c0fc2..afdb972fa6 100644
--- a/legacy/eet/AUTHORS
+++ b/legacy/eet/AUTHORS
@@ -10,3 +10,4 @@ Raphael Kubo da Costa <kubo@profusion.mobi>
10Mathieu Taillefumier <mathieu.taillefumier@free.fr> 10Mathieu Taillefumier <mathieu.taillefumier@free.fr>
11Albin "Lutin" Tonnerre <albin.tonnerre@gmail.com> 11Albin "Lutin" Tonnerre <albin.tonnerre@gmail.com>
12Adam Simpkins <adam@adamsimpkins.net> 12Adam Simpkins <adam@adamsimpkins.net>
13Mike Blumenkrantz <mike@zentific.com>
diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog
index 753de5b29e..ce5520cf0b 100644
--- a/legacy/eet/ChangeLog
+++ b/legacy/eet/ChangeLog
@@ -509,3 +509,9 @@
5092011-06-10 Cedric BAIL 5092011-06-10 Cedric BAIL
510 510
511 * Add EET_DATA_DESCRIPTOR_ADD_LIST_STRING helper to define List of char *. 511 * Add EET_DATA_DESCRIPTOR_ADD_LIST_STRING helper to define List of char *.
512
5132011-07-04 Mike Blumenkrantz
514
515 * Add functions to manipulate nodes:
516 eet_node_children_get, eet_node_next_get, eet_node_parent_get,
517 eet_node_type_get, eet_node_value_get, eet_node_name_get
diff --git a/legacy/eet/src/lib/Eet.h b/legacy/eet/src/lib/Eet.h
index 3f01904626..06a27a9076 100644
--- a/legacy/eet/src/lib/Eet.h
+++ b/legacy/eet/src/lib/Eet.h
@@ -3745,6 +3745,35 @@ eet_node_struct_child_new(const char *parent,
3745 Eet_Node *child); 3745 Eet_Node *child);
3746 3746
3747/** 3747/**
3748 * @brief Get a node's child nodes
3749 * @param node The node
3750 * @return The first child node which contains a pointer to the
3751 * next child node and the parent.
3752 * @since 1.5
3753 */
3754EAPI Eet_Node *
3755eet_node_children_get(Eet_Node *node);
3756
3757/**
3758 * @brief Get the next node in a list of nodes
3759 * @param node The node
3760 * @return A node which contains a pointer to the
3761 * next child node and the parent.
3762 * @since 1.5
3763 */
3764EAPI Eet_Node *
3765eet_node_next_get(Eet_Node *node);
3766
3767/**
3768 * @brief Get the parent node of a node
3769 * @param node The node
3770 * @return The parent node of @p node
3771 * @since 1.5
3772 */
3773EAPI Eet_Node *
3774eet_node_parent_get(Eet_Node *node);
3775
3776/**
3748 * TODO FIX ME 3777 * TODO FIX ME
3749 * @ingroup Eet_Node_Group 3778 * @ingroup Eet_Node_Group
3750 */ 3779 */
@@ -3783,6 +3812,24 @@ eet_node_dump(Eet_Node *n,
3783 void *dumpdata); 3812 void *dumpdata);
3784 3813
3785/** 3814/**
3815 * @brief Return the type of a node
3816 * @param node The node
3817 * @return The node's type (EET_T_$TYPE)
3818 * @since 1.5
3819 */
3820EAPI int
3821eet_node_type_get(Eet_Node *node);
3822
3823/**
3824 * @brief Return the node's data
3825 * @param node The node
3826 * @return The data contained in the node
3827 * @since 1.5
3828 */
3829EAPI Eet_Node_Data *
3830eet_node_value_get(Eet_Node *node);
3831
3832/**
3786 * TODO FIX ME 3833 * TODO FIX ME
3787 * @ingroup Eet_Node_Group 3834 * @ingroup Eet_Node_Group
3788 */ 3835 */
diff --git a/legacy/eet/src/lib/eet_node.c b/legacy/eet/src/lib/eet_node.c
index 35d820a685..771fe13186 100644
--- a/legacy/eet/src/lib/eet_node.c
+++ b/legacy/eet/src/lib/eet_node.c
@@ -225,6 +225,27 @@ eet_node_struct_child_new(const char *parent,
225 return n; 225 return n;
226} /* eet_node_struct_child_new */ 226} /* eet_node_struct_child_new */
227 227
228Eet_Node *
229eet_node_children_get(Eet_Node *node)
230{
231 if (!node) return NULL;
232 return node->values;
233}
234
235Eet_Node *
236eet_node_next_get(Eet_Node *node)
237{
238 if (!node) return NULL;
239 return node->next;
240}
241
242Eet_Node *
243eet_node_parent_get(Eet_Node *node)
244{
245 if (!node) return NULL;
246 return node->parent;
247}
248
228void 249void
229eet_node_list_append(Eet_Node *parent, 250eet_node_list_append(Eet_Node *parent,
230 const char *name, 251 const char *name,
@@ -330,6 +351,28 @@ eet_node_hash_add(Eet_Node *parent,
330 parent->values = nn; 351 parent->values = nn;
331} /* eet_node_hash_add */ 352} /* eet_node_hash_add */
332 353
354
355int
356eet_node_type_get(Eet_Node *node)
357{
358 if (!node) return EET_T_UNKNOW;
359 return node->type;
360}
361
362Eet_Node_Data *
363eet_node_value_get(Eet_Node *node)
364{
365 if (!node) return NULL;
366 return &node->data;
367}
368
369const char *
370eet_node_name_get(Eet_Node *node)
371{
372 if (!node) return NULL;
373 return node->name;
374}
375
333void 376void
334eet_node_del(Eet_Node *n) 377eet_node_del(Eet_Node *n)
335{ 378{