From cjliarng at yahoo.com.tw Mon Jul 2 05:04:27 2007 From: cjliarng at yahoo.com.tw (cjliarng) Date: Mon, 2 Jul 2007 11:04:27 +0800 (CST) Subject: [Expat-discuss] Downsize Expat For Embedded System In-Reply-To: Message-ID: <937391.6761.qm@web73414.mail.tp2.yahoo.com> Dear All, Thanks for Sebastian's help. Here is my outcome.. Expat 2.0.1 on linux 2.4.17 using gcc. 1. original size: 342,709 2. Add -DXML_MIN_SIZE in CFLAGS, size: 267,301 (undeine XML_DTD, XML_NS didn't show any help in share object size.) 3. strip -d libexpat.so.1.5.2, size: 120,104 (this is good enough for me) FYI. Thanks and Regards, anne. ?????????b???A?O???b???w?? - ???W?]?w Yahoo!?_???w???????I From jzhang at ximpleware.com Mon Jul 2 20:03:05 2007 From: jzhang at ximpleware.com (Jimmy Zhang) Date: Mon, 2 Jul 2007 11:03:05 -0700 Subject: [Expat-discuss] Downsize Expat For Embedded System References: Message-ID: <030701c7bcd3$427abd90$0202a8c0@ximpleware> Take a look at vtd-xml http://vtd-xml.sf.net it also is quite compact > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 2 Jul 2007 11:04:27 +0800 (CST) > From: cjliarng > Subject: Re: [Expat-discuss] Downsize Expat For Embedded System > To: expat-discuss at libexpat.org > Message-ID: <937391.6761.qm at web73414.mail.tp2.yahoo.com> > Content-Type: text/plain; charset=big5 > > Dear All, > Thanks for Sebastian's help. > Here is my outcome.. > Expat 2.0.1 on linux 2.4.17 using gcc. > 1. original size: 342,709 > 2. Add -DXML_MIN_SIZE in CFLAGS, size: 267,301 > (undeine XML_DTD, XML_NS didn't show any help in share object size.) > 3. strip -d libexpat.so.1.5.2, size: 120,104 > (this is good enough for me) > > FYI. > > Thanks and Regards, > anne. > > > ?????????b???A?O???b???w?? - ???W?]?w Yahoo!?_???w???????I > > ------------------------------ > > _______________________________________________ > Expat-discuss mailing list > Expat-discuss at libexpat.org > http://mail.libexpat.org/mailman/listinfo/expat-discuss > > > End of Expat-discuss Digest, Vol 88, Issue 1 > ******************************************** > From dbn.lists at gmail.com Mon Jul 2 22:33:52 2007 From: dbn.lists at gmail.com (Dan Nicholson) Date: Mon, 2 Jul 2007 13:33:52 -0700 Subject: [Expat-discuss] [PATCH] Add pkg-config support Message-ID: <20070702203351.GA21478@tilt> Hi, This patch adds a pkg-config file for expat. Using pkg-config makes it easy to link libexpat into your application: cc `pkg-config --libs expat` -c -o foo foo.c This has the values substituted from configure, and uses the expat_version() macro to find the version number. That might not be the most robust way to handle this. You must 'cvs add expat.pc.in' to get the whole patch. -- Dan. --- /dev/null 2007-06-29 06:21:44.613798959 -0700 +++ expat.pc.in 2007-07-02 11:45:39.000000000 -0700 @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: expat +Version: @VERSION@ +Description: expat XML parser +Libs: -L${libdir} -lexpat +Cflags: -I${includedir} Index: .cvsignore =================================================================== RCS file: /cvsroot/expat/expat/.cvsignore,v retrieving revision 1.10 diff -p -u -r1.10 .cvsignore --- .cvsignore 3 May 2007 19:54:50 -0000 1.10 +++ .cvsignore 2 Jul 2007 18:51:20 -0000 @@ -11,3 +11,4 @@ libtool expat.ncb expat.opt .project +expat.pc Index: configure.in =================================================================== RCS file: /cvsroot/expat/expat/configure.in,v retrieving revision 1.45 diff -p -u -r1.45 configure.in --- configure.in 9 May 2007 13:26:48 -0000 1.45 +++ configure.in 2 Jul 2007 18:51:20 -0000 @@ -27,6 +27,8 @@ define([expat_version], ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.0.x])) AC_INIT(expat, expat_version, expat-bugs at libexpat.org) +VERSION=expat_version() +AC_SUBST(VERSION) undefine([expat_version]) AC_CONFIG_SRCDIR(Makefile.in) @@ -144,7 +146,7 @@ AC_DEFINE([XML_DTD], 1, AC_DEFINE([XML_CONTEXT_BYTES], 1024, [Define to specify how much context to retain around the current parse point.]) -AC_CONFIG_FILES(Makefile) +AC_CONFIG_FILES(Makefile expat.pc) AC_OUTPUT abs_srcdir="`cd $srcdir && pwd`" From webmaster at hartwork.org Tue Jul 3 23:18:25 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Tue, 03 Jul 2007 23:18:25 +0200 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <20070702203351.GA21478@tilt> References: <20070702203351.GA21478@tilt> Message-ID: <468ABD21.6000004@hartwork.org> Hello Dan! Please attach your patch to the bug asking for a pkg-config file [1]. Patches get lost easily on a mailing list. That way we can have a closer look at it later. I hope the rest of the Expat team is okay with this. Thanks for sending your patch! Sebastian [1] http://sourceforge.net/tracker/index.php?func=detail&aid=1715957&group_id=10127&atid=110127 From dbn.lists at gmail.com Fri Jul 6 17:04:18 2007 From: dbn.lists at gmail.com (Dan Nicholson) Date: Fri, 6 Jul 2007 08:04:18 -0700 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <468ABD21.6000004@hartwork.org> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> Message-ID: <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> Hi Sebastian, On 7/3/07, Sebastian Pipping wrote: > > Please attach your patch to the bug asking for a pkg-config file [1]. > Patches get lost easily on a mailing list. That way we can have a > closer look at it later. I hope the rest of the Expat team > is okay with this. Thanks for sending your patch! Sure. The previous patch left out the really crucial step of installing the pkg-config file. It's pretty non-intrusive to add the pkg-config file. It's convenient that libexpat doesn't explicitly link to any other libraries, so you don't have to figure out how to export that information through pkg-config. > [1] > http://sourceforge.net/tracker/index.php?func=detail&aid=1715957&group_id=10127&atid=110127 Done (sortof). I couldn't figure out Sourceforge bug tracker, so you can find the patch here: http://www.linuxfromscratch.org/~dnicholson/patches/expat-pkgconfig.patch -- Dan From weigelt at metux.de Tue Jul 10 15:20:18 2007 From: weigelt at metux.de (Enrico Weigelt) Date: Tue, 10 Jul 2007 15:20:18 +0200 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> Message-ID: <20070710132018.GA2635@nibiru.local> Aehm, what happend to my pkg-conf patch from Oct'06 ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT service - http://www.metux.de/ --------------------------------------------------------------------- Please visit the OpenSource QM Taskforce: http://wiki.metux.de/public/OpenSource_QM_Taskforce Patches / Fixes for a lot dozens of packages in dozens of versions: http://patches.metux.de/ --------------------------------------------------------------------- From karl at waclawek.net Tue Jul 10 15:40:32 2007 From: karl at waclawek.net (Karl Waclawek) Date: Tue, 10 Jul 2007 09:40:32 -0400 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <20070710132018.GA2635@nibiru.local> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> <20070710132018.GA2635@nibiru.local> Message-ID: <46938C50.9030704@waclawek.net> Enrico Weigelt wrote: > Aehm, what happend to my pkg-conf patch from Oct'06 ? > > cu > I am not familiar with this tool, so I didn't respond. Maybe you attach your solution to the recent bug as well, and discuss with the others which is best. Let's see what you guys come up with. Karl From weigelt at metux.de Tue Jul 10 15:54:56 2007 From: weigelt at metux.de (Enrico Weigelt) Date: Tue, 10 Jul 2007 15:54:56 +0200 Subject: [Expat-discuss] GPLv3 Message-ID: <20070710135456.GB2635@nibiru.local> Hi folks, did anyone already think of moving to GPLv3 ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT service - http://www.metux.de/ --------------------------------------------------------------------- Please visit the OpenSource QM Taskforce: http://wiki.metux.de/public/OpenSource_QM_Taskforce Patches / Fixes for a lot dozens of packages in dozens of versions: http://patches.metux.de/ --------------------------------------------------------------------- From dbn.lists at gmail.com Tue Jul 10 15:56:27 2007 From: dbn.lists at gmail.com (Dan Nicholson) Date: Tue, 10 Jul 2007 06:56:27 -0700 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <46938C50.9030704@waclawek.net> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> <20070710132018.GA2635@nibiru.local> <46938C50.9030704@waclawek.net> Message-ID: <91705d080707100656gc9432day23757652cc8a5c3e@mail.gmail.com> On 7/10/07, Karl Waclawek wrote: > Enrico Weigelt wrote: > > Aehm, what happend to my pkg-conf patch from Oct'06 ? > > I am not familiar with this tool, so I didn't respond. > Maybe you attach your solution to the recent bug as well, and discuss > with the others which is best. > Let's see what you guys come up with. I never found any old patch, so I just generated a new one. It's pretty simple, but I'd be interested in seeing what you came up with. Karl, just as an example of why people use pkg-config is that it has very good integration with autoconf. Linking to libexpat while checking the version would be simple: PKG_CHECK_MODULES(EXPAT, expat >= 2.0.1, have_expat=true, have_expat=false) This macro is shipped with pkg-config. The results are stored in EXPAT_LIBS and EXPAT_CFLAGS. That would make linking with expat in non-standard locations trivial. Currently, you have to do something like this (from dbus): AC_CHECK_LIB(expat, XML_ParserCreate_MM, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) That works, but it doesn't check versions or store any info about directory prefixes in -I or -L. Anything like that is custom shell and prone to errors. -- Dan From karl at waclawek.net Tue Jul 10 16:26:51 2007 From: karl at waclawek.net (Karl Waclawek) Date: Tue, 10 Jul 2007 10:26:51 -0400 Subject: [Expat-discuss] GPLv3 In-Reply-To: <20070710135456.GB2635@nibiru.local> References: <20070710135456.GB2635@nibiru.local> Message-ID: <4693972B.4050904@waclawek.net> Enrico Weigelt wrote: > Hi folks, > > did anyone already think of moving to GPLv3 ? > > > I would have to say: absolutely not. We have a no-nonsense license which ensures that Expat can be used just about everywhere. I am sure that it has significantly contributed to Expat's widespread use. Also, its one of the few licenses a non-lawyer can understand. Karl From karl at waclawek.net Tue Jul 10 16:39:14 2007 From: karl at waclawek.net (Karl Waclawek) Date: Tue, 10 Jul 2007 10:39:14 -0400 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <91705d080707100656gc9432day23757652cc8a5c3e@mail.gmail.com> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> <20070710132018.GA2635@nibiru.local> <46938C50.9030704@waclawek.net> <91705d080707100656gc9432day23757652cc8a5c3e@mail.gmail.com> Message-ID: <46939A12.4040309@waclawek.net> Dan Nicholson wrote: > Karl, just as an example of why people use pkg-config is that it has > very good integration with autoconf. Linking to libexpat while > checking the version would be simple: > > PKG_CHECK_MODULES(EXPAT, expat >= 2.0.1, have_expat=true, > have_expat=false) > > This macro is shipped with pkg-config. The results are stored in > EXPAT_LIBS and EXPAT_CFLAGS. That would make linking with expat in > non-standard locations trivial. > > Currently, you have to do something like this (from dbus): > > AC_CHECK_LIB(expat, XML_ParserCreate_MM, > [ AC_CHECK_HEADERS(expat.h, have_expat=true, > have_expat=false) ], > have_expat=false) > > That works, but it doesn't check versions or store any info about > directory prefixes in -I or -L. Anything like that is custom shell and > prone to errors. Any idea if this patch will work on all the environments where Expat builds now? Karl From dbn.lists at gmail.com Tue Jul 10 16:48:45 2007 From: dbn.lists at gmail.com (Dan Nicholson) Date: Tue, 10 Jul 2007 07:48:45 -0700 Subject: [Expat-discuss] [PATCH] Add pkg-config support In-Reply-To: <46939A12.4040309@waclawek.net> References: <20070702203351.GA21478@tilt> <468ABD21.6000004@hartwork.org> <91705d080707060804k13f43323g68d5060409250168@mail.gmail.com> <20070710132018.GA2635@nibiru.local> <46938C50.9030704@waclawek.net> <91705d080707100656gc9432day23757652cc8a5c3e@mail.gmail.com> <46939A12.4040309@waclawek.net> Message-ID: <91705d080707100748n46c279c7n60585eb9c2c7217a@mail.gmail.com> On 7/10/07, Karl Waclawek wrote: > Dan Nicholson wrote: > > Karl, just as an example of why people use pkg-config is that it has > > very good integration with autoconf. Linking to libexpat while > > checking the version would be simple: > > > > PKG_CHECK_MODULES(EXPAT, expat >= 2.0.1, have_expat=true, > > have_expat=false) > > > > This macro is shipped with pkg-config. The results are stored in > > EXPAT_LIBS and EXPAT_CFLAGS. That would make linking with expat in > > non-standard locations trivial. > > > > Currently, you have to do something like this (from dbus): > > > > AC_CHECK_LIB(expat, XML_ParserCreate_MM, > > [ AC_CHECK_HEADERS(expat.h, have_expat=true, > > have_expat=false) ], > > have_expat=false) > > > > That works, but it doesn't check versions or store any info about > > directory prefixes in -I or -L. Anything like that is custom shell and > > prone to errors. > > Any idea if this patch will work on all the environments where Expat > builds now? pkg-config works on many platforms. But your case is simple. Since you're just distributing the .pc file and you don't depend on anything but C libraries, it's someone else's job to figure out whether it works on their platform with their package. It should, though. All it lists is the version, the directories, the necessary CFLAGS, and the necessary LIBS. As an example, though, Xorg builds on many platforms, and pkg-config is a foundation of their build system. To give you an idea of how many packages make use of pkg-config, this is on my Linux system: $ ls /usr/lib/pkgconfig/ | wc -l 379 -- Dan From webmaster at hartwork.org Tue Jul 10 18:41:48 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Tue, 10 Jul 2007 18:41:48 +0200 Subject: [Expat-discuss] GPLv3 In-Reply-To: <4693972B.4050904@waclawek.net> References: <20070710135456.GB2635@nibiru.local> <4693972B.4050904@waclawek.net> Message-ID: <4693B6CC.2080200@hartwork.org> Karl Waclawek wrote: > [..] I am sure that it has significantly contributed > to Expat's widespread use. [..] -------------------------------------------------------------- I fully agree. If Expat was GPL or LGPL licensed the libSpiff library [1] could not have been released under the BSD license. The Xiph.Org Foundation releases all its libraries under the BSD license to enable widespread adoption, also by vendors that are still afraid of Open Source. Sebastian [1] http://libspiff.sourceforge.net/ From gert.cuykens at gmail.com Sat Jul 14 02:23:31 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 14 Jul 2007 02:23:31 +0200 Subject: [Expat-discuss] unclosed token Message-ID: Hi, can anybody tell me what i did wrong please ? http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/make.sh?revision=165&view=markup http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?revision=165&view=markup http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/cgi.c?revision=164&view=markup From gert.cuykens at gmail.com Sat Jul 14 20:49:47 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 14 Jul 2007 20:49:47 +0200 Subject: [Expat-discuss] unclosed token In-Reply-To: <46990F2F.3070904@hartwork.org> References: <46990F2F.3070904@hartwork.org> Message-ID: On 7/14/07, Sebastian Pipping wrote: > Hello Gert! > > Please give more details so people have an easier > start helping you. Like: what exact error you get, > what line the error occurs and what you are trying > to do from the a bigger picture view. > > Finding out what you already know will take more > time from us than for you to write a few lines about it. > > Thank you! > > Sebastian test script ------------- http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/make.sh?revision=166&view=markup source code ------------------ http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/cgi.c?revision=166&view=markup http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?revision=166&view=markup When i run the test script on ubuntu 7 I get gert at www:/var/www/trunk/cgi# ./make.sh INPUT=test Content-Type: text/xml; charset=utf-8 unclosed token at line 1 gert at www:/var/www/trunk/cgi# From webmaster at hartwork.org Sun Jul 15 03:09:02 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 15 Jul 2007 03:09:02 +0200 Subject: [Expat-discuss] unclosed token In-Reply-To: References: <46990F2F.3070904@hartwork.org> Message-ID: <469973AE.9030609@hartwork.org> >From a quick look over the code this line seems very odd to me: int len = sizeof(buf); /* xml.c, line 30 */ [buf] is of type [char *] and therefore [len] probably is 4 on your system. What you want in there is the length of the string instead. Maybe that is the bug already. Another thing I noticed is you don't call XML_ParserFree if XML_Parse fails although you have to. Also "[t]he string your handler receives is NOT zero terminated" [1]. That means your character handler will cause trouble sooner or later: printf("DATA=%s \n", s); /* xml.c, line 16 */ That's all I can do for you right now. Sebastian [1] http://www.xml.com/pub/a/1999/09/expat/index.html?page=3#chardatahandler From gert.cuykens at gmail.com Sun Jul 15 04:33:58 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sun, 15 Jul 2007 04:33:58 +0200 Subject: [Expat-discuss] unclosed token In-Reply-To: <469973AE.9030609@hartwork.org> References: <46990F2F.3070904@hartwork.org> <469973AE.9030609@hartwork.org> Message-ID: Victory... thanks :) http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?revision=173&view=markup root at www:/var/www/trunk/cgi# ./make.sh INPUT=test START=root START=test DATA=test END=test END=root Content-Type: text/xml; charset=utf-8 root at www:/var/www/trunk/cgi# From gert.cuykens at gmail.com Thu Jul 19 03:42:49 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Thu, 19 Jul 2007 03:42:49 +0200 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? Message-ID: source code : http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?revision=181&view=markup source code : http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/po.c?revision=181&view=markup root at www:/var/www/trunk/cgi# gcc -g -o x xml.c -lexpat xml.c: In function ?parse?: xml.c:34: warning: passing argument 2 of ?XML_SetCharacterDataHandler? from incompatible pointer type xml.c:35: warning: passing argument 2 of ?XML_SetEndElementHandler? from incompatible pointer type root at www:/var/www/trunk/cgi# ./x Segmentation fault (core dumped) root at www:/var/www/trunk/cgi# (gdb) break characterData Breakpoint 1 at 0x400bb8: file xml.c, line 13. (gdb) run x Starting program: /var/www/trunk/cgi/x x Breakpoint 1, characterData (page= {length = 140735890907920, line = 0x2b0e0a256800, add = 0x602258}, s=0x7fffa0c8e530 "", l=-1597447296) at xml.c:13 13 page.add(&page,"test"); (gdb) page.length Undefined command: "page". Try "help". (gdb) print page.length $1 = 140735890907920 (gdb) print page.line $2 = (char **) 0x2b0e0a256800 (gdb) print page.line[0] $3 = 0x2b0e0a0452e0 "H\211\\$?H\211l$?H\211?L\211d$?L\211l$?I\211?L\211t$?H\203?(H9?I\211?I\211??????t\022\017?\006\200?8\220" (gdb) print page.line[1] $4 = 0x2b0e0a044210 "L\211l$?I\211?H\211l$?L\211d$?L\211t$?I\211?H\211\\$?H\203?8L9?H\211?I\211??????\017\204\200" (gdb) From webmaster at hartwork.org Thu Jul 19 03:51:08 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Thu, 19 Jul 2007 03:51:08 +0200 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? In-Reply-To: References: Message-ID: <469EC38C.2010506@hartwork.org> Don't change the handlers' signatures - do a cast inside their bodies instead. Sebastian From gert.cuykens at gmail.com Thu Jul 19 04:07:02 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Thu, 19 Jul 2007 04:07:02 +0200 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? In-Reply-To: <469EC38C.2010506@hartwork.org> References: <469EC38C.2010506@hartwork.org> Message-ID: On 7/19/07, Sebastian Pipping wrote: > Don't change the handlers' signatures - do a cast inside > their bodies instead. I am sorry if the following looks stupid but its my best shot ? static void characterData(void *userData, const XML_Char *s, int l) { PAGE page=(PAGE)userData; char data[l]; memcpy(data,s,l); page.add(&page,"test"); } root at www:/var/www/trunk/cgi# gcc -g -o x xml.c -lexpat xml.c: In function ?characterData?: xml.c:11: error: conversion to non-scalar type requested xml.c: In function ?endElement?: xml.c:20: error: conversion to non-scalar type requested root at www:/var/www/trunk/cgi# From webmaster at hartwork.org Thu Jul 19 04:10:42 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Thu, 19 Jul 2007 04:10:42 +0200 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? In-Reply-To: References: <469EC38C.2010506@hartwork.org> Message-ID: <469EC822.3070205@hartwork.org> You pass in a pointer, you get a pointer out. Try this instead: PAGE * const page = (PAGE *)userData; Sebastian From nickmacd at gmail.com Thu Jul 19 04:39:50 2007 From: nickmacd at gmail.com (Nick MacDonald) Date: Wed, 18 Jul 2007 22:39:50 -0400 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? In-Reply-To: References: Message-ID: Start with this, quickly typed by hand and not compiled, but should work: struct mydata { unsigned int type; /* If you think you might need more than one type of structure */ unsigned int a; unsigned int b; /* or whatever */ }; typedef stuct mydata *ptr2mydata; /* global instance */ struct mydata myglobaldata; main() { void* userDataPtr = &myglobaldata; someExpatFunction(..., userDataPtr); } someExpatCallback(..., passes in userData,...) { ptr2mydata myuserdata=(ptr2mydata)userData; /* a cast */ printf("In function %s, userData->a=%u\n", __FUNCTION__, myuserdata->a); /* and so on */ } Good luck... From gert.cuykens at gmail.com Thu Jul 19 05:02:36 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Thu, 19 Jul 2007 05:02:36 +0200 Subject: [Expat-discuss] Any suggestion please how to transfer a struct as user data ? In-Reply-To: References: Message-ID: On 7/19/07, Nick MacDonald wrote: > Start with this, quickly typed by hand and not compiled, but should work: > > > struct mydata > { > unsigned int type; /* If you think you might need more than one > type of structure */ > unsigned int a; > unsigned int b; /* or whatever */ > }; > > typedef stuct mydata *ptr2mydata; > > /* global instance */ > struct mydata myglobaldata; > > > main() > { > void* userDataPtr = &myglobaldata; > someExpatFunction(..., userDataPtr); > } > > > someExpatCallback(..., passes in userData,...) > { > ptr2mydata myuserdata=(ptr2mydata)userData; /* a cast */ > > printf("In function %s, userData->a=%u\n", __FUNCTION__, myuserdata->a); > > /* and so on */ > } > > Good luck... > Works now :) thanks too Sebastian Pipping static void characterData(void *userData, const XML_Char *s, int l) { PAGE *page = (PAGE *)userData; page->add(page,"test"); } From gert.cuykens at gmail.com Thu Jul 19 18:43:21 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Thu, 19 Jul 2007 18:43:21 +0200 Subject: [Expat-discuss] characterData Message-ID: Is it possible to launch the characterData handler when expat parses a empty tag This works except when i parse a empty password http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/make.sh?view=markup http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup Any suggestions ? From gert.cuykens at gmail.com Thu Jul 19 20:43:52 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Thu, 19 Jul 2007 20:43:52 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/19/07, Gert Cuykens wrote: > Is it possible to launch the characterData handler when expat parses a > empty tag > > This works except when i parse a empty password > > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/make.sh?view=markup > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup > > Any suggestions ? > I could code a start and end handler verifying if characterData handler happened but thats more code then just to make sure there are no empty tags ? Are there any other tricks ? From gert.cuykens at gmail.com Fri Jul 20 02:54:00 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 02:54:00 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: Never mind this is much better :) http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup From webmaster at hartwork.org Fri Jul 20 03:04:12 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Fri, 20 Jul 2007 03:04:12 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: <46A00A0C.3030905@hartwork.org> You don't handle the case yet that the character handler is called multiple times for a single node. The node one two three can actually be passed to the handler as "one tw" and "o three" or similar. You have to do concatenation yourself. Sebastian From gert.cuykens at gmail.com Fri Jul 20 03:22:55 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 03:22:55 +0200 Subject: [Expat-discuss] characterData In-Reply-To: <46A00A0C.3030905@hartwork.org> References: <46A00A0C.3030905@hartwork.org> Message-ID: On 7/20/07, Sebastian Pipping wrote: > You don't handle the case yet that the character handler > is called multiple times for a single node. > The node > > one two three > > can actually be passed to the handler as > > "one tw" > > and > > "o three" > > or similar. You have to do concatenation yourself. hmm yes you are right need to make a drawing for that, but first i want to find out why my xml post to apache2 doest come trough. I only get the first line. Probably has to do with stdin and \n characters or something. From gert.cuykens at gmail.com Fri Jul 20 04:56:23 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 04:56:23 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: <46A00A0C.3030905@hartwork.org> Message-ID: On 7/20/07, Gert Cuykens wrote: > On 7/20/07, Sebastian Pipping wrote: > > You don't handle the case yet that the character handler > > is called multiple times for a single node. > > The node > > > > one two three > > > > can actually be passed to the handler as > > > > "one tw" > > > and > > > > "o three" > > > > or similar. You have to do concatenation yourself. > > hmm yes you are right need to make a drawing for that, but first i > want to find out why my xml post to apache2 doest come trough. I only > get the first line. Probably has to do with stdin and \n characters or > something. > if i am not mistaken in this version http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup i only get ++++ when i write a tag inside a other tag like for example -----++++---- For now that will just do fine for my application. I like to keep it as simple as possible i am not that smart. I will make a start tag init later. From Mark.Williams at techop.co.uk Fri Jul 20 10:45:56 2007 From: Mark.Williams at techop.co.uk (Mark Williams) Date: Fri, 20 Jul 2007 09:45:56 +0100 Subject: [Expat-discuss] characterData In-Reply-To: Message-ID: > On 7/20/07, Gert Cuykens wrote: > > On 7/20/07, Sebastian Pipping wrote: > > > You don't handle the case yet that the character handler > > > is called multiple times for a single node. > > > The node > > > > > > one two three > > > > > > can actually be passed to the handler as > > > > > > "one tw" > > > > and > > > > > > "o three" > > > > > > or similar. You have to do concatenation yourself. > > > > hmm yes you are right need to make a drawing for that, but first i > > want to find out why my xml post to apache2 doest come > trough. I only > > get the first line. Probably has to do with stdin and \n > characters or > > something. > > > > if i am not mistaken in this version > > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup > > i only get ++++ when i write a tag inside a other tag like for example > -----++++---- > > For now that will just do fine for my application. I like to keep it > as simple as possible i am not that smart. I will make a start tag > init later. You also have a memory leak in this code. You can check for empty elements just by checking if page->data == NULL in your end element handler. Mark From gert.cuykens at gmail.com Fri Jul 20 16:52:18 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 16:52:18 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/20/07, Mark Williams wrote: > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup > You also have a memory leak in this code. You can check for empty > elements just by checking if page->data == NULL in your end element > handler. Thanks i think i see it too, its leaking when i do something like this statemant1 statemant2 resulting in NULL/DATA/DATA and everything after NULL doesn't get freed. From gert.cuykens at gmail.com Fri Jul 20 17:27:30 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 17:27:30 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/20/07, Gert Cuykens wrote: > On 7/20/07, Mark Williams wrote: > > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup > > You also have a memory leak in this code. You can check for empty > > elements just by checking if page->data == NULL in your end element > > handler. > > Thanks i think i see it too, its leaking when i do something like this > > > statemant1 > statemant2 > > resulting in NULL/DATA/DATA and everything after NULL doesn't get freed. > Actually come to think of it there are a koppel of leaks more :) From gert.cuykens at gmail.com Fri Jul 20 18:20:02 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Fri, 20 Jul 2007 18:20:02 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/20/07, Gert Cuykens wrote: > On 7/20/07, Gert Cuykens wrote: > > On 7/20/07, Mark Williams wrote: > > > http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup > > > You also have a memory leak in this code. You can check for empty > > > elements just by checking if page->data == NULL in your end element > > > handler. > > > > Thanks i think i see it too, its leaking when i do something like this > > > > > > statemant1 > > statemant2 > > > > resulting in NULL/DATA/DATA and everything after NULL doesn't get freed. > > > > Actually come to think of it there are a koppel of leaks more :) > This should cover all memory leaks i think http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup From gert.cuykens at gmail.com Sat Jul 21 05:30:17 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 21 Jul 2007 05:30:17 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/21/07, Nick MacDonald wrote: > Since you are NOT guaranteed to get only ONE CharacterData handler > call, you should really be writing: > > static void > characterData(void *userData, const XML_Char *s, int l) > { > PAGE *page = (PAGE *)userData; > if (NULL == page->data) > { > char *data=malloc(l); > memcpy(data,s,l); > page->data=data; > page->dataSize=l; /* a new structure member */ > } > else > { > char *data=realloc(data, l+page->dataSize); > memcpy(data+page->dataSize,s,l); > page->data=data; > page->dataSize+=l; > } > } > Thanks :) From gert.cuykens at gmail.com Sat Jul 21 05:51:06 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 21 Jul 2007 05:51:06 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: On 7/21/07, Gert Cuykens wrote: > On 7/21/07, Nick MacDonald wrote: > > Since you are NOT guaranteed to get only ONE CharacterData handler > > call, you should really be writing: > > > > static void > > characterData(void *userData, const XML_Char *s, int l) > > { > > PAGE *page = (PAGE *)userData; > > if (NULL == page->data) > > { > > char *data=malloc(l); > > memcpy(data,s,l); > > page->data=data; > > page->dataSize=l; /* a new structure member */ > > } > > else > > { > > char *data=realloc(data, l+page->dataSize); > > memcpy(data+page->dataSize,s,l); > > page->data=data; > > page->dataSize+=l; > > } > > } > > > > Thanks :) > Anything else :) http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup PS Can this mysql cgi be added in the expat example's for your next release ? From webmaster at hartwork.org Sat Jul 21 06:57:08 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sat, 21 Jul 2007 06:57:08 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: Message-ID: <46A19224.1010606@hartwork.org> Gert Cuykens wrote: > On 7/21/07, Nick MacDonald wrote: >> Since you are NOT guaranteed to get only ONE CharacterData handler >> call, you should really be writing: >> >> static void >> characterData(void *userData, const XML_Char *s, int l) >> { >> PAGE *page = (PAGE *)userData; >> if (NULL == page->data) >> { >> char *data=malloc(l); >> memcpy(data,s,l); >> page->data=data; >> page->dataSize=l; /* a new structure member */ >> } >> else >> { >> char *data=realloc(data, l+page->dataSize); >> memcpy(data+page->dataSize,s,l); >> page->data=data; >> page->dataSize+=l; >> } >> } >> > > Thanks :) --------------------------------------- I still wonder how all this can work without zero-termination. Am I missing something? Sebastian From gert.cuykens at gmail.com Sat Jul 21 13:46:13 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 21 Jul 2007 13:46:13 +0200 Subject: [Expat-discuss] characterData In-Reply-To: <46A19224.1010606@hartwork.org> References: <46A19224.1010606@hartwork.org> Message-ID: On 7/21/07, Sebastian Pipping wrote: > I still wonder how all this can work > without zero-termination. Am I missing > something? the po.c add function adds a zero http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/po.c?view=markup From gert.cuykens at gmail.com Sat Jul 21 20:26:51 2007 From: gert.cuykens at gmail.com (Gert Cuykens) Date: Sat, 21 Jul 2007 20:26:51 +0200 Subject: [Expat-discuss] characterData In-Reply-To: References: <46A19224.1010606@hartwork.org> Message-ID: recoded the output and added 2 more malloc checks http://dfo.svn.sourceforge.net/viewvc/dfo/trunk/cgi/xml.c?view=markup From dclusin at enernoc.com Fri Jul 20 18:18:37 2007 From: dclusin at enernoc.com (Dan Clusin) Date: Fri, 20 Jul 2007 12:18:37 -0400 Subject: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls Message-ID: <97948279523F1A4CA9C0ADE3ED520898C208E4@webmail> Greetings, I've run into a problem concerning heap corruption using expat and I'm not really sure what to make of it. Any suggestion would be much appreciated. Description: I'm writing an XMPP client currently on a FC 7 Linux machine. For those of you who aren't aware, XMPP is an instant messaging protocol that uses XML as a stream for the underlying data formatting of the protocol. Part of the specification requires that the stream be renegotiated once the socket connection between the client and server becomes encrypted. So for example, the client would send its initial handshake such as: Then the server would respond as with its own opening XML stream that is similar. All of the data retrieved from the server is considered its own XML document. That is to say, The XML data my program sends to the server is not considered to be part of the data that is Being processed by the expat library. So as I said before, once the connection becomes encrypted during the handshake process (using SSL), my client needs to send its own stream header again (similar to example above) And the server will respond with its response to the handshake. The stream before encryption And the stream after encryption are required to be (as per the spec) thought of as 2 different XML streams (or documents if you prefer). It made sense to me at the time to have these processed by two different parsers, since The streams are not related. So my solution to this was to destroy the first parser using XML_ParserFree Once the SSL negotiation completed. An XML_ParserCreate would immediately proceed the XML_ParserFree Call. How this is handled in my program is as follows: 1. Program starts up, creates a parser, etc. 2. Parser is configured and supplied the various handlers. 3. Connection is made, handshake is sent, etc. 4. All further responses from the server are fed to the expat parser 5. SSL is negotiated and set up. 6. Outside of the handler functions (in the main socket listener loop to be precise), the current parser Is destroyed and a new one is created. 7. The new parser is now fed all the data from the secure connection. So now my problem: My program crashes sometime later (approximately 3 calls later to my element start handler When the attribute being processed is the namespace.). Specifically, it crashes on a malloc call. I'm fairly confident That this is due to heap corruption because my machine has 2GB of memory, and I have inspected the application Using valgrind and it doesn't use more than 1MB of memory. It always crashes in the exact same manner and sequence of element handler calls. I noticed that if I take out the XML_ParserFree call for the original call and just create the new one it works fine and does not destroy the heap. This isn't an optimal solution for obvious reasons. Some more information that could help: The reference to the XML parser is contained inside a structure that is being used as the userData for the XML parser. The form of that structure is as follows: typedef struct xmpp_session { linked_queue_t *outbound; login_phase_t connection_state; tcp_socket_t *server; xml_node_t *current_node; XML_Parser the_parser; } xmpp_session_t; My XML_Parser init and delete routines are as follows: void xml_parser_init( xmpp_session_t *a_connection ) { a_connection->the_parser = XML_ParserCreate( NULL ); XML_SetStartElementHandler( a_connection->the_parser, xml_element_start ); XML_SetEndElementHandler( a_connection->the_parser, xml_element_end ); XML_SetCharacterDataHandler( a_connection->the_parser, xml_cdata_handler ); XML_SetUserData( a_connection->the_parser, a_connection ); } void xml_parser_destroy( xmpp_session_t *a_session ) { XML_ParserFree( a_session->the_parser ); a_session->current_node = NULL; } The code inside the main socket loop for restarting the parser is as follows: printf("restarting parser.\n"); //xml_parser_destroy( the_session ); xml_parser_init( the_session ); As I said before, it only corrupts the heap when I have the parser destroy call un-commented out. Also, something to note is that the xmpp_session_t instance is kept the same (not copied or a new One create), and just passed to the new parser instance. If anyone has any suggestions I would very much appreciate it. Kindest regards, Daniel Clusin From webmaster at hartwork.org Sun Jul 22 17:49:30 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Sun, 22 Jul 2007 17:49:30 +0200 Subject: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls In-Reply-To: <97948279523F1A4CA9C0ADE3ED520898C208E4@webmail> References: <97948279523F1A4CA9C0ADE3ED520898C208E4@webmail> Message-ID: <46A37C8A.4080702@hartwork.org> Dan Clusin wrote: > printf("restarting parser.\n"); > > //xml_parser_destroy( the_session ); > > xml_parser_init( the_session ); ------------------------------------------------- Hello Dan! I was wonderung if you also call the destroy method the very first time with no parser instance existing yet. Since XML_Parser is a pointer type typedef struct XML_ParserStruct *XML_Parser; a call to xml_parser_destroy on a session with an uninitialized XML_Parser member would call free() on a broken pointer. Just an idea. If that's not the guilty part the only other thing I can offer you is a workaround calling XML_ParserReset on the old parser and then reusing it. Good luck! Sebastian From dclusin at enernoc.com Mon Jul 23 12:59:33 2007 From: dclusin at enernoc.com (Dan Clusin) Date: Mon, 23 Jul 2007 06:59:33 -0400 Subject: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls In-Reply-To: <46A37C8A.4080702@hartwork.org> References: <97948279523F1A4CA9C0ADE3ED520898C208E4@webmail> <46A37C8A.4080702@hartwork.org> Message-ID: <97948279523F1A4CA9C0ADE3ED520898C2093C@webmail> I'm fairly sure that is not the issue, however I will investigate further. That doesn't seem to be the case because the variable for the conditional Surrounding the restarting of the parser is only set to true once SSL setup Has been completed. It is set to false at the beginning of the progam (main) and is currently only single threaded. Would XML_ParserReset destroy all of the state currently associated with the Current XML document? That's really all I'm looking for. I don't really care If the parser is actually destroyed and re-initialised. So long as no data >From the previous XML document could potentially futs up the current document being parsed. Regards, Dan -----Original Message----- From: Sebastian Pipping [mailto:webmaster at hartwork.org] Sent: Sunday, July 22, 2007 11:50 AM To: Dan Clusin Cc: expat-discuss at libexpat.org Subject: Re: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls Dan Clusin wrote: > printf("restarting parser.\n"); > > //xml_parser_destroy( the_session ); > > xml_parser_init( the_session ); ------------------------------------------------- Hello Dan! I was wonderung if you also call the destroy method the very first time with no parser instance existing yet. Since XML_Parser is a pointer type typedef struct XML_ParserStruct *XML_Parser; a call to xml_parser_destroy on a session with an uninitialized XML_Parser member would call free() on a broken pointer. Just an idea. If that's not the guilty part the only other thing I can offer you is a workaround calling XML_ParserReset on the old parser and then reusing it. Good luck! Sebastian From webmaster at hartwork.org Mon Jul 23 20:39:50 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Mon, 23 Jul 2007 20:39:50 +0200 Subject: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls In-Reply-To: <97948279523F1A4CA9C0ADE3ED520898C2093C@webmail> References: <97948279523F1A4CA9C0ADE3ED520898C208E4@webmail> <46A37C8A.4080702@hartwork.org> <97948279523F1A4CA9C0ADE3ED520898C2093C@webmail> Message-ID: <46A4F5F6.5010808@hartwork.org> Dan Clusin wrote: > Would XML_ParserReset destroy all of the state currently > associated with the Current XML document? That's really > all I'm looking for. I don't really care if the parser > is actually destroyed and re-initialised. So long as no > data From the previous XML document could potentially > futs up the current document being parsed. ----------------------------------------------- Yes, that's what it does: XML_Bool XMLCALL XML_ParserReset(XML_Parser p, const XML_Char *encoding); "Clean up the memory structures maintained by the parser so that it may be used again. After this has been called, parser is ready to start parsing a new document. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. This function may not be used on a parser created using XML_ExternalEntityParserCreate; it will return XML_FALSE in that case. Returns XML_TRUE on success. Your application is responsible for dealing with any memory associated with user data." Sebastian From mark.serlin at ashgaming.com Thu Jul 26 14:07:18 2007 From: mark.serlin at ashgaming.com (Mark Serlin) Date: Thu, 26 Jul 2007 13:07:18 +0100 Subject: [Expat-discuss] Licence Message-ID: Dear all, where can i find the licensing information for expat please? ________________________________________________ Mark Serlin Senior Developer - Ash Gaming Ltd Profitable Games For Interactive Platforms * 2nd Floor, 59 Lafone Street, Eagle Wharf, London, SE1 2LX ( +44 (0)207 403 8796 : ashgaming.com CONFIDENTIALITY AND DISCLAIMER NOTICE: This email and any files transmitted with it are confidential and may contain sensitive information. They are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient(s) of this email please notify the sender immediately by return email or by telephoning 020 7403 8796. Please delete all copies from your system and do not print, forward or copy its contents. If this email has been received in error, its recipient(s) is notified that any dissemination of the information contained in this email is strictly prohibited. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ash Gaming Ltd. Ash Gaming Ltd reserves the right to monitor and record all incoming and outgoing emails. Ash Gaming Ltd does not accept any responsibility for viruses once this email has been transmitted. You should take full responsibility for virus checking. No contract may be concluded on behalf of Ash Gaming Ltd, nor service of process accepted, by email unless confirmed in writing by a duly authorised representative of Ash Gaming Ltd. Ash Gaming Ltd is a company registered in England and Wales with company number 4070861. Its registered office is at 4-6 Church Road, Burgess Hill, West Sussex, RH15 9AE. Full details about Ash Gaming Ltd can be found on the website at http://www.ashgaming.com From webmaster at hartwork.org Thu Jul 26 15:47:27 2007 From: webmaster at hartwork.org (Sebastian Pipping) Date: Thu, 26 Jul 2007 15:47:27 +0200 Subject: [Expat-discuss] Licence In-Reply-To: References: Message-ID: <46A8A5EF.1010502@hartwork.org> Mark Serlin wrote: > Dear all, > where can i find the licensing information for expat please? --------------------------------------------------------------- On the Expat project page at SourceForge: http://sourceforge.net/projects/expat/ "License : MIT License" Full text here: http://expat.cvs.sourceforge.net/expat/expat/COPYING?view=markup Sebastian