add a bunch of functions for manipulating eet_node structs
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Jul 2011 03:47:03 +0000 (03:47 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Jul 2011 03:47:03 +0000 (03:47 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eet@60957 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

AUTHORS
ChangeLog
src/lib/Eet.h
src/lib/eet_node.c

diff --git a/AUTHORS b/AUTHORS
index 6ec31c0..afdb972 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -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>
index 753de5b..ce5520c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 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
index 3f01904..06a27a9 100644 (file)
@@ -3745,6 +3745,35 @@ 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
  */
@@ -3783,6 +3812,24 @@ eet_node_dump(Eet_Node  *n,
               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
  */
index 35d820a..771fe13 100644 (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)
 {