Asterisk - The Open Source Telephony Project
18.5.0
|
XML Documentation API. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/paths.h"
#include "asterisk/linkedlists.h"
#include "asterisk/config.h"
#include "asterisk/term.h"
#include "asterisk/astobj2.h"
#include "asterisk/xmldoc.h"
#include "asterisk/cli.h"
Go to the source code of this file.
Data Structures | |
struct | documentation_tree |
XML documentation tree. More... | |
struct | strcolorized_tags |
struct | strspecial_tags |
struct | strsyntaxtype |
Mapping between type of node and type of syntax to generate. More... | |
struct | xmldoc_tree |
Container of documentation trees. More... | |
Macros | |
#define | GOTONEXT(__rev, __a) (__rev ? ast_xml_node_get_prev(__a) : ast_xml_node_get_next(__a)) |
#define | ISLAST(__rev, __a) (__rev == 1 ? (ast_xml_node_get_prev(__a) ? 0 : 1) : (ast_xml_node_get_next(__a) ? 0 : 1)) |
#define | MP(__a) ((multiple ? __a : "")) |
Enumerations | |
enum | syntaxtype { FUNCTION_SYNTAX, MANAGER_SYNTAX, MANAGER_EVENT_SYNTAX, CONFIG_INFO_SYNTAX, CONFIG_FILE_SYNTAX, CONFIG_OPTION_SYNTAX, CONFIG_OBJECT_SYNTAX, COMMAND_SYNTAX } |
Types of syntax that we are able to generate. More... | |
Functions | |
static char * | _ast_xmldoc_build_arguments (struct ast_xml_node *node) |
static char * | _ast_xmldoc_build_description (struct ast_xml_node *node) |
static char * | _ast_xmldoc_build_seealso (struct ast_xml_node *node) |
static char * | _ast_xmldoc_build_synopsis (struct ast_xml_node *node) |
static char * | _ast_xmldoc_build_syntax (struct ast_xml_node *root_node, const char *type, const char *name) |
static char * | _xmldoc_build_field (struct ast_xml_node *node, const char *var, int raw) |
static struct ast_xml_doc_item * | ast_xml_doc_item_alloc (const char *name, const char *type) |
static int | ast_xml_doc_item_cmp (void *obj, void *arg, int flags) |
static void | ast_xml_doc_item_destructor (void *obj) |
static int | ast_xml_doc_item_hash (const void *obj, const int flags) |
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... | |
int | ast_xmldoc_load_documentation (void) |
Load XML documentation. Provided by xmldoc.c. 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... | |
static void | build_config_docs (struct ast_xml_node *cur, struct ast_xml_doc_item_list *root) |
static char * | handle_dump_docs (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | xmldoc_attribute_match (struct ast_xml_node *node, const char *attr, const char *value) |
static struct ast_xml_doc_item * | xmldoc_build_documentation_item (struct ast_xml_node *node, const char *name, const char *type) |
static char * | xmldoc_build_field (const char *type, const char *name, const char *module, const char *var, int raw) |
static struct ast_xml_doc_item * | xmldoc_build_final_response (struct ast_xml_node *manager_action) |
static struct ast_xml_doc_item * | xmldoc_build_list_responses (struct ast_xml_node *manager_action) |
static struct ast_str * | xmldoc_get_formatted (struct ast_xml_node *node, int raw_output, int raw_wrap) |
static struct ast_xml_node * | xmldoc_get_node (const char *type, const char *name, const char *module, const char *language) |
static char * | xmldoc_get_syntax_cmd (struct ast_xml_node *fixnode, const char *name, int printname) |
static char * | xmldoc_get_syntax_config_object (struct ast_xml_node *fixnode, const char *name) |
static char * | xmldoc_get_syntax_config_option (struct ast_xml_node *fixnode, const char *name) |
static char * | xmldoc_get_syntax_fun (struct ast_xml_node *rootnode, const char *rootname, const char *childname, int printparenthesis, int printrootname) |
static char * | xmldoc_get_syntax_manager (struct ast_xml_node *fixnode, const char *name, const char *manager_type) |
static enum syntaxtype | xmldoc_get_syntax_type (const char *type) |
static int | xmldoc_has_inside (struct ast_xml_node *fixnode, const char *what) |
static int | xmldoc_has_nodes (struct ast_xml_node *fixnode) |
static int | xmldoc_has_specialtags (struct ast_xml_node *fixnode) |
static int | xmldoc_parse_argument (struct ast_xml_node *fixnode, int insideparameter, const char *paramtabs, const char *tabs, struct ast_str **buffer) |
static char * | xmldoc_parse_cmd_enumlist (struct ast_xml_node *fixnode) |
static int | xmldoc_parse_common_elements (struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer) |
static int | xmldoc_parse_enum (struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_parse_enumlist (struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_parse_example (struct ast_xml_node *fixnode, struct ast_str **buffer) |
static int | xmldoc_parse_info (struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer) |
static int | xmldoc_parse_option (struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) |
static void | xmldoc_parse_optionlist (struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_parse_para (struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer) |
static void | xmldoc_parse_parameter (struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_parse_specialtags (struct ast_xml_node *fixnode, const char *tabs, const char *posttabs, struct ast_str **buffer) |
static int | xmldoc_parse_variable (struct ast_xml_node *node, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_parse_variablelist (struct ast_xml_node *node, const char *tabs, struct ast_str **buffer) |
static int | xmldoc_postbrlen (const char *postbr) |
static void | xmldoc_reverse_helper (int reverse, int *len, char **syntax, const char *fmt,...) |
static void | xmldoc_setpostbr (char *postbr, size_t len, const char *text) |
static void | xmldoc_string_cleanup (const char *text, struct ast_str **output, int lastspaces, int maintain_newlines) |
static char * | xmldoc_string_wrap (const char *text, int columns) |
static void | xmldoc_unload_documentation (void) |
Close and unload XML documentation. More... | |
Variables | |
static struct ast_cli_entry | cli_dump_xmldocs = { .handler = handle_dump_docs , .summary = "Dump the XML docs to the specified file" ,} |
static const struct strcolorized_tags | colorized_tags [] |
static const char | default_documentation_language [] = "en_US" |
Default documentation language. More... | |
static char | documentation_language [6] |
XML documentation language. More... | |
static const struct strspecial_tags | special_tags [] |
static struct strsyntaxtype | stxtype [] |
static const int | xmldoc_text_columns = 79 |
Number of columns to print when showing the XML documentation with a 'core show application/function *' CLI command. Used in text wrapping. More... | |
static struct xmldoc_tree | xmldoc_tree = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
#define GOTONEXT | ( | __rev, | |
__a | |||
) | (__rev ? ast_xml_node_get_prev(__a) : ast_xml_node_get_next(__a)) |
Referenced by xmldoc_get_syntax_fun().
#define ISLAST | ( | __rev, | |
__a | |||
) | (__rev == 1 ? (ast_xml_node_get_prev(__a) ? 0 : 1) : (ast_xml_node_get_next(__a) ? 0 : 1)) |
Referenced by xmldoc_get_syntax_fun().
#define MP | ( | __a | ) | ((multiple ? __a : "")) |
Referenced by xmldoc_get_syntax_fun().
enum syntaxtype |
Types of syntax that we are able to generate.
Enumerator | |
---|---|
FUNCTION_SYNTAX | |
MANAGER_SYNTAX | |
MANAGER_EVENT_SYNTAX | |
CONFIG_INFO_SYNTAX | |
CONFIG_FILE_SYNTAX | |
CONFIG_OPTION_SYNTAX | |
CONFIG_OBJECT_SYNTAX | |
COMMAND_SYNTAX |
Definition at line 1154 of file xmldoc.c.
|
static |
Definition at line 2035 of file xmldoc.c.
References ast_free, ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_str_truncate(), ast_strdup, ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), buf, NULL, and xmldoc_parse_parameter().
Referenced by ast_xmldoc_build_arguments(), ast_xmldoc_regenerate_doc_item(), and xmldoc_build_documentation_item().
|
static |
Definition at line 2245 of file xmldoc.c.
References _xmldoc_build_field().
Referenced by ast_xmldoc_regenerate_doc_item(), and xmldoc_build_documentation_item().
|
static |
Definition at line 1636 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_strdup, 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 NULL.
Referenced by ast_xmldoc_build_seealso(), ast_xmldoc_regenerate_doc_item(), and xmldoc_build_documentation_item().
|
static |
Definition at line 2222 of file xmldoc.c.
References _xmldoc_build_field().
Referenced by ast_xmldoc_regenerate_doc_item(), and xmldoc_build_documentation_item().
|
static |
Definition at line 1216 of file xmldoc.c.
References ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), COMMAND_SYNTAX, CONFIG_OBJECT_SYNTAX, CONFIG_OPTION_SYNTAX, FUNCTION_SYNTAX, MANAGER_EVENT_SYNTAX, MANAGER_SYNTAX, NULL, xmldoc_get_syntax_cmd(), xmldoc_get_syntax_config_object(), xmldoc_get_syntax_config_option(), xmldoc_get_syntax_fun(), xmldoc_get_syntax_manager(), and xmldoc_get_syntax_type().
Referenced by ast_xmldoc_build_syntax(), ast_xmldoc_regenerate_doc_item(), and xmldoc_build_documentation_item().
|
static |
Definition at line 2157 of file xmldoc.c.
References ast_free, ast_str_buffer(), ast_str_strlen(), ast_strdup, ast_xml_find_element(), ast_xml_node_get_children(), NULL, and xmldoc_get_formatted().
Referenced by _ast_xmldoc_build_description(), _ast_xmldoc_build_synopsis(), and xmldoc_build_field().
|
static |
Definition at line 2289 of file xmldoc.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, ast_xml_doc_item::arguments, ast_log, AST_LOG_ERROR, ast_str_create, ast_string_field_init, ast_string_field_set, ast_xml_doc_item_destructor(), ast_xml_doc_item::description, item, NULL, ast_xml_doc_item::seealso, ast_xml_doc_item::synopsis, and ast_xml_doc_item::syntax.
Referenced by xmldoc_build_documentation_item().
|
static |
Definition at line 2340 of file xmldoc.c.
References CMP_MATCH, CMP_STOP, match(), ast_xml_doc_item::name, and OBJ_KEY.
Referenced by ast_xmldoc_build_documentation().
|
static |
Definition at line 2260 of file xmldoc.c.
References ao2_ref, ast_xml_doc_item::arguments, ast_free, AST_LIST_NEXT, ast_string_field_free_memory, ast_xml_doc_item::description, documentation_tree::doc, ast_xml_doc_item::next, NULL, ast_xml_doc_item::seealso, ast_xml_doc_item::synopsis, and ast_xml_doc_item::syntax.
Referenced by ast_xml_doc_item_alloc().
|
static |
Definition at line 2328 of file xmldoc.c.
References ast_str_case_hash(), item, ast_xml_doc_item::name, name, and OBJ_KEY.
Referenced by ast_xmldoc_build_documentation().
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 2075 of file xmldoc.c.
References _ast_xmldoc_build_arguments(), ast_strlen_zero, ast_xml_node_get_children(), documentation_language, NULL, 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 2250 of file xmldoc.c.
References 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 2653 of file xmldoc.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_link, ao2_t_ref, ast_config_AST_DATA_DIR, 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(), ast_xmldoc_regenerate_doc_item(), build_config_docs(), CONFIG_INFO_SYNTAX, default_documentation_language, documentation_tree::doc, documentation_language, item, MANAGER_EVENT_SYNTAX, name, ast_xml_doc_item::next, NULL, RAII_VAR, 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 2528 of file xmldoc.c.
References ast_strlen_zero, ast_xml_node_get_children(), documentation_language, NULL, 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 2463 of file xmldoc.c.
References ast_strlen_zero, ast_xml_node_get_children(), documentation_language, NULL, 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 1698 of file xmldoc.c.
References _ast_xmldoc_build_seealso(), ast_strlen_zero, ast_xml_node_get_children(), documentation_language, NULL, 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 2227 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 1253 of file xmldoc.c.
References _ast_xmldoc_build_syntax(), documentation_language, NULL, and xmldoc_get_node().
Referenced by acf_retrieve_docs(), ast_agi_register(), ast_manager_register2(), and ast_register_application2().
int ast_xmldoc_load_documentation | ( | void | ) |
Load XML documentation. Provided by xmldoc.c.
1 | on error. |
0 | on success. |
Definition at line 2879 of file xmldoc.c.
References ast_asprintf, ast_calloc, ast_cli_register, ast_config_AST_DATA_DIR, ast_config_destroy(), ast_config_load2(), ast_debug, ast_free, ast_log, ast_malloc, ast_register_cleanup(), AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strdup, ast_strlen_zero, ast_variable_browse(), ast_xml_close(), ast_xml_get_root(), ast_xml_init(), ast_xml_node_get_name(), ast_xml_open(), CONFIG_STATUS_FILEINVALID, default_documentation_language, documentation_tree::doc, documentation_language, documentation_tree::filename, GLOB_ABORTED, LOG_ERROR, LOG_WARNING, MY_GLOB_FLAGS, ast_variable::name, ast_variable::next, NULL, ast_variable::value, var, and xmldoc_unload_documentation().
Referenced by asterisk_daemon().
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 242 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.
query | 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 2545 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 2604 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, name, ast_xml_doc_item::node, ast_xml_doc_item::seealso, synopsis, ast_xml_doc_item::synopsis, ast_xml_doc_item::syntax, and ast_xml_doc_item::type.
Referenced by ast_xmldoc_build_documentation(), xmldoc_update_config_option(), and xmldoc_update_config_type().
|
static |
Definition at line 2576 of file xmldoc.c.
References AST_LIST_INSERT_TAIL, ast_log, ast_string_field_set, ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), item, LOG_ERROR, name, ast_xml_doc_item::next, ast_xml_doc_item::ref, and xmldoc_build_documentation_item().
Referenced by ast_xmldoc_build_documentation().
|
static |
Definition at line 2787 of file xmldoc.c.
References ast_cli_args::argc, ast_cli_args::argv, AST_LIST_TRAVERSE, ast_log, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_xml_add_child_list(), ast_xml_close(), ast_xml_copy_node_list(), ast_xml_doc_dump_file(), ast_xml_get_root(), ast_xml_new(), ast_xml_new_node(), ast_xml_node_get_children(), ast_xml_set_root(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, documentation_tree::doc, errno, LOG_ERROR, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 412 of file xmldoc.c.
References ast_xml_free_attr(), ast_xml_get_attribute(), and match().
Referenced by xmldoc_get_node().
|
static |
Definition at line 2360 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_doc_item_alloc(), ast_xml_doc_item::description, item, ast_xml_doc_item::node, NULL, ast_xml_doc_item::seealso, synopsis, ast_xml_doc_item::synopsis, and ast_xml_doc_item::syntax.
Referenced by ast_xmldoc_build_documentation(), build_config_docs(), xmldoc_build_final_response(), and xmldoc_build_list_responses().
|
static |
Definition at line 2190 of file xmldoc.c.
References _xmldoc_build_field(), ast_log, ast_strlen_zero, documentation_language, LOG_ERROR, LOG_WARNING, NULL, and xmldoc_get_node().
Referenced by ast_xmldoc_build_description(), and ast_xmldoc_build_synopsis().
|
static |
Definition at line 2494 of file xmldoc.c.
References ast_xml_find_element(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), name, NULL, and xmldoc_build_documentation_item().
Referenced by ast_xmldoc_build_final_response().
|
static |
Definition at line 2419 of file xmldoc.c.
References ao2_cleanup, AST_LIST_FIRST, AST_LIST_HEAD_INIT, AST_LIST_INSERT_TAIL, ast_xml_find_element(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), name, ast_xml_doc_item::next, NULL, RAII_VAR, and xmldoc_build_documentation_item().
Referenced by ast_xmldoc_build_list_responses().
|
static |
Definition at line 2103 of file xmldoc.c.
References ast_skip_blanks(), ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_str_truncate(), ast_xml_free_text(), ast_xml_get_text(), ast_xml_node_get_children(), ast_xml_node_get_next(), NULL, tmp(), xmldoc_parse_common_elements(), xmldoc_parse_enumlist(), xmldoc_parse_specialtags(), xmldoc_parse_variablelist(), and xmldoc_string_cleanup().
Referenced by _xmldoc_build_field().
|
static |
Definition at line 434 of file xmldoc.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strlen_zero, ast_xml_find_element(), ast_xml_get_root(), ast_xml_node_get_children(), ast_xml_node_get_next(), documentation_tree::doc, NULL, and xmldoc_attribute_match().
Referenced by ast_xmldoc_build_arguments(), ast_xmldoc_build_final_response(), ast_xmldoc_build_list_responses(), ast_xmldoc_build_seealso(), ast_xmldoc_build_syntax(), and xmldoc_build_field().
|
static |
Definition at line 932 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_strdup, ast_true(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), first, NULL, xmldoc_has_inside(), and xmldoc_parse_cmd_enumlist().
Referenced by _ast_xmldoc_build_syntax(), and xmldoc_parse_cmd_enumlist().
|
static |
Definition at line 1090 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strdup, ast_true(), ast_xml_find_element(), ast_xml_free_attr(), ast_xml_free_text(), ast_xml_get_attribute(), ast_xml_get_text(), ast_xml_node_get_children(), match(), NULL, RAII_VAR, S_OR, text, and tmp().
Referenced by _ast_xmldoc_build_syntax().
|
static |
Definition at line 1126 of file xmldoc.c.
References ast_free, ast_str_buffer(), ast_str_create, ast_str_set(), ast_strdup, ast_xml_free_attr(), ast_xml_get_attribute(), NULL, RAII_VAR, regex(), and type.
Referenced by _ast_xmldoc_build_syntax().
|
static |
Definition at line 638 of file xmldoc.c.
References ast_asprintf, ast_free, ast_log, ast_strdup, ast_strdupa, ast_strlen_zero, ast_true(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), GOTONEXT, ISLAST, len(), LOG_WARNING, MP, NULL, xmldoc_has_inside(), and xmldoc_reverse_helper().
Referenced by _ast_xmldoc_build_syntax(), and xmldoc_parse_optionlist().
|
static |
Definition at line 1038 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_strdup, ast_true(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), and NULL.
Referenced by _ast_xmldoc_build_syntax().
|
static |
Definition at line 1189 of file xmldoc.c.
References ARRAY_LEN, FUNCTION_SYNTAX, strsyntaxtype::stxtype, and stxtype.
Referenced by _ast_xmldoc_build_syntax(), and ast_xmldoc_build_documentation().
|
static |
Definition at line 568 of file xmldoc.c.
References ast_xml_node_get_children(), ast_xml_node_get_name(), and ast_xml_node_get_next().
Referenced by xmldoc_get_syntax_cmd(), xmldoc_get_syntax_fun(), xmldoc_parse_argument(), and xmldoc_parse_parameter().
|
static |
Definition at line 589 of file xmldoc.c.
References ast_xml_node_get_children(), ast_xml_node_get_name(), and ast_xml_node_get_next().
Referenced by xmldoc_parse_parameter().
|
static |
Definition at line 610 of file xmldoc.c.
References ARRAY_LEN, ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), and special_tags.
Referenced by xmldoc_parse_argument().
|
static |
Definition at line 1470 of file xmldoc.c.
References ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_next(), xmldoc_has_inside(), xmldoc_has_specialtags(), and xmldoc_parse_common_elements().
Referenced by xmldoc_parse_option(), and xmldoc_parse_parameter().
|
static |
Definition at line 882 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_strdup, ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), first, and xmldoc_get_syntax_cmd().
Referenced by xmldoc_get_syntax_cmd().
|
static |
Definition at line 1281 of file xmldoc.c.
References xmldoc_parse_info(), xmldoc_parse_para(), and xmldoc_parse_specialtags().
Referenced by xmldoc_get_formatted(), xmldoc_parse_argument(), xmldoc_parse_enum(), xmldoc_parse_info(), xmldoc_parse_option(), xmldoc_parse_variable(), and xmldoc_parse_variablelist().
|
static |
Definition at line 1728 of file xmldoc.c.
References ast_asprintf, ast_free, ast_xml_node_get_children(), ast_xml_node_get_next(), xmldoc_parse_common_elements(), xmldoc_parse_enumlist(), and xmldoc_parse_parameter().
Referenced by xmldoc_parse_enumlist().
|
static |
Definition at line 1762 of file xmldoc.c.
References ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), and xmldoc_parse_enum().
Referenced by xmldoc_get_formatted(), xmldoc_parse_enum(), xmldoc_parse_info(), xmldoc_parse_option(), and xmldoc_parse_parameter().
|
static |
Definition at line 1358 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), 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(), and xmldoc_string_cleanup().
Referenced by xmldoc_parse_specialtags().
|
static |
Definition at line 1981 of file xmldoc.c.
References ast_asprintf, ast_free, ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), xmldoc_parse_common_elements(), xmldoc_parse_enumlist(), and xmldoc_parse_parameter().
Referenced by xmldoc_parse_common_elements(), xmldoc_parse_parameter(), and xmldoc_parse_specialtags().
|
static |
Definition at line 1801 of file xmldoc.c.
References ast_asprintf, ast_free, ast_str_append(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), NULL, xmldoc_parse_argument(), xmldoc_parse_common_elements(), xmldoc_parse_enumlist(), and xmldoc_parse_variablelist().
Referenced by xmldoc_parse_optionlist().
|
static |
Definition at line 1845 of file xmldoc.c.
References ast_free, ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), xmldoc_get_syntax_fun(), and xmldoc_parse_option().
Referenced by xmldoc_parse_parameter().
|
static |
Definition at line 1303 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_xml_free_text(), ast_xml_get_text(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), tmp(), and xmldoc_string_cleanup().
Referenced by xmldoc_parse_common_elements(), xmldoc_parse_parameter(), and xmldoc_parse_specialtags().
|
static |
Definition at line 1898 of file xmldoc.c.
References ast_asprintf, ast_free, ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), xmldoc_has_inside(), xmldoc_has_nodes(), xmldoc_parse_argument(), xmldoc_parse_enumlist(), xmldoc_parse_info(), xmldoc_parse_optionlist(), xmldoc_parse_para(), and xmldoc_parse_specialtags().
Referenced by _ast_xmldoc_build_arguments(), xmldoc_parse_enum(), and xmldoc_parse_info().
|
static |
Definition at line 1411 of file xmldoc.c.
References ARRAY_LEN, ast_str_append(), ast_strlen_zero, ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), end, special_tags, xmldoc_parse_example(), xmldoc_parse_info(), and xmldoc_parse_para().
Referenced by xmldoc_get_formatted(), xmldoc_parse_common_elements(), and xmldoc_parse_parameter().
|
static |
Definition at line 1517 of file xmldoc.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_strlen(), 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(), tmp(), xmldoc_parse_common_elements(), and xmldoc_string_cleanup().
Referenced by xmldoc_parse_variablelist().
|
static |
Definition at line 1578 of file xmldoc.c.
References ast_asprintf, ast_free, ast_str_append(), ast_xml_free_attr(), ast_xml_get_attribute(), ast_xml_node_get_children(), ast_xml_node_get_name(), ast_xml_node_get_next(), tmp(), xmldoc_parse_common_elements(), and xmldoc_parse_variable().
Referenced by xmldoc_get_formatted(), and xmldoc_parse_option().
|
static |
|
static |
Definition at line 516 of file xmldoc.c.
References ast_free, ast_realloc, ast_vasprintf, and tmp().
Referenced by xmldoc_get_syntax_fun().
|
static |
Definition at line 148 of file xmldoc.c.
Referenced by xmldoc_string_wrap().
|
static |
Definition at line 361 of file xmldoc.c.
References ast_log, ast_str_append(), ast_str_create, ast_str_trim_blanks(), LOG_ERROR, and NULL.
Referenced by xmldoc_get_formatted(), xmldoc_parse_example(), xmldoc_parse_para(), and xmldoc_parse_variable().
|
static |
Definition at line 176 of file xmldoc.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_truncate(), ast_strdup, ESC, LOG_WARNING, NULL, tmp(), xmldoc_postbrlen(), and xmldoc_setpostbr().
Referenced by ast_xmldoc_printable().
|
static |
Close and unload XML documentation.
Definition at line 2862 of file xmldoc.c.
References ast_cli_unregister(), ast_free, AST_RWLIST_REMOVE_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_xml_close(), ast_xml_finish(), documentation_tree::doc, and documentation_tree::filename.
Referenced by ast_xmldoc_load_documentation().
|
static |
|
static |
Referenced by ast_xmldoc_printable().
|
static |
Default documentation language.
Definition at line 44 of file xmldoc.c.
Referenced by ast_xmldoc_build_documentation(), and ast_xmldoc_load_documentation().
|
static |
XML documentation language.
Definition at line 51 of file xmldoc.c.
Referenced by ast_xmldoc_build_arguments(), ast_xmldoc_build_documentation(), ast_xmldoc_build_final_response(), ast_xmldoc_build_list_responses(), ast_xmldoc_build_seealso(), ast_xmldoc_build_syntax(), ast_xmldoc_load_documentation(), and xmldoc_build_field().
|
static |
Referenced by xmldoc_has_specialtags(), and xmldoc_parse_specialtags().
|
static |
Referenced by xmldoc_get_syntax_type().
|
static |
Number of columns to print when showing the XML documentation with a 'core show application/function *' CLI command. Used in text wrapping.
Definition at line 48 of file xmldoc.c.
Referenced by ast_xmldoc_printable().
|
static |