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/xmldoc.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/xmldoc.h')
-rw-r--r-- | include/asterisk/xmldoc.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/asterisk/xmldoc.h b/include/asterisk/xmldoc.h index 9bf647612..c09f693c8 100644 --- a/include/asterisk/xmldoc.h +++ b/include/asterisk/xmldoc.h @@ -35,6 +35,7 @@ enum ast_doc_src { #ifdef AST_XML_DOCS struct ao2_container; +struct ast_xml_node; /*! \brief Struct that contains the XML documentation for a particular item. Note * that this is an ao2 ref counted object. @@ -61,11 +62,27 @@ struct ast_xml_doc_item { AST_STRING_FIELD(name); /*! The type of the item */ AST_STRING_FIELD(type); + /*! Reference to another field */ + AST_STRING_FIELD(ref); ); + /*! The node that this item was created from. Note that the life time of + * the node is not tied to the lifetime of this object. + */ + struct ast_xml_node *node; /*! The next XML documentation item that matches the same name/item type */ struct ast_xml_doc_item *next; }; +/*! \brief Execute an XPath query on the loaded XML documentation + * \param query The XPath query string to execute + * \param ... Variable printf style format arguments + * \retval An XPath results object on success + * \retval NULL if no match found + * + * \since 12 + */ +struct ast_xml_xpath_results *__attribute__((format(printf, 1, 2))) ast_xmldoc_query(const char *fmt, ...); + /*! * \brief Get the syntax for a specified application or function. * \param type Application, Function or AGI ? @@ -138,6 +155,17 @@ char *ast_xmldoc_build_description(const char *type, const char *name, const cha */ struct ao2_container *ast_xmldoc_build_documentation(const char *type); +/*! + * \brief Regenerate the documentation for a particular item + * \param item The documentation item to regenerate + * + * \retval -1 on error + * \retval 0 on success + * + * \since 12 + */ +int ast_xmldoc_regenerate_doc_item(struct ast_xml_doc_item *item); + #endif /* AST_XML_DOCS */ #endif /* _ASTERISK_XMLDOC_H */ |