[svn-commits] eliel: branch group/appdocsxml r151976 - in /team/group/appdocsxml: include/a...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Oct 25 11:57:04 CDT 2008


Author: eliel
Date: Sat Oct 25 11:57:03 2008
New Revision: 151976

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151976
Log:
- XML_DOCUMENTATION was renamed to AST_XML_DOCS.
- xml.h will only have the actual ast_xml API, and will include the XML implementation,
  right now libxml2 defined in xml_libxml2.h.


Added:
    team/group/appdocsxml/include/asterisk/xml_libxml2.h   (with props)
Modified:
    team/group/appdocsxml/include/asterisk/xml.h
    team/group/appdocsxml/main/asterisk.c
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/include/asterisk/xml.h
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/include/asterisk/xml.h?view=diff&rev=151976&r1=151975&r2=151976
==============================================================================
--- team/group/appdocsxml/include/asterisk/xml.h (original)
+++ team/group/appdocsxml/include/asterisk/xml.h Sat Oct 25 11:57:03 2008
@@ -20,30 +20,9 @@
 /*! \file 
  *  \brief Asterisk XML abstraction layer
  */
- 
-/* Implementation specific code. */
-#if defined(HAVE_LIBXML2) && !defined(AST_XML_H_IMPLEMENTATION)
-/* AST_XML_IMPLEMENTATION must be defined if an XML implementation is available. */
-#define AST_XML_H_IMPLEMENTATION
-/* libxml2 specific definitions */
 
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-typedef xmlNode ast_xml_node;
-typedef xmlDoc ast_xml_doc;
-typedef char ast_xml_attr;
-typedef const char ast_xml_text;
-
-/* Node member mapping, not always the child node is called 'children' */
-#define AST_XML_CHILD	children
-#define AST_XML_NEXT	next
-#define AST_XML_PREV	prev
-#define AST_XML_PARENT	parent
-#define AST_XML_NAME	name
-
-#endif /* defined(HAVE_LIBXML2) && !defined(AST_XML_H_IMPLEMENTATION) */
-
+/* Include here the XML implementation header. */
+#include "asterisk/xml_libxml2.h"
 
 /* Compile this if we have a working XML implementation. */
 #ifdef AST_XML_H_IMPLEMENTATION
@@ -123,7 +102,7 @@
 const char *ast_xml_get_text(ast_xml_node *node);
 
 /* Features using ast_xml_ */
-#define XML_DOCUMENTATION
+#define AST_XML_DOCS
 
 #endif /* AST_XML_H_IMPLEMENTATION */
 

Added: team/group/appdocsxml/include/asterisk/xml_libxml2.h
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/include/asterisk/xml_libxml2.h?view=auto&rev=151976
==============================================================================
--- team/group/appdocsxml/include/asterisk/xml_libxml2.h (added)
+++ team/group/appdocsxml/include/asterisk/xml_libxml2.h Sat Oct 25 11:57:03 2008
@@ -1,0 +1,38 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2008, Eliel C. Sardanons (LU1ALY) <eliels at gmail.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/* Implementation specific code. */
+#if defined(HAVE_LIBXML2) && !defined(AST_XML_H_IMPLEMENTATION)
+/* AST_XML_IMPLEMENTATION must be defined if an XML implementation is available. */
+#define AST_XML_H_IMPLEMENTATION
+/* libxml2 specific definitions */
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
+typedef xmlNode ast_xml_node;
+typedef xmlDoc ast_xml_doc;
+typedef char ast_xml_attr;
+typedef const char ast_xml_text;
+
+/* Node member mapping, not always the child node is called 'children' */
+#define AST_XML_CHILD   children
+#define AST_XML_NEXT    next
+#define AST_XML_PREV    prev
+#define AST_XML_PARENT  parent
+#define AST_XML_NAME    name
+
+#endif /* defined(HAVE_LIBXML2) && !defined(AST_XML_H_IMPLEMENTATION) */

Propchange: team/group/appdocsxml/include/asterisk/xml_libxml2.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/appdocsxml/include/asterisk/xml_libxml2.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/appdocsxml/include/asterisk/xml_libxml2.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/group/appdocsxml/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/asterisk.c?view=diff&rev=151976&r1=151975&r2=151976
==============================================================================
--- team/group/appdocsxml/main/asterisk.c (original)
+++ team/group/appdocsxml/main/asterisk.c Sat Oct 25 11:57:03 2008
@@ -3329,7 +3329,7 @@
 		exit(1);
 	}
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	/* Load XML documentation. */
 	ast_load_documentation();
 #endif

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=151976&r1=151975&r2=151976
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Sat Oct 25 11:57:03 2008
@@ -822,7 +822,7 @@
 	int priority;				/*!< Priority associated with this exception */
 };
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 /*! \brief Default documentation language. */
 static const char default_documentation_language[] = "en_US";
 
@@ -900,7 +900,7 @@
 static unsigned int hashtab_hash_priority(const void *obj);
 static unsigned int hashtab_hash_labels(const void *obj);
 static void __ast_internal_context_destroy( struct ast_context *con);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 static char *xmldoc_colorization(const char *bwinput, int base_fg, int base_bg);
 #endif
 
