mirror of
https://github.com/asterisk/asterisk.git
synced 2026-06-30 12:10:12 -07:00
docs: Add "Provided-by" to doc XML and CLI output.
For application, function, manager, managerEvent, managerEventInstance and info XML documentation nodes, the make_xml_documentation script will add a "module" attribute if not already present. For XML in separate "*_doc.xml" files, the script figures out the correct module name. For documentation in the "main" directory, the module name is set to "builtin". The CLI handlers for "core show application", "core show function", "manager show command" and "manager show event", have been updated to show the following after the Synopsis... ``` [Provided By] <modulename> ``` For modules that provide additional "info" elements (like the technologies do for Dial), the providing module has also been added. ``` Technology: WebSocket Provided by: chan_websocket WebSocket Dial Strings: ... ``` UserNote: The CLI help for applications, functions, manager commands and manager events now shows the module that provides its functionality.
This commit is contained in:
committed by
Asterisk Development Team
parent
62fc57ce88
commit
5906dcd50d
@@ -181,7 +181,8 @@ struct manager_action {
|
||||
* function and unregistering the AMI action object.
|
||||
*/
|
||||
unsigned int registered:1;
|
||||
AST_STRING_FIELD_EXTENDED(since); /*!< Documentation "since" element */
|
||||
AST_STRING_FIELD_EXTENDED(since); /*!< Documentation "since" element */
|
||||
AST_STRING_FIELD_EXTENDED(provided_by); /*!< Documentation "provided_by" element */
|
||||
};
|
||||
|
||||
/*! \brief External routines may register/unregister manager callbacks this way
|
||||
|
||||
@@ -151,6 +151,7 @@ struct ast_custom_function {
|
||||
|
||||
AST_RWLIST_ENTRY(ast_custom_function) acflist;
|
||||
AST_STRING_FIELD_EXTENDED(since); /*!< Since text for 'show functions' */
|
||||
AST_STRING_FIELD_EXTENDED(provided_by); /*!< Provided-by text for 'show functions' */
|
||||
};
|
||||
|
||||
/*! \brief All switch functions have the same interface, so define a type for them */
|
||||
|
||||
@@ -80,6 +80,8 @@ struct ast_xml_doc_item {
|
||||
AST_LIST_ENTRY(ast_xml_doc_item) next;
|
||||
/*! Since tagged information, if it exists */
|
||||
struct ast_str *since;
|
||||
/*! The provided-by of the item */
|
||||
struct ast_str *provided_by;
|
||||
};
|
||||
|
||||
/*! \brief Execute an XPath query on the loaded XML documentation
|
||||
@@ -180,6 +182,18 @@ char *ast_xmldoc_printable(const char *bwinput, int withcolors);
|
||||
*/
|
||||
char *ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module);
|
||||
|
||||
/*!
|
||||
* \brief Generate provided-by documentation from XML.
|
||||
* \param type The source of documentation (application, function, etc).
|
||||
* \param name The name of the application, function, etc.
|
||||
* \param module The module the item is in (optional, can be NULL)
|
||||
* \retval NULL on error.
|
||||
* \retval A malloc'ed string with the provided-by.
|
||||
*
|
||||
* \note The value actually comes from the "module" attribute.
|
||||
*/
|
||||
char *ast_xmldoc_build_provided_by(const char *type, const char *name, const char *module);
|
||||
|
||||
/*!
|
||||
* \brief Generate description documentation from XML.
|
||||
* \param type The source of documentation (application, function, etc).
|
||||
|
||||
Reference in New Issue
Block a user