56    struct ast_xml_doc *
doc;            
 
 
   83    { 
"<",  
">",  
COLOR_GREEN,  
"<replaceable>", 
"</replaceable>" },
 
   84    { 
"\'", 
"\'", 
COLOR_BLUE,   
"<literal>",     
"</literal>" },
 
   85    { 
"*",  
"*",  
COLOR_RED,    
"<emphasis>",    
"</emphasis>" },
 
   86    { 
"\"", 
"\"", 
COLOR_YELLOW, 
"<filename>",    
"</filename>" },
 
   87    { 
"\"", 
"\"", 
COLOR_CYAN,   
"<directory>",   
"</directory>" },
 
   88    { 
"${", 
"}",  
COLOR_GREEN,  
"<variable>",    
"</variable>" },
 
   91    { 
"\'", 
"\'", 
COLOR_GRAY,   
"<astcli>",      
"</astcli>" },
 
   95    { 
"", 
"", 
COLOR_RED,   
"<warning>", 
"</warning>" },
 
   97    { 
"", 
"", 
COLOR_WHITE, 
"<exampletext>", 
"</exampletext>"},
 
  105    { 
"note",    
"<note>NOTE:</note> ",             
"" },
 
  106    { 
"warning", 
"<warning>WARNING!!!:</warning> ", 
"" },
 
  107    { 
"example", 
"<example>Example:</example> ", 
"" },
 
  121    int postbrreallen = 0, i;
 
  127    postbrlen = strlen(postbr);
 
  128    for (i = 0; i < postbrlen; i++) {
 
  129        if (postbr[i] == 
'\t') {
 
  130            postbrreallen += 8 - (postbrreallen % 8);
 
  135    return postbrreallen;
 
 
  149    int c, postbrlen = 0;
 
  155    for (
c = 0; 
c < 
len; 
c++) {
 
  157            postbr[postbrlen++] = 
text[
c];
 
  162    postbr[postbrlen] = 
'\0';
 
 
  178    char *ret, postbr[160];
 
  179    int count, i, textlen, postbrlen, lastbreak;
 
  200    textlen = strlen(
text);
 
  201    for (i = 0; i < textlen; i++) {
 
  202        if (
text[i] == 
'\n') {
 
  212            } 
while (i < textlen && 
text[i] != 
'm');
 
  214            if (
text[i] == 
' ') {
 
  222            int back = i - lastbreak;
 
  223            if (lastbreak && back > 0 && back < 30) {
 
 
  244    char *wrapped = 
NULL;
 
  245    int i, 
c, 
len, colorsection;
 
  254    bwinputlen = strlen(bwinput);
 
  267    for (i = 0; i < bwinputlen; i++) {
 
 
  370    textlen = strlen(
text);
 
  378    for (i = 0; i < textlen; i++) {
 
  379        if (
text[i] == 
'\n' || 
text[i] == 
'\r') {
 
  380            if (maintain_newlines) {
 
  384            while (
text[i + 1] == 
'\t' || 
text[i + 1] == 
'\r' || 
text[i + 1] == 
'\n') {
 
 
  414    int match = attr_value && !strcmp(attr_value, 
value);
 
 
  438    struct ast_xml_node *first_match = 
NULL;
 
  439    struct ast_xml_node *lang_match = 
NULL;
 
 
  531    tmpfmtlen = strlen(tmpfmt);
 
  532    totlen = *
len + tmpfmtlen + 1;
 
  539    *syntax = new_syntax;
 
  542        memmove(*syntax + tmpfmtlen, *syntax, *
len);
 
  545        strcpy(*syntax, tmpfmt);
 
  547        (*syntax)[tmpfmtlen] = tmp;
 
  548        (*syntax)[totlen - 1] = 
'\0';
 
  550        strcpy(*syntax + *
len, tmpfmt);
 
 
  569    struct ast_xml_node *
node = fixnode;
 
 
  590    struct ast_xml_node *
node = fixnode;
 
 
  611    struct ast_xml_node *
node = fixnode;
 
 
  637static char *
xmldoc_get_syntax_fun(
struct ast_xml_node *rootnode, 
const char *rootname, 
const char *childname, 
int printparenthesis, 
int printrootname)
 
  639#define GOTONEXT(__rev, __a) (__rev ? ast_xml_node_get_prev(__a) : ast_xml_node_get_next(__a)) 
  640#define ISLAST(__rev, __a)  (__rev == 1 ? (ast_xml_node_get_prev(__a) ? 0 : 1) : (ast_xml_node_get_next(__a) ? 0 : 1)) 
  641#define MP(__a) ((multiple ? __a : "")) 
  643    const char *paramtype, *multipletype, *paramnameattr, *attrargsep, *parenthesis, *argname;
 
  644    int reverse, required, paramcount = 0, openbrackets = 0, 
len = 0, hasparams=0;
 
  645    int reqfinode = 0, reqlanode = 0, optmidnode = 0, prnparenthesis, multiple;
 
  646    char *syntax = 
NULL, *argsep, *paramname;
 
  649        ast_log(
LOG_WARNING, 
"Tried to look in XML tree with faulty rootname or childname while creating a syntax.\n");
 
  655        if (
ast_asprintf(&syntax, 
"%s%s", (printrootname ? rootname : 
""), (printparenthesis ? 
"()" : 
"")) < 0) {
 
  686        reqlanode = required;
 
  691            reqfinode = required;
 
  697        if (
ast_asprintf(&syntax, 
"%s%s", (printrootname ? rootname : 
""), (printparenthesis ? 
"()" : 
"")) < 0) {
 
  703    if (reqfinode && reqlanode) {
 
  709            if (
node != firstparam && 
node != lastparam) {
 
  722    if ((!reqfinode && reqlanode) || (reqfinode && reqlanode && optmidnode)) {
 
  733            (printrootname ? (printrootname == 2 ? 
")]" : 
")"): 
""));
 
  736            (printrootname ? (printrootname == 2 ? 
"[(" : 
"(") : 
""));
 
  749                prnparenthesis = 
ast_true(parenthesis);
 
  750                if (!strcasecmp(parenthesis, 
"optional")) {
 
  765            if (!paramnameattr) {
 
  772                if (
ast_asprintf(&syntax, 
"%s%s", (printrootname ? rootname : 
""), (printparenthesis ? 
"()" : 
"")) < 0) {
 
  810                while (openbrackets > 0) {
 
  830                                    MP(
"["), 
MP(argsep), 
MP(
"...]"), argsep);
 
  833                                    MP(
"["), 
MP(argsep), 
MP(
"...]"));
 
  838                                    MP(
"["), 
MP(argsep), 
MP(
"...]"));
 
  841                                    MP(
"["), 
MP(argsep), 
MP(
"...]"));
 
  853    while (openbrackets > 0) {
 
  861            (printrootname ? (printrootname == 2 ? 
"[(" : 
"(") : 
""));
 
 
  883    struct ast_xml_node *
node = fixnode;
 
  885    char *enumname, *ret;
 
 
  934    struct ast_xml_node *tmpnode, *
node = fixnode;
 
  935    char *ret, *paramname;
 
  936    const char *paramtype, *attrname, *literal;
 
  937    int required, isenum, 
first = 1, isliteral;
 
 1010                (required ? 
"" : 
"["),
 
 1011                (isenum || isliteral ? 
"" : 
"<"),
 
 1013                (isenum || isliteral ? 
"" : 
">"),
 
 1014                (required ? 
"" : 
"]"));
 
 
 1040    struct ast_xml_node *
node = fixnode;
 
 1041    const char *paramtype, *attrname;
 
 1062        required = !strcasecmp(manager_type, 
"event") ? 1 : 0;
 
 1076            (required ? 
"" : 
"["),
 
 1078            (required ? 
"" : 
"]"));
 
 
 1091    struct ast_xml_node *matchinfo, *tmp;
 
 1093    const char *attr_value;
 
 1097    if (!syntax || !fixnode) {
 
 
 1128    const char *default_value;
 
 1132    if (!syntax || !fixnode) {
 
 1139    ast_str_set(&syntax, 0, 
"%s = [%s] (Default: %s) (Regex: %s)\n",
 
 1142        default_value ?: 
"n/a",
 
 
 1217    char *syntax = 
NULL;
 
 1218    struct ast_xml_node *
node = root_node;
 
 
 1254    struct ast_xml_node *
node;
 
 
 1309    const char *tmptext;
 
 1310    struct ast_xml_node *tmp;
 
 
 1365    struct ast_xml_node *
node = fixnode;
 
 1366    const char *tmptext;
 
 1368    struct ast_str *stripped_text;
 
 1393            if (stripped_text) {
 
 1394                ast_str_append(buffer, 0, 
"\n %s<exampletext>%s</exampletext>\n",
 
 
 1420    struct ast_xml_node *
node = fixnode;
 
 
 1479    struct ast_xml_node *
node = fixnode;
 
 1480    const char *argname;
 
 1481    int count = 0, ret = 0;
 
 1493        ast_str_append(buffer, 0, 
"%s%s%s", tabs, argname, (insideparameter ? 
"\n" : 
""));
 
 
 1528    struct ast_xml_node *tmp;
 
 1529    const char *valname;
 
 1530    const char *tmptext;
 
 1532    int ret = 0, printedpara=0;
 
 
 1589    struct ast_xml_node *tmp;
 
 1590    const char *varname;
 
 1617                ast_str_append(buffer, 0, 
"%s<variable>%s</variable>: ", tabs, varname);
 
 
 1649    const char *
typename;
 
 1650    const char *content;
 
 1687        if (!strcasecmp(
typename, 
"application")) {
 
 1689        } 
else if (!strcasecmp(
typename, 
"function")) {
 
 1691        } 
else if (!strcasecmp(
typename, 
"astcli")) {
 
 
 1710    struct ast_xml_node *
node;
 
 
 1748    const char *content;
 
 
 1795    struct ast_xml_node *
node;
 
 
 1828    struct ast_xml_node *
node = fixnode;
 
 
 1863    struct ast_xml_node *
node = fixnode;
 
 1864    const char *enumname;
 
 
 1902    struct ast_xml_node *
node;
 
 
 1946    struct ast_xml_node *
node;
 
 1947    const char *optname, *hasparams;
 
 1965        if (hasparams && !strcasecmp(hasparams, 
"optional")) {
 
 1970        if (!optionsyntax) {
 
 
 1999    const char *paramname;
 
 2000    struct ast_xml_node *
node = fixnode;
 
 2001    int hasarguments, printed = 0;
 
 
 2092    if (!internaltabs) {
 
 2098        ast_str_append(buffer, 0, 
"%s<note>Technology: %s</note>\n", internaltabs, tech);
 
 2110            if (internal_ret > ret) {
 
 
 2136    char *retstr = 
NULL;
 
 
 2176    struct ast_xml_node *
node;
 
 
 2209    struct ast_xml_node *tmp;
 
 2210    const char *notcleanret, *tmpstr;
 
 2216        tmpstr = notcleanret;
 
 
 2296    struct ast_xml_node *
node;
 
 2310            " If this module was recently built, run 'xmldoc reload' to refresh documentation\n",
 
 
 2420        goto ast_xml_doc_item_failure;
 
 2425        goto ast_xml_doc_item_failure;
 
 2432ast_xml_doc_item_failure:
 
 
 2541    struct ast_xml_node *
event;
 
 2542    struct ast_xml_node *responses;
 
 2543    struct ast_xml_node *list_elements;
 
 2554    if (!list_elements) {
 
 2560        struct ast_xml_node *event_instance;
 
 2570            "managerEventInstance", 
NULL, 
NULL);
 
 
 2585    struct ast_xml_node *
node;
 
 
 2621    struct ast_xml_node *responses;
 
 2622    struct ast_xml_node *final_response_event;
 
 2623    struct ast_xml_node *event_instance;
 
 2633    if (!final_response_event) {
 
 2638        "managerEventInstance", 
NULL, 
NULL);
 
 2639    if (!event_instance) {
 
 
 2655    struct ast_xml_node *
node;
 
 
 2675struct ast_xml_xpath_results *__attribute__((format(printf, 1, 2))) 
ast_xmldoc_query(const 
char *fmt, ...)
 
 2677    struct ast_xml_xpath_results *results = 
NULL;
 
 
 2708    struct ast_xml_node *iter;
 
 2712        const char *iter_name;
 
 
 2874#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 
 2875static int xml_pathmatch(
char *xmlpattern, 
int xmlpattern_maxlen, glob_t *globbuf)
 
 2879    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/thirdparty/*-%s.xml",
 
 2881    if((globret = glob(xmlpattern, GLOB_NOCHECK, 
NULL, globbuf))) {
 
 2885    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/thirdparty/*-%.2s_??.xml",
 
 2887    if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK, 
NULL, globbuf))) {
 
 2891    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/thirdparty/*-%s.xml",
 
 2893    if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK, 
NULL, globbuf))) {
 
 2897    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/*-%s.xml",
 
 2899    if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK, 
NULL, globbuf))) {
 
 2903    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/*-%.2s_??.xml",
 
 2905    if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK, 
NULL, globbuf))) {
 
 2909    snprintf(xmlpattern, xmlpattern_maxlen, 
"%s/documentation/*-%s.xml",
 
 2911    globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK, 
NULL, globbuf);
 
 2920    struct ast_xml_doc *dumpdoc;
 
 2921    struct ast_xml_node *dumproot;
 
 2928            "Usage: xmldoc dump <filename>\n" 
 2929            "  Dump XML documentation to a file\n";
 
 2958        struct ast_xml_node *kids_copy;
 
 2976    if (!(f = fopen(
a->argv[2], 
"w"))) {
 
 
 3021    struct ast_xml_node *root_node;
 
 3022    struct ast_xml_doc *tmpdoc;
 
 3028    int globret, i, dup, duplicate;
 
 3030#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 
 3031    int xmlpattern_maxlen;
 
 3039            if (!strcasecmp(
var->name, 
"documentation_language")) {
 
 3057    globbuf.gl_offs = 0;    
 
 3059#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 
 3060    xmlpattern_maxlen = strlen(
ast_config_AST_DATA_DIR) + strlen(
"/documentation/thirdparty") + strlen(
"/*-??_??.xml") + 1;
 
 3062    globret = xml_pathmatch(xmlpattern, xmlpattern_maxlen, &globbuf);
 
 3072    ast_debug(3, 
"gl_pathc %zu\n", (
size_t)globbuf.gl_pathc);
 
 3073    if (globret == GLOB_NOSPACE) {
 
 3074        ast_log(
LOG_WARNING, 
"XML load failure, glob expansion of pattern '%s' failed: Not enough memory\n", xmlpattern);
 
 3078        ast_log(
LOG_WARNING, 
"XML load failure, glob expansion of pattern '%s' failed: Read error\n", xmlpattern);
 
 3096    for (i = 0; i < globbuf.gl_pathc; i++) {
 
 3099        for (dup = 0; dup < i; dup++) {
 
 3100            if (!strcmp(globbuf.gl_pathv[i], globbuf.gl_pathv[dup])) {
 
 3105        if (duplicate || strchr(globbuf.gl_pathv[i], 
'*')) {
 
 3113            ast_log(
LOG_ERROR, 
"Could not open XML documentation at '%s'\n", globbuf.gl_pathv[i]);
 
 3135        doc_tree->
doc = tmpdoc;
 
 
 3162            "Usage: xmldoc reload\n" 
 3163            "  Reload XML documentation\n";
 
 
Prototypes for public functions only of internal interest,.
struct sla_ringing_trunk * first
char * strcasestr(const char *, const char *)
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ast_realloc(p, len)
A wrapper for realloc()
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_vasprintf(ret, fmt, ap)
A wrapper for vasprintf()
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_t_ref(o, delta, tag)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
static char language[MAX_LANGUAGE]
Standard Command Line Interface.
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
#define ast_cli_register(e)
Registers a command or an array of commands.
#define AST_CLI_DEFINE(fn, txt,...)
static int regex(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Configuration File Parser.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
#define ast_debug(level,...)
Log a DEBUG message.
A set of macros to manage forward-linked lists.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_RWLIST_REMOVE_HEAD
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_LIST_HEAD_INIT(head)
Initializes a list head structure.
#define AST_RWLIST_INSERT_TAIL
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
#define ast_opt_light_background
Asterisk file paths, configured in asterisk.conf.
const char * ast_config_AST_DATA_DIR
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
int ast_str_set_va(struct ast_str **buf, ssize_t max_len, const char *fmt, va_list ap)
Set a dynamic string from a va_list.
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_str_trim_blanks(struct ast_str *buf)
Trims trailing whitespace characters from an ast_str string.
@ AST_DYNSTR_BUILD_FAILED
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char *attribute_pure ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
descriptor for a cli entry.
Structure used to handle boolean flags.
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
The struct to be used as the head of an ast_xml_doc_item list when being manipulated.
Struct that contains the XML documentation for a particular item. Note that this is an ao2 ref counte...
struct ast_xml_node * node
const ast_string_field ref
struct ast_xml_doc_item * next
struct ast_str * arguments
struct ast_str * description
const ast_string_field name
struct ast_str * synopsis
struct documentation_tree::@442 entry
Mapping between type of node and type of syntax to generate.
Container of documentation trees.
Handy terminal functions for vt* terms.
int ast_term_color_code(struct ast_str **str, int fgcolor, int bgcolor)
Append a color sequence to an ast_str.
const char * ast_term_reset(void)
Returns the terminal reset code.
static struct aco_type item
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
struct ast_xml_node * ast_xml_copy_node_list(struct ast_xml_node *list)
Create a copy of a n ode list.
struct ast_xml_node * ast_xml_node_get_children(struct ast_xml_node *node)
Get the node's children.
const char * ast_xml_get_attribute(struct ast_xml_node *node, const char *attrname)
Get a node attribute by name.
const char * ast_xml_get_text(struct ast_xml_node *node)
Get an element content string.
struct ast_xml_node * ast_xml_new_node(const char *name)
Create a XML node.
void ast_xml_close(struct ast_xml_doc *doc)
Close an already open document and free the used structure.
const char * ast_xml_node_get_name(struct ast_xml_node *node)
Get the name of a node.
int ast_xml_finish(void)
Cleanup library allocated global data.
void ast_xml_free_attr(const char *attribute)
Free an attribute returned by ast_xml_get_attribute()
int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc)
Dump the specified document to a file.
struct ast_xml_node * ast_xml_node_get_next(struct ast_xml_node *node)
Get the next node in the same level.
struct ast_xml_xpath_results * ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str)
Execute an XPath query on an XML document.
struct ast_xml_doc * ast_xml_new(void)
Create a XML document.
struct ast_xml_node * ast_xml_add_child_list(struct ast_xml_node *parent, struct ast_xml_node *child)
Add a list of child nodes, to a specified parent node.
void ast_xml_free_text(const char *text)
Free a content element that was returned by ast_xml_get_text()
int ast_xml_init(void)
Initialize the XML library implementation. This function is used to setup everything needed to start ...
void ast_xml_set_root(struct ast_xml_doc *doc, struct ast_xml_node *node)
Specify the root node of a XML document.
struct ast_xml_node * ast_xml_find_element(struct ast_xml_node *root_node, const char *name, const char *attrname, const char *attrvalue)
Find a node element by name.
struct ast_xml_doc * ast_xml_open(char *filename)
Open an XML document.
struct ast_xml_node * ast_xml_get_root(struct ast_xml_doc *doc)
Get the document root node.
struct ast_xml_xpath_results * ast_xmldoc_query(const char *fmt,...)
Execute an XPath query on the loaded XML documentation.
static int xmldoc_has_nodes(struct ast_xml_node *fixnode)
static int xmldoc_parse_enum(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
static int ast_xml_doc_item_cmp(void *obj, void *arg, int flags)
static void xmldoc_string_cleanup(const char *text, struct ast_str **output, int lastspaces, int maintain_newlines)
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...
static char documentation_language[6]
XML documentation language.
static struct ast_xml_doc_item * xmldoc_build_list_responses(struct ast_xml_node *manager_action)
static void ast_xml_doc_item_destructor(void *obj)
char * ast_xmldoc_build_description(const char *type, const char *name, const char *module)
Generate description documentation from XML.
static void xmldoc_parse_optionlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
static char * _ast_xmldoc_build_syntax(struct ast_xml_node *root_node, const char *type, const char *name)
static char * handle_dump_docs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int xmldoc_parse_option(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
static char * _xmldoc_build_field(struct ast_xml_node *node, const char *var, int raw)
static int xmldoc_parse_variable(struct ast_xml_node *node, const char *tabs, struct ast_str **buffer)
static void xmldoc_setpostbr(char *postbr, size_t len, const char *text)
static struct ast_xml_doc_item * xmldoc_build_documentation_item(struct ast_xml_node *node, const char *name, const char *type)
char * ast_xmldoc_build_syntax(const char *type, const char *name, const char *module)
Get the syntax for a specified application or function.
static void xmldoc_purge_documentation(void)
static int xmldoc_parse_info(struct ast_xml_node *node, const char *tabs, const char *posttabs, 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 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.
char * ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module)
Generate synopsis documentation from XML.
static char * xmldoc_get_syntax_config_object(struct ast_xml_node *fixnode, const char *name)
syntaxtype
Types of syntax that we are able to generate.
static const char default_documentation_language[]
Default documentation language.
static enum syntaxtype xmldoc_get_syntax_type(const char *type)
static int xmldoc_load_documentation(int first_time)
static char * xmldoc_parse_cmd_enumlist(struct ast_xml_node *fixnode)
static char * handle_reload_docs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int xmldoc_reload_documentation(void)
static struct ast_cli_entry cli_dump_xmldocs
static char * xmldoc_get_syntax_cmd(struct ast_xml_node *fixnode, const char *name, int printname)
char * ast_xmldoc_build_since(const char *type, const char *name, const char *module)
Parse the <since> node content.
struct ao2_container * ast_xmldoc_build_documentation(const char *type)
Build the documentation for a particular source type.
static void xmldoc_parse_parameter(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
static struct ast_xml_doc_item * ast_xml_doc_item_alloc(const char *name, const char *type)
static const struct strspecial_tags special_tags[]
static const struct strcolorized_tags colorized_tags[]
static struct ast_str * xmldoc_get_formatted(struct ast_xml_node *node, int raw_output, int raw_wrap)
int ast_xmldoc_load_documentation(void)
Load XML documentation. Provided by xmldoc.c.
static int xmldoc_has_specialtags(struct ast_xml_node *fixnode)
static int xmldoc_parse_variablelist(struct ast_xml_node *node, const char *tabs, struct ast_str **buffer)
static int xmldoc_parse_argument(struct ast_xml_node *fixnode, int insideparameter, const char *paramtabs, const char *tabs, struct ast_str **buffer)
static int xmldoc_parse_example(struct ast_xml_node *fixnode, 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 char * xmldoc_get_syntax_config_option(struct ast_xml_node *fixnode, const char *name)
static char * xmldoc_get_syntax_manager(struct ast_xml_node *fixnode, const char *name, const char *manager_type)
static struct ast_cli_entry cli_reload_xmldocs
static char * xmldoc_string_wrap(const char *text, int columns)
static const int xmldoc_text_columns
Number of columns to print when showing the XML documentation with a 'core show application/function ...
char * ast_xmldoc_build_seealso(const char *type, const char *name, const char *module)
Parse the <see-also> node content.
static char * xmldoc_build_field(const char *type, const char *name, const char *module, const char *var, int raw)
static int xmldoc_has_inside(struct ast_xml_node *fixnode, const char *what)
static void build_config_docs(struct ast_xml_node *cur, struct ast_xml_doc_item_list *root)
static char * _ast_xmldoc_build_since(struct ast_xml_node *node)
static char * xmldoc_get_syntax_fun(struct ast_xml_node *rootnode, const char *rootname, const char *childname, int printparenthesis, int printrootname)
#define GOTONEXT(__rev, __a)
static int xmldoc_parse_common_elements(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)
static void xmldoc_unload_documentation(void)
Close and unload XML documentation.
char * ast_xmldoc_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.
static char * _ast_xmldoc_build_seealso(struct ast_xml_node *node)
static struct strsyntaxtype stxtype[]
static char * _ast_xmldoc_build_arguments(struct ast_xml_node *node)
static int xmldoc_parse_para(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)
static int xmldoc_attribute_match(struct ast_xml_node *node, const char *attr, const char *value)
static int xmldoc_parse_enumlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
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...
int ast_xmldoc_regenerate_doc_item(struct ast_xml_doc_item *item)
Regenerate the documentation for a particular item.
static struct ast_xml_node * xmldoc_get_node(const char *type, const char *name, const char *module, const char *language)
static char * _ast_xmldoc_build_synopsis(struct ast_xml_node *node)
#define ISLAST(__rev, __a)
static struct ast_xml_doc_item * xmldoc_build_final_response(struct ast_xml_node *manager_action)
static char * _ast_xmldoc_build_description(struct ast_xml_node *node)
Asterisk XML Documentation API.