* move 2.0.x compatibility files to fcl20/ subdir

git-svn-id: trunk@6446 -
This commit is contained in:
peter 2007-02-11 22:17:07 +00:00
parent 5c31c25849
commit 5ec60ffc9b
7 changed files with 1978 additions and 329 deletions

6
.gitattributes vendored
View File

@ -8216,7 +8216,10 @@ utils/fpmc/test.mc -text
utils/fppkg/Makefile svneol=native#text/plain
utils/fppkg/Makefile.fpc svneol=native#text/plain
utils/fppkg/README svneol=native#text/plain
utils/fppkg/contnrs20.pp svneol=native#text/plain
utils/fppkg/fcl20/contnrs.pp svneol=native#text/plain
utils/fppkg/fcl20/streamcoll.pp svneol=native#text/plain
utils/fppkg/fcl20/zipper.pp svneol=native#text/plain
utils/fppkg/fcl20/zstream.pp svneol=native#text/plain
utils/fppkg/fpmkcnst.inc svneol=native#text/plain
utils/fppkg/fpmktype.pp svneol=native#text/plain
utils/fppkg/fpmkunit.pp svneol=native#text/plain
@ -8267,7 +8270,6 @@ utils/fppkg/pkgwget.pp svneol=native#text/plain
utils/fppkg/rep2xml.lpi svneol=native#text/plain
utils/fppkg/rep2xml.lpr svneol=native#text/plain
utils/fppkg/reptest.pp svneol=native#text/plain
utils/fppkg/streamcoll20.pp svneol=native#text/plain
utils/fppkg/testdownload.pp svneol=native#text/plain
utils/fprcp/Makefile svneol=native#text/plain
utils/fprcp/Makefile.fpc svneol=native#text/plain

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/01/25]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/10/31]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos 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-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-embedded
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx
LIMIT83fs = go32v2 os2 emx watcom
@ -232,6 +232,9 @@ endif
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
override PACKAGE_NAME=fppkg
override PACKAGE_VERSION=2.0.0
ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
FCL20=fcl20
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -283,12 +286,6 @@ endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -310,9 +307,6 @@ endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -331,9 +325,6 @@ endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -343,9 +334,6 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -355,9 +343,6 @@ endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_PROGRAMS+=fppkg
endif
@ -370,21 +355,9 @@ endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_PROGRAMS+=fppkg
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -436,12 +409,6 @@ endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -463,9 +430,6 @@ endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -484,9 +448,6 @@ endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -496,9 +457,6 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -508,9 +466,6 @@ endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
@ -523,21 +478,9 @@ endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload pkgwget pkglnet pkglibcurl
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_UNITS+=fpmktype fpmkunit fprepos fpxmlrep pkgropts pkghandler pkgmkconv pkgdownload
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -589,12 +532,6 @@ endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -616,9 +553,6 @@ endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -637,9 +571,6 @@ endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -649,9 +580,6 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -661,9 +589,6 @@ endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
@ -676,21 +601,9 @@ endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_RSTS+=fprepos fpxmlrep fppkg
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -742,12 +655,6 @@ endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -769,9 +676,6 @@ endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -790,9 +694,6 @@ endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -802,9 +703,6 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -814,9 +712,6 @@ endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_EXAMPLES+=rep2xml
endif
@ -829,21 +724,9 @@ endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_EXAMPLES+=rep2xml
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_EXAMPLES+=rep2xml
endif
override INSTALL_FPCPACKAGE=y
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
@ -896,12 +779,6 @@ endif
ifeq ($(FULL_TARGET),i386-wince)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),i386-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),i386-symbian)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
@ -923,9 +800,6 @@ endif
ifeq ($(FULL_TARGET),m68k-palmos)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
@ -944,9 +818,6 @@ endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),sparc-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
@ -956,9 +827,6 @@ endif
ifeq ($(FULL_TARGET),sparc-solaris)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
@ -968,9 +836,6 @@ endif
ifeq ($(FULL_TARGET),x86_64-win64)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
@ -983,173 +848,131 @@ endif
ifeq ($(FULL_TARGET),arm-gba)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),arm-nds)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),arm-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),arm-symbian)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override COMPILER_INCLUDEDIR+=lnet/sys
endif
ifeq ($(FULL_TARGET),i386-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-go32v2)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-win32)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-os2)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-beos)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-netbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-solaris)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-qnx)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-netware)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-openbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-wdosx)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-darwin)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-emx)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-watcom)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),i386-wince)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),i386-embedded)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),i386-symbian)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-amiga)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-atari)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),m68k-palmos)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-macos)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),sparc-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),sparc-solaris)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),x86_64-win64)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),arm-linux)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),arm-palmos)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),arm-wince)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),arm-gba)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),arm-nds)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),arm-embedded)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),arm-symbian)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override COMPILER_UNITDIR+=lnet
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override COMPILER_UNITDIR+=lnet
override COMPILER_UNITDIR+=$(FCL20) lnet
endif
ifdef REQUIRE_UNITSDIR
override UNITSDIR+=$(REQUIRE_UNITSDIR)
@ -1508,10 +1331,6 @@ EXEEXT=.gba
SHAREDLIBEXT=.so
SHORTSUFFIX=gba
endif
ifeq ($(OS_TARGET),symbian)
SHAREDLIBEXT=.dll
SHORTSUFFIX=symbian
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
@ -1961,6 +1780,7 @@ REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_PASJPEG=1
@ -2132,24 +1952,6 @@ REQUIRE_PACKAGES_IBASE=1
REQUIRE_PACKAGES_POSTGRES=1
REQUIRE_PACKAGES_SQLITE=1
endif
ifeq ($(FULL_TARGET),i386-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),i386-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),m68k-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2243,15 +2045,6 @@ REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),m68k-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),powerpc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2329,15 +2122,6 @@ REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),sparc-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2382,15 +2166,6 @@ REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),sparc-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),x86_64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2430,19 +2205,11 @@ REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_WINUNITS=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),arm-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2490,33 +2257,6 @@ REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),arm-nds)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),arm-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),arm-symbian)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
@ -2534,15 +2274,6 @@ REQUIRE_PACKAGES_ODBC=1
REQUIRE_PACKAGES_ORACLE=1
REQUIRE_PACKAGES_SQLITE=1
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL=1
REQUIRE_PACKAGES_LIBCURL=1
REQUIRE_PACKAGES_NETDB=1
REQUIRE_PACKAGES_PASJPEG=1
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)
@ -2933,6 +2664,32 @@ ifdef UNITDIR_SQLITE
override COMPILER_UNITDIR+=$(UNITDIR_SQLITE)
endif
endif
ifdef REQUIRE_PACKAGES_WINUNITS
PACKAGEDIR_WINUNITS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_WINUNITS),)
ifneq ($(wildcard $(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)),)
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)/units/$(TARGETSUFFIX)
else
UNITDIR_WINUNITS=$(PACKAGEDIR_WINUNITS)
endif
ifdef CHECKDEPEND
$(PACKAGEDIR_WINUNITS)/$(FPCMADE):
$(MAKE) -C $(PACKAGEDIR_WINUNITS) $(FPCMADE)
override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS)/$(FPCMADE)
endif
else
PACKAGEDIR_WINUNITS=
UNITDIR_WINUNITS:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits/Package.fpc,$(UNITSDIR)))))
ifneq ($(UNITDIR_WINUNITS),)
UNITDIR_WINUNITS:=$(firstword $(UNITDIR_WINUNITS))
else
UNITDIR_WINUNITS=
endif
endif
ifdef UNITDIR_WINUNITS
override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS)
endif
endif
ifndef NOCPUDEF
override FPCOPTDEF=$(CPU_TARGET)
endif
@ -3043,13 +2800,6 @@ ifeq ($(CPU_TARGET),i386)
override FPCOPT+=-Aas
endif
endif
ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
ifeq ($(OS_TARGET),linux)
ifeq ($(CPU_TARGET),x86_64)
override FPCOPT+=-Cg
endif
endif
endif
ifdef LINKSHARED
endif
ifdef GCCLIBDIR

