[svn-commits] twilson: branch twilson/config_docs r370517 - in /team/twilson/config_docs: i...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 26 09:34:44 CDT 2012


Author: twilson
Date: Thu Jul 26 09:34:38 2012
New Revision: 370517

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370517
Log:
Some basic cleanup, added documentation, etc.

Modified:
    team/twilson/config_docs/include/asterisk/xml.h
    team/twilson/config_docs/include/asterisk/xmldoc.h
    team/twilson/config_docs/main/xml.c
    team/twilson/config_docs/main/xmldoc.c

Modified: team/twilson/config_docs/include/asterisk/xml.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_docs/include/asterisk/xml.h?view=diff&rev=370517&r1=370516&r2=370517
==============================================================================
--- team/twilson/config_docs/include/asterisk/xml.h (original)
+++ team/twilson/config_docs/include/asterisk/xml.h Thu Jul 26 09:34:38 2012
@@ -23,6 +23,7 @@
 
 struct ast_xml_node;
 struct ast_xml_doc;
+struct ast_xml_xpath_results;
 
 /*!
  * \brief Initialize the XML library implementation.
@@ -207,13 +208,18 @@
  * \brief Dump the specified document to a file. */
 int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc);
 
-struct ast_xml_xpath_results;
+/*! \brief Free the XPath results */
 void ast_xml_xpath_results_free(struct ast_xml_xpath_results *results);
+
+/*! \brief Return the number of results from an XPath query */
 int ast_xml_xpath_num_results(struct ast_xml_xpath_results *results);
+
+/*! \brief Return the first result node of an XPath query */
 struct ast_xml_node *ast_xml_xpath_results(struct ast_xml_xpath_results *results);
-/*!
- * \brief Execute an XPath query on an XML document */
-struct ast_xml_xpath_results *ast_xml_node_find_xpath(struct ast_xml_doc *doc, const char *xpath_str);
+
+/*! \brief Execute an XPath query on an XML document */
+struct ast_xml_xpath_results *ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str);
+
 /* Features using ast_xml_ */
 #ifdef HAVE_LIBXML2
 #define AST_XML_DOCS

Modified: team/twilson/config_docs/include/asterisk/xmldoc.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_docs/include/asterisk/xmldoc.h?view=diff&rev=370517&r1=370516&r2=370517
==============================================================================
--- team/twilson/config_docs/include/asterisk/xmldoc.h (original)
+++ team/twilson/config_docs/include/asterisk/xmldoc.h Thu Jul 26 09:34:38 2012
@@ -71,7 +71,23 @@
 	unsigned int regex;
 };
 
+/*! \brief Update the XML for an ACO option
+ * \param module The module name
+ * \param name The option name
+ * \param object_name The config type name
+ * \param default_value The option's default value
+ * \param regex Whether or not the value is matched via regex (non-zero = yes)
+ */
 void ast_xmldoc_update_config_option(const char *module, const char *name, const char *object_name, const char *default_value, unsigned int regex);
+
+/*! \brief Update the XML for an ACO type
+ * \param module The module name
+ * \param name The config type name
+ * \param category The category regex to match against
+ * \param matchfield The field that needs to be matched, if applicable
+ * \param matchvalue The value of the matchfield needed for a match, if applicable
+ * \param matches Whether the category regex specifies a whitelist or blacklist (non-zero = whitelist)
+ */
 void ast_xmldoc_update_config_type(const char *module, const char *name, const char *category, const char *matchfield, const char *matchvalue, unsigned int matches);
 
 /*!

Modified: team/twilson/config_docs/main/xml.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_docs/main/xml.c?view=diff&rev=370517&r1=370516&r2=370517
==============================================================================
--- team/twilson/config_docs/main/xml.c (original)
+++ team/twilson/config_docs/main/xml.c Thu Jul 26 09:34:38 2012
@@ -333,7 +333,7 @@
 	return ((xmlXPathObjectPtr) results)->nodesetval->nodeNr;
 }
 
-struct ast_xml_xpath_results *ast_xml_node_find_xpath(struct ast_xml_doc *doc, const char *xpath_str)
+struct ast_xml_xpath_results *ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str)
 {
 	xmlXPathContextPtr context;
 	xmlXPathObjectPtr result;

Modified: team/twilson/config_docs/main/xmldoc.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_docs/main/xmldoc.c?view=diff&rev=370517&r1=370516&r2=370517
==============================================================================
--- team/twilson/config_docs/main/xmldoc.c (original)
+++ team/twilson/config_docs/main/xmldoc.c Thu Jul 26 09:34:38 2012
@@ -2287,7 +2287,7 @@
 
 	AST_RWLIST_RDLOCK(&xmldoc_tree);
 	AST_LIST_TRAVERSE(&xmldoc_tree, doctree, entry) {
-		if (!(results = ast_xml_node_find_xpath(doctree->doc, ast_str_buffer(xpath_str)))) {
+		if (!(results = ast_xml_query(doctree->doc, ast_str_buffer(xpath_str)))) {
 			continue;
 		}
 		break;




More information about the svn-commits mailing list