Corbaization of the document structures, Daniel.
diff --git a/ChangeLog b/ChangeLog
index 14f505e..6f1cdfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Oct 17 02:43:21 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * tree.h, tree.c: Ok, the main objects in the tree will be native
+ corba objects, it costs 8 bytes per Node, Attribute and Document
+ but it simplifies the Corba integration a lot (no extra interface
+ objects to allocate/free).
+
Tue Oct 13 21:46:57 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.h, tree.c, parser.c: added prev and doc pointers to Node,
diff --git a/Makefile.am b/Makefile.am
index 1eed746..84f6c22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
+INCLUDES = -I@srcdir@ @CORBA_CFLAGS@
+
noinst_PROGRAMS=tester
bin_SCRIPTS=xml-config
@@ -15,7 +17,6 @@
tester.c \
tree.c
-
xmlincdir = $(includedir)/gnome-xml
xmlinc_HEADERS = \
entities.h \
diff --git a/configure.in b/configure.in
index 59fc4ea..cbe37ad 100644
--- a/configure.in
+++ b/configure.in
@@ -36,6 +36,16 @@
AC_SUBST(XML_LIBS)
AC_SUBST(XML_INCLUDEDIR)
+AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
+
+dnl
+dnl Corba is enabled by default
+dnl
+if test "$enable_java" = "no" ; then
+ CORBA_CFLAGS="-DWITHOUT_CORBA"
+fi
+AC_SUBST(CORBA_CFLAGS)
+
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strdup strndup strerror snprintf )
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index a4a808d..91677a6 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -80,6 +80,11 @@
* A attribute of an XML node.
*/
typedef struct xmlAttr {
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
struct xmlAttr *next; /* parent->childs link */
const CHAR *name; /* the name of the property */
@@ -105,7 +110,11 @@
#define XML_NOTATION_NODE 12
typedef struct xmlNode {
- int type; /* type number in the DTD */
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* type number in the DTD, must be third ! */
struct xmlDoc *doc; /* the containing document */
struct xmlNode *parent; /* child->parent link */
struct xmlNode *next; /* next sibling link */
@@ -116,13 +125,17 @@
xmlNs *ns; /* pointer to the associated namespace */
xmlNs *nsDef; /* namespace definitions on this node */
CHAR *content; /* the content */
- void *servant; /* for Corba ! */
} xmlNode, *xmlNodePtr;
/*
* An XML document.
*/
typedef struct xmlDoc {
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
const CHAR *version; /* the XML version string */
const CHAR *encoding; /* encoding, if any */
@@ -132,7 +145,6 @@
struct xmlNs *oldNs; /* Global namespace, the old way */
void *entities; /* Hash table for general entities if any */
struct xmlNode *root; /* the document tree */
- void *servant; /* for Corba ! */
} xmlDoc, *xmlDocPtr;
/*
diff --git a/tree.c b/tree.c
index c4eddec..72287a2 100644
--- a/tree.c
+++ b/tree.c
@@ -277,7 +277,10 @@
cur->entities = NULL;
cur->standalone = -1;
cur->compression = xmlCompressMode;
- cur->servant = NULL;
+#ifndef WITHOUT_CORBA
+ cur->_private = NULL;
+ cur->vepv = NULL;
+#endif
return(cur);
}
@@ -326,6 +329,10 @@
cur->value = xmlStrdup(value);
else
cur->value = NULL;
+#ifndef WITHOUT_CORBA
+ cur->_private = NULL;
+ cur->vepv = NULL;
+#endif
/*
* Add it at the end to preserve parsing order ...
@@ -407,7 +414,10 @@
cur->name = xmlStrdup(name);
cur->ns = ns;
cur->nsDef = NULL;
- cur->servant = NULL;
+#ifndef WITHOUT_CORBA
+ cur->_private = NULL;
+ cur->vepv = NULL;
+#endif
if (content != NULL)
cur->content = xmlStrdup(content);
else
diff --git a/tree.h b/tree.h
index a4a808d..91677a6 100644
--- a/tree.h
+++ b/tree.h
@@ -80,6 +80,11 @@
* A attribute of an XML node.
*/
typedef struct xmlAttr {
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* XML_ATTRIBUTE_NODE, must be third ! */
struct xmlNode *node; /* attr->node link */
struct xmlAttr *next; /* parent->childs link */
const CHAR *name; /* the name of the property */
@@ -105,7 +110,11 @@
#define XML_NOTATION_NODE 12
typedef struct xmlNode {
- int type; /* type number in the DTD */
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* type number in the DTD, must be third ! */
struct xmlDoc *doc; /* the containing document */
struct xmlNode *parent; /* child->parent link */
struct xmlNode *next; /* next sibling link */
@@ -116,13 +125,17 @@
xmlNs *ns; /* pointer to the associated namespace */
xmlNs *nsDef; /* namespace definitions on this node */
CHAR *content; /* the content */
- void *servant; /* for Corba ! */
} xmlNode, *xmlNodePtr;
/*
* An XML document.
*/
typedef struct xmlDoc {
+#ifndef XML_WITHOUT_CORBA
+ void *_private; /* for Corba, must be first ! */
+ void *vepv; /* for Corba, must be next ! */
+#endif
+ int type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
const CHAR *version; /* the XML version string */
const CHAR *encoding; /* encoding, if any */
@@ -132,7 +145,6 @@
struct xmlNs *oldNs; /* Global namespace, the old way */
void *entities; /* Hash table for general entities if any */
struct xmlNode *root; /* the document tree */
- void *servant; /* for Corba ! */
} xmlDoc, *xmlDocPtr;
/*