diff options
-rw-r--r-- | libs/files/domc-library.patch | 277 |
1 files changed, 257 insertions, 20 deletions
diff --git a/libs/files/domc-library.patch b/libs/files/domc-library.patch index 590979e..02a076e 100644 --- a/libs/files/domc-library.patch +++ b/libs/files/domc-library.patch @@ -1,6 +1,6 @@ diff -r -C2 domc-0.7.0/Makefile domc/Makefile *** domc-0.7.0/Makefile 2003-03-22 17:08:50.000000000 -0700 ---- domc/Makefile 2004-07-29 16:16:16.337211622 -0600 +--- domc/Makefile 2004-07-29 17:05:29.000000000 -0600 *************** *** 1,6 **** ! prefix = /usr/local @@ -54,9 +54,62 @@ diff -r -C2 domc-0.7.0/Makefile domc/Makefile rm -f $(OBJS) $(ARNAME) $(SONAME) $(includedir)/domc.h $(libdir)/$(ARNAME) $(libdir)/$(SONAME) $(libdir)/$(SOVERSION) $(libdir)/lib$(LIBNAME).so $(DISTRO).zip ! # cd $(mandir)/man3 && rm -f $(MAN) +diff -r -C2 domc-0.7.0/Makefile.msvc domc/Makefile.msvc +*** domc-0.7.0/Makefile.msvc 2003-03-22 16:44:29.000000000 -0700 +--- domc/Makefile.msvc 2004-07-29 19:55:06.000000000 -0600 +*************** +*** 1,15 **** + !include <win32.mak> +! LIBMBA=..\libmba-0.5.0 +! EXPAT=..\Expat-1.95.5 + # For i18n support in domc the encdec library is required. + # Specify were the encdec library is below, change HAVE_ENCDEC to 1 + # in src\defines.h and add /LIBPATH:$(ENCDEC) encdec.lib to the + # .dll link command. +! ENCDEC=..\encdec-0.3.7 + OBJS=src\expatls.obj src\events.obj src\timestamp.obj src\dom.obj src\node.obj src\namednodemap.obj src\nodelist.obj src\wcwidth.obj + + +! domc.dll: $(OBJS) +! $(link) /INCREMENTAL:NO /NOLOGO /LIBPATH:$(EXPAT)\Libs /LIBPATH:$(LIBMBA) /LIBPATH:$(ENCDEC) libexpat.lib libmba.lib encdec.lib /DEF:domc.def /OUT:domc.dll -entry:_DllMainCRTStartup@12 -dll $(OBJS) + + domc.lib: $(OBJS) +--- 1,19 ---- + !include <win32.mak> +! LIBMBA=..\libmba +! # EXPAT=..\Expat-1.95.5 + # For i18n support in domc the encdec library is required. + # Specify were the encdec library is below, change HAVE_ENCDEC to 1 + # in src\defines.h and add /LIBPATH:$(ENCDEC) encdec.lib to the + # .dll link command. +! # ENCDEC=..\encdec-0.3.7 + OBJS=src\expatls.obj src\events.obj src\timestamp.obj src\dom.obj src\node.obj src\namednodemap.obj src\nodelist.obj src\wcwidth.obj + ++ # Debug flags ++ cflags=$(cflags) /MLd /GZ /Gm /ZI /Od /D_DEBUG + +! all: domc.lib +! +! # domc.dll: $(OBJS) +! # $(link) $(lflags) /INCREMENTAL:NO /NOLOGO /LIBPATH:$(LIBMBA) libmba.lib /DEF:domc.def /OUT:domc.dll -entry:_DllMainCRTStartup@12 -dll $(OBJS) + + domc.lib: $(OBJS) +*************** +*** 17,21 **** + + .c.obj: +! $(cc) $(cflags) /I$(EXPAT)\Source\lib /I$(ENCDEC)\src /I$(LIBMBA)\src /Fo$@ $*.c + + clean: +--- 21,25 ---- + + .c.obj: +! $(cc) $(cflags) /I$(LIBMBA)\src /Fo$@ $*.c + + clean: diff -r -C2 domc-0.7.0/src/defines.h domc/src/defines.h *** domc-0.7.0/src/defines.h 2003-03-22 16:35:36.000000000 -0700 ---- domc/src/defines.h 2004-07-29 16:16:16.338211509 -0600 +--- domc/src/defines.h 2004-07-29 17:05:29.000000000 -0600 *************** *** 22,26 **** #define HAVE_STRDUP 1 @@ -83,9 +136,77 @@ diff -r -C2 domc-0.7.0/src/defines.h domc/src/defines.h ! #define HAVE_EXPAT 0 #define HAVE_MBSTATE 1 #define HAVE_WCWIDTH 1 +diff -r -C2 domc-0.7.0/src/dom.c domc/src/dom.c +*** domc-0.7.0/src/dom.c 2003-03-21 01:50:28.000000000 -0700 +--- domc/src/dom.c 2004-07-29 19:38:46.000000000 -0600 +*************** +*** 183,188 **** + { + DOM_Document *doc; + +! namespaceURI = NULL; qualifiedName = NULL; + + msgno_add_codes(dom_codes); +--- 183,189 ---- + { + DOM_Document *doc; ++ DOM_Element *el; + +! namespaceURI = NULL; + + msgno_add_codes(dom_codes); +*************** +*** 197,200 **** +--- 198,210 ---- + } + ++ if (qualifiedName && *qualifiedName) { ++ if ((el = DOM_Document_createElement(doc, qualifiedName)) == NULL) { ++ AMSG(""); ++ DOM_Document_destroyNode(doc, doc); ++ return NULL; ++ } ++ DOM_Node_appendChild(doc, el); ++ } ++ + return doc; + } +*************** +*** 281,293 **** + + attr = DOM_NamedNodeMap_removeNamedItem(element->attributes, name); + +! DOM_MutationEvent_initMutationEvent(&evt, "DOMAttrModified", 1, 0, +! attr, attr->nodeValue, NULL, attr->nodeName, DOM_MUTATION_EVENT_REMOVAL); +! DOM_EventTarget_dispatchEvent(element, &evt); + +! updateCommonParent(element->parentNode); + +! if (attr) { +! DOM_Document_destroyNode(attr->ownerDocument, attr); + } + } +--- 291,307 ---- + + attr = DOM_NamedNodeMap_removeNamedItem(element->attributes, name); ++ ++ /* removeAttribute doesn't throw exceptions on NOT_FOUND_ERR */ ++ if (DOM_Exception == DOM_NOT_FOUND_ERR) ++ DOM_Exception = 0; + +! if (attr) { +! DOM_MutationEvent_initMutationEvent(&evt, "DOMAttrModified", 1, 0, +! attr, attr->nodeValue, NULL, attr->nodeName, DOM_MUTATION_EVENT_REMOVAL); +! DOM_EventTarget_dispatchEvent(element, &evt); + +! updateCommonParent(element->parentNode); + +! DOM_Document_destroyNode(attr->ownerDocument, attr); + } + } diff -r -C2 domc-0.7.0/src/domc.h domc/src/domc.h *** domc-0.7.0/src/domc.h 2003-03-22 16:46:46.000000000 -0700 ---- domc/src/domc.h 2004-07-29 16:16:16.375207324 -0600 +--- domc/src/domc.h 2004-07-29 17:05:29.000000000 -0600 *************** *** 186,189 **** --- 186,191 ---- @@ -123,22 +244,12 @@ diff -r -C2 domc-0.7.0/src/domc.h domc/src/domc.h + int DOM_DocumentLS_save(DOM_DocumentLS *this, const char *uri, const DOM_Node *node); int DOM_DocumentLS_fwrite(const DOM_DocumentLS *this, FILE *stream); -Only in domc/src: dom.o -Only in domc/src: events.o diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c *** domc-0.7.0/src/expatls.c 2003-03-21 02:20:24.000000000 -0700 ---- domc/src/expatls.c 2004-07-29 16:53:54.199838102 -0600 -*************** -*** 64,67 **** ---- 64,68 ---- - #endif - -+ - #if HAVE_EXPAT > 130 - #include <expat.h> +--- domc/src/expatls.c 2004-08-02 16:58:41.000000000 -0600 *************** *** 128,131 **** ---- 129,134 ---- +--- 128,133 ---- } + #if HAVE_EXPAT > 0 @@ -147,7 +258,7 @@ diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c xmldecl_fn(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone) *************** *** 708,711 **** ---- 711,754 ---- +--- 710,753 ---- } + #endif /* HAVE_EXPAT */ @@ -199,7 +310,7 @@ diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c ! fputds(e->node->nodeValue, stream); fputc('"', stream); } ---- 775,779 ---- +--- 774,778 ---- fputds(e->node->nodeName, stream); fputs("=\"", stream); ! fputds_encoded(e->node->nodeValue, stream); @@ -212,14 +323,103 @@ diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c ! fputds(node->nodeValue, stream); break; case DOM_CDATA_SECTION_NODE: ---- 796,800 ---- +--- 795,799 ---- break; case DOM_TEXT_NODE: ! fputds_encoded(node->nodeValue, stream); break; case DOM_CDATA_SECTION_NODE: *************** -*** 805,814 **** +*** 761,803 **** + case DOM_NOTATION_NODE: + fputs(" <!NOTATION ", stream); +! fputs(node->nodeName, stream); + if (node->u.Entity.publicId) { + fputs(" PUBLIC \"", stream); +! fputs(node->u.Entity.publicId, stream); + fputs("\" \"", stream); +! fputs(node->u.Entity.systemId, stream); + fputc('"', stream); + } else if (node->u.Entity.systemId) { + fputs(" SYSTEM \"", stream); +! fputs(node->u.Entity.systemId, stream); + fputc('"', stream); + } +! fputs(">"NL, stream); + break; + case DOM_ENTITY_NODE: + fputs(" <!ENTITY ", stream); +! fputs(node->nodeName, stream); + if (node->nodeValue) { + fputc('"', stream); +! fputs(node->nodeValue, stream); + fputc('"', stream); + } else { + if (node->u.Entity.publicId) { + fputs(" PUBLIC \"", stream); +! fputs(node->u.Entity.publicId, stream); + fputs("\" \"", stream); +! fputs(node->u.Entity.systemId, stream); + fputc('"', stream); + } else if (node->u.Entity.systemId) { + fputs(" SYSTEM \"", stream); +! fputs(node->u.Entity.systemId, stream); + fputc('"', stream); + } + if (node->u.Entity.notationName) { + fputs(" NDATA ", stream); +! fputs(node->u.Entity.notationName, stream); + } + } +! fputs(">"NL, stream); + break; + case DOM_PROCESSING_INSTRUCTION_NODE: +--- 803,845 ---- + case DOM_NOTATION_NODE: + fputs(" <!NOTATION ", stream); +! fputds(node->nodeName, stream); + if (node->u.Entity.publicId) { + fputs(" PUBLIC \"", stream); +! fputds(node->u.Entity.publicId, stream); + fputs("\" \"", stream); +! fputds(node->u.Entity.systemId, stream); + fputc('"', stream); + } else if (node->u.Entity.systemId) { + fputs(" SYSTEM \"", stream); +! fputds(node->u.Entity.systemId, stream); + fputc('"', stream); + } +! fputs(">", stream); + break; + case DOM_ENTITY_NODE: + fputs(" <!ENTITY ", stream); +! fputds(node->nodeName, stream); + if (node->nodeValue) { + fputc('"', stream); +! fputds(node->nodeValue, stream); + fputc('"', stream); + } else { + if (node->u.Entity.publicId) { + fputs(" PUBLIC \"", stream); +! fputds(node->u.Entity.publicId, stream); + fputs("\" \"", stream); +! fputds(node->u.Entity.systemId, stream); + fputc('"', stream); + } else if (node->u.Entity.systemId) { + fputs(" SYSTEM \"", stream); +! fputds(node->u.Entity.systemId, stream); + fputc('"', stream); + } + if (node->u.Entity.notationName) { + fputs(" NDATA ", stream); +! fputds(node->u.Entity.notationName, stream); + } + } +! fputs(">", stream); + break; + case DOM_PROCESSING_INSTRUCTION_NODE: +*************** +*** 805,823 **** fputds(node->u.ProcessingInstruction.target, stream); fputc(' ', stream); ! fputds(node->u.ProcessingInstruction.data, stream); @@ -230,7 +430,16 @@ diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c ! fputds(node->nodeValue, stream); fputs("-->", stream); break; ---- 848,857 ---- + case DOM_DOCUMENT_NODE: + fputs("<?xml", stream); +! if (node->u.Document.version) { +! fputs(" version=\"", stream); +! fputs(node->u.Document.version, stream); +! fputc('\"', stream); +! } + #ifdef CODESET + fputs(" encoding=\"", stream); +--- 847,863 ---- fputds(node->u.ProcessingInstruction.target, stream); fputc(' ', stream); ! fputds_encoded(node->u.ProcessingInstruction.data, stream); @@ -241,3 +450,31 @@ diff -r -C2 domc-0.7.0/src/expatls.c domc/src/expatls.c ! fputds_encoded(node->nodeValue, stream); fputs("-->", stream); break; + case DOM_DOCUMENT_NODE: + fputs("<?xml", stream); +! fputs(" version=\"", stream); +! fputds(node->u.Document.version ? node->u.Document.version : "1.0", stream); +! fputc('\"', stream); + #ifdef CODESET + fputs(" encoding=\"", stream); +*************** +*** 825,834 **** + fputc('\"', stream); + #endif +! if (node->u.Document.standalone == 0) { +! printf(" standalone=\"no\""); +! } else if (node->u.Document.standalone == 1) { +! printf(" standalone=\"yes\""); + } +! fputs("?>"NL NL, stream); + for (c = node->firstChild; c != NULL; c = c->nextSibling) { + if (DOM_DocumentLS_fwrite(c, stream) == -1) { +--- 865,872 ---- + fputc('\"', stream); + #endif +! if (node->u.Document.standalone != 0) { +! fputs(" standalone=\"yes\"", stream); + } +! fputs("?>"NL, stream); + for (c = node->firstChild; c != NULL; c = c->nextSibling) { + if (DOM_DocumentLS_fwrite(c, stream) == -1) { |