From a22928b8535efe180dd9f7b6000495c90079ae9a Mon Sep 17 00:00:00 2001 From: "Eliel C. Sardanons" Date: Thu, 13 Nov 2008 15:46:06 +0000 Subject: Introduce XML documentation for: - MeetMe() - MeetMeCount() - MeetMeChannelAdmin() - MeetMeAdmin() - SLAStation() - SLATrunk() - Add an attribute to optionlist 'hasparams' with the same functionality as the one we have in and (the DTD was updated) - Fix a leak when getting an attribute while parsing an . git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156575 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/xmldoc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/xmldoc.c b/main/xmldoc.c index 084fdf3fd..5921960c4 100644 --- a/main/xmldoc.c +++ b/main/xmldoc.c @@ -1462,8 +1462,9 @@ static int xmldoc_parse_option(struct ast_xml_node *fixnode, const char *tabs, s static void xmldoc_parse_optionlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) { struct ast_xml_node *node; - const char *optname; + const char *optname, *hasparams; char *optionsyntax; + int optparams; for (node = ast_xml_node_get_children(fixnode); node; node = ast_xml_node_get_next(node)) { /* Start appending every option tag. */ @@ -1477,8 +1478,16 @@ static void xmldoc_parse_optionlist(struct ast_xml_node *fixnode, const char *ta continue; } - optionsyntax = xmldoc_get_syntax_fun(node, optname, "argument", 0, 1); + optparams = 1; + hasparams = ast_xml_get_attribute(node, "hasparams"); + if (hasparams && !strcasecmp(hasparams, "optional")) { + optparams = 2; + } + + optionsyntax = xmldoc_get_syntax_fun(node, optname, "argument", 0, optparams); if (!optionsyntax) { + ast_xml_free_attr(optname); + ast_xml_free_attr(hasparams); continue; } @@ -1487,6 +1496,8 @@ static void xmldoc_parse_optionlist(struct ast_xml_node *fixnode, const char *ta if (!xmldoc_parse_option(node, tabs, buffer)) { ast_str_append(buffer, 0, "\n"); } + ast_xml_free_attr(optname); + ast_xml_free_attr(hasparams); } } -- cgit v1.2.3