diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-02-15 13:38:12 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-02-15 13:38:12 +0000 |
commit | d04ab3c6450f3d92aa004ae9d6e0e7da51f702a3 (patch) | |
tree | 821330ff71a4484afa46ade4a2bbd211c800a992 /include/asterisk/xml.h | |
parent | edf0483f4f0e73ded128f1e613b60f31925af102 (diff) |
Add CLI configuration documentation
This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:
1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
options that use the configuration framework
This patch include configuration documentation for the following modules:
* chan_motif
* res_xmpp
* app_confbridge
* app_skel
* udptl
Two new CLI commands have been added:
* config show help - show configuration help by module, category, and item
* xmldoc dump - dump the in-memory representation of the XML documentation to
a new XML file.
Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058
patches:
on review 2058 uploaded by twilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/xml.h')
-rw-r--r-- | include/asterisk/xml.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/asterisk/xml.h b/include/asterisk/xml.h index ddfcc25d9..063e8c0b3 100644 --- a/include/asterisk/xml.h +++ b/include/asterisk/xml.h @@ -23,6 +23,7 @@ struct ast_xml_node; struct ast_xml_doc; +struct ast_xml_xpath_results; /*! * \brief Initialize the XML library implementation. @@ -207,6 +208,44 @@ struct ast_xml_node *ast_xml_node_get_parent(struct ast_xml_node *node); * \brief Dump the specified document to a file. */ int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc); +/*! + * \brief Free the XPath results + * \param results The XPath results object to dispose of + * + * \since 12 + */ +void ast_xml_xpath_results_free(struct ast_xml_xpath_results *results); + +/*! + * \brief Return the number of results from an XPath query + * \param results The XPath results object to count + * \retval The number of results in the XPath object + * + * \since 12 + */ +int ast_xml_xpath_num_results(struct ast_xml_xpath_results *results); + +/*! + * \brief Return the first result node of an XPath query + * \param results The XPath results object to get the first result from + * \retval The first result in the XPath object on success + * \retval NULL on error + * + * \since 12 + */ +struct ast_xml_node *ast_xml_xpath_get_first_result(struct ast_xml_xpath_results *results); + +/*! + * \brief Execute an XPath query on an XML document + * \param doc The XML document to query + * \param xpath_str The XPath query string to execute on the document + * \retval An object containing the results of the XPath query on success + * \retval NULL on failure + * + * \since 12 + */ +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 |