Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Asterisk XML Documentation API. More...
Go to the source code of this file.
Data Structures | |
struct | ast_xml_doc_item |
Struct that contains the XML documentation for a particular item. Note that this is an ao2 ref counted object. More... | |
struct | ast_xml_doc_item_list |
The struct to be used as the head of an ast_xml_doc_item list when being manipulated. More... | |
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... | |
struct ao2_container * | ast_xmldoc_build_documentation (const char *type) |
Build the documentation for a particular source type. More... | |
struct ast_xml_doc_item * | ast_xmldoc_build_final_response (const char *type, const char *name, const char *module) |
Generate the [final response] tag based on type of node ('application', 'function' or 'agi') and name. More... | |
struct ast_xml_doc_item * | ast_xmldoc_build_list_responses (const char *type, const char *name, const char *module) |
Generate the [list responses] tag based on type of node ('application', 'function' or 'agi') and name. 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... | |
struct ast_xml_xpath_results * | ast_xmldoc_query (const char *fmt,...) |
Execute an XPath query on the loaded XML documentation. More... | |
int | ast_xmldoc_regenerate_doc_item (struct ast_xml_doc_item *item) |
Regenerate the documentation for a particular item. More... | |
Asterisk XML Documentation API.
Definition in file xmldoc.h.
enum ast_doc_src |
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 2084 of file xmldoc.c.
References _ast_xmldoc_build_arguments(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero(), ast_xml_node_get_children(), documentation_language, name, NULL, type, and xmldoc_get_node().
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 2271 of file xmldoc.c.
References name, type, and xmldoc_build_field().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
struct ao2_container * ast_xmldoc_build_documentation | ( | const char * | type | ) |
Build the documentation for a particular source type.
type | The source of the documentation items (application, function, etc.) |
NULL | on error |
An | ao2_container populated with ast_xml_doc instances for each item that exists for the specified source type |
Definition at line 2684 of file xmldoc.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_link, ao2_t_ref, AST_LIST_FIRST, AST_LIST_HEAD_INIT, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_log, AST_LOG_ERROR, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_xml_doc_item_cmp(), ast_xml_doc_item_hash(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_get_root(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), build_config_docs(), CONFIG_INFO_SYNTAX, documentation_tree::doc, item, MANAGER_EVENT_SYNTAX, name, ast_xml_doc_item::next, NULL, RAII_VAR, type, xmldoc_build_documentation_item(), and xmldoc_get_syntax_type().
Referenced by __init_manager(), and aco_init().
struct ast_xml_doc_item * ast_xmldoc_build_final_response | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Generate the [final response] 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 'responses' tag. |
module | The module the item is in (optional, can be NULL) |
Definition at line 2554 of file xmldoc.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero(), ast_xml_node_get_children(), documentation_language, name, NULL, type, xmldoc_build_final_response(), and xmldoc_get_node().
Referenced by ast_manager_register2().
struct ast_xml_doc_item * ast_xmldoc_build_list_responses | ( | const char * | type, |
const char * | name, | ||
const char * | module | ||
) |
Generate the [list responses] 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 'responses' tag. |
module | The module the item is in (optional, can be NULL) |
Definition at line 2484 of file xmldoc.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero(), ast_xml_node_get_children(), documentation_language, name, NULL, type, xmldoc_build_list_responses(), and xmldoc_get_node().
Referenced by ast_manager_register2().
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 1702 of file xmldoc.c.
References _ast_xmldoc_build_seealso(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero(), ast_xml_node_get_children(), documentation_language, name, NULL, type, 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 2248 of file xmldoc.c.
References name, type, and 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 1252 of file xmldoc.c.
References _ast_xmldoc_build_syntax(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, documentation_language, name, NULL, type, and xmldoc_get_node().
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 241 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(), ast_term_reset(), buf, c, COLOR_CYAN, colorized_tags, end, len(), NULL, strcasestr(), tmp(), xmldoc_string_wrap(), and xmldoc_text_columns.
Referenced by cli_show_module_options(), cli_show_module_type(), cli_show_module_types(), handle_cli_agi_show(), handle_show_function(), handle_showmancmd(), print_app_docs(), print_event_instance(), and write_htmldump().
struct ast_xml_xpath_results * ast_xmldoc_query | ( | const char * | fmt, |
... | |||
) |
Execute an XPath query on the loaded XML documentation.
fmt | The XPath query string to execute |
... | Variable printf style format arguments |
An | XPath results object on success |
NULL | if no match found |
Definition at line 2576 of file xmldoc.c.
References AST_DYNSTR_BUILD_FAILED, ast_free, AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_str_buffer(), ast_str_create, ast_str_set_va(), ast_xml_query(), documentation_tree::doc, NULL, and RAII_VAR.
Referenced by load_modules(), xmldoc_update_config_option(), and xmldoc_update_config_type().
int ast_xmldoc_regenerate_doc_item | ( | struct ast_xml_doc_item * | item | ) |
Regenerate the documentation for a particular item.
item | The documentation item to regenerate |
-1 | on error |
0 | on success |
Definition at line 2635 of file xmldoc.c.
References _ast_xmldoc_build_arguments(), _ast_xmldoc_build_description(), _ast_xmldoc_build_seealso(), _ast_xmldoc_build_synopsis(), _ast_xmldoc_build_syntax(), ast_xml_doc_item::arguments, ast_free, ast_str_set(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_doc_item::description, item, name, ast_xml_doc_item::seealso, synopsis, ast_xml_doc_item::syntax, and aco_type::type.
Referenced by xmldoc_update_config_option(), and xmldoc_update_config_type().