[asterisk-commits] eliel: branch group/data_api_gsoc2009 r203644 - in /team/group/data_api_gsoc2...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 26 11:15:34 CDT 2009


Author: eliel
Date: Fri Jun 26 11:15:31 2009
New Revision: 203644

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203644
Log:
90 columns max.

Modified:
    team/group/data_api_gsoc2009/include/asterisk/data.h
    team/group/data_api_gsoc2009/main/data.c

Modified: team/group/data_api_gsoc2009/include/asterisk/data.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/include/asterisk/data.h?view=diff&rev=203644&r1=203643&r2=203644
==============================================================================
--- team/group/data_api_gsoc2009/include/asterisk/data.h (original)
+++ team/group/data_api_gsoc2009/include/asterisk/data.h Fri Jun 26 11:15:31 2009
@@ -143,7 +143,8 @@
 		/*! \brief Path to the node to retrieve. */
 		AST_STRING_FIELD(path);
 		/*! \brief Search string, return the nodes that match this conditions.
-		 *         Setting it to NULL will match every node in the specified path. */
+		 *         Setting it to NULL will match every node in the specified
+		 *         path. */
 		AST_STRING_FIELD(search);
 		/*! \brief Filter string, return the internal nodes specified here.
 		 *         Setting it to NULL will return every internal node. */
@@ -166,7 +167,8 @@
  * \retval 0 on success.
  * \see __ast_data_unregister, __ast_data_register_multiple
  */
-int __ast_data_register(const char *path, const struct ast_data_handler *handler, const char *registrar);
+int __ast_data_register(const char *path, const struct ast_data_handler *handler,
+	const char *registrar);
 #define ast_data_register(path, handler) __ast_data_register(path, handler, __FILE__)
 
 /*!
@@ -178,15 +180,17 @@
  * \retval 0 on success.
  * \see __ast_data_register, __ast_data_unregister
  */
-int __ast_data_register_multiple(const struct ast_data_entry *data_entries, size_t entries, const char *registrar);
-#define ast_data_register_multiple(data_entries, entries) __ast_data_register_multiple(data_entries, entries, __FILE__);
+int __ast_data_register_multiple(const struct ast_data_entry *data_entries,
+	size_t entries, const char *registrar);
+#define ast_data_register_multiple(data_entries, entries) \
+	__ast_data_register_multiple(data_entries, entries, __FILE__);
 
 /*!
  * \brief Unregister a data provider.
- * \param[in] path Which node to unregister, if path is NULL unregister every node registered by
- *            the passed 'registrar'.
- * \param[in] registrar Who is trying to unregister this node, only the owner (the one who registered
- *            the node) will be able to unregister it.
+ * \param[in] path Which node to unregister, if path is NULL unregister every node
+ *                 registered by the passed 'registrar'.
+ * \param[in] registrar Who is trying to unregister this node, only the owner (the
+ *                      one who registered the node) will be able to unregister it.
  * \see ast_data_register
  * \retval <0 on error.
  * \retval 0 on success.
@@ -199,8 +203,8 @@
  * \brief Retrieve a subtree from the asterisk data API.
  * \param[in] query The query structure specifying what nodes to retrieve.
  * \retval NULL on error.
- * \retval The dynamically allocated requested sub-tree (it needs to be released using
- *         ast_data_free.
+ * \retval non-NULL The dynamically allocated requested sub-tree (it needs to be
+ *         released using ast_data_free.
  * \see ast_data_free, ast_data_get_xml
  */
 struct ast_data *ast_data_get(const struct ast_data_query *query);
@@ -209,8 +213,8 @@
  * \brief Retrieve a subtree from the asterisk data API in XML format..
  * \param[in] query The query structure specifying what nodes to retrieve.
  * \retval NULL on error.
