[asterisk-commits] bkruse: branch group/appdocsxml r128199 - in /team/group/appdocsxml: ./ apps/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 5 14:58:49 CDT 2008


Author: bkruse
Date: Sat Jul  5 14:58:48 2008
New Revision: 128199

URL: http://svn.digium.com/view/asterisk?view=rev&rev=128199
Log:
No more iksemel, now using mxml!

Updated the dial documentation xml to fix
an xml error, I need to figure out how to
catch these with mxml.

Modified:
    team/group/appdocsxml/Makefile
    team/group/appdocsxml/apps/app_dial.c
    team/group/appdocsxml/main/Makefile
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/Makefile?view=diff&rev=128199&r1=128198&r2=128199
==============================================================================
--- team/group/appdocsxml/Makefile (original)
+++ team/group/appdocsxml/Makefile Sat Jul  5 14:58:48 2008
@@ -294,7 +294,7 @@
 
 # if use xml documentation?
   ASTCFLAGS+=-DXML_DOCUMENTATION
-  LIBS+=-liksemel
+  LIBS+=-lmxml
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   ASTCFLAGS+=-D__Darwin__
@@ -484,7 +484,8 @@
 
 documentation:
 	@echo "Building Documentation."
-	@echo "<docs>" > documentation.xml
+	@echo "<?xml version="1.0" encoding="ISO-8859-1"?>" > documentation.xml
+	@echo "<docs>" >> documentation.xml
 	@for x in $(MOD_SUBDIRS); do \
 		for i in $$x/*.c; do \
 			$(AWK) -f build_tools/get_documentation $$i >> documentation.xml ; \

Modified: team/group/appdocsxml/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_dial.c?view=diff&rev=128199&r1=128198&r2=128199
==============================================================================
--- team/group/appdocsxml/apps/app_dial.c (original)
+++ team/group/appdocsxml/apps/app_dial.c Sat Jul  5 14:58:48 2008
@@ -122,6 +122,7 @@
 		<option name="c">
 			If DIAL cancels this call, always set the flag to tell the channel
 			driver that the call is answered elsewhere.
+		</option>
 		<option name="d">
 			Allow the calling user to dial a 1 digit extension while waiting for
 			a call to be answered. Exit to that extension if it exists in the

Modified: team/group/appdocsxml/main/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/Makefile?view=diff&rev=128199&r1=128198&r2=128199
==============================================================================
--- team/group/appdocsxml/main/Makefile (original)
+++ team/group/appdocsxml/main/Makefile Sat Jul  5 14:58:48 2008
@@ -43,7 +43,7 @@
 
 AST_LIBS += $(SSL_LIB)
 AST_LIBS += $(BKTR_LIB)
-AST_LIBS += -liksemel
+AST_LIBS += -lmxml -L../menuselect/mxml
 
 ifeq ($(POLL_AVAILABLE),)
   OBJS+=poll.o

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=128199&r1=128198&r2=128199
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Sat Jul  5 14:58:48 2008
@@ -16,10 +16,6 @@
  * at the top of the source tree.
  */
 
-/*** MODULEINFO
-	<depend>iksemel</depend>
- ***/
-
 /*! \file
  *
  * \brief Core PBX routines.
@@ -31,7 +27,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include <iksemel.h>
+#include "../menuselect/mxml/mxml.h"
 
 #include "asterisk/_private.h"
 #include "asterisk/paths.h"	/* use ast_config_AST_SYSTEM_NAME */
@@ -335,8 +331,7 @@
 static unsigned int hashtab_hash_labels(const void *obj);
 static void __ast_internal_context_destroy( struct ast_context *con);
 #ifdef XML_DOCUMENTATION
-static int xml_tag(void *udata, char *name, char **atts, int type); 
-static int xml_cdata(void *udata, char *data, size_t len); 
+mxml_node_t *documentation_tree;
 #endif
 
 /* a func for qsort to use to sort a char array */
@@ -4314,36 +4309,6 @@
 	return 0;
 }
 
-/*! \brief Throwing away cdata, don't care now. */
-static int xml_cdata(void *udata, char *data, size_t len) {
-	return IKS_OK;
-}
-
-/*! \brief Debug out the information loaded from the document. */
-static int xml_tag(void *udata, char *name, char **atts, int type) {
-
-	switch(type) {
-		case IKS_OPEN:
-			ast_log(LOG_DEBUG, "TAG <%s>\n", name);
-			break;
-		case IKS_CLOSE:
-			ast_log(LOG_DEBUG, "TAG </%s>\n", name);
-			break;
-		case IKS_SINGLE:
-			ast_log(LOG_DEBUG, "TAG <%s/>\n", name);
-			break;
-	}
-
-	if(atts) {
-		int i = 0;
-		while(atts[i]) {
-			ast_log(LOG_DEBUG, " ATTRIB %s='%s'\n", atts[i], atts[i+1]);
-			i += 2;
-		}	
-	}
-	return 0;
-}
-
 /* todo: If we cannot read the file, don't allow people to try to register
  * with ast_register_application_xml */
 
@@ -4351,15 +4316,11 @@
 static int ast_load_documentation(void) {
 
 	FILE *xmldoc;
-	iksparser *p;
-	char *buf;
-	long length;
+	mxml_node_t *node;
 
 	ast_log(LOG_DEBUG, "************** LOADING XML DOCUMENTATION ********************\n");
 
 	/* For now, I just throw away cdata */
-	p = iks_sax_new(NULL, xml_tag, xml_cdata);	
-
 	xmldoc = fopen(FILE_XML_DOC, "r");
 
 	if(!xmldoc) {
@@ -4367,37 +4328,16 @@
 		return 1;
 	}
 
-	/* Get filesize, alloc space */
-	fseek(xmldoc, 0, SEEK_END);
-	/* We should have some sort of bounds checking */
-	length = ftell(xmldoc); 
-	fseek(xmldoc, 0, SEEK_SET);
-
-	buf = (char *)malloc(length);
-
-	fread(buf, length, 1, xmldoc);
+	documentation_tree = mxmlLoadFile(NULL, xmldoc, MXML_TEXT_CALLBACK);
+
 	fclose(xmldoc);
 
-	ast_log(LOG_ERROR, "test: %s\n", buf);
+	node = mxmlFindElement(documentation_tree, documentation_tree, "application", "name", "Dial", MXML_DESCEND);
+
+	ast_log(LOG_WARNING, "Testing: ********** '%s'", node->value.opaque);
+
 	/* Ok, let's now process it. */
 	/* Check for errors in loading the doc */
-	switch(iks_parse(p, buf, 0, 1)) {
-		case IKS_OK:
-			/* looks good, no more error checking */
-			ast_log(LOG_DEBUG, "Document Successfully Parsed\n");
-			break;
-		case IKS_NOMEM:
-			ast_log(LOG_ERROR, "Not enough memory to parse the xml document.\n");
-			return 1;
-		case IKS_BADXML:
-			ast_log(LOG_ERROR, "Bad XML Format in the xml document.\n");
-			return 1;
-		case IKS_HOOK:
-			ast_log(LOG_ERROR, "XML hooking problem? idk.\n");
-			return 1;
-	} 	
-
-	iks_parser_delete(p);
 
 	return 0;
 }




More information about the asterisk-commits mailing list