56 struct ast_xml_doc *
doc;
84 {
"<",
">",
COLOR_GREEN,
"<replaceable>",
"</replaceable>" },
85 {
"\'",
"\'",
COLOR_BLUE,
"<literal>",
"</literal>" },
86 {
"*",
"*",
COLOR_RED,
"<emphasis>",
"</emphasis>" },
87 {
"\"",
"\"",
COLOR_YELLOW,
"<filename>",
"</filename>" },
88 {
"\"",
"\"",
COLOR_CYAN,
"<directory>",
"</directory>" },
89 {
"${",
"}",
COLOR_GREEN,
"<variable>",
"</variable>" },
92 {
"\'",
"\'",
COLOR_GRAY,
"<astcli>",
"</astcli>" },
96 {
"",
"",
COLOR_RED,
"<warning>",
"</warning>" },
98 {
"",
"",
COLOR_GRAY,
"<exampletext>",
"</exampletext>"},
106 {
"note",
"<note>NOTE:</note> ",
"" },
107 {
"warning",
"<warning>WARNING!!!:</warning> ",
"" },
108 {
"example",
"<example>Example:</example> ",
"" },
122 int postbrreallen = 0, i;
128 postbrlen = strlen(postbr);
129 for (i = 0; i < postbrlen; i++) {
130 if (postbr[i] ==
'\t') {
131 postbrreallen += 8 - (postbrreallen % 8);
136 return postbrreallen;
150 int c, postbrlen = 0;
156 for (c = 0; c <
len; c++) {
157 if (text[c] ==
'\t' || text[c] ==
' ') {
158 postbr[postbrlen++] = text[
c];
163 postbr[postbrlen] =
'\0';
179 char *ret, postbr[160];
180 int count, i, textlen, postbrlen, lastbreak;
183 if (!text || columns <= 0) {
201 textlen = strlen(text);
202 for (i = 0; i < textlen; i++) {
203 if (text[i] ==
'\n') {
208 }
else if (text[i] ==
ESC) {
213 }
while (i < textlen && text[i] !=
'm');
215 if (text[i] ==
' ') {
221 if (count > columns) {
223 int back = i - lastbreak;
224 if (lastbreak && back > 0 && back < 30) {
245 char *wrapped =
NULL;
246 int i,
c,
len, colorsection;
255 bwinputlen = strlen(bwinput);
268 for (i = 0; i < bwinputlen; i++) {
371 textlen = strlen(text);
379 for (i = 0; i < textlen; i++) {
380 if (text[i] ==
'\n' || text[i] ==
'\r') {
381 if (maintain_newlines) {
385 while (text[i + 1] ==
'\t' || text[i + 1] ==
'\r' || text[i + 1] ==
'\n') {
415 int match = attr_value && !strcmp(attr_value, value);
437 struct ast_xml_node *first_match =
NULL;
438 struct ast_xml_node *lang_match =
NULL;
532 tmpfmtlen = strlen(tmpfmt);
533 totlen = *len + tmpfmtlen + 1;
540 *syntax = new_syntax;
543 memmove(*syntax + tmpfmtlen, *syntax, *len);
546 strcpy(*syntax, tmpfmt);
548 (*syntax)[tmpfmtlen] =
tmp;
549 (*syntax)[totlen - 1] =
'\0';
551 strcpy(*syntax + *len, tmpfmt);
570 struct ast_xml_node *
node = fixnode;
591 struct ast_xml_node *
node = fixnode;
612 struct ast_xml_node *
node = fixnode;
638 static char *
xmldoc_get_syntax_fun(
struct ast_xml_node *rootnode,
const char *rootname,
const char *childname,
int printparenthesis,
int printrootname)
640 #define GOTONEXT(__rev, __a) (__rev ? ast_xml_node_get_prev(__a) : ast_xml_node_get_next(__a)) 641 #define ISLAST(__rev, __a) (__rev == 1 ? (ast_xml_node_get_prev(__a) ? 0 : 1) : (ast_xml_node_get_next(__a) ? 0 : 1)) 642 #define MP(__a) ((multiple ? __a : "")) 644 const char *paramtype, *multipletype, *paramnameattr, *attrargsep, *parenthesis, *argname;
645 int reverse, required, paramcount = 0, openbrackets = 0,
len = 0, hasparams=0;
646 int reqfinode = 0, reqlanode = 0, optmidnode = 0, prnparenthesis, multiple;
647 char *syntax =
NULL, *argsep, *paramname;
650 ast_log(
LOG_WARNING,
"Tried to look in XML tree with faulty rootname or childname while creating a syntax.\n");
656 if (
ast_asprintf(&syntax,
"%s%s", (printrootname ? rootname :
""), (printparenthesis ?
"()" :
"")) < 0) {
687 reqlanode = required;
692 reqfinode = required;
698 if (
ast_asprintf(&syntax,
"%s%s", (printrootname ? rootname :
""), (printparenthesis ?
"()" :
"")) < 0) {
704 if (reqfinode && reqlanode) {
710 if (node != firstparam && node != lastparam) {
723 if ((!reqfinode && reqlanode) || (reqfinode && reqlanode && optmidnode)) {
734 (printrootname ? (printrootname == 2 ?
")]" :
")"):
""));
737 (printrootname ? (printrootname == 2 ?
"[(" :
"(") :
""));
740 for (; node; node =
GOTONEXT(reverse, node)) {
750 prnparenthesis =
ast_true(parenthesis);
751 if (!strcasecmp(parenthesis,
"optional")) {
766 if (!paramnameattr) {
773 if (
ast_asprintf(&syntax,
"%s%s", (printrootname ? rootname :
""), (printparenthesis ?
"()" :
"")) < 0) {
811 while (openbrackets > 0) {
827 if (
ISLAST(reverse, node)) {
831 MP(
"["),
MP(argsep),
MP(
"...]"), argsep);
834 MP(
"["),
MP(argsep),
MP(
"...]"));
839 MP(
"["),
MP(argsep),
MP(
"...]"));
842 MP(
"["),
MP(argsep),
MP(
"...]"));
854 while (openbrackets > 0) {
862 (printrootname ? (printrootname == 2 ?
"[(" :
"(") :
""));
884 struct ast_xml_node *
node = fixnode;
886 char *enumname, *ret;
935 struct ast_xml_node *tmpnode, *
node = fixnode;
936 char *ret, *paramname;
937 const char *paramtype, *attrname, *literal;
938 int required, isenum,
first = 1, isliteral;
1011 (required ?
"" :
"["),
1012 (isenum || isliteral ?
"" :
"<"),
1014 (isenum || isliteral ?
"" :
">"),
1015 (required ?
"" :
"]"));
1041 struct ast_xml_node *
node = fixnode;
1042 const char *paramtype, *attrname;
1063 required = !strcasecmp(manager_type,
"event") ? 1 : 0;
1077 (required ?
"" :
"["),
1079 (required ?
"" :
"]"));
1092 struct ast_xml_node *matchinfo, *
tmp;
1094 const char *attr_value;
1098 if (!syntax || !fixnode) {
1111 ast_str_set(&syntax, 0,
"category %s /%s/", match ?
"=~" :
"!~", text);
1119 ast_str_append(&syntax, 0,
" matchfield: %s = %s",
S_OR(attr_value,
"Unknown"), text);
1129 const char *default_value;
1133 if (!syntax || !fixnode) {
1140 ast_str_set(&syntax, 0,
"%s = [%s] (Default: %s) (Regex: %s)\n",
1143 default_value ?:
"n/a",
1193 if (!strcasecmp(
stxtype[i].type, type)) {
1218 char *syntax =
NULL;
1219 struct ast_xml_node *
node = root_node;
1255 struct ast_xml_node *
node;
1305 const char *tmptext;
1306 struct ast_xml_node *
tmp;
1360 struct ast_xml_node *
node = fixnode;
1361 const char *tmptext;
1363 struct ast_str *stripped_text;
1387 if (stripped_text) {
1413 struct ast_xml_node *
node = fixnode;
1472 struct ast_xml_node *
node = fixnode;
1473 const char *argname;
1474 int count = 0, ret = 0;
1486 ast_str_append(buffer, 0,
"%s%s%s", tabs, argname, (insideparameter ?
"\n" :
""));
1519 struct ast_xml_node *
tmp;
1520 const char *valname;
1521 const char *tmptext;
1523 int ret = 0, printedpara=0;
1580 struct ast_xml_node *
tmp;
1581 const char *varname;
1608 ast_str_append(buffer, 0,
"%s<variable>%s</variable>: ", tabs, varname);
1640 const char *
typename;
1641 const char *content;
1678 if (!strcasecmp(
typename,
"application")) {
1679 ast_str_append(&outputstr, 0,
"%s%s()", (first ?
"" :
", "), content);
1680 }
else if (!strcasecmp(
typename,
"function")) {
1681 ast_str_append(&outputstr, 0,
"%s%s", (first ?
"" :
", "), content);
1682 }
else if (!strcasecmp(
typename,
"astcli")) {
1683 ast_str_append(&outputstr, 0,
"%s<astcli>%s</astcli>", (first ?
"" :
", "), content);
1685 ast_str_append(&outputstr, 0,
"%s%s", (first ?
"" :
", "), content);
1701 struct ast_xml_node *
node;
1730 struct ast_xml_node *
node = fixnode;
1764 struct ast_xml_node *
node = fixnode;
1765 const char *enumname;
1803 struct ast_xml_node *
node;
1847 struct ast_xml_node *
node;
1848 const char *optname, *hasparams;
1866 if (hasparams && !strcasecmp(hasparams,
"optional")) {
1871 if (!optionsyntax) {
1900 const char *paramname;
1901 struct ast_xml_node *
node = fixnode;
1902 int hasarguments, printed = 0;
1993 if (!internaltabs) {
1999 ast_str_append(buffer, 0,
"%s<note>Technology: %s</note>\n", internaltabs, tech);
2011 if (internal_ret > ret) {
2037 char *retstr =
NULL;
2077 struct ast_xml_node *
node;
2105 struct ast_xml_node *
tmp;
2106 const char *notcleanret, *tmpstr;
2112 tmpstr = notcleanret;
2192 struct ast_xml_node *
node;
2306 goto ast_xml_doc_item_failure;
2311 goto ast_xml_doc_item_failure;
2318 ast_xml_doc_item_failure:
2421 struct ast_xml_node *
event;
2422 struct ast_xml_node *responses;
2423 struct ast_xml_node *list_elements;
2434 if (!list_elements) {
2440 struct ast_xml_node *event_instance;
2450 "managerEventInstance",
NULL,
NULL);
2465 struct ast_xml_node *
node;
2496 struct ast_xml_node *responses;
2497 struct ast_xml_node *final_response_event;
2498 struct ast_xml_node *event_instance;
2508 if (!final_response_event) {
2513 "managerEventInstance",
NULL,
NULL);
2514 if (!event_instance) {
2530 struct ast_xml_node *
node;
2547 struct ast_xml_xpath_results *results =
NULL;
2578 struct ast_xml_node *iter;
2582 const char *iter_name;
2613 if (!item || !item->
node) {
2732 ao2_t_ref(item, -1,
"Dispose of creation ref");
2744 #if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 2745 static int xml_pathmatch(
char *xmlpattern,
int xmlpattern_maxlen, glob_t *globbuf)
2749 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/thirdparty/*-%s.xml",
2751 if((globret = glob(xmlpattern, GLOB_NOCHECK,
NULL, globbuf))) {
2755 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/thirdparty/*-%.2s_??.xml",
2757 if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK,
NULL, globbuf))) {
2761 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/thirdparty/*-%s.xml",
2763 if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK,
NULL, globbuf))) {
2767 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/*-%s.xml",
2769 if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK,
NULL, globbuf))) {
2773 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/*-%.2s_??.xml",
2775 if((globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK,
NULL, globbuf))) {
2779 snprintf(xmlpattern, xmlpattern_maxlen,
"%s/documentation/*-%s.xml",
2781 globret = glob(xmlpattern, GLOB_APPEND | GLOB_NOCHECK,
NULL, globbuf);
2790 struct ast_xml_doc *dumpdoc;
2791 struct ast_xml_node *dumproot;
2798 "Usage: xmldoc dump <filename>\n" 2799 " Dump XML documentation to a file\n";
2828 struct ast_xml_node *kids_copy;
2846 if (!(f = fopen(a->
argv[2],
"w"))) {
2881 struct ast_xml_node *root_node;
2882 struct ast_xml_doc *tmpdoc;
2888 int globret, i, dup, duplicate;
2890 #if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 2891 int xmlpattern_maxlen;
2899 if (!strcasecmp(var->
name,
"documentation_language")) {
2915 globbuf.gl_offs = 0;
2917 #if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU) 2918 xmlpattern_maxlen = strlen(
ast_config_AST_DATA_DIR) + strlen(
"/documentation/thirdparty") + strlen(
"/*-??_??.xml") + 1;
2920 globret = xml_pathmatch(xmlpattern, xmlpattern_maxlen, &globbuf);
2930 ast_debug(3,
"gl_pathc %zu\n", (
size_t)globbuf.gl_pathc);
2931 if (globret == GLOB_NOSPACE) {
2932 ast_log(
LOG_WARNING,
"XML load failure, glob expansion of pattern '%s' failed: Not enough memory\n", xmlpattern);
2936 ast_log(
LOG_WARNING,
"XML load failure, glob expansion of pattern '%s' failed: Read error\n", xmlpattern);
2944 for (i = 0; i < globbuf.gl_pathc; i++) {
2947 for (dup = 0; dup < i; dup++) {
2948 if (!strcmp(globbuf.gl_pathv[i], globbuf.gl_pathv[dup])) {
2953 if (duplicate || strchr(globbuf.gl_pathv[i],
'*')) {
2961 ast_log(
LOG_ERROR,
"Could not open XML documentation at '%s'\n", globbuf.gl_pathv[i]);
2983 doc_tree->
doc = tmpdoc;
#define ao2_t_ref(o, delta, tag)
Reference/unreference an object and return the old refcount.
static int ast_xml_doc_item_cmp(void *obj, void *arg, int flags)
static const char synopsis[]
struct ast_variable * next
static int xmldoc_parse_example(struct ast_xml_node *fixnode, struct ast_str **buffer)
#define AST_CLI_DEFINE(fn, txt,...)
static int xmldoc_parse_option(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)
Asterisk main include file. File version handling, generic pbx functions.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
static char * _ast_xmldoc_build_synopsis(struct ast_xml_node *node)
#define ast_realloc(p, len)
A wrapper for realloc()
static void ast_xml_doc_item_destructor(void *obj)
int ast_xml_init(void)
Initialize the XML library implementation. This function is used to setup everything needed to start ...
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
static int xmldoc_parse_info(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)
static int ast_xml_doc_item_hash(const void *obj, const int flags)
static char * xmldoc_build_field(const char *type, const char *name, const char *module, const char *var, int raw)
struct ast_xml_doc_item * next
static void xmldoc_parse_optionlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
struct ast_xml_xpath_results * ast_xmldoc_query(const char *fmt,...)
Execute an XPath query on the loaded XML documentation.
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...
const ast_string_field ref
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
static int xmldoc_attribute_match(struct ast_xml_node *node, const char *attr, const char *value)
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
descriptor for a cli entry.
static const struct strcolorized_tags colorized_tags[]
static struct ast_cli_entry cli_dump_xmldocs
struct ast_xml_node * node
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define CONFIG_STATUS_FILEINVALID
struct ast_xml_doc * ast_xml_open(char *filename)
Open an XML document.
struct ast_xml_doc * ast_xml_new(void)
Create a XML document.
static char * xmldoc_get_syntax_config_option(struct ast_xml_node *fixnode, const char *name)
static struct ast_xml_doc_item * xmldoc_build_documentation_item(struct ast_xml_node *node, const char *name, const char *type)
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
static struct ast_str * xmldoc_get_formatted(struct ast_xml_node *node, int raw_output, int raw_wrap)
Mapping between type of node and type of syntax to generate.
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
Structure for variables, used for configurations and for channel variables.
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.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
int ast_term_color_code(struct ast_str **str, int fgcolor, int bgcolor)
Append a color sequence to an ast_str.
int ast_xmldoc_regenerate_doc_item(struct ast_xml_doc_item *item)
Regenerate the documentation for a particular item.
static void xmldoc_reverse_helper(int reverse, int *len, char **syntax, const char *fmt,...)
static char * xmldoc_get_syntax_cmd(struct ast_xml_node *fixnode, const char *name, int printname)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static int xmldoc_parse_enum(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
static struct aco_type item
int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc)
Dump the specified document to a file.
#define ao2_alloc_options(data_size, destructor_fn, options)
static int match(struct ast_sockaddr *addr, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur, int check_dcallno)
#define ast_vasprintf(ret, fmt, ap)
A wrapper for vasprintf()
#define ast_strdup(str)
A wrapper for strdup()
struct ast_xml_node * ast_xml_get_root(struct ast_xml_doc *doc)
Get the document root node.
char * ast_xmldoc_build_seealso(const char *type, const char *name, const char *module)
Parse the <see-also> node content.
static void build_config_docs(struct ast_xml_node *cur, struct ast_xml_doc_item_list *root)
static int xmldoc_parse_common_elements(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)
char * ast_xmldoc_build_syntax(const char *type, const char *name, const char *module)
Get the syntax for a specified application or function.
static struct ast_xml_doc_item * xmldoc_build_final_response(struct ast_xml_node *manager_action)
static char * handle_dump_docs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
int ast_xmldoc_load_documentation(void)
Load XML documentation. Provided by xmldoc.c.
The struct to be used as the head of an ast_xml_doc_item list when being manipulated.
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
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...
#define ast_strlen_zero(foo)
static int xmldoc_has_specialtags(struct ast_xml_node *fixnode)
char * ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module)
Generate synopsis documentation from XML.
#define ast_cli_register(e)
Registers a command or an array of commands.
static void xmldoc_string_cleanup(const char *text, struct ast_str **output, int lastspaces, int maintain_newlines)
static struct strsyntaxtype stxtype[]
static int xmldoc_has_nodes(struct ast_xml_node *fixnode)
const char * ast_xml_get_attribute(struct ast_xml_node *node, const char *attrname)
Get a node attribute by name.
void ast_xml_free_attr(const char *attribute)
Free an attribute returned by ast_xml_get_attribute()
syntaxtype
Types of syntax that we are able to generate.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Configuration File Parser.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define ast_debug(level,...)
Log a DEBUG message.
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.
static char * _xmldoc_build_field(struct ast_xml_node *node, const char *var, int raw)
const ast_string_field type
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...
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Asterisk file paths, configured in asterisk.conf.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
static const char default_documentation_language[]
Default documentation language.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ISLAST(__rev, __a)
static char * xmldoc_get_syntax_manager(struct ast_xml_node *fixnode, const char *name, const char *manager_type)
static char * _ast_xmldoc_build_syntax(struct ast_xml_node *root_node, const char *type, const char *name)
static char * _ast_xmldoc_build_description(struct ast_xml_node *node)
#define ao2_ref(o, delta)
void ast_config_destroy(struct ast_config *config)
Destroys a config.
#define ast_strdupa(s)
duplicate a string in memory from the stack
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.
A set of macros to manage forward-linked lists.
static char language[MAX_LANGUAGE]
#define ast_malloc(len)
A wrapper for malloc()
struct ast_xml_node * ast_xml_new_node(const char *name)
Create a XML node.
char * ast_xmldoc_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.
static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *tabs, const char *posttabs, struct ast_str **buffer)
struct ast_str * description
static char documentation_language[6]
XML documentation language.
const char * ast_config_AST_DATA_DIR
static const struct strspecial_tags special_tags[]
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
static void xmldoc_parse_parameter(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
static int xmldoc_parse_enumlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer)
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.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static enum syntaxtype xmldoc_get_syntax_type(const char *type)
static const int xmldoc_text_columns
Number of columns to print when showing the XML documentation with a 'core show application/function ...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static struct ast_xml_doc_item * xmldoc_build_list_responses(struct ast_xml_node *manager_action)
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
struct sla_ringing_trunk * first
void ast_xml_set_root(struct ast_xml_doc *doc, struct ast_xml_node *node)
Specify the root node of a XML document.
char * strcasestr(const char *, const char *)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
const ast_string_field name
static void xmldoc_unload_documentation(void)
Close and unload XML documentation.
static int xmldoc_parse_argument(struct ast_xml_node *fixnode, int insideparameter, const char *paramtabs, const char *tabs, struct ast_str **buffer)
#define AST_LIST_HEAD_INIT(head)
Initializes a list head structure.
#define ast_calloc(num, len)
A wrapper for calloc()
static int regex(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
const char * ast_term_reset(void)
Returns the terminal reset code.
#define GOTONEXT(__rev, __a)
struct ast_xml_node * ast_xml_copy_node_list(struct ast_xml_node *list)
Create a copy of a n ode list.
static char * xmldoc_parse_cmd_enumlist(struct ast_xml_node *fixnode)
static int xmldoc_has_inside(struct ast_xml_node *fixnode, const char *what)
Asterisk XML Documentation API.
#define AST_RWLIST_REMOVE_HEAD
Prototypes for public functions only of internal interest,.
#define ast_opt_light_background
void ast_xml_close(struct ast_xml_doc *doc)
Close an already open document and free the used structure.
Structure used to handle boolean flags.
static char * _ast_xmldoc_build_seealso(struct ast_xml_node *node)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define AST_RWLIST_INSERT_TAIL
static void xmldoc_setpostbr(char *postbr, size_t len, const char *text)
Standard Command Line Interface.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
const char * ast_xml_get_text(struct ast_xml_node *node)
Get an element content string.
static char * xmldoc_get_syntax_config_object(struct ast_xml_node *fixnode, const char *name)
static char * _ast_xmldoc_build_arguments(struct ast_xml_node *node)
Handy terminal functions for vt* terms.
Struct that contains the XML documentation for a particular item. Note that this is an ao2 ref counte...
static int xmldoc_parse_para(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer)
Container of documentation trees.
struct ast_str * arguments
void ast_str_trim_blanks(struct ast_str *buf)
Trims trailing whitespace characters from an ast_str string.
struct ast_xml_node * ast_xml_node_get_next(struct ast_xml_node *node)
Get the next node in the same level.
static struct ast_xml_node * xmldoc_get_node(const char *type, const char *name, const char *module, const char *language)
static snd_pcm_format_t format
int ast_xml_finish(void)
Cleanup library allocated global data.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
static int xmldoc_parse_variablelist(struct ast_xml_node *node, const char *tabs, struct ast_str **buffer)
static int xmldoc_parse_variable(struct ast_xml_node *node, const char *tabs, struct ast_str **buffer)
char * ast_xmldoc_build_description(const char *type, const char *name, const char *module)
Generate description documentation from XML.
static char * xmldoc_string_wrap(const char *text, int columns)
struct ast_xml_node * ast_xml_node_get_children(struct ast_xml_node *node)
Get the node's children.
const char * ast_xml_node_get_name(struct ast_xml_node *node)
Get the name of a node.
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
void ast_xml_free_text(const char *text)
Free a content element that was returned by ast_xml_get_text()
struct ao2_container * ast_xmldoc_build_documentation(const char *type)
Build the documentation for a particular source type.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
struct ast_str * synopsis
static char * xmldoc_get_syntax_fun(struct ast_xml_node *rootnode, const char *rootname, const char *childname, int printparenthesis, int printrootname)
static int xmldoc_postbrlen(const char *postbr)
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ao2_link(container, obj)