Asterisk XML Documentation API. More...
#include "asterisk/xml.h"
Go to the source code of this file.
Enumerations | |
enum | ast_doc_src { AST_XML_DOC, AST_STATIC_DOC } |
From where the documentation come from, this structure is useful for use it inside application/functions/manager actions structure. More... | |
Functions | |
char * | ast_xmldoc_build_arguments (const char *type, const char *name, const char *module) |
Generate the [arguments] tag based on type of node ('application', 'function' or 'agi') and name. More... | |
char * | ast_xmldoc_build_description (const char *type, const char *name, const char *module) |
Generate description documentation from XML. More... | |
char * | ast_xmldoc_build_seealso (const char *type, const char *name, const char *module) |
Parse the <see-also> node content. More... | |
char * | ast_xmldoc_build_synopsis (const char *type, const char *name, const char *module) |
Generate synopsis documentation from XML. More... | |
char * | ast_xmldoc_build_syntax (const char *type, const char *name, const char *module) |
Get the syntax for a specified application or function. More... | |
char * | ast_xmldoc_printable (const char *bwinput, int withcolors) |
Colorize and put delimiters (instead of tags) to the xmldoc output. More... | |
Asterisk XML Documentation API.
Definition in file xmldoc.h.
enum ast_doc_src |
From where the documentation come from, this structure is useful for use it inside application/functions/manager actions structure.
Enumerator | |
---|---|
AST_XML_DOC |
From XML documentation |
AST_STATIC_DOC |
From application/function registration |
Definition at line 28 of file xmldoc.h.
char* ast_xmldoc_build_arguments | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Generate the [arguments] tag based on type of node ('application', 'function' or 'agi') and name.
type | 'application', 'function' or 'agi' ? |
name | Name of the application or function to build the 'arguments' tag. |
module | The module the item is in (optional, can be NULL) |
NULL | on error. |
Output | buffer with the [arguments] tag content. |
Definition at line 1761 of file xmldoc.c.
References ast_free, ast_str_buffer(), ast_str_create(), ast_str_strlen(), ast_str_truncate(), ast_strdup, ast_strlen_zero(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), xmldoc_get_node(), and xmldoc_parse_parameter().
Referenced by acf_retrieve_docs(), ast_manager_register2(), and ast_register_application2().
char* ast_xmldoc_build_description | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Generate description documentation from XML.
type | The source of documentation (application, function, etc). |
name | The name of the application, function, etc. |
module | The module the item is in (optional, can be NULL) |
NULL | on error. |
A | malloc'ed string with the formatted description. |
Definition at line 1899 of file xmldoc.c.
References xmldoc_build_field().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
char* ast_xmldoc_build_seealso | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Parse the <see-also> node content.
type | 'application', 'function' or 'agi'. |
name | Application or functions name. |
module | The module the item is in (optional, can be NULL) |
NULL | on error. |
Content | of the see-also node. |
Definition at line 1461 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create(), ast_strdup, ast_strlen_zero(), ast_xml_free_attr(), ast_xml_free_text(), ast_xml_get_attribute(), ast_xml_get_text(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), first, and xmldoc_get_node().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
char* ast_xmldoc_build_synopsis | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Generate synopsis documentation from XML.
type | The source of documentation (application, function, etc). |
name | The name of the application, function, etc. |
module | The module the item is in (optional, can be NULL) |
NULL | on error. |
A | malloc'ed string with the synopsis. |
Definition at line 1894 of file xmldoc.c.
References xmldoc_build_field().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
char* ast_xmldoc_build_syntax | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Get the syntax for a specified application or function.
type | Application, Function or AGI ? |
name | Name of the application or function. |
module | The module the item is in (optional, can be NULL) |
NULL | on error. |
The | generated syntax in a ast_malloc'ed string. |
Definition at line 1156 of file xmldoc.c.
References ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), COMMAND_SYNTAX, FUNCTION_SYNTAX, MANAGER_SYNTAX, xmldoc_get_node(), xmldoc_get_syntax_cmd(), xmldoc_get_syntax_fun(), xmldoc_get_syntax_manager(), and xmldoc_get_syntax_type().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
char* ast_xmldoc_printable | ( | const char * | bwinput, |
int | withcolors | ||
) |
Colorize and put delimiters (instead of tags) to the xmldoc output.
bwinput | Not colorized input with tags. |
withcolors | Result output with colors. |
NULL | on error. |
New | malloced buffer colorized and with delimiters. |
Definition at line 315 of file xmldoc.c.
References ARRAY_LEN, ast_copy_string(), ast_free, ast_opt_light_background, ast_str_append(), ast_str_buffer(), ast_str_create(), ast_term_color_code(), COLOR_CYAN, colorized_tags, len(), strcasestr(), term_end(), and xmldoc_string_wrap().
Referenced by handle_cli_agi_show(), handle_show_function(), handle_showmancmd(), print_app_docs(), and write_htmldump().