- * \retval The dynamically allocated requested sub-tree (it needs to be released using
- *         ast_data_free.
+ * \retval non-NULL The dynamically allocated requested sub-tree (it needs to be
+ *         released using ast_data_free.
  * \see ast_data_free, ast_data_get
  */
 struct ast_xml_doc *ast_data_get_xml(const struct ast_data_query *query);
@@ -255,7 +259,8 @@
  * \retval NULL on error (memory exhaustion only).
  * \retval non-NULL a newly allocated node.
  */
-struct ast_data *ast_data_add_int(struct ast_data *root, const char *childname, int value);
+struct ast_data *ast_data_add_int(struct ast_data *root, const char *childname,
+	int value);
 
 /*!
  * \brief Add an unsigned integer node type.
@@ -265,7 +270,8 @@
  * \retval NULL on error (memory exhaustion only).
  * \retval non-NULL a newly allocated node.
  */
-struct ast_data *ast_data_add_uint(struct ast_data *root, const char *childname, unsigned int value);
+struct ast_data *ast_data_add_uint(struct ast_data *root, const char *childname,
+	unsigned int value);
 
 /*!
  * \brief Add a floating point node type.
@@ -275,7 +281,8 @@
  * \retval NULL on error (memory exhaustion only).
  * \retval non-NULL a newly allocated node.
  */
-struct ast_data *ast_data_add_dbl(struct ast_data *root, const char *childname, double dbl);
+struct ast_data *ast_data_add_dbl(struct ast_data *root, const char *childname,
+	double dbl);
 
 
 /*!
@@ -286,7 +293,8 @@
  * \retval NULL on error (memory exhaustion only).
  * \retval non-NULL a newly allocated node.
  */
-struct ast_data *ast_data_add_str(struct ast_data *root, const char *childname, const char *string);
+struct ast_data *ast_data_add_str(struct ast_data *root, const char *childname,
+	const char *string);
 
 /*!
  * \brief Add a boolean node type.
@@ -296,7 +304,8 @@
  * \retval NULL on error (memory exhaustion only).
  * \retval non-NULL a newly allocated node.
  */
-struct ast_data *ast_data_add_bool(struct ast_data *root, const char *childname, unsigned int boolean);
+struct ast_data *ast_data_add_bool(struct ast_data *root, const char *childname,
+	unsigned int boolean);
 
 /*!
  * \brief Initialize an iterator.
@@ -305,7 +314,8 @@
  * \retval NULL on error.
  * \retval non-NULL A dinamically allocated iterator structure.
  */
-struct ast_data_iterator *ast_data_iterator_init(struct ast_data *tree, const char *elements);
+struct ast_data_iterator *ast_data_iterator_init(struct ast_data *tree,
+	const char *elements);
 
 /*!
  * \brief Release (stop using) an iterator.
@@ -341,7 +351,8 @@
  * \retval 0 on success.
  * \retval <0 on error.
  */
-int ast_data_retrieve_str(struct ast_data *tree, const char *path, const struct ast_str **value);
+int ast_data_retrieve_str(struct ast_data *tree, const char *path,
+	const struct ast_str **value);
 
 /*!
  * \brief Retrieve an string from a node in the tree.

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=203644&r1=203643&r2=203644
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Fri Jun 26 11:15:31 2009
@@ -667,7 +667,8 @@
  * \retval NULL on error.
  * \retval non-NULL The generated data result.
  */
-static struct ast_data *data_result_generate(const struct ast_data_query *query, const char *search_path)
+static struct ast_data *data_result_generate(const struct ast_data_query *query,
+	const char *search_path)
 {
 	char *node_name, *tmp_path;
 	struct data_provider *provider_child, *tmp_provider_child;
@@ -694,7 +695,8 @@
 			break;
 		}
 
-		tmp_provider_child = data_provider_find(provider_child->children, node_name, NULL);
+		tmp_provider_child = data_provider_find(provider_child->children,
+				node_name, NULL);
 
 		/* release the reference from this child */
 		ao2_ref(provider_child, -1);
@@ -703,7 +705,8 @@
 	}
 
 	if (!provider_child) {
-		ast_log(LOG_ERROR, "Invalid path '%s', '%s' not found.\n", tmp_path, node_name);
+		ast_log(LOG_ERROR, "Invalid path '%s', '%s' not found.\n",
+				tmp_path, node_name);
 		return NULL;
 	}
 
@@ -736,7 +739,8 @@
  * \param[in] parent_data The initial ast_data node to be passed to xml.
  * \param[out] parent_xml The root node to insert the xml.
  */
-static void data_get_xml_add_child(struct ast_data *parent_data, struct ast_xml_node *parent_xml)
+static void data_get_xml_add_child(struct ast_data *parent_data,
+	struct ast_xml_node *parent_xml)
 {
 	struct ao2_iterator i;
 	struct ast_data *node;
@@ -759,15 +763,18 @@
 			ast_xml_set_text(child_xml, node->payload.str);
 			break;
 		case AST_DATA_INTEGER:
-			snprintf(node_content, sizeof(node_content), "%d", node->payload.sint);
+			snprintf(node_content, sizeof(node_content), "%d",
+				node->payload.sint);
 			ast_xml_set_text(child_xml, node_content);
 			break;
 		case AST_DATA_UNSIGNED_INTEGER:
-			snprintf(node_content, sizeof(node_content), "%u", node->payload.uint);
+			snprintf(node_content, sizeof(node_content), "%u",
+				node->payload.uint);
 			ast_xml_set_text(child_xml, node_content);
 			break;
 		case AST_DATA_DOUBLE:
-			snprintf(node_content, sizeof(node_content), "%f", node->payload.dbl);
+			snprintf(node_content, sizeof(node_content), "%f",
+				node->payload.dbl);
 			ast_xml_set_text(child_xml, node_content);
 			break;
 		case AST_DATA_BOOLEAN:
@@ -897,12 +904,14 @@
 	return __ast_data_add(root, name, AST_DATA_INTEGER, &value);
 }
 
-struct ast_data *ast_data_add_uint(struct ast_data *root, const char *name, unsigned int value)
+struct ast_data *ast_data_add_uint(struct ast_data *root, const char *name,
+	unsigned int value)
 {
 	return __ast_data_add(root, name, AST_DATA_UNSIGNED_INTEGER, &value);
 }
 
-struct ast_data *ast_data_add_dbl(struct ast_data *root, const char *childname, double dbl)
+struct ast_data *ast_data_add_dbl(struct ast_data *root, const char *childname,
+	double dbl)
 {
 	return __ast_data_add(root, childname, AST_DATA_DOUBLE, &dbl);
 }
@@ -913,7 +922,8 @@
 	return __ast_data_add(root, childname, AST_DATA_BOOLEAN, &boolean);
 }
 
-struct ast_data *ast_data_add_str(struct ast_data *root, const char *childname, const char *value)
+struct ast_data *ast_data_add_str(struct ast_data *root, const char *childname,
+	const char *value)
 {
 	char *name;
 	size_t namelen = 1 + (ast_strlen_zero(value) ? 0 : strlen(value));
@@ -944,7 +954,8 @@
 	ao2_ref(root, -1);
 }
 
-struct ast_data_iterator *ast_data_iterator_init(struct ast_data *tree, const char *elements)
+struct ast_data_iterator *ast_data_iterator_init(struct ast_data *tree,
+	const char *elements)
 {
 	struct ast_data_iterator *iterator;
 	struct ao2_iterator i;




More information about the asterisk-commits mailing list