Wed Jan 8 2020 09:49:51

Asterisk developer's documentation


xmldoc.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2008, Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
5  *
6  * See http://www.asterisk.org for more information about
7  * the Asterisk project. Please do not directly contact
8  * any of the maintainers of this project for assistance;
9  * the project provides a web site, mailing lists and IRC
10  * channels for your use.
11  *
12  * This program is free software, distributed under the terms of
13  * the GNU General Public License Version 2. See the LICENSE file
14  * at the top of the source tree.
15  */
16 
17 #ifndef _ASTERISK_XMLDOC_H
18 #define _ASTERISK_XMLDOC_H
19 
20 /*! \file
21  * \brief Asterisk XML Documentation API
22  */
23 
24 #include "asterisk/xml.h"
25 
26 /*! \brief From where the documentation come from, this structure is useful for
27  * use it inside application/functions/manager actions structure. */
29  AST_XML_DOC, /*!< From XML documentation */
30  AST_STATIC_DOC /*!< From application/function registration */
31 };
32 
33 #ifdef AST_XML_DOCS
34 
35 /*!
36  * \brief Get the syntax for a specified application or function.
37  * \param type Application, Function or AGI ?
38  * \param name Name of the application or function.
39  * \param module The module the item is in (optional, can be NULL)
40  * \retval NULL on error.
41  * \retval The generated syntax in a ast_malloc'ed string.
42  */
43 char *ast_xmldoc_build_syntax(const char *type, const char *name, const char *module);
44 
45 /*!
46  * \brief Parse the <see-also> node content.
47  * \param type 'application', 'function' or 'agi'.
48  * \param name Application or functions name.
49  * \param module The module the item is in (optional, can be NULL)
50  * \retval NULL on error.
51  * \retval Content of the see-also node.
52  */
53 char *ast_xmldoc_build_seealso(const char *type, const char *name, const char *module);
54 
55 /*!
56  * \brief Generate the [arguments] tag based on type of node ('application',
57  * 'function' or 'agi') and name.
58  * \param type 'application', 'function' or 'agi' ?
59  * \param name Name of the application or function to build the 'arguments' tag.
60  * \param module The module the item is in (optional, can be NULL)
61  * \retval NULL on error.
62  * \retval Output buffer with the [arguments] tag content.
63  */
64 char *ast_xmldoc_build_arguments(const char *type, const char *name, const char *module);
65 
66 /*!
67  * \brief Colorize and put delimiters (instead of tags) to the xmldoc output.
68  * \param bwinput Not colorized input with tags.
69  * \param withcolors Result output with colors.
70  * \retval NULL on error.
71  * \retval New malloced buffer colorized and with delimiters.
72  */
73 char *ast_xmldoc_printable(const char *bwinput, int withcolors);
74 
75 /*!
76  * \brief Generate synopsis documentation from XML.
77  * \param type The source of documentation (application, function, etc).
78  * \param name The name of the application, function, etc.
79  * \param module The module the item is in (optional, can be NULL)
80  * \retval NULL on error.
81  * \retval A malloc'ed string with the synopsis.
82  */
83 char *ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module);
84 
85 /*!
86  * \brief Generate description documentation from XML.
87  * \param type The source of documentation (application, function, etc).
88  * \param name The name of the application, function, etc.
89  * \param module The module the item is in (optional, can be NULL)
90  * \retval NULL on error.
91  * \retval A malloc'ed string with the formatted description.
92  */
93 char *ast_xmldoc_build_description(const char *type, const char *name, const char *module);
94 
95 #endif /* AST_XML_DOCS */
96 
97 #endif /* _ASTERISK_XMLDOC_H */
char * ast_xmldoc_build_description(const char *type, const char *name, const char *module)
Generate description documentation from XML.
Definition: xmldoc.c:1899
char * ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module)
Generate synopsis documentation from XML.
Definition: xmldoc.c:1894
char * ast_xmldoc_build_arguments(const char *type, const char *name, const char *module)
Generate the [arguments] tag based on type of node (&#39;application&#39;, &#39;function&#39; or &#39;agi&#39;) and name...
Definition: xmldoc.c:1761
ast_doc_src
From where the documentation come from, this structure is useful for use it inside application/functi...
Definition: xmldoc.h:28
Asterisk XML abstraction layer.
static const char name[]
char * ast_xmldoc_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.
Definition: xmldoc.c:315
static const char type[]
Definition: chan_nbs.c:57
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:1156
char * ast_xmldoc_build_seealso(const char *type, const char *name, const char *module)
Parse the &lt;see-also&gt; node content.
Definition: xmldoc.c:1461