@@ -3041,7 +3041,7 @@
 	term_color(destitle, "[Description]\n", COLOR_MAGENTA, 0, 40);
 	term_color(seealsotitle, "[See Also]\n", COLOR_MAGENTA, 0, 40);
 	term_color(syntax, S_OR(acf->syntax, "Not available"), COLOR_CYAN, 0, syntax_size);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	if (acf->docsrc == AST_XML_DOC) {
 		arguments = xmldoc_colorization(S_OR(acf->arguments, "Not available"), COLOR_CYAN, COLOR_BLACK);
 		synopsis = xmldoc_colorization(S_OR(acf->synopsis, "Not available"), COLOR_CYAN, COLOR_BLACK);
@@ -3091,7 +3091,7 @@
 		term_color(synopsis, S_OR(acf->synopsis, "Not available"), COLOR_CYAN, 0, synopsis_size);
 		term_color(description, S_OR(acf->desc, "Not available"), COLOR_CYAN, 0, description_size);
 		term_color(seealso, S_OR(acf->seealso, "Not available"), COLOR_CYAN, 0, seealso_size);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	}
 #endif
 
@@ -3130,7 +3130,7 @@
 
 	AST_RWLIST_WRLOCK(&acf_root);
 	if ((cur = AST_RWLIST_REMOVE(&acf_root, acf, acflist))) {
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 		if (cur->docsrc == AST_XML_DOC) {
 			ast_string_field_free_memory(acf);
 		}
@@ -3142,7 +3142,7 @@
 	return cur ? 0 : -1;
 }
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 static const struct strcolorized_tags {
 	const char *init;		/*!< Replace initial tag with this string. */
 	const char *end;		/*!< Replace end tag with this string. */
@@ -4545,13 +4545,13 @@
 
 	return ret;
 }
-#endif /* XML_DOCUMENTATION */
+#endif /* AST_XML_DOCS */
 
 int __ast_custom_function_register(struct ast_custom_function *acf, struct ast_module *mod)
 {
 	struct ast_custom_function *cur;
 	char tmps[80];
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	char *tmpxml;
 #endif
 
@@ -4561,7 +4561,7 @@
 	acf->mod = mod;
 	acf->docsrc = AST_STATIC_DOC;
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	/* Let's try to find it in the Documentation XML */
 	if (ast_strlen_zero(acf->desc) && ast_strlen_zero(acf->synopsis)) {
 		if (ast_string_field_init(acf, 128)) {
@@ -6283,7 +6283,7 @@
 	struct ast_app *tmp, *cur = NULL;
 	char tmps[80];
 	int length, res;
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	char *tmpxml;
 #endif
 
@@ -6309,7 +6309,7 @@
 		return -1;
 	}
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	/* Try to lookup the docs in our XML documentation database */
 	if (ast_strlen_zero(synopsis) && ast_strlen_zero(description)) {
 		/* load synopsis */
@@ -6342,7 +6342,7 @@
 		ast_string_field_set(tmp, synopsis, synopsis);
 		ast_string_field_set(tmp, description, description);
 		tmp->docsrc = AST_STATIC_DOC;
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 	}
 #endif
 
@@ -6368,7 +6368,7 @@
 	return 0;
 }
 
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 /*! \brief Close and unload XML documentation. */
 static void xmldoc_unload_documentation(void)
 {
@@ -6483,7 +6483,7 @@
 
 	return 0;
 }
-#endif /* XML_DOCUMENTATION */
+#endif /* AST_XML_DOCS */
 
 /*
  * Append to the list. We don't have a tail pointer because we need
@@ -6583,7 +6583,7 @@
 				term_color(syntitle, "[Synopsis]\n", COLOR_MAGENTA, 0, 40);
 				term_color(destitle, "[Description]\n", COLOR_MAGENTA, 0, 40);
 				term_color(seealsotitle, "[See Also]\n", COLOR_MAGENTA, 0, 40);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 				if (aa->docsrc == AST_XML_DOC) {
 					description = xmldoc_colorization(S_OR(aa->description, "Not available"), COLOR_CYAN, COLOR_BLACK);
 					arguments = xmldoc_colorization(S_OR(aa->arguments, "Not available"), COLOR_CYAN, COLOR_BLACK);
@@ -6630,7 +6630,7 @@
 					term_color(description, S_OR(aa->description, "Not available"),	COLOR_CYAN, 0, description_size);
 					term_color(arguments, S_OR(aa->arguments, "Not available"), COLOR_CYAN, 0, arguments_size);
 					term_color(seealso, S_OR(aa->seealso, "Not available"), COLOR_CYAN, 0, seealso_size);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 				}
 #endif
 				if (!ast_strlen_zero(aa->syntax)) {
@@ -7765,7 +7765,7 @@
 			unreference_cached_app(tmp);
 			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_verb(2, "Unregistered application '%s'\n", tmp->name);
-#ifdef XML_DOCUMENTATION
+#ifdef AST_XML_DOCS
 			if (tmp->docsrc == AST_XML_DOC) {
 				ast_string_field_free_memory(tmp);
 			}




More information about the svn-commits mailing list