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 /*! \brief From where the documentation come from, this structure is useful for 00027 * use it inside application/functions/manager actions structure. */ 00028 enum ast_doc_src { 00029 AST_XML_DOC, /*!< From XML documentation */ 00030 AST_STATIC_DOC /*!< From application/function registration */ 00031 }; 00032 00033 #ifdef AST_XML_DOCS 00034 00035 /*! 00036 * \brief Get the syntax for a specified application or function. 00037 * \param type Application, Function or AGI ? 00038 * \param name Name of the application or function. 00039 * \param module The module the item is in (optional, can be NULL) 00040 * \retval NULL on error. 00041 * \retval The generated syntax in a ast_malloc'ed string. 00042 */ 00043 char *ast_xmldoc_build_syntax(const char *type, const char *name, const char *module); 00044 00045 /*! 00046 * \brief Parse the <see-also> node content. 00047 * \param type 'application', 'function' or 'agi'. 00048 * \param name Application or functions name. 00049 * \param module The module the item is in (optional, can be NULL) 00050 * \retval NULL on error. 00051 * \retval Content of the see-also node. 00052 */ 00053 char *ast_xmldoc_build_seealso(const char *type, const char *name, const char *module); 00054 00055 /*! 00056 * \brief Generate the [arguments] tag based on type of node ('application', 00057 * 'function' or 'agi') and name. 00058 * \param type 'application', 'function' or 'agi' ? 00059 * \param name Name of the application or function to build the 'arguments' tag. 00060 * \param module The module the item is in (optional, can be NULL) 00061 * \retval NULL on error. 00062 * \retval Output buffer with the [arguments] tag content. 00063 */ 00064 char *ast_xmldoc_build_arguments(const char *type, const char *name, const char *module); 00065 00066 /*! 00067 * \brief Colorize and put delimiters (instead of tags) to the xmldoc output. 00068 * \param bwinput Not colorized input with tags. 00069 * \param withcolors Result output with colors. 00070 * \retval NULL on error. 00071 * \retval New malloced buffer colorized and with delimiters. 00072 */ 00073 char *ast_xmldoc_printable(const char *bwinput, int withcolors); 00074 00075 /*! 00076 * \brief Generate synopsis documentation from XML. 00077 * \param type The source of documentation (application, function, etc). 00078 * \param name The name of the application, function, etc. 00079 * \param module The module the item is in (optional, can be NULL) 00080 * \retval NULL on error. 00081 * \retval A malloc'ed string with the synopsis. 00082 */ 00083 char *ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module); 00084 00085 /*! 00086 * \brief Generate description documentation from XML. 00087 * \param type The source of documentation (application, function, etc). 00088 * \param name The name of the application, function, etc. 00089 * \param module The module the item is in (optional, can be NULL) 00090 * \retval NULL on error. 00091 * \retval A malloc'ed string with the formatted description. 00092 */ 00093 char *ast_xmldoc_build_description(const char *type, const char *name, const char *module); 00094 00095 #endif /* AST_XML_DOCS */ 00096 00097 #endif /* _ASTERISK_XMLDOC_H */