[asterisk-commits] bbryant: branch group/data_api_gsoc2009 r204144 - /team/group/data_api_gsoc20...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 29 13:46:48 CDT 2009


Author: bbryant
Date: Mon Jun 29 13:46:44 2009
New Revision: 204144

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204144
Log:
A few updates to keep the branch up to date.

Modified:
    team/group/data_api_gsoc2009/main/data.c

Modified: team/group/data_api_gsoc2009/main/data.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/main/data.c?view=diff&rev=204144&r1=204143&r2=204144
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Mon Jun 29 13:46:44 2009
@@ -58,6 +58,12 @@
 	char name[0];
 };
 
+struct data_filter {
+	/*! \brief The list of filter or search requirements 
+	           ( container of type struct ast_data ) */
+	struct ao2_container *children;
+};
+
 /*! \brief A data container node pointing to the registered handler. */
 struct data_provider {
 	/*! \brief node content handler. */
@@ -622,9 +628,10 @@
  * \retval NULL on error.
  * \retval non-NULL The generated result tree.
  */
-static struct ast_data *data_result_generate_node(const struct ast_data_query *query,
+static struct ast_data *__data_result_generate_node(const struct ast_data_query *query,
 	const struct data_provider *root_provider,
-	const char *parent_node_name)
+	const char *parent_node_name,
+	struct data_filter *filter)
 {
 	struct ast_data *generated, *node;
 	struct ao2_iterator i;
@@ -649,7 +656,7 @@
 	/* if this is not a terminal node, generate every child node. */
 	i = ao2_iterator_init(root_provider->children, 0);
 	while ((provider = ao2_iterator_next(&i))) {
-		generated = data_result_generate_node(query, provider, provider->name);
+		generated = __data_result_generate_node(query, provider, provider->name, filter);
 		if (generated) {
 			data_result_add_child(node, generated);
 		}
@@ -657,6 +664,21 @@
 	}
 
 	return node;
+}
+
+/*!
+ * \internal
+ * \brief Generate all the tree from a specified provider.
+ * \param[in] query The query executed.
+ * \param[in] root_provider The provider specified in the path of the query.
+ * \param[in] parent_node_name The root node name.
+ * \retval NULL on error.
+ * \retval non-NULL The generated result tree.
+ */
+static struct ast_data *data_result_generate_node(const struct ast_data_query *query,
+	const struct data_provider *root_provider,
+	const char *parent_node_name) {
+	return __data_result_generate_node(query, root_provider, parent_node_name, NULL);
 }
 
 /*!
@@ -786,7 +808,8 @@
 			break;
 		case AST_DATA_POINTER:
 		case AST_DATA_IPADDR:
-			/* add internal data. */
+			snprintf(node_content, sizeof(node_content), "%s", ast_inet_ntoa(node->payload.ipaddr));
+			ast_xml_set_Text(child_xml, node_content);
 			break;
 		}
 		ast_xml_add_child(parent_xml, child_xml);




More information about the asterisk-commits mailing list