View File

@ -22,7 +22,7 @@ examples=rep2xml
rsts=fprepos fpxmlrep fppkg
[compiler]
unitdir=lnet
unitdir=$(FCL20) lnet
includedir=lnet/sys
[install]
@ -34,6 +34,12 @@ fpcdir=../..
[require]
packages=fcl libcurl
[prerules]
# Compatibility to compile with 2.0.x
ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
FCL20=fcl20
endif
[rules]
.NOTPARALLEL:
fpmkunit$(PPUEXT) : fpmkunit.pp fpmkcnst.inc fpmktype$(PPUEXT)

View File

@ -16,7 +16,7 @@
{$H+}
{$ifdef CLASSESINLINE}{$inline on}{$endif}
unit contnrs20;
unit contnrs;
interface

View File

@ -17,7 +17,7 @@
{$mode objfpc}
{$h+}
unit streamcoll20;
unit streamcoll;
interface

1451
utils/fppkg/fcl20/zipper.pp Normal file

File diff suppressed because it is too large Load Diff

440
utils/fppkg/fcl20/zstream.pp Executable file
View File

@ -0,0 +1,440 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by the Free Pascal development team
Implementation of compression streams.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$mode objfpc}
unit zstream;
{ ---------------------------------------------------------------------
For linux and freebsd it's also possible to use ZLib instead
of paszlib. You need to undefine 'usepaszlib'.
---------------------------------------------------------------------}
{$define usepaszlib}
interface
uses
Sysutils, Classes
{$ifdef usepaszlib}
,paszlib,zbase
{$else}
,zlib
{$endif}
;
{$H+}
type
// Error reporting.
EZlibError = class(EStreamError);
ECompressionError = class(EZlibError);
EDecompressionError = class(EZlibError);
TCustomZlibStream = class(TOwnerStream)
private
FStrmPos: Integer;
FOnProgress: TNotifyEvent;
FZRec: TZStream;
FBuffer: array [Word] of Byte;
protected
procedure Progress(Sender: TObject); dynamic;
property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
public
constructor Create(Strm: TStream);
end;
TCompressionLevel = (clNone, clFastest, clDefault, clMax);
TCompressionStream = class(TCustomZlibStream)
private
function GetCompressionRate: extended;
function CompressionCheck(code: Integer): Integer;
procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
var OutBuf: Pointer; var OutBytes: Integer);
public
constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream; ASkipHeader : Boolean = False);
destructor Destroy; override;
function Read(var Buffer; Count: Longint): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
property CompressionRate: extended read GetCompressionRate;
property OnProgress;
end;
TDecompressionStream = class(TCustomZlibStream)
private
function DecompressionCheck(code: Integer): Integer;
procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
OutEstimate: Integer; var OutBuf: Pointer; var OutBytes: Integer);
public
constructor Create(ASource: TStream; ASkipHeader : Boolean = False);
destructor Destroy; override;
function Read(var Buffer; Count: Longint): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
property OnProgress;
end;
TGZOpenMode = (gzOpenRead,gzOpenWrite);
TGZFileStream = Class(TStream)
Private
FOpenMode : TGZOpenmode;
FFIle : gzfile;
Public
Constructor Create(FileName: String;FileMode: TGZOpenMode);
Destructor Destroy;override;
Function Read(Var Buffer; Count : longint): longint;override;
function Write(const Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
end;
implementation
Const
ErrorStrings : array [0..6] of string =
('Unknown error %d','Z_ERRNO','Z_STREAM_ERROR',
'Z_DATA_ERROR','Z_MEM_ERROR','Z_BUF_ERROR','Z_VERSION_ERROR');
SCouldntOpenFile = 'Couldn''t open file : %s';
SReadOnlyStream = 'Decompression streams are read-only';
SWriteOnlyStream = 'Compression streams are write-only';
SSeekError = 'Compression stream seek error';
SInvalidSeek = 'Invalid Compression seek operation';
procedure TCompressionStream.CompressBuf(const InBuf: Pointer; InBytes: Integer;
var OutBuf: Pointer; var OutBytes: Integer);
var
strm: TZStream;
P: Pointer;
begin
FillChar(strm, sizeof(strm), 0);
OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
OutBuf:=GetMem(OutBytes);
try
strm.next_in := InBuf;
strm.avail_in := InBytes;
strm.next_out := OutBuf;
strm.avail_out := OutBytes;
CompressionCheck(deflateInit(strm, Z_BEST_COMPRESSION));
try
while CompressionCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
begin
P := OutBuf;
Inc(OutBytes, 256);
ReallocMem(OutBuf,OutBytes);
strm.next_out := PByte(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
strm.avail_out := 256;
end;
finally
CompressionCheck(deflateEnd(strm));
end;
ReallocMem(OutBuf,strm.total_out);
OutBytes := strm.total_out;
except
FreeMem(OutBuf);
raise;
end;
end;
procedure TDecompressionStream.DecompressBuf(const InBuf: Pointer; InBytes: Integer;
OutEstimate: Integer; var OutBuf: Pointer; var OutBytes: Integer);
var
strm: TZStream;
P: Pointer;
BufInc: Integer;
Type
PByte = ^Byte;
begin
FillChar(strm, sizeof(strm), 0);
BufInc := (InBytes + 255) and not 255;
if OutEstimate = 0 then
OutBytes := BufInc
else
OutBytes := OutEstimate;
OutBuf:=GetMem(OutBytes);
try
strm.next_in := InBuf;
strm.avail_in := InBytes;
strm.next_out := OutBuf;
strm.avail_out := OutBytes;
DecompressionCheck(inflateInit(strm));
try
while DecompressionCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
begin
P := OutBuf;
Inc(OutBytes, BufInc);
ReallocMem(OutBuf, OutBytes);
strm.next_out := PByte(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
strm.avail_out := BufInc;
end;
finally
DecompressionCheck(inflateEnd(strm));
end;
ReallocMem(OutBuf, strm.total_out);
OutBytes := strm.total_out;
except
FreeMem(OutBuf);
raise;
end;
end;
// TCustomZlibStream
constructor TCustomZLibStream.Create(Strm: TStream);
begin
inherited Create(Strm);
FStrmPos := Strm.Position;
end;
procedure TCustomZLibStream.Progress(Sender: TObject);
begin
if Assigned(FOnProgress) then FOnProgress(Sender);
end;
// TCompressionStream
constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
Dest: TStream; ASkipHeader : Boolean = False);
const
Levels: array [TCompressionLevel] of ShortInt =
(Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
begin
inherited Create(Dest);
FZRec.next_out := @FBuffer[0];
FZRec.avail_out := sizeof(FBuffer);
If ASkipHeader then
CompressionCheck(deflateInit2(FZRec, Levels[CompressionLevel],Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, 0))
else
CompressionCheck(deflateInit(FZRec, Levels[CompressionLevel]));
end;
destructor TCompressionStream.Destroy;
begin
FZRec.next_in := nil;
FZRec.avail_in := 0;
try
if Source.Position <> FStrmPos then Source.Position := FStrmPos;
while (CompressionCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
and (FZRec.avail_out = 0) do
begin
Source.WriteBuffer(FBuffer, sizeof(FBuffer));
FZRec.next_out := @FBuffer[0];
FZRec.avail_out := sizeof(FBuffer);
end;
if FZRec.avail_out < sizeof(FBuffer) then
Source.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
finally
deflateEnd(FZRec);
end;
inherited Destroy;
end;
function TCompressionStream.CompressionCheck(code: Integer): Integer;
begin
Result := code;
if (code < 0) then
if code < -6 then
raise ECompressionError.CreateFmt(Errorstrings[0],[Code])
else
raise ECompressionError.Create(ErrorStrings[Abs(Code)]);
end;
function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
begin
raise ECompressionError.Create('Invalid stream operation');
result:=0;
end;
function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
begin
FZRec.next_in := @Buffer;
FZRec.avail_in := Count;
if Source.Position <> FStrmPos then Source.Position := FStrmPos;
while (FZRec.avail_in > 0) do
begin
CompressionCheck(deflate(FZRec, 0));
if FZRec.avail_out = 0 then
begin
Source.WriteBuffer(FBuffer, sizeof(FBuffer));
FZRec.next_out := @FBuffer[0];
FZRec.avail_out := sizeof(FBuffer);
FStrmPos := Source.Position;
Progress(Self);
end;
end;
Result := Count;
end;
function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
begin
if (Offset = 0) and (Origin = soFromCurrent) then
Result := FZRec.total_in
else
raise ECompressionError.Create(SInvalidSeek);
end;
function TCompressionStream.GetCompressionRate: extended;
begin
Result:=0.0;
{ With FZrec do
if total_in = 0 then
GetCompressionRate:=0.0
else
GetCompressionRate:=1.0E2*(1.0E0-(total_out/total_in));
}
end;
// TDecompressionStream
constructor TDecompressionStream.Create(ASource: TStream; ASkipHeader : Boolean = False);
begin
inherited Create(ASource);
FZRec.next_in := @FBuffer[0];
If ASkipHeader then
DeCompressionCheck(inflateInit2(FZRec,-MAX_WBITS))
else
DeCompressionCheck(inflateInit(FZRec));
end;
destructor TDecompressionStream.Destroy;
begin
if FZRec.avail_in <> 0 then
Source.Seek(-FZRec.avail_in, soFromCurrent);
inflateEnd(FZRec);
inherited Destroy;
end;
function TDecompressionStream.DecompressionCheck(code: Integer): Integer;
begin
Result := code;
If Code<0 then
if code < -6 then
raise EDecompressionError.CreateFmt(Errorstrings[0],[Code])
else
raise EDecompressionError.Create(ErrorStrings[Abs(Code)]);
end;
function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
begin
FZRec.next_out := @Buffer;
FZRec.avail_out := Count;
if Source.Position <> FStrmPos then Source.Position := FStrmPos;
while (FZRec.avail_out > 0) do
begin
if FZRec.avail_in = 0 then
begin
FZRec.avail_in := Source.Read(FBuffer, sizeof(FBuffer));
if FZRec.avail_in = 0 then
begin
Result := Count - FZRec.avail_out;
Exit;
end;
FZRec.next_in := @FBuffer[0];
FStrmPos := Source.Position;
Progress(Self);
end;
if DeCompressionCheck(inflate(FZRec, 0)) = Z_STREAM_END then
begin
Result := Count - FZRec.avail_out;
Exit;
end;
end;
Result := Count;
end;
function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
begin
raise EDecompressionError.Create('Invalid stream operation');
result:=0;
end;
function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
var
I: Integer;
Buf: array [0..4095] of Char;
begin
if (Offset = 0) and (Origin = soFromBeginning) then
begin
DecompressionCheck(inflateReset(FZRec));
FZRec.next_in := @FBuffer[0];
FZRec.avail_in := 0;
Source.Position := 0;
FStrmPos := 0;
end
else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
begin
if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
if Offset > 0 then
begin
for I := 1 to Offset div sizeof(Buf) do
ReadBuffer(Buf, sizeof(Buf));
ReadBuffer(Buf, Offset mod sizeof(Buf));
end;
end
else
raise EDecompressionError.Create(SInvalidSeek);
Result := FZRec.total_out;
end;
// TGZFileStream
Constructor TGZFileStream.Create(FileName: String;FileMode: TGZOpenMode);
Const OpenStrings : array[TGZOpenMode] of pchar = ('rb','wb');
begin
FOpenMode:=FileMode;
FFile:=gzopen (PChar(FileName),Openstrings[FileMode]);
If FFile=Nil then
Raise ezlibError.CreateFmt (SCouldntOpenFIle,[FileName]);
end;
Destructor TGZFileStream.Destroy;
begin
gzclose(FFile);
Inherited Destroy;
end;
Function TGZFileStream.Read(Var Buffer; Count : longint): longint;
begin
If FOpenMode=gzOpenWrite then
Raise ezliberror.create(SWriteOnlyStream);
Result:=gzRead(FFile,@Buffer,Count);
end;
function TGZFileStream.Write(const Buffer; Count: Longint): Longint;
begin
If FOpenMode=gzOpenRead then
Raise EzlibError.Create(SReadonlyStream);
Result:=gzWrite(FFile,@Buffer,Count);
end;
function TGZFileStream.Seek(Offset: Longint; Origin: Word): Longint;
begin
Result:=gzseek(FFile,Offset,Origin);
If Result=-1 then
Raise eZlibError.Create(SSeekError);
end;
end.