[asterisk-commits] mvanbaak: branch group/appdocsxml r137287 - /team/group/appdocsxml/main/pbx.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 12 10:53:25 CDT 2008
Author: mvanbaak
Date: Tue Aug 12 10:53:24 2008
New Revision: 137287
URL: http://svn.digium.com/view/asterisk?view=rev&rev=137287
Log:
dont output raw text on synopsis field only, but introduce a 'raw' function argument to do it.
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=137287&r1=137286&r2=137287
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Tue Aug 12 10:53:24 2008
@@ -3205,10 +3205,11 @@
/*! \brief Return the string within a node formatted with
* <para> and <variablelist> elements.
* \param node Parent node where content resides.
+ * \param raw If set, return the node's content without further processing.
* \retval NULL on error
* \retval Node content on success.
*/
-static char *xmldoc_get_formatted(ast_xml_node *node)
+static char *xmldoc_get_formatted(ast_xml_node *node, int raw_output)
{
ast_xml_node *tmp;
char *ret = NULL;
@@ -3218,7 +3219,7 @@
return NULL;
}
- if (!strcasecmp((char *)node->name, "synopsis")) {
+ if (raw_output) {
ret = ast_xml_get_text(node);
} else {
tmp = node->AST_XML_CHILD;
@@ -3244,7 +3245,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)
+static char *xmldoc_get_field(const char *type, const char *name, const char *var, int raw)
{
ast_xml_node *node;
@@ -3273,7 +3274,7 @@
return NULL;
}
- return xmldoc_get_formatted(node);
+ return xmldoc_get_formatted(node, raw);
}
#endif /* XML_DOCUMENTATION */
@@ -3291,8 +3292,8 @@
#ifdef XML_DOCUMENTATION
/* Let's try to find it in the Documentation XML */
if (ast_strlen_zero(acf->desc) && ast_strlen_zero(acf->synopsis)) {
- acf->synopsis = xmldoc_get_field("function", acf->name, "synopsis");
- acf->desc = xmldoc_get_field("function", acf->name, "description");
+ acf->synopsis = xmldoc_get_field("function", acf->name, "synopsis", 1);
+ acf->desc = xmldoc_get_field("function", acf->name, "description", 0);
acf->syntax = xmldoc_build_syntax("application", acf->name);
acf->docsrc = AST_XML_DOC;
}
@@ -5003,8 +5004,8 @@
#ifdef XML_DOCUMENTATION
/* Try to lookup the docs in our XML documentation database */
if (ast_strlen_zero(synopsis) && ast_strlen_zero(description)) {
- tmp->synopsis = xmldoc_get_field("application", app, "synopsis");
- tmp->description = xmldoc_get_field("application", app, "description");
+ tmp->synopsis = xmldoc_get_field("application", app, "synopsis", 1);
+ tmp->description = xmldoc_get_field("application", app, "description", 0);
tmp->syntax = xmldoc_build_syntax("application", app);
tmp->docsrc = AST_XML_DOC;
} else {
More information about the asterisk-commits
mailing list