Asterisk - The Open Source Telephony Project GIT-master-754dea3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
pbx_app.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2016, CFWare, LLC
5 *
6 * Corey Farrell <git@cfware.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*! \file
20 *
21 * \brief Custom function management routines.
22 *
23 * \author Corey Farrell <git@cfware.com>
24 */
25
26/*** MODULEINFO
27 <support_level>core</support_level>
28 ***/
29
30#include "asterisk.h"
31
32#include "asterisk/_private.h"
33#include "asterisk/cli.h"
35#include "asterisk/module.h"
36#include "asterisk/pbx.h"
38#include "asterisk/strings.h"
39#include "asterisk/term.h"
40#include "asterisk/utils.h"
41#include "asterisk/xmldoc.h"
42#include "pbx_private.h"
43
44/*! \brief ast_app: A registered application */
45struct ast_app {
46 int (*execute)(struct ast_channel *chan, const char *data);
48 AST_STRING_FIELD(synopsis); /*!< Synopsis text for 'show applications' */
49 AST_STRING_FIELD(since); /*!< Since text for 'show applications' */
50 AST_STRING_FIELD(description); /*!< Description (help text) for 'show application &lt;name&gt;' */
51 AST_STRING_FIELD(syntax); /*!< Syntax text for 'core show applications' */
52 AST_STRING_FIELD(arguments); /*!< Arguments description */
53 AST_STRING_FIELD(seealso); /*!< See also */
54 );
55#ifdef AST_XML_DOCS
56 enum ast_doc_src docsrc; /*!< Where the documentation come from. */
57#endif
58 AST_RWLIST_ENTRY(ast_app) list; /*!< Next app in list */
59 struct ast_module *module; /*!< Module this app belongs to */
60 char name[0]; /*!< Name of the application */
61};
62
63/*!
64 * \brief Registered applications container.
65 *
66 * It is sorted by application name.
67 */
69
70static struct ast_app *pbx_findapp_nolock(const char *name)
71{
72 struct ast_app *cur;
73 int cmp;
74
75 AST_RWLIST_TRAVERSE(&apps, cur, list) {
76 cmp = strcasecmp(name, cur->name);
77 if (cmp > 0) {
78 continue;
79 }
80 if (!cmp) {
81 /* Found it. */
82 break;
83 }
84 /* Not in container. */
85 cur = NULL;
86 break;
87 }
88
89 return cur;
90}
91
92struct ast_app *pbx_findapp(const char *app)
93{
94 struct ast_app *ret;
95
99
100 return ret;
101}
102
103/*! \brief Dynamically register a new dial plan application */
104int ast_register_application2(const char *app, int (*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
105{
106 struct ast_app *tmp;
107 struct ast_app *cur;
108 int length;
109#ifdef AST_XML_DOCS
110 char *tmpxml;
111#endif
112
114 cur = pbx_findapp_nolock(app);
115 if (cur) {
116 ast_log(LOG_WARNING, "Already have an application '%s'\n", app);
118 return -1;
119 }
120
121 length = sizeof(*tmp) + strlen(app) + 1;
122
123 if (!(tmp = ast_calloc(1, length))) {
125 return -1;
126 }
127
128 if (ast_string_field_init(tmp, 128)) {
130 ast_free(tmp);
131 return -1;
132 }
133
134 strcpy(tmp->name, app);
135 tmp->execute = execute;
136 tmp->module = mod;
137
138#ifdef AST_XML_DOCS
139 /* Try to lookup the docs in our XML documentation database */
141 /* load synopsis */
142 tmpxml = ast_xmldoc_build_synopsis("application", app, ast_module_name(tmp->module));
143 ast_string_field_set(tmp, synopsis, tmpxml);
144 ast_free(tmpxml);
145
146 /* load since */
147 tmpxml = ast_xmldoc_build_since("application", app, ast_module_name(tmp->module));
148 ast_string_field_set(tmp, since, tmpxml);
149 ast_free(tmpxml);
150
151 /* load description */
152 tmpxml = ast_xmldoc_build_description("application", app, ast_module_name(tmp->module));
153 ast_string_field_set(tmp, description, tmpxml);
154 ast_free(tmpxml);
155
156 /* load syntax */
157 tmpxml = ast_xmldoc_build_syntax("application", app, ast_module_name(tmp->module));
158 ast_string_field_set(tmp, syntax, tmpxml);
159 ast_free(tmpxml);
160
161 /* load arguments */
162 tmpxml = ast_xmldoc_build_arguments("application", app, ast_module_name(tmp->module));
163 ast_string_field_set(tmp, arguments, tmpxml);
164 ast_free(tmpxml);
165
166 /* load seealso */
167 tmpxml = ast_xmldoc_build_seealso("application", app, ast_module_name(tmp->module));
168 ast_string_field_set(tmp, seealso, tmpxml);
169 ast_free(tmpxml);
170 tmp->docsrc = AST_XML_DOC;
171 } else {
172#endif
175#ifdef AST_XML_DOCS
176 tmp->docsrc = AST_STATIC_DOC;
177 }
178#endif
179
180 /* Store in alphabetical order */
182 if (strcasecmp(tmp->name, cur->name) < 0) {
184 break;
185 }
186 }
188 if (!cur)
189 AST_RWLIST_INSERT_TAIL(&apps, tmp, list);
190
191 ast_verb(5, "Registered application '" COLORIZE_FMT "'\n", COLORIZE(COLOR_BRCYAN, 0, tmp->name));
192
194
195 return 0;
196}
197
198static void print_app_docs(struct ast_app *aa, int fd)
199{
201
202#ifdef AST_XML_DOCS
203 if (aa->docsrc == AST_XML_DOC) {
204 synopsis = ast_xmldoc_printable(S_OR(aa->synopsis, "Not available"), 1);
205 since = ast_xmldoc_printable(S_OR(aa->since, "Not available"), 1);
206 description = ast_xmldoc_printable(S_OR(aa->description, "Not available"), 1);
207 syntax = ast_xmldoc_printable(S_OR(aa->syntax, "Not available"), 1);
208 arguments = ast_xmldoc_printable(S_OR(aa->arguments, "Not available"), 1);
209 seealso = ast_xmldoc_printable(S_OR(aa->seealso, "Not available"), 1);
210 } else
211#endif
212 {
213 synopsis = ast_strdup(S_OR(aa->synopsis, "Not Available"));
214 since = ast_strdup(S_OR(aa->since, "Not Available"));
215 description = ast_strdup(S_OR(aa->description, "Not Available"));
216 syntax = ast_strdup(S_OR(aa->syntax, "Not Available"));
217 arguments = ast_strdup(S_OR(aa->arguments, "Not Available"));
218 seealso = ast_strdup(S_OR(aa->seealso, "Not Available"));
219 }
220 /* check allocated memory. */
221 if (!synopsis || !since || !description || !syntax || !arguments || !seealso) {
222 goto free_docs;
223 }
224
225 ast_cli(fd, "\n"
226 "%s -= Info about Application '%s' =- %s\n\n"
227 COLORIZE_FMT "\n"
228 "%s\n\n"
229 COLORIZE_FMT "\n"
230 "%s\n\n"
231 COLORIZE_FMT "\n"
232 "%s\n\n"
233 COLORIZE_FMT "\n"
234 "%s\n\n"
235 COLORIZE_FMT "\n"
236 "%s\n\n"
237 COLORIZE_FMT "\n"
238 "%s\n\n",
240 COLORIZE(COLOR_MAGENTA, 0, "[Synopsis]"), synopsis,
241 COLORIZE(COLOR_MAGENTA, 0, "[Since]"), since,
242 COLORIZE(COLOR_MAGENTA, 0, "[Description]"), description,
243 COLORIZE(COLOR_MAGENTA, 0, "[Syntax]"), syntax,
244 COLORIZE(COLOR_MAGENTA, 0, "[Arguments]"), arguments,
245 COLORIZE(COLOR_MAGENTA, 0, "[See Also]"), seealso
246 );
247
248free_docs:
255}
256
257/*!
258 * \brief 'show application' CLI command implementation function...
259 */
260static char *handle_show_application(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
261{
262 struct ast_app *aa;
263 int app, no_registered_app = 1;
264
265 switch (cmd) {
266 case CLI_INIT:
267 e->command = "core show application";
268 e->usage =
269 "Usage: core show application <application> [<application> [<application> [...]]]\n"
270 " Describes a particular application.\n";
271 return NULL;
272 case CLI_GENERATE:
273 /*
274 * There is a possibility to show information about more than one
275 * application at one time. You can type 'show application Dial Echo' and
276 * you will see information about these two applications ...
277 */
278 return ast_complete_applications(a->line, a->word, -1);
279 }
280
281 if (a->argc < 4) {
282 return CLI_SHOWUSAGE;
283 }
284
286 AST_RWLIST_TRAVERSE(&apps, aa, list) {
287 /* Check for each app that was supplied as an argument */
288 for (app = 3; app < a->argc; app++) {
289 if (strcasecmp(aa->name, a->argv[app])) {
290 continue;
291 }
292
293 /* We found it! */
294 no_registered_app = 0;
295
296 print_app_docs(aa, a->fd);
297 }
298 }
300
301 /* we found at least one app? no? */
302 if (no_registered_app) {
303 ast_cli(a->fd, "Your application(s) is (are) not registered\n");
304 return CLI_FAILURE;
305 }
306
307 return CLI_SUCCESS;
308}
309
310static char *handle_show_applications(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
311{
312 struct ast_app *aa;
313 int like = 0, describing = 0;
314 int total_match = 0; /* Number of matches in like clause */
315 int total_apps = 0; /* Number of apps registered */
316
317 switch (cmd) {
318 case CLI_INIT:
319 e->command = "core show applications [like|describing]";
320 e->usage =
321 "Usage: core show applications [{like|describing} <text>]\n"
322 " List applications which are currently available.\n"
323 " If 'like', <text> will be a substring of the app name\n"
324 " If 'describing', <text> will be a substring of the description\n";
325 return NULL;
326 case CLI_GENERATE:
327 return NULL;
328 }
329
331
332 if (AST_RWLIST_EMPTY(&apps)) {
333 ast_cli(a->fd, "There are no registered applications\n");
335 return CLI_SUCCESS;
336 }
337
338 /* core list applications like <keyword> */
339 if ((a->argc == 5) && (!strcmp(a->argv[3], "like"))) {
340 like = 1;
341 } else if ((a->argc > 4) && (!strcmp(a->argv[3], "describing"))) {
342 describing = 1;
343 }
344
345 /* core list applications describing <keyword1> [<keyword2>] [...] */
346 if ((!like) && (!describing)) {
347 ast_cli(a->fd, " -= Registered Asterisk Applications =-\n");
348 } else {
349 ast_cli(a->fd, " -= Matching Asterisk Applications =-\n");
350 }
351
352 AST_RWLIST_TRAVERSE(&apps, aa, list) {
353 int printapp = 0;
354 total_apps++;
355 if (like) {
356 if (strcasestr(aa->name, a->argv[4])) {
357 printapp = 1;
358 total_match++;
359 }
360 } else if (describing) {
361 if (aa->description) {
362 /* Match all words on command line */
363 int i;
364 printapp = 1;
365 for (i = 4; i < a->argc; i++) {
366 if (!strcasestr(aa->description, a->argv[i])) {
367 printapp = 0;
368 } else {
369 total_match++;
370 }
371 }
372 }
373 } else {
374 printapp = 1;
375 }
376
377 if (printapp) {
378 ast_cli(a->fd," %20s: %s\n", aa->name, aa->synopsis ? aa->synopsis : "<Synopsis not available>");
379 }
380 }
381 if ((!like) && (!describing)) {
382 ast_cli(a->fd, " -= %d Applications Registered =-\n",total_apps);
383 } else {
384 ast_cli(a->fd, " -= %d Applications Matching =-\n",total_match);
385 }
386
388
389 return CLI_SUCCESS;
390}
391
393{
394 struct ast_app *cur;
395 int cmp;
396
397 /* Anticipate need for conlock in unreference_cached_app(), in order to avoid
398 * possible deadlock with pbx_extension_helper()/pbx_findapp()
399 */
401
404 cmp = strcasecmp(app, cur->name);
405 if (cmp > 0) {
406 continue;
407 }
408 if (!cmp) {
409 /* Found it. */
412 ast_verb(5, "Unregistered application '%s'\n", cur->name);
414 ast_free(cur);
415 break;
416 }
417 /* Not in container. */
418 cur = NULL;
419 break;
420 }
423
425
426 return cur ? 0 : -1;
427}
428
429char *ast_complete_applications(const char *line, const char *word, int state)
430{
431 struct ast_app *app;
432 int which = 0;
433 int cmp;
434 char *ret = NULL;
435 size_t wordlen = strlen(word);
436
438 AST_RWLIST_TRAVERSE(&apps, app, list) {
439 cmp = strncasecmp(word, app->name, wordlen);
440 if (cmp < 0) {
441 /* No more matches. */
442 break;
443 } else if (!cmp) {
444 /* Found match. */
445 if (state != -1) {
446 if (++which <= state) {
447 /* Not enough matches. */
448 continue;
449 }
450 ret = ast_strdup(app->name);
451 break;
452 }
454 break;
455 }
456 }
457 }
459
460 return ret;
461}
462
463const char *app_name(struct ast_app *app)
464{
465 return app->name;
466}
467
468/*!
469 \note This function is special. It saves the stack so that no matter
470 how many times it is called, it returns to the same place */
471int pbx_exec(struct ast_channel *c, /*!< Channel */
472 struct ast_app *app, /*!< Application */
473 const char *data) /*!< Data for execution */
474{
475 int res;
476 struct ast_module_user *u = NULL;
477 const char *saved_c_appl;
478 const char *saved_c_data;
479
480 /* save channel values */
481 saved_c_appl= ast_channel_appl(c);
482 saved_c_data= ast_channel_data(c);
483
485 ast_channel_appl_set(c, app->name);
486 ast_channel_data_set(c, data);
489
490 if (app->module)
491 u = __ast_module_user_add(app->module, c);
492 res = app->execute(c, S_OR(data, ""));
493 if (app->module && u)
494 __ast_module_user_remove(app->module, u);
495 /* restore channel values */
496 ast_channel_appl_set(c, saved_c_appl);
497 ast_channel_data_set(c, saved_c_data);
498 return res;
499}
500
501int ast_pbx_exec_application(struct ast_channel *chan, const char *app_name, const char *app_args)
502{
503 int res = -1;
504 struct ast_app *app;
505
507 if (!app) {
508 ast_log(LOG_WARNING, "Could not find application (%s)\n", app_name);
509 } else {
510 struct ast_str *substituted_args = NULL;
511
512 if (!ast_strlen_zero(app_args) && (substituted_args = ast_str_create(16))) {
513 ast_str_substitute_variables(&substituted_args, 0, chan, app_args);
514 res = pbx_exec(chan, app, ast_str_buffer(substituted_args));
515 ast_free(substituted_args);
516 } else {
517 if (!ast_strlen_zero(app_args)) {
518 ast_log(LOG_WARNING, "Could not substitute application argument variables for %s\n", app_name);
519 }
520 res = pbx_exec(chan, app, app_args);
521 }
522 /* Manually make a snapshot now, since pbx_exec won't necessarily get called again immediately. */
524 }
525 return res;
526}
527
528static struct ast_cli_entry app_cli[] = {
529 AST_CLI_DEFINE(handle_show_applications, "Shows registered dialplan applications"),
530 AST_CLI_DEFINE(handle_show_application, "Describe a specific dialplan application"),
531};
532
533static void unload_pbx_app(void)
534{
536}
537
539{
542
543 return 0;
544}
Prototypes for public functions only of internal interest,.
static const char app[]
Definition: app_adsiprog.c:56
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.
Definition: clicompat.c:19
#define ast_free(a)
Definition: astmm.h:180
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:241
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:202
#define ast_log
Definition: astobj2.c:42
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
const char * ast_channel_data(const struct ast_channel *chan)
#define ast_channel_lock(chan)
Definition: channel.h:2970
void ast_channel_data_set(struct ast_channel *chan, const char *value)
const char * ast_channel_appl(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
Definition: channel.h:2971
Standard Command Line Interface.
#define CLI_SHOWUSAGE
Definition: cli.h:45
#define CLI_SUCCESS
Definition: cli.h:44
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
#define AST_CLI_DEFINE(fn, txt,...)
Definition: cli.h:197
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
Definition: main/cli.c:2768
void ast_cli(int fd, const char *fmt,...)
Definition: clicompat.c:6
@ CLI_INIT
Definition: cli.h:152
@ CLI_GENERATE
Definition: cli.h:153
#define CLI_FAILURE
Definition: cli.h:46
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
short word
static const char name[]
Definition: format_mp3.c:68
static char * synopsis
Definition: func_enum.c:166
static SQLHSTMT execute(struct odbc_obj *obj, void *data, int silent)
Common execution function for SQL queries.
Definition: func_odbc.c:485
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
#define ast_verb(level,...)
#define LOG_WARNING
A set of macros to manage forward-linked lists.
#define AST_RWLIST_EMPTY
Definition: linkedlists.h:452
#define AST_RWLIST_REMOVE_CURRENT
Definition: linkedlists.h:570
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
Definition: linkedlists.h:78
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
Definition: linkedlists.h:545
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
Definition: linkedlists.h:52
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
Definition: linkedlists.h:151
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
Definition: linkedlists.h:333
#define AST_RWLIST_TRAVERSE_SAFE_END
Definition: linkedlists.h:617
#define AST_RWLIST_TRAVERSE
Definition: linkedlists.h:494
#define AST_RWLIST_INSERT_TAIL
Definition: linkedlists.h:741
#define AST_RWLIST_ENTRY
Definition: linkedlists.h:415
#define AST_RWLIST_INSERT_BEFORE_CURRENT
Definition: linkedlists.h:610
Asterisk module definitions.
struct ast_module_user * __ast_module_user_add(struct ast_module *, struct ast_channel *)
Definition: loader.c:809
const char * ast_module_name(const struct ast_module *mod)
Get the name of a module.
Definition: loader.c:624
void __ast_module_user_remove(struct ast_module *, struct ast_module_user *)
Definition: loader.c:835
void unreference_cached_app(struct ast_app *app)
Definition: pbx.c:6145
Core PBX routines and definitions.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
int ast_rdlock_contexts(void)
Read locks the context list.
Definition: pbx.c:8483
int ast_unlock_contexts(void)
Unlocks contexts.
Definition: pbx.c:8488
int ast_register_application2(const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
Dynamically register a new dial plan application.
Definition: pbx_app.c:104
const char * app_name(struct ast_app *app)
Definition: pbx_app.c:463
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
Definition: pbx_app.c:471
char * ast_complete_applications(const char *line, const char *word, int state)
Command completion for the list of installed applications.
Definition: pbx_app.c:429
int ast_pbx_exec_application(struct ast_channel *chan, const char *app_name, const char *app_args)
Execute an application.
Definition: pbx_app.c:501
static struct ast_cli_entry app_cli[]
Definition: pbx_app.c:528
static void unload_pbx_app(void)
Definition: pbx_app.c:533
static void print_app_docs(struct ast_app *aa, int fd)
Definition: pbx_app.c:198
static char * handle_show_application(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
'show application' CLI command implementation function...
Definition: pbx_app.c:260
int load_pbx_app(void)
Definition: pbx_app.c:538
int ast_unregister_application(const char *app)
Unregister an application.
Definition: pbx_app.c:392
struct ast_app * pbx_findapp(const char *app)
Look up an application.
Definition: pbx_app.c:92
static char * handle_show_applications(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
Definition: pbx_app.c:310
static struct ast_app * pbx_findapp_nolock(const char *name)
Definition: pbx_app.c:70
Private include file for pbx.
#define NULL
Definition: resample.c:96
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Definition: stringfields.h:341
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:303
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
Definition: stringfields.h:521
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
Definition: stringfields.h:359
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Definition: stringfields.h:374
String manipulation functions.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:761
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Definition: strings.h:659
Registered applications container.
Definition: pbx_app.c:68
ast_app: A registered application
Definition: pbx_app.c:45
const ast_string_field since
Definition: pbx_app.c:54
const ast_string_field description
Definition: pbx_app.c:54
const ast_string_field synopsis
Definition: pbx_app.c:54
enum ast_doc_src docsrc
Definition: pbx_app.c:56
const ast_string_field seealso
Definition: pbx_app.c:54
const ast_string_field syntax
Definition: pbx_app.c:54
const ast_string_field arguments
Definition: pbx_app.c:54
int(* execute)(struct ast_channel *chan, const char *data)
Definition: pbx_app.c:46
Main Channel structure associated with a channel.
const char * data
descriptor for a cli entry.
Definition: cli.h:171
char * command
Definition: cli.h:186
const char * usage
Definition: cli.h:177
struct ast_channel * chan
Definition: loader.c:137
Support for dynamic strings.
Definition: strings.h:623
Handy terminal functions for vt* terms.
#define COLOR_BRCYAN
Definition: term.h:63
const char * ast_term_reset(void)
Returns the terminal reset code.
Definition: term.c:357
#define COLOR_MAGENTA
Definition: term.h:60
const char * ast_term_color(int fgcolor, int bgcolor)
Return a color sequence string.
Definition: term.c:341
#define COLORIZE(fg, bg, str)
Definition: term.h:72
#define COLORIZE_FMT
Shortcut macros for coloring a set of text.
Definition: term.h:71
static struct test_val a
static struct test_val c
Utility functions.
#define ARRAY_LEN(a)
Definition: utils.h:666
Asterisk XML Documentation API.
char * ast_xmldoc_build_description(const char *type, const char *name, const char *module)
Generate description documentation from XML.
Definition: xmldoc.c:2356
char * ast_xmldoc_build_syntax(const char *type, const char *name, const char *module)
Get the syntax for a specified application or function.
Definition: xmldoc.c:1252
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.
Definition: xmldoc.c:2169
char * ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module)
Generate synopsis documentation from XML.
Definition: xmldoc.c:2333
char * ast_xmldoc_build_since(const char *type, const char *name, const char *module)
Parse the <since> node content.
Definition: xmldoc.c:1787
ast_doc_src
From where the documentation come from, this structure is useful for use it inside application/functi...
Definition: xmldoc.h:30
@ AST_XML_DOC
Definition: xmldoc.h:31
@ AST_STATIC_DOC
Definition: xmldoc.h:32
char * ast_xmldoc_build_seealso(const char *type, const char *name, const char *module)
Parse the <see-also> node content.
Definition: xmldoc.c:1702
char * ast_xmldoc_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.
Definition: xmldoc.c:241