aboutsummaryrefslogtreecommitdiffstats
path: root/main/xmldoc.c
diff options
context:
space:
mode:
authoreliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-15 13:23:37 +0000
committereliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-15 13:23:37 +0000
commitf2fc79c88e99260db9d5424055d43c656b9f0f0d (patch)
treeb9653187c3ba04da9f13fe662d1cc996ac8986d4 /main/xmldoc.c
parent45f9cd17df2101b80b1804f4bc3f0ffd888eda41 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@194635 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/xmldoc.c')
-rw-r--r--main/xmldoc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/xmldoc.c b/main/xmldoc.c
index 2ddb20179..29d951ac5 100644
--- a/main/xmldoc.c
+++ b/main/xmldoc.c
@@ -60,6 +60,7 @@ struct documentation_tree {
};
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 @@ static int xmldoc_parse_enum(struct ast_xml_node *fixnode, const char *tabs, str
{
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 @@ static int xmldoc_parse_enum(struct ast_xml_node *fixnode, const char *tabs, str
} else if ((xmldoc_parse_specialtags(node, (ret ? tabs : " - "), "\n", buffer))) {
ret = 1;
}
+
+ xmldoc_parse_enumlist(node, optiontabs, buffer);
}
+
+ ast_free(optiontabs);
+
return ret;
}