[asterisk-commits] eliel: trunk r194635 - in /trunk: doc/appdocsxml.dtd main/xmldoc.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 15 08:23:45 CDT 2009


Author: eliel
Date: Fri May 15 08:23:37 2009
New Revision: 194635

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=194635
Log:
Allow to specify an enumlist inside an enum.

It was not possible to use an enumlist inside an enum:
<enumlist>
   <enum name="aa">
      <enumlist>
         ...
      </enumlist>
   </enum>
</enumlist>
Now we will be able to insert as many levels as we want.

(closes issue #15112)
Reported by: lmadsen


Modified:
    trunk/doc/appdocsxml.dtd
    trunk/main/xmldoc.c

Modified: trunk/doc/appdocsxml.dtd
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/doc/appdocsxml.dtd?view=diff&rev=194635&r1=194634&r2=194635
==============================================================================
--- trunk/doc/appdocsxml.dtd (original)
+++ trunk/doc/appdocsxml.dtd Fri May 15 08:23:37 2009
@@ -41,7 +41,7 @@
   <!ATTLIST option hasparams CDATA "">
 
   <!ELEMENT enumlist (enum+)>
-  <!ELEMENT enum (para|note|warning|parameter)*>
+  <!ELEMENT enum (para|note|warning|parameter|enumlist)*>
   <!ATTLIST enum name CDATA "">
 
   <!ELEMENT argument (para|note|warning|variablelist|argument)*>

Modified: trunk/main/xmldoc.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/xmldoc.c?view=diff&rev=194635&r1=194634&r2=194635
==============================================================================
--- trunk/main/xmldoc.c (original)
+++ trunk/main/xmldoc.c Fri May 15 08:23:37 2009
@@ -60,6 +60,7 @@
 };
 
 static char *xmldoc_get_syntax_cmd(struct ast_xml_node *fixnode, const char *name, int printname);
+static int xmldoc_parse_enumlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer);
 
 /*!
  * \brief Container of documentation trees
@@ -1400,6 +1401,9 @@
 {
 	struct ast_xml_node *node = fixnode;
 	int ret = 0;
+	char *optiontabs;
+
+	ast_asprintf(&optiontabs, "%s    ", tabs);
 
 	for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) {
 		if ((xmldoc_parse_para(node, (ret ? tabs : " - "), "\n", buffer))) {
@@ -1407,7 +1411,12 @@
 		} else if ((xmldoc_parse_specialtags(node, (ret ? tabs : " - "), "\n", buffer))) {
 			ret = 1;
 		}
-	}
+
+		xmldoc_parse_enumlist(node, optiontabs, buffer);
+	}
+
+	ast_free(optiontabs);
+
 	return ret;
 }
 




More information about the asterisk-commits mailing list