Thu Apr 28 2011 16:56:49

Asterisk developer's documentation


xmldoc.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2008, Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
00005  *
00006  * See http://www.asterisk.org for more information about
00007  * the Asterisk project. Please do not directly contact
00008  * any of the maintainers of this project for assistance;
00009  * the project provides a web site, mailing lists and IRC
00010  * channels for your use.
00011  *
00012  * This program is free software, distributed under the terms of
00013  * the GNU General Public License Version 2. See the LICENSE file
00014  * at the top of the source tree.
00015  */
00016 
00017 #ifndef _ASTERISK_XMLDOC_H
00018 #define _ASTERISK_XMLDOC_H
00019 
00020 /*! \file
00021  *  \brief Asterisk XML Documentation API
00022  */
00023 
00024 #include "asterisk/xml.h"
00025 
00026 #ifdef AST_XML_DOCS
00027 
00028 /*!
00029  *  \brief Get the syntax for a specified application or function.
00030  *  \param type Application, Function or AGI ?
00031  *  \param name Name of the application or function.
00032  *  \retval NULL on error.
00033  *  \retval The generated syntax in a ast_malloc'ed string.
00034  */
00035 char *ast_xmldoc_build_syntax(const char *type, const char *name);
00036 
00037 /*!
00038  *  \brief Parse the <see-also> node content.
00039  *  \param type 'application', 'function' or 'agi'.
00040  *  \param name Application or functions name.
00041  *  \retval NULL on error.
00042  *  \retval Content of the see-also node.
00043  */
00044 char *ast_xmldoc_build_seealso(const char *type, const char *name);
00045 
00046 /*!
00047  *  \brief Generate the [arguments] tag based on type of node ('application',
00048  *         'function' or 'agi') and name.
00049  *  \param type 'application', 'function' or 'agi' ?
00050  *  \param name Name of the application or function to build the 'arguments' tag.
00051  *  \retval NULL on error.
00052  *  \retval Output buffer with the [arguments] tag content.
00053  */
00054 char *ast_xmldoc_build_arguments(const char *type, const char *name);
00055 
00056 /*!
00057  *  \brief Colorize and put delimiters (instead of tags) to the xmldoc output.
00058  *  \param bwinput Not colorized input with tags.
00059  *  \param withcolors Result output with colors.
00060  *  \retval NULL on error.
00061  *  \retval New malloced buffer colorized and with delimiters.
00062  */
00063 char *ast_xmldoc_printable(const char *bwinput, int withcolors);
00064 
00065 /*!
00066  *  \brief Generate synopsis documentation from XML.
00067  *  \param type The source of documentation (application, function, etc).
00068  *  \param name The name of the application, function, etc.
00069  *  \retval NULL on error.
00070  *  \retval A malloc'ed string with the synopsis.
00071  */
00072 char *ast_xmldoc_build_synopsis(const char *type, const char *name);
00073 
00074 /*!
00075  *  \brief Generate description documentation from XML.
00076  *  \param type The source of documentation (application, function, etc).
00077  *  \param name The name of the application, function, etc.
00078  *  \retval NULL on error.
00079  *  \retval A malloc'ed string with the formatted description.
00080  */
00081 char *ast_xmldoc_build_description(const char *type, const char *name);
00082 
00083 #endif /* AST_XML_DOCS */
00084 
00085 #endif /* _ASTERISK_XMLDOC_H */