[asterisk-commits] eliel: branch group/data_api_gsoc2009 r210521 - /team/group/data_api_gsoc2009...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 5 07:52:28 CDT 2009


Author: eliel
Date: Wed Aug  5 07:52:25 2009
New Revision: 210521

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=210521
Log:
Formatting changes.


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=210521&r1=210520&r2=210521
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Wed Aug  5 07:52:25 2009
@@ -55,7 +55,7 @@
 static const uint32_t current_query_version = AST_DATA_QUERY_VERSION;
 
 /*! \brief The data tree to be returned by the callbacks and
-		   managed by functions local to this file. */
+	   managed by functions local to this file. */
 struct ast_data {
 	enum ast_data_type type;
 
@@ -222,7 +222,8 @@
 		return 1;
 	}
 
-	ast_log(LOG_ERROR, "A module is not compatible with the current data api version\n");
+	ast_log(LOG_ERROR, "A module is not compatible with the"
+		"current data api version\n");
 
 	return 0;
 }
@@ -568,6 +569,8 @@
 /*!
  * \internal
  * \brief Print a node to the console.
+ * \param[in] node The node to print.
+ * \param[in] depth The actual node depth in the tree.
  * \see __ast_data_print_debug, ast_data_print_debug
  */
 static void __ast_data_print_debug_node(const struct ast_data *node, uint32_t depth)
@@ -1169,7 +1172,8 @@
 	return data_search_comparison_result(node_value - value, cmp_type);
 }
 
