[asterisk-commits] eliel: branch group/appdocsxml r151872 - /team/group/appdocsxml/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 24 05:44:35 CDT 2008


Author: eliel
Date: Fri Oct 24 05:44:35 2008
New Revision: 151872

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151872
Log:
Put some naming convention on the functions:
- Almost all the functions related to parsing XML documentation are of the form: xmldoc_*
- Every function that parse an entire final tag like [Synopsis], [Arguments], [Description], [Syntax] and [See Also] are of the form: xmldoc_build_*

Modified:
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=151872&r1=151871&r2=151872
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Fri Oct 24 05:44:35 2008
@@ -3599,7 +3599,7 @@
  *  \param printrootname Boolean if we must print the rootname before the syntax and parenthesis at the begining/end.
  *  \retval NULL on error.
  *  \retval An ast_malloc'ed string with the syntax generated. */
-static char *xmldoc_build_syntax(ast_xml_node *rootnode, const char *rootname, const char *childname, int printparenthesis, int printrootname)
+static char *xmldoc_get_syntax(ast_xml_node *rootnode, const char *rootname, const char *childname, int printparenthesis, int printrootname)
 {
 #define GOTONEXT(__rev, __a) (__rev ? __a->AST_XML_PREV : __a->AST_XML_NEXT)
 #define ISLAST(__rev, __a)  (__rev == 1 ? (__a->AST_XML_PREV ? 0 : 1) : (__a->AST_XML_NEXT ? 0 : 1))
@@ -3701,7 +3701,7 @@
 		}
 
 		if (xmldoc_has_arguments(node)) {
-			paramname = xmldoc_build_syntax(node, "parameter", "argument", 0, 0);
+			paramname = xmldoc_get_syntax(node, "parameter", "argument", 0, 0);
 			paramnamemalloc = 1;
 		} else {
 			paramnamemalloc = 0;
@@ -3812,7 +3812,7 @@
  *  \retval NULL on error.
  *  \retval The generated syntax in a ast_malloc'ed string.
  */
-static char *xmldoc_get_syntax(const char *type, const char *name)
+static char *xmldoc_build_syntax(const char *type, const char *name)
 {
 	ast_xml_node *node;
 	char *syntax = NULL;
@@ -3829,7 +3829,7 @@
 	}
 
 	if (node) {
-		syntax = xmldoc_build_syntax(node, name, "parameter", 1, 1);
+		syntax = xmldoc_get_syntax(node, name, "parameter", 1, 1);
 	}
 	return syntax;
 }
@@ -4100,7 +4100,7 @@
  *  \retval NULL on error.
  *  \retval Content of the see-also node.
  */
-static char *xmldoc_parse_seealso(const char *type, const char *name)
+static char *xmldoc_build_seealso(const char *type, const char *name)
 {
 	struct ast_str *outputstr;
 	char *output;
@@ -4299,7 +4299,7 @@
 			continue;
 		}
 
-		optionsyntax = xmldoc_build_syntax(node, optname, "argument", 0, 1);
+		optionsyntax = xmldoc_get_syntax(node, optname, "argument", 0, 1);
 		if (!optionsyntax) {
 			continue;
 		}
@@ -4472,7 +4472,7 @@
  *  \retval NULL On error.
  *  \retval Field text content on success.
  */
-static char *xmldoc_get_field(const char *type, const char *name, const char *var, int raw)
+static char *xmldoc_build_field(const char *type, const char *name, const char *var, int raw)
 {
 	ast_xml_node *node;
 	char *ret = NULL;
@@ -4529,17 +4529,17 @@
 		}
 
 		/* load synopsis */
-		tmpxml = xmldoc_get_field("function", acf->name, "synopsis", 1);
+		tmpxml = xmldoc_build_field("function", acf->name, "synopsis", 1);
 		ast_string_field_set(acf, synopsis, tmpxml);
 		ast_free(tmpxml);
 
 		/* load description */	
-		tmpxml = xmldoc_get_field("function", acf->name, "description", 0);
+		tmpxml = xmldoc_build_field("function", acf->name, "description", 0);
 		ast_string_field_set(acf, desc, tmpxml);
 		ast_free(tmpxml);
 
 		/* load syntax */
-		tmpxml = xmldoc_get_syntax("function", acf->name);
+		tmpxml = xmldoc_build_syntax("function", acf->name);
 		ast_string_field_set(acf, syntax, tmpxml);
 		ast_free(tmpxml);
 
@@ -4549,7 +4549,7 @@
 		ast_free(tmpxml);
 
 		/* load seealso */
-		tmpxml = xmldoc_parse_seealso("function", acf->name);
+		tmpxml = xmldoc_build_seealso("function", acf->name);
 		ast_string_field_set(acf, seealso, tmpxml);
 		ast_free(tmpxml);
 
@@ -6273,17 +6273,17 @@
 	/* Try to lookup the docs in our XML documentation database */
 	if (ast_strlen_zero(synopsis) && ast_strlen_zero(description)) {
 		/* load synopsis */
-		tmpxml = xmldoc_get_field("application", app, "synopsis", 1);
+		tmpxml = xmldoc_build_field("application", app, "synopsis", 1);
 		ast_string_field_set(tmp, synopsis, tmpxml);
 		ast_free(tmpxml);
 		
 		/* load description */
-		tmpxml = xmldoc_get_field("application", app, "description", 0);
+		tmpxml = xmldoc_build_field("application", app, "description", 0);
 		ast_string_field_set(tmp, description, tmpxml);
 		ast_free(tmpxml);
 
 		/* load syntax */
-		tmpxml = xmldoc_get_syntax("application", app);
+		tmpxml = xmldoc_build_syntax("application", app);
 		ast_string_field_set(tmp, syntax, tmpxml);
 		ast_free(tmpxml);
 
@@ -6293,7 +6293,7 @@
 		ast_free(tmpxml);	
 	
 		/* load seealso */
-		tmpxml = xmldoc_parse_seealso("application", app);
+		tmpxml = xmldoc_build_seealso("application", app);
 		ast_string_field_set(tmp, seealso, tmpxml);
 		ast_free(tmpxml);
 		tmp->docsrc = AST_XML_DOC;




More information about the asterisk-commits mailing list