From 522d8464d51e9da9da91093d6e2f312cea2e07f5 Mon Sep 17 00:00:00 2001 From: ivost Date: Sat, 24 Jan 2009 01:40:17 +0000 Subject: * fixed name of libxml2, it's called now xml2. This way it follows the rules of the other libs in packages * tried to fix the samples (still some problems) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12587 3ad0048d-3df7-0310-abae-a5850022a9f2 --- packages/libxml/Makefile | 118 ++++---- packages/libxml/Makefile.fpc | 2 +- packages/libxml/examples/exutils.pas | 6 +- packages/libxml/examples/io1.pas | 4 +- packages/libxml/examples/io2.pas | 4 +- packages/libxml/examples/reader1.pas | 2 +- packages/libxml/examples/reader2.pas | 2 +- packages/libxml/examples/tree1.pas | 2 +- packages/libxml/examples/tree2.pas | 4 +- packages/libxml/fpmake.pp | 4 +- packages/libxml/src/libxml2.pas | 570 ----------------------------------- packages/libxml/src/xml2.pas | 570 +++++++++++++++++++++++++++++++++++ packages/libxml/src/xmlxsd.pas | 2 +- 13 files changed, 645 insertions(+), 645 deletions(-) delete mode 100644 packages/libxml/src/libxml2.pas create mode 100644 packages/libxml/src/xml2.pas (limited to 'packages/libxml') diff --git a/packages/libxml/Makefile b/packages/libxml/Makefile index f4869e9b7a..a3135866e9 100644 --- a/packages/libxml/Makefile +++ b/packages/libxml/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/10/22] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/01/18] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded @@ -265,178 +265,178 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F override PACKAGE_NAME=libxml2 override PACKAGE_VERSION=2.2.2 ifeq ($(FULL_TARGET),i386-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-go32v2) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-win32) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-os2) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-freebsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-beos) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-haiku) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-netbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-solaris) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-qnx) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-netware) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-openbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-wdosx) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-darwin) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-emx) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-watcom) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-netwlibc) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-wince) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-symbian) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-freebsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-netbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-amiga) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-atari) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-openbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-palmos) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),m68k-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-netbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-amiga) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-macos) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-darwin) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-morphos) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),sparc-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),sparc-netbsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),sparc-solaris) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),sparc-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),x86_64-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),x86_64-freebsd) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),x86_64-darwin) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),x86_64-win64) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),x86_64-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-palmos) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-darwin) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-wince) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-gba) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-nds) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),arm-symbian) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc64-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc64-darwin) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),powerpc64-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),avr-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),armeb-linux) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),armeb-embedded) -override TARGET_UNITS+=libxml2 xmlxsd +override TARGET_UNITS+=xml2 xmlxsd endif ifeq ($(FULL_TARGET),i386-linux) override TARGET_EXAMPLEDIRS+=examples diff --git a/packages/libxml/Makefile.fpc b/packages/libxml/Makefile.fpc index 2f882cbc68..5600a1e82a 100644 --- a/packages/libxml/Makefile.fpc +++ b/packages/libxml/Makefile.fpc @@ -7,7 +7,7 @@ name=libxml2 version=2.2.2 [target] -units=libxml2 xmlxsd +units=xml2 xmlxsd exampledirs=examples [require] diff --git a/packages/libxml/examples/exutils.pas b/packages/libxml/examples/exutils.pas index 9bd32bbd3e..347d373dda 100644 --- a/packages/libxml/examples/exutils.pas +++ b/packages/libxml/examples/exutils.pas @@ -6,7 +6,7 @@ interface uses ctypes, - libxml2, + xml2, SysUtils; procedure docdump(doc: xmlDocPtr); @@ -24,7 +24,7 @@ var begin mem := nil; xmlDocDumpMemory(doc, mem, size); - writeln(mem); + writeln(pchar(mem)); xmlFree(mem); end; @@ -48,4 +48,4 @@ begin writeln(msg); end; -end. \ No newline at end of file +end. diff --git a/packages/libxml/examples/io1.pas b/packages/libxml/examples/io1.pas index 920c9a8a63..f453dacf77 100644 --- a/packages/libxml/examples/io1.pas +++ b/packages/libxml/examples/io1.pas @@ -17,7 +17,7 @@ program io1; uses ctypes, - libxml2, + xml2, exutils, SysUtils; @@ -172,4 +172,4 @@ begin * Cleanup function for the XML library. *) xmlCleanupParser(); -end. \ No newline at end of file +end. diff --git a/packages/libxml/examples/io2.pas b/packages/libxml/examples/io2.pas index 50a6c62c69..9b63bcdb91 100644 --- a/packages/libxml/examples/io2.pas +++ b/packages/libxml/examples/io2.pas @@ -15,7 +15,7 @@ program io2; uses ctypes, - libxml2, + xml2, exutils, SysUtils; @@ -46,4 +46,4 @@ begin *) xmlFree(xmlbuff); xmlFreeDoc(doc); -end. \ No newline at end of file +end. diff --git a/packages/libxml/examples/reader1.pas b/packages/libxml/examples/reader1.pas index 877960385f..8ca1516568 100644 --- a/packages/libxml/examples/reader1.pas +++ b/packages/libxml/examples/reader1.pas @@ -17,7 +17,7 @@ program reader1; uses ctypes, - libxml2, + xml2, exutils; (** diff --git a/packages/libxml/examples/reader2.pas b/packages/libxml/examples/reader2.pas index 414b193841..87e7af781c 100644 --- a/packages/libxml/examples/reader2.pas +++ b/packages/libxml/examples/reader2.pas @@ -18,7 +18,7 @@ program reader2; uses ctypes, - libxml2, + xml2, exutils; (** diff --git a/packages/libxml/examples/tree1.pas b/packages/libxml/examples/tree1.pas index b648daa7fd..eb27157269 100644 --- a/packages/libxml/examples/tree1.pas +++ b/packages/libxml/examples/tree1.pas @@ -16,7 +16,7 @@ program tree1; uses ctypes, - libxml2, + xml2, exutils, SysUtils; diff --git a/packages/libxml/examples/tree2.pas b/packages/libxml/examples/tree2.pas index 20870a7081..8bd8a4518b 100644 --- a/packages/libxml/examples/tree2.pas +++ b/packages/libxml/examples/tree2.pas @@ -14,7 +14,7 @@ program tree2; uses ctypes, - libxml2, + xml2, exutils, SysUtils; @@ -107,4 +107,4 @@ begin * this is to debug memory for regression tests *) xmlMemoryDump(); -end. \ No newline at end of file +end. diff --git a/packages/libxml/fpmake.pp b/packages/libxml/fpmake.pp index fbfa2a1aae..900d1bf179 100644 --- a/packages/libxml/fpmake.pp +++ b/packages/libxml/fpmake.pp @@ -12,7 +12,7 @@ begin begin {$endif ALLPACKAGES} - P:=AddPackage('libxml2'); + P:=AddPackage('xml2'); {$ifdef ALLPACKAGES} P.Directory:='libxml'; {$endif ALLPACKAGES} @@ -20,7 +20,7 @@ begin P.SourcePath.Add('src'); P.IncludePath.Add('src'); - T:=P.Targets.AddUnit('libxml2.pas'); + T:=P.Targets.AddUnit('xml2.pas'); with T.Dependencies do begin AddInclude('xinclude.inc'); diff --git a/packages/libxml/src/libxml2.pas b/packages/libxml/src/libxml2.pas deleted file mode 100644 index 12938d5ba6..0000000000 --- a/packages/libxml/src/libxml2.pas +++ /dev/null @@ -1,570 +0,0 @@ -{ - Translation of the libxml2 headers for FreePascal - Copyright (C) 2008 by Ivo Steinmann -} - -unit libxml2; - -{$mode objfpc} -{$H+} -{$macro on} - -{$ALIGN 8} -{$MINENUMSIZE 4} - -interface - -uses -{$IFDEF WINDOWS} - windows, -{$ENDIF} -{$IFDEF UNIX} - unixtype, -{$ENDIF} - ctypes; - -//{$IF Sizeof(cbool) <> Sizeof(cint)} -// {$ERROR 'cbool size mismatch!'} -//{$ENDIF} - -{$IFDEF WINDOWS} - {$DEFINE DYNLINK} -{$ENDIF} - -{$IFDEF DYNLINK} -const -{$IF Defined(WINDOWS)} - libxml2lib = 'libxml2.dll'; -{$ELSEIF Defined(UNIX)} - libxml2lib = 'libxml2.so'; -{$ELSE} - {$MESSAGE ERROR 'DYNLINK not supported'} -{$IFEND} -{$ELSE} - {$LINKLIB xml2} -{$ENDIF} - -{$i xmlexports.inc} -{$i xmlversion.inc} - -{$IFDEF WINDOWS} -type - size_t = culong; -{$ENDIF} - -type - PFILE = pointer; - va_list = pointer; - iconv_t = pointer; - -(* - include pointers (forwarding) -*) -{$DEFINE POINTER} - {$i catalog.inc} - {$i chvalid.inc} - {$i dict.inc} - {$i encoding.inc} - {$i tree.inc} - {$i list.inc} - {$i entities.inc} - {$i xmlerror.inc} - {$i xmlmemory.inc} - {$i hash.inc} - {$i pattern.inc} - {$i schemasInternals.inc} - {$i valid.inc} - {$i parser.inc} - {$i parserInternals.inc} - {$i schematron.inc} - {$i threads.inc} - {$i uri.inc} - {$i relaxng.inc} - {$i globals.inc} - {$i nanoftp.inc} - {$i nanohttp.inc} - {$i SAX.inc} - {$i SAX2.inc} - {$i HTMLtree.inc} - {$i HTMLparser.inc} - {$i xmlautomata.inc} - {$i xmlIO.inc} - {$i xmlmodule.inc} - {$i xmlreader.inc} - {$i xmlregexp.inc} - {$i xmlsave.inc} - {$i xmlschemas.inc} - {$i xmlschemastypes.inc} - {$i xmlstring.inc} - {$i xmlunicode.inc} - {$i xmlwriter.inc} - {$i c14n.inc} - {$i xpath.inc} - {$i xpathInternals.inc} - {$i xlink.inc} - {$i xinclude.inc} - {$i xpointer.inc} -{$UNDEF POINTER} - -(* - include types -*) -{$DEFINE TYPE} - {$i catalog.inc} - {$i chvalid.inc} - {$i dict.inc} - {$i encoding.inc} - {$i tree.inc} - {$i list.inc} - {$i entities.inc} - {$i xmlerror.inc} - {$i xmlmemory.inc} - {$i hash.inc} - {$i pattern.inc} - {$i schemasInternals.inc} - {$i valid.inc} - {$i parser.inc} - {$i parserInternals.inc} - {$i schematron.inc} - {$i threads.inc} - {$i uri.inc} - {$i relaxng.inc} - {$i globals.inc} - {$i nanoftp.inc} - {$i nanohttp.inc} - {$i SAX.inc} - {$i SAX2.inc} - {$i HTMLtree.inc} - {$i HTMLparser.inc} - {$i xmlautomata.inc} - {$i xmlIO.inc} - {$i xmlmodule.inc} - {$i xmlreader.inc} - {$i xmlregexp.inc} - {$i xmlsave.inc} - {$i xmlschemas.inc} - {$i xmlschemastypes.inc} - {$i xmlstring.inc} - {$i xmlunicode.inc} - {$i xmlwriter.inc} - {$i c14n.inc} - {$i xpath.inc} - {$i xpathInternals.inc} - {$i xlink.inc} - {$i xinclude.inc} - {$i xpointer.inc} -{$UNDEF TYPE} - -(* - include constants -*) -{$DEFINE CONST} -const - {$i catalog.inc} - {$i chvalid.inc} - {$i dict.inc} - {$i encoding.inc} - {$i tree.inc} - {$i list.inc} - {$i entities.inc} - {$i xmlerror.inc} - {$i xmlmemory.inc} - {$i pattern.inc} - {$i schemasInternals.inc} - {$i hash.inc} - {$i valid.inc} - {$i parser.inc} - {$i parserInternals.inc} - {$i schematron.inc} - {$i threads.inc} - {$i uri.inc} - {$i relaxng.inc} - {$i globals.inc} - {$i nanoftp.inc} - {$i nanohttp.inc} - {$i SAX.inc} - {$i SAX2.inc} - {$i HTMLtree.inc} - {$i HTMLparser.inc} - {$i xmlautomata.inc} - {$i xmlIO.inc} - {$i xmlmodule.inc} - {$i xmlreader.inc} - {$i xmlregexp.inc} - {$i xmlsave.inc} - {$i xmlschemas.inc} - {$i xmlschemastypes.inc} - {$i xmlstring.inc} - {$i xmlunicode.inc} - {$i xmlwriter.inc} - {$i c14n.inc} - {$i xpath.inc} - {$i xpathInternals.inc} - {$i xlink.inc} - {$i xinclude.inc} - {$i xpointer.inc} -{$UNDEF CONST} - -(* - include functions -*) -{$DEFINE FUNCTION} - {$i catalog.inc} - {$i chvalid.inc} - {$i dict.inc} - {$i encoding.inc} - {$i tree.inc} - {$i list.inc} - {$i entities.inc} - {$i xmlerror.inc} - {$i xmlmemory.inc} - {$i pattern.inc} - {$i schemasInternals.inc} - {$i hash.inc} - {$i valid.inc} - {$i parser.inc} - {$i parserInternals.inc} - {$i schematron.inc} - {$i threads.inc} - {$i uri.inc} - {$i relaxng.inc} - {$i globals.inc} - {$i nanoftp.inc} - {$i nanohttp.inc} - {$i SAX.inc} - {$i SAX2.inc} - {$i HTMLtree.inc} - {$i HTMLparser.inc} - {$i xmlautomata.inc} - {$i xmlIO.inc} - {$i xmlmodule.inc} - {$i xmlreader.inc} - {$i xmlregexp.inc} - {$i xmlsave.inc} - {$i xmlschemas.inc} - {$i xmlschemastypes.inc} - {$i xmlstring.inc} - {$i xmlunicode.inc} - {$i xmlwriter.inc} - {$i c14n.inc} - {$i xpath.inc} - {$i xpathInternals.inc} - {$i xlink.inc} - {$i xinclude.inc} - {$i xpointer.inc} -{$UNDEF FUNCTION} - -operator := (const S: String): xmlCharPtr; inline; -//operator := (const C: AnsiChar): xmlCharPtr; inline; - -implementation - -procedure fpcxmlFree(mem: pointer); XMLCALL; -begin - FreeMem(mem); -end; - -function fpcxmlMalloc(size: size_t): pointer; XMLCALL; -begin - GetMem(Result, size); -end; - -function fpcxmlRealloc(mem: pointer; size: size_t): pointer; XMLCALL; -begin - Result := mem; - ReallocMem(Result, size); -end; - -procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); XMLCALL; -begin - writeln('struct error'); -end; - - -(* - * macros from xmlversion.inc - *) - -procedure LIBXML_TEST_VERSION; -begin - xmlCheckVersion(LIBXML_VERSION); -end; - - -(* - * macros from xmlversion.inc - *) - -function BAD_CAST(str: pchar): xmlCharPtr; -begin - result := xmlCharPtr(str); -end; - -function BAD_CAST(str: string): xmlCharPtr; -begin - result := xmlCharPtr(PChar(str)); -end; - -operator := (const S: String): xmlCharPtr; inline; -begin - Result := xmlCharPtr(PChar(S)); -end; - -{operator := (const C: AnsiChar): xmlCharPtr; inline; -begin - Result := xmlCharPtr(PChar(String(C))); -end;} - - -(* - * macros from chvalid.inc - *) - -function xmlIsBaseChar_ch(c: cint): cbool; -begin - Result := - ((c >= $41) and (c <= $5A)) or - ((c >= $61) and (c <= $7A)) or - ((c >= $C0) and (c <= $D6)) or - ((c >= $D8) and (c <= $F6)) or - (c >= $F8); -end; - -function xmlIsBaseCharQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsBaseChar_ch(c) - else - Result := xmlCharInRange(c, __xmlIsBaseCharGroup); -end; - -function xmlIsBlank_ch(c: cint): cbool; -begin - Result := (c = $20) or ((c >= $9) and (c <= $A)) or (c = $D); -end; - -function xmlIsBlankQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsBaseChar_ch(c) - else - Result := false; -end; - -function xmlIsChar_ch(c: cint): cbool; -begin - Result := ((c >= $9) and (c <= $A)) or (c = $D) or (c >= $20); -end; - -function xmlIsCharQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsChar_ch(c) - else - Result := - ((c >= $000100) and (c <= $00D7FF)) or - ((c >= $00E000) and (c <= $00FFFD)) or - ((c >= $010000) and (c <= $10FFFF)); -end; - -function xmlIsCombiningQ(c: cint): cbool; -begin - if c < $100 then - Result := false - else - Result := xmlCharInRange(c, __xmlIsCombiningGroup); -end; - -function xmlIsDigit_ch(c: cint): cbool; -begin - Result := (c >= $30) and (c <= $39); -end; - -function xmlIsDigitQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsDigit_ch(c) - else - Result := xmlCharInRange(c, __xmlIsDigitGroup); -end; - -function xmlIsExtender_ch(c: cint): cbool; -begin - Result := c = $B7; -end; - -function xmlIsExtenderQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsExtender_ch(c) - else - Result := xmlCharInRange(c, __xmlIsExtenderGroup); -end; - -function xmlIsIdeographicQ(c: cint): cbool; -begin - if c < $100 then - Result := false - else - Result := - ((c >= $4E00) and (c <= $9FA5)) or - (c = $3007) or - ((c >= $3021) and (c <= $3029)); -end; - -function xmlIsPubidChar_ch(c: cint): cbool; -begin - if (c >= 0) and (c <= 255) then - Result := __xmlIsPubidChar_tab^[c] - else - Result := false; -end; - -function xmlIsPubidCharQ(c: cint): cbool; -begin - if c < $100 then - Result := xmlIsPubidChar_ch(c) - else - Result := false; -end; - - -(* - * macros from HTMLparser.inc - *) - -function htmlDefaultSubelement(elt: htmlElemDescPtr): pchar; -begin - Result := elt^.defaultsubelt; -end; - -function htmlElementAllowedHereDesc(parent: htmlElemDescPtr; elt: htmlElemDescPtr): cint; -begin - Result := htmlElementAllowedHere(parent, BAD_CAST(elt^.name)); -end; - -function htmlRequiredAttrs(elt: htmlElemDescPtr): ppchar; -begin - Result := elt^.attrs_req; -end; - - -(* - * macros from tree.inc - *) - -function XML_GET_CONTENT(n: pointer): xmlCharPtr; -begin - if xmlNodePtr(n)^._type = XML_ELEMENT_NODE then - Result := nil - else - Result := xmlNodePtr(n)^.content; -end; - - -(* - * macros from xpath.inc - *) - -function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint; -begin - if assigned(ns) then - Result := ns^.nodeNr - else - Result := 0; -end; - -function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr; -begin - if assigned(ns) and (index >= 0) and (index < ns^.nodeNr) then - Result := ns^.nodeTab[index] - else - Result := nil; -end; - -function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean; -begin - Result := not assigned(ns) or (ns^.nodeNr = 0) or (ns^.nodeTab = nil); -end; - -{$IFDEF WINDOWS} -procedure LoadExternalVariables; -var - libHandle: THandle; -begin - libHandle := LoadLibrary(libxml2lib); - if libHandle <> 0 then - begin - { xmlregexp.inc } - {__emptyExp := xmlExpNodePtrPtr(GetProcAddress(libHandle, 'emptyExp')); - __forbiddenExp := xmlExpNodePtrPtr(GetProcAddress(libHandle, 'forbiddenExp'));} - - { paserInternals.inc } - //__xmlParserMaxDepth := PCardinal(GetProcAddress(libHandle, 'xmlParserMaxDepth')); - - { } - {xmlStringComment := PChar(GetProcAddress(libHandle, 'xmlStringComment')); - xmlStringText := PChar(GetProcAddress(libHandle, 'xmlStringText')); - xmlStringTextNoenc := PChar(GetProcAddress(libHandle, 'xmlStringTextNoenc'));} - - { chvalid.inc } - __xmlIsBaseCharGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsBaseCharGroup')); - __xmlIsCharGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsCharGroup')); - __xmlIsCombiningGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsCombiningGroup')); - __xmlIsDigitGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsDigitGroup')); - __xmlIsExtenderGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsExtenderGroup')); - __xmlIsIdeographicGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsIdeographicGroup')); - __xmlIsPubidChar_tab := GetProcAddress(libHandle, 'xmlIsPubidChar_tab'); - - { globals.inc } - xmlMalloc := xmlMallocFunc(GetProcAddress(libHandle, 'xmlMalloc')); - xmlMallocAtomic := xmlMallocFunc(GetProcAddress(libHandle, 'xmlMallocAtomic')); - xmlRealloc := xmlReallocFunc(GetProcAddress(libHandle, 'xmlRealloc')); - xmlFree := xmlFreeFunc(GetProcAddress(libHandle, 'xmlFree')); - xmlMemStrdup := xmlStrdupFunc(GetProcAddress(libHandle, 'xmlMemStrdup')); - - { xpath.inc } - {__xmlXPathNAN := PDouble(GetProcAddress(libHandle, 'xmlXPathNAN')); - __xmlXPathNINF := PDouble(GetProcAddress(libHandle, 'xmlXPathNINF')); - __xmlXPathPINF := PDouble(GetProcAddress(libHandle, 'xmlXPathPINF'));} - - FreeLibrary(libHandle); - end; -end; -{$ENDIF} - -initialization -{$IFDEF WINDOWS} - LoadExternalVariables; -{$ENDIF} - -(* - * this initialize the library and check potential ABI mismatches - * between the version it was compiled for and the actual shared - * library used. - *) - LIBXML_TEST_VERSION; - -(* - * overloading the memory functions - *) - xmlMemSetup(@fpcxmlFree, @fpcxmlMalloc, @fpcxmlRealloc, nil); - -(* - * overloading the error functions - *) - //xmlSetGenericErrorFunc(nil, @fpcxmlGenericErrorHandler); - //xmlSetStructuredErrorFunc(nil, @fpcxmlStructuredErrorHandler); - -finalization -(* - * Cleanup function for the XML library. - *) - //xmlCleanupParser(); - -(* - * this is to debug memory for regression tests - *) - xmlMemoryDump(); - -end. diff --git a/packages/libxml/src/xml2.pas b/packages/libxml/src/xml2.pas new file mode 100644 index 0000000000..3f2ad54548 --- /dev/null +++ b/packages/libxml/src/xml2.pas @@ -0,0 +1,570 @@ +{ + Translation of the libxml2 headers for FreePascal + Copyright (C) 2008 by Ivo Steinmann +} + +unit xml2; + +{$mode objfpc} +{$H+} +{$macro on} + +{$ALIGN 8} +{$MINENUMSIZE 4} + +interface + +uses +{$IFDEF WINDOWS} + windows, +{$ENDIF} +{$IFDEF UNIX} + unixtype, +{$ENDIF} + ctypes; + +//{$IF Sizeof(cbool) <> Sizeof(cint)} +// {$ERROR 'cbool size mismatch!'} +//{$ENDIF} + +{$IFDEF WINDOWS} + {$DEFINE DYNLINK} +{$ENDIF} + +{$IFDEF DYNLINK} +const +{$IF Defined(WINDOWS)} + libxml2lib = 'libxml2.dll'; +{$ELSEIF Defined(UNIX)} + libxml2lib = 'libxml2.so'; +{$ELSE} + {$MESSAGE ERROR 'DYNLINK not supported'} +{$IFEND} +{$ELSE} + {$LINKLIB xml2} +{$ENDIF} + +{$i xmlexports.inc} +{$i xmlversion.inc} + +{$IFDEF WINDOWS} +type + size_t = culong; +{$ENDIF} + +type + PFILE = pointer; + va_list = pointer; + iconv_t = pointer; + +(* + include pointers (forwarding) +*) +{$DEFINE POINTER} + {$i catalog.inc} + {$i chvalid.inc} + {$i dict.inc} + {$i encoding.inc} + {$i tree.inc} + {$i list.inc} + {$i entities.inc} + {$i xmlerror.inc} + {$i xmlmemory.inc} + {$i hash.inc} + {$i pattern.inc} + {$i schemasInternals.inc} + {$i valid.inc} + {$i parser.inc} + {$i parserInternals.inc} + {$i schematron.inc} + {$i threads.inc} + {$i uri.inc} + {$i relaxng.inc} + {$i globals.inc} + {$i nanoftp.inc} + {$i nanohttp.inc} + {$i SAX.inc} + {$i SAX2.inc} + {$i HTMLtree.inc} + {$i HTMLparser.inc} + {$i xmlautomata.inc} + {$i xmlIO.inc} + {$i xmlmodule.inc} + {$i xmlreader.inc} + {$i xmlregexp.inc} + {$i xmlsave.inc} + {$i xmlschemas.inc} + {$i xmlschemastypes.inc} + {$i xmlstring.inc} + {$i xmlunicode.inc} + {$i xmlwriter.inc} + {$i c14n.inc} + {$i xpath.inc} + {$i xpathInternals.inc} + {$i xlink.inc} + {$i xinclude.inc} + {$i xpointer.inc} +{$UNDEF POINTER} + +(* + include types +*) +{$DEFINE TYPE} + {$i catalog.inc} + {$i chvalid.inc} + {$i dict.inc} + {$i encoding.inc} + {$i tree.inc} + {$i list.inc} + {$i entities.inc} + {$i xmlerror.inc} + {$i xmlmemory.inc} + {$i hash.inc} + {$i pattern.inc} + {$i schemasInternals.inc} + {$i valid.inc} + {$i parser.inc} + {$i parserInternals.inc} + {$i schematron.inc} + {$i threads.inc} + {$i uri.inc} + {$i relaxng.inc} + {$i globals.inc} + {$i nanoftp.inc} + {$i nanohttp.inc} + {$i SAX.inc} + {$i SAX2.inc} + {$i HTMLtree.inc} + {$i HTMLparser.inc} + {$i xmlautomata.inc} + {$i xmlIO.inc} + {$i xmlmodule.inc} + {$i xmlreader.inc} + {$i xmlregexp.inc} + {$i xmlsave.inc} + {$i xmlschemas.inc} + {$i xmlschemastypes.inc} + {$i xmlstring.inc} + {$i xmlunicode.inc} + {$i xmlwriter.inc} + {$i c14n.inc} + {$i xpath.inc} + {$i xpathInternals.inc} + {$i xlink.inc} + {$i xinclude.inc} + {$i xpointer.inc} +{$UNDEF TYPE} + +(* + include constants +*) +{$DEFINE CONST} +const + {$i catalog.inc} + {$i chvalid.inc} + {$i dict.inc} + {$i encoding.inc} + {$i tree.inc} + {$i list.inc} + {$i entities.inc} + {$i xmlerror.inc} + {$i xmlmemory.inc} + {$i pattern.inc} + {$i schemasInternals.inc} + {$i hash.inc} + {$i valid.inc} + {$i parser.inc} + {$i parserInternals.inc} + {$i schematron.inc} + {$i threads.inc} + {$i uri.inc} + {$i relaxng.inc} + {$i globals.inc} + {$i nanoftp.inc} + {$i nanohttp.inc} + {$i SAX.inc} + {$i SAX2.inc} + {$i HTMLtree.inc} + {$i HTMLparser.inc} + {$i xmlautomata.inc} + {$i xmlIO.inc} + {$i xmlmodule.inc} + {$i xmlreader.inc} + {$i xmlregexp.inc} + {$i xmlsave.inc} + {$i xmlschemas.inc} + {$i xmlschemastypes.inc} + {$i xmlstring.inc} + {$i xmlunicode.inc} + {$i xmlwriter.inc} + {$i c14n.inc} + {$i xpath.inc} + {$i xpathInternals.inc} + {$i xlink.inc} + {$i xinclude.inc} + {$i xpointer.inc} +{$UNDEF CONST} + +(* + include functions +*) +{$DEFINE FUNCTION} + {$i catalog.inc} + {$i chvalid.inc} + {$i dict.inc} + {$i encoding.inc} + {$i tree.inc} + {$i list.inc} + {$i entities.inc} + {$i xmlerror.inc} + {$i xmlmemory.inc} + {$i pattern.inc} + {$i schemasInternals.inc} + {$i hash.inc} + {$i valid.inc} + {$i parser.inc} + {$i parserInternals.inc} + {$i schematron.inc} + {$i threads.inc} + {$i uri.inc} + {$i relaxng.inc} + {$i globals.inc} + {$i nanoftp.inc} + {$i nanohttp.inc} + {$i SAX.inc} + {$i SAX2.inc} + {$i HTMLtree.inc} + {$i HTMLparser.inc} + {$i xmlautomata.inc} + {$i xmlIO.inc} + {$i xmlmodule.inc} + {$i xmlreader.inc} + {$i xmlregexp.inc} + {$i xmlsave.inc} + {$i xmlschemas.inc} + {$i xmlschemastypes.inc} + {$i xmlstring.inc} + {$i xmlunicode.inc} + {$i xmlwriter.inc} + {$i c14n.inc} + {$i xpath.inc} + {$i xpathInternals.inc} + {$i xlink.inc} + {$i xinclude.inc} + {$i xpointer.inc} +{$UNDEF FUNCTION} + +operator := (const S: String): xmlCharPtr; inline; +//operator := (const C: AnsiChar): xmlCharPtr; inline; + +implementation + +procedure fpcxmlFree(mem: pointer); XMLCALL; +begin + FreeMem(mem); +end; + +function fpcxmlMalloc(size: size_t): pointer; XMLCALL; +begin + GetMem(Result, size); +end; + +function fpcxmlRealloc(mem: pointer; size: size_t): pointer; XMLCALL; +begin + Result := mem; + ReallocMem(Result, size); +end; + +procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); XMLCALL; +begin + writeln('struct error'); +end; + + +(* + * macros from xmlversion.inc + *) + +procedure LIBXML_TEST_VERSION; +begin + xmlCheckVersion(LIBXML_VERSION); +end; + + +(* + * macros from xmlversion.inc + *) + +function BAD_CAST(str: pchar): xmlCharPtr; +begin + result := xmlCharPtr(str); +end; + +function BAD_CAST(str: string): xmlCharPtr; +begin + result := xmlCharPtr(PChar(str)); +end; + +operator := (const S: String): xmlCharPtr; inline; +begin + Result := xmlCharPtr(PChar(S)); +end; + +{operator := (const C: AnsiChar): xmlCharPtr; inline; +begin + Result := xmlCharPtr(PChar(String(C))); +end;} + + +(* + * macros from chvalid.inc + *) + +function xmlIsBaseChar_ch(c: cint): cbool; +begin + Result := + ((c >= $41) and (c <= $5A)) or + ((c >= $61) and (c <= $7A)) or + ((c >= $C0) and (c <= $D6)) or + ((c >= $D8) and (c <= $F6)) or + (c >= $F8); +end; + +function xmlIsBaseCharQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsBaseChar_ch(c) + else + Result := xmlCharInRange(c, __xmlIsBaseCharGroup); +end; + +function xmlIsBlank_ch(c: cint): cbool; +begin + Result := (c = $20) or ((c >= $9) and (c <= $A)) or (c = $D); +end; + +function xmlIsBlankQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsBaseChar_ch(c) + else + Result := false; +end; + +function xmlIsChar_ch(c: cint): cbool; +begin + Result := ((c >= $9) and (c <= $A)) or (c = $D) or (c >= $20); +end; + +function xmlIsCharQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsChar_ch(c) + else + Result := + ((c >= $000100) and (c <= $00D7FF)) or + ((c >= $00E000) and (c <= $00FFFD)) or + ((c >= $010000) and (c <= $10FFFF)); +end; + +function xmlIsCombiningQ(c: cint): cbool; +begin + if c < $100 then + Result := false + else + Result := xmlCharInRange(c, __xmlIsCombiningGroup); +end; + +function xmlIsDigit_ch(c: cint): cbool; +begin + Result := (c >= $30) and (c <= $39); +end; + +function xmlIsDigitQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsDigit_ch(c) + else + Result := xmlCharInRange(c, __xmlIsDigitGroup); +end; + +function xmlIsExtender_ch(c: cint): cbool; +begin + Result := c = $B7; +end; + +function xmlIsExtenderQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsExtender_ch(c) + else + Result := xmlCharInRange(c, __xmlIsExtenderGroup); +end; + +function xmlIsIdeographicQ(c: cint): cbool; +begin + if c < $100 then + Result := false + else + Result := + ((c >= $4E00) and (c <= $9FA5)) or + (c = $3007) or + ((c >= $3021) and (c <= $3029)); +end; + +function xmlIsPubidChar_ch(c: cint): cbool; +begin + if (c >= 0) and (c <= 255) then + Result := __xmlIsPubidChar_tab^[c] + else + Result := false; +end; + +function xmlIsPubidCharQ(c: cint): cbool; +begin + if c < $100 then + Result := xmlIsPubidChar_ch(c) + else + Result := false; +end; + + +(* + * macros from HTMLparser.inc + *) + +function htmlDefaultSubelement(elt: htmlElemDescPtr): pchar; +begin + Result := elt^.defaultsubelt; +end; + +function htmlElementAllowedHereDesc(parent: htmlElemDescPtr; elt: htmlElemDescPtr): cint; +begin + Result := htmlElementAllowedHere(parent, BAD_CAST(elt^.name)); +end; + +function htmlRequiredAttrs(elt: htmlElemDescPtr): ppchar; +begin + Result := elt^.attrs_req; +end; + + +(* + * macros from tree.inc + *) + +function XML_GET_CONTENT(n: pointer): xmlCharPtr; +begin + if xmlNodePtr(n)^._type = XML_ELEMENT_NODE then + Result := nil + else + Result := xmlNodePtr(n)^.content; +end; + + +(* + * macros from xpath.inc + *) + +function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint; +begin + if assigned(ns) then + Result := ns^.nodeNr + else + Result := 0; +end; + +function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr; +begin + if assigned(ns) and (index >= 0) and (index < ns^.nodeNr) then + Result := ns^.nodeTab[index] + else + Result := nil; +end; + +function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean; +begin + Result := not assigned(ns) or (ns^.nodeNr = 0) or (ns^.nodeTab = nil); +end; + +{$IFDEF WINDOWS} +procedure LoadExternalVariables; +var + libHandle: THandle; +begin + libHandle := LoadLibrary(libxml2lib); + if libHandle <> 0 then + begin + { xmlregexp.inc } + {__emptyExp := xmlExpNodePtrPtr(GetProcAddress(libHandle, 'emptyExp')); + __forbiddenExp := xmlExpNodePtrPtr(GetProcAddress(libHandle, 'forbiddenExp'));} + + { paserInternals.inc } + //__xmlParserMaxDepth := PCardinal(GetProcAddress(libHandle, 'xmlParserMaxDepth')); + + { } + {xmlStringComment := PChar(GetProcAddress(libHandle, 'xmlStringComment')); + xmlStringText := PChar(GetProcAddress(libHandle, 'xmlStringText')); + xmlStringTextNoenc := PChar(GetProcAddress(libHandle, 'xmlStringTextNoenc'));} + + { chvalid.inc } + __xmlIsBaseCharGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsBaseCharGroup')); + __xmlIsCharGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsCharGroup')); + __xmlIsCombiningGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsCombiningGroup')); + __xmlIsDigitGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsDigitGroup')); + __xmlIsExtenderGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsExtenderGroup')); + __xmlIsIdeographicGroup := xmlChRangeGroupPtr(GetProcAddress(libHandle, 'xmlIsIdeographicGroup')); + __xmlIsPubidChar_tab := GetProcAddress(libHandle, 'xmlIsPubidChar_tab'); + + { globals.inc } + xmlMalloc := xmlMallocFunc(GetProcAddress(libHandle, 'xmlMalloc')); + xmlMallocAtomic := xmlMallocFunc(GetProcAddress(libHandle, 'xmlMallocAtomic')); + xmlRealloc := xmlReallocFunc(GetProcAddress(libHandle, 'xmlRealloc')); + xmlFree := xmlFreeFunc(GetProcAddress(libHandle, 'xmlFree')); + xmlMemStrdup := xmlStrdupFunc(GetProcAddress(libHandle, 'xmlMemStrdup')); + + { xpath.inc } + {__xmlXPathNAN := PDouble(GetProcAddress(libHandle, 'xmlXPathNAN')); + __xmlXPathNINF := PDouble(GetProcAddress(libHandle, 'xmlXPathNINF')); + __xmlXPathPINF := PDouble(GetProcAddress(libHandle, 'xmlXPathPINF'));} + + FreeLibrary(libHandle); + end; +end; +{$ENDIF} + +initialization +{$IFDEF WINDOWS} + LoadExternalVariables; +{$ENDIF} + +(* + * this initialize the library and check potential ABI mismatches + * between the version it was compiled for and the actual shared + * library used. + *) + LIBXML_TEST_VERSION; + +(* + * overloading the memory functions + *) + xmlMemSetup(@fpcxmlFree, @fpcxmlMalloc, @fpcxmlRealloc, nil); + +(* + * overloading the error functions + *) + //xmlSetGenericErrorFunc(nil, @fpcxmlGenericErrorHandler); + //xmlSetStructuredErrorFunc(nil, @fpcxmlStructuredErrorHandler); + +finalization +(* + * Cleanup function for the XML library. + *) + //xmlCleanupParser(); + +(* + * this is to debug memory for regression tests + *) + xmlMemoryDump(); + +end. diff --git a/packages/libxml/src/xmlxsd.pas b/packages/libxml/src/xmlxsd.pas index 5a6cf258c3..b44affe1a5 100644 --- a/packages/libxml/src/xmlxsd.pas +++ b/packages/libxml/src/xmlxsd.pas @@ -11,7 +11,7 @@ unit xmlxsd; interface uses - libxml2, + xml2, DateUtils, SysUtils; -- cgit v1.2.1