-int ast_data_search_cmp_int(const struct ast_data_search *root, const char *name, int value)
+int ast_data_search_cmp_int(const struct ast_data_search *root, const char *name,
+	int value)
 {
 	struct ast_data_search *child;
 	int node_value;
@@ -1195,14 +1199,14 @@
  * \retval <0 if the member was not found.
  * \retval >=0 The member position in the mapping structure.
  */
-static inline int data_search_mapping_find(const struct ast_data_mapping_structure *mapping,
+static inline int data_search_mapping_find(const struct ast_data_mapping_structure *map,
 	size_t mapping_len,
 	const char *member_name)
 {
 	int i;
 
 	for (i = 0; i < mapping_len; i++) {
-		if (!strcmp(mapping[i].name, member_name)) {
+		if (!strcmp(map[i].name, member_name)) {
 			return i;
 		}
 	}
@@ -1254,43 +1258,43 @@
 
 		notmatch = 0;
 		switch (mapping[member].type) {
-			case AST_DATA_STRING:
-				notmatch = ast_data_search_cmp_string(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_STRING(structure));
-				break;
-			case AST_DATA_INTEGER:
-				notmatch = ast_data_search_cmp_int(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_INTEGER(structure));
-				break;
-			case AST_DATA_BOOLEAN:
-				notmatch = ast_data_search_cmp_bool(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_BOOLEAN(structure));
-				break;
-			case AST_DATA_UNSIGNED_INTEGER:
-				notmatch = ast_data_search_cmp_uint(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_UNSIGNED_INTEGER(structure));
-				break;
-			case AST_DATA_DOUBLE:
-				notmatch = ast_data_search_cmp_dbl(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_DOUBLE(structure));
-				break;
-			case AST_DATA_IPADDR:
-				notmatch = ast_data_search_cmp_ipaddr(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_IPADDR(structure));
-				break;
-			case AST_DATA_POINTER:
-				notmatch = ast_data_search_cmp_ptr(struct_children,
-					node->name,
-					mapping[member].get.AST_DATA_POINTER(structure));
-				break;
-			case AST_DATA_CONTAINER:
-				break;
+		case AST_DATA_STRING:
+			notmatch = ast_data_search_cmp_string(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_STRING(structure));
+			break;
+		case AST_DATA_INTEGER:
+			notmatch = ast_data_search_cmp_int(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_INTEGER(structure));
+			break;
+		case AST_DATA_BOOLEAN:
+			notmatch = ast_data_search_cmp_bool(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_BOOLEAN(structure));
+			break;
+		case AST_DATA_UNSIGNED_INTEGER:
+			notmatch = ast_data_search_cmp_uint(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_UNSIGNED_INTEGER(structure));
+			break;
+		case AST_DATA_DOUBLE:
+			notmatch = ast_data_search_cmp_dbl(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_DOUBLE(structure));
+			break;
+		case AST_DATA_IPADDR:
+			notmatch = ast_data_search_cmp_ipaddr(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_IPADDR(structure));
+			break;
+		case AST_DATA_POINTER:
+			notmatch = ast_data_search_cmp_ptr(struct_children,
+				node->name,
+				mapping[member].get.AST_DATA_POINTER(structure));
+			break;
+		case AST_DATA_CONTAINER:
+			break;
 		}
 
 		ao2_ref(node, -1);
@@ -1610,7 +1614,8 @@
 		return NULL;
 	}
 
-	for (token = strtok_r(strfilter, ",", &saveptr); token; token = strtok_r(NULL, ",", &saveptr)) {
+	for (token = strtok_r(strfilter, ",", &saveptr); token;
+			token = strtok_r(NULL, ",", &saveptr)) {
 		node_added = data_filter_add_nodes(filter->children, token);
 	}
 
@@ -1678,7 +1683,8 @@
 		if (!filter || filter_child) {
 			/* only generate the internal node, if we have something to
 			 * generate based on the filtering string. */
-			generated = data_result_generate_node(query, provider, provider->name,
+			generated = data_result_generate_node(query, provider,
+				provider->name,
 				search_child, filter_child);
 		}
 		/* decrement the refcount of the internal search node. */
@@ -1756,7 +1762,8 @@
 	if (query->search) {
 		search = data_search_generate(query->search);
 		if (search) {
-			search_child = data_search_find(search->children, provider_child->name);
+			search_child = data_search_find(search->children,
+				provider_child->name);
 		}
 	}
 
@@ -1764,11 +1771,13 @@
 	if (query->filter) {
 		filter = data_filter_generate(query->filter);
 		if (filter) {
-			filter_child = data_filter_find(filter->children, provider_child->name);
-		}
-	}
-
-	result = data_result_generate_node(query, provider_child, provider_child->name, search_child, filter);
+			filter_child = data_filter_find(filter->children,
+				provider_child->name);
+		}
+	}
+
+	result = data_result_generate_node(query, provider_child, provider_child->name,
+			search_child, filter);
 
 	/* release the requested provider. */
 	ao2_ref(provider_child, -1);
@@ -1875,7 +1884,8 @@
 			ast_xml_set_text(child_xml, node_content);
 			break;
 		case AST_DATA_IPADDR:
-			snprintf(node_content, sizeof(node_content), "%s", ast_inet_ntoa(node->payload.ipaddr));
+			snprintf(node_content, sizeof(node_content), "%s",
+				ast_inet_ntoa(node->payload.ipaddr));
 			ast_xml_set_text(child_xml, node_content);
 			break;
 		}
@@ -2220,8 +2230,8 @@
 
 		/* if there is a pattern specified, check if this node matches
 		 * the wanted node names. */
-		if (!iterator->is_pattern &&
-			(iterator->pattern && !strcasecmp(res->name, iterator->pattern))) {
+		if (!iterator->is_pattern && (iterator->pattern &&
+				!strcasecmp(res->name, iterator->pattern))) {
 			break;
 		}
 
@@ -2233,7 +2243,8 @@
 	return res;
 }
 
-int ast_data_retrieve(struct ast_data *tree, const char *path, struct ast_data_retrieve *content)
+int ast_data_retrieve(struct ast_data *tree, const char *path,
+	struct ast_data_retrieve *content)
 {
 	struct ast_data *node;
 




More information about the asterisk-commits mailing list