[asterisk-commits] eliel: branch group/appdocsxml r136399 - in /team/group/appdocsxml: include/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 7 07:31:04 CDT 2008


Author: eliel
Date: Thu Aug  7 07:31:04 2008
New Revision: 136399

URL: http://svn.digium.com/view/asterisk?view=rev&rev=136399
Log:
- Changed ast_xml_get_text(node), only one parameter is needed (the node), not needed
  to pass the ast_xml_doc.
- Fix the documentation (use retval instead of return for the possible return values).


Modified:
    team/group/appdocsxml/include/asterisk/xml.h
    team/group/appdocsxml/main/pbx.c
    team/group/appdocsxml/main/xml.c

Modified: team/group/appdocsxml/include/asterisk/xml.h
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/include/asterisk/xml.h?view=diff&rev=136399&r1=136398&r2=136399
==============================================================================
--- team/group/appdocsxml/include/asterisk/xml.h (original)
+++ team/group/appdocsxml/include/asterisk/xml.h Thu Aug  7 07:31:04 2008
@@ -43,26 +43,34 @@
 /*! \brief Initialize the XML library implementation. 
  *         This function is used to setup everything needed
  *         to start working with the xml implementation.
+ *  \retval 0 On success.
+ *  \retval 1 On error.
  */
 int ast_xml_init(void);
 
-/*! \brief Cleanup library allocated global data. */
+/*! \brief Cleanup library allocated global data. 
+ *  \retval 0 On success.
+ *  \retval 1 On error.
+ */
 int ast_xml_finish(void);
 
 /*! \brief Open an XML document.
  *  \param filename Document path.
- *  \return NULL on error, or the ast_xml_doc reference 
+ *  \retval NULL on error.
+ *  \retval The ast_xml_doc reference to the open document.
  */
 ast_xml_doc *ast_xml_open(char *filename);
 
 /*! \brief Close an already open document and free the used
  *        structure.
+ *  \retval doc The document reference.
  */
 void ast_xml_close(ast_xml_doc *doc);
 
 /*! \brief Get the document root node.
  *  \param doc Document reference
- *  \return NULL on error, root node on success.
+ *  \retval NULL on error
+ *  \retval The root node on success.
  */
 ast_xml_node *ast_xml_get_root(ast_xml_doc *doc);
 
@@ -84,7 +92,8 @@
 /*! \brief Get a node attribute by name
  *  \param node Node where to search the attribute.
  *  \param attrname Attribute name.
- *  \return NULL on error, or the attribute value on success.
+ *  \retval NULL on error
+ *  \retval The attribute value on success.
  */
 ast_xml_attr *ast_xml_get_attribute(ast_xml_node *node, const char *attrname);
 
@@ -93,16 +102,17 @@
  *  \param name Node name to find.
  *  \param attrname attribute name to match (if NULL it won't be matched).
  *  \param attrvalue attribute value to match (if NULL it won't be matched).
- *  \return NULL if not found, or the node on success.
+ *  \retval NULL if not found
+ *  \retval The node on success.
  */
 ast_xml_node *ast_xml_find_element(ast_xml_node *root_node, const char *name, const char *attrname, const char *attrvalue);
 
 /*! \brief Get an element content string.
- *  \param xmldoc XML document element.
- *  \param node node from where to get the string.
- *  \return return the content of node.
+ *  \param node Node from where to get the string.
+ *  \retval NULL on error.
+ *  \retval The text content of node.
  */
-char *ast_xml_get_text(ast_xml_doc *xmldoc, ast_xml_node *node);
+char *ast_xml_get_text(ast_xml_node *node);
 
 #endif /* _ASTERISK_XML_H */
 

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=136399&r1=136398&r2=136399
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Thu Aug  7 07:31:04 2008
@@ -2876,7 +2876,7 @@
 	tmp = node->AST_XML_CHILD;
 	while (tmp) {
 		if (!strcasecmp((char *)tmp->AST_XML_NAME, "para")) {
-			tmptext = ast_xml_get_text(documentation_tree, tmp);
+			tmptext = ast_xml_get_text(tmp);
 			if (tmptext) {
 				ret = ast_realloc(ret, len + strlen(tmptext) + 2);
 				len += sprintf(ret + len, "%s\n", tmptext);

Modified: team/group/appdocsxml/main/xml.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/xml.c?view=diff&rev=136399&r1=136398&r2=136399
==============================================================================
--- team/group/appdocsxml/main/xml.c (original)
+++ team/group/appdocsxml/main/xml.c Thu Aug  7 07:31:04 2008
@@ -158,13 +158,13 @@
 	return NULL;
 }
 
-char *ast_xml_get_text(ast_xml_doc *xmldoc, ast_xml_node *node)
+char *ast_xml_get_text(ast_xml_node *node)
 {
-	if (!node || !node->children || !xmldoc) {
+	if (!node || !node->children) {
 		return NULL;
 	}
 
-	return (char *)xmlNodeListGetString(xmldoc, node->children, 0);
+	return (char *)xmlNodeListGetString(node->doc, node->children, 0);
 }
 
 #endif /* HAVE_LIBXML2 */




More information about the asterisk-commits mailing list