├── zlib ├── contrib │ ├── blast │ │ ├── test.txt │ │ ├── README │ │ ├── test.pk │ │ ├── Makefile │ │ └── blast.h │ ├── infback9 │ │ ├── README │ │ ├── infback9.h │ │ ├── inflate9.h │ │ └── inftree9.h │ ├── puff │ │ ├── zeros.raw │ │ ├── puff.h │ │ ├── Makefile │ │ └── README │ ├── dotzlib │ │ ├── DotZLib.chm │ │ ├── DotZLib │ │ │ ├── DotZLib.cs │ │ │ ├── CodecBase.cs │ │ │ ├── Deflater.cs │ │ │ ├── GZipStream.cs │ │ │ ├── Inflater.cs │ │ │ ├── ChecksumImpl.cs │ │ │ ├── CircularBuffer.cs │ │ │ └── AssemblyInfo.cs │ │ ├── DotZLib.sln │ │ ├── DotZLib.build │ │ ├── LICENSE_1_0.txt │ │ └── readme.txt │ ├── masmx64 │ │ ├── bld_ml64.bat │ │ └── readme.txt │ ├── masmx86 │ │ ├── bld_ml32.bat │ │ └── readme.txt │ ├── minizip │ │ ├── MiniZip64_Changes.txt │ │ ├── minizip.pc.in │ │ ├── Makefile │ │ ├── mztools.h │ │ ├── configure.ac │ │ ├── iowin32.h │ │ ├── make_vms.com │ │ ├── Makefile.am │ │ ├── minizip.1 │ │ ├── miniunzip.1 │ │ └── MiniZip64_info.txt │ ├── delphi │ │ ├── ZLibConst.pas │ │ ├── readme.txt │ │ └── zlibd32.mak │ ├── testzlib │ │ └── testzlib.txt │ ├── untgz │ │ ├── Makefile │ │ └── Makefile.msc │ ├── iostream3 │ │ ├── TODO │ │ ├── README │ │ └── test.cc │ ├── ada │ │ ├── zlib.gpr │ │ ├── readme.txt │ │ ├── zlib-thin.adb │ │ └── buffer_demo.adb │ ├── iostream │ │ ├── test.cpp │ │ └── zfstream.h │ ├── iostream2 │ │ └── zstream_test.cpp │ ├── vstudio │ │ ├── vc10 │ │ │ ├── miniunz.vcxproj.filters │ │ │ ├── minizip.vcxproj.filters │ │ │ ├── testzlibdll.vcxproj.filters │ │ │ ├── zlib.rc │ │ │ ├── testzlib.vcxproj.filters │ │ │ ├── zlibstat.vcxproj.filters │ │ │ └── zlibvc.vcxproj.filters │ │ ├── vc12 │ │ │ └── zlib.rc │ │ ├── vc14 │ │ │ └── zlib.rc │ │ ├── vc11 │ │ │ └── zlib.rc │ │ ├── vc9 │ │ │ └── zlib.rc │ │ └── readme.txt │ ├── asm686 │ │ └── README.686 │ ├── README.contrib │ └── pascal │ │ ├── zlibd32.mak │ │ └── readme.txt ├── zlib.3.pdf ├── doc │ └── crc-doc.1.0.pdf ├── win32 │ ├── VisualC.txt │ ├── zlib1.rc │ ├── zlib.def │ └── Makefile.bor ├── old │ ├── README │ ├── os2 │ │ ├── zlib.def │ │ └── Makefile.os2 │ ├── descrip.mms │ ├── Makefile.emx │ └── Makefile.riscos ├── nintendods │ └── README ├── zlib.pc ├── zlib.pc.in ├── zlib.pc.cmakein ├── inffast.h ├── gzclose.c ├── watcom │ ├── watcom_l.mak │ └── watcom_f.mak ├── msdos │ ├── Makefile.emx │ ├── Makefile.dj2 │ ├── Makefile.tc │ ├── Makefile.msc │ └── Makefile.bor ├── os400 │ ├── README400 │ └── bndsrc ├── zlib.map ├── amiga │ ├── Makefile.sas │ └── Makefile.pup ├── examples │ ├── README.examples │ └── zran.h ├── INDEX ├── compress.c ├── uncompr.c ├── inftrees.h ├── treebuild.xml └── zlib2ansi ├── zlib.modulemap ├── zlib.xcodeproj ├── project.xcworkspace │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ └── t_zlib_verify.xcscheme ├── scripts ├── t_zlib_torture.sh ├── t_bats_zlib.pl ├── t_zlib_all.pl ├── zlib_tests.py └── t_install_roots.pl ├── AddOn ├── ZTests │ ├── ztest_fuzzer.c │ └── ztest_common.h ├── zopt_defs.h └── zopt_inffast.h ├── zlib.plist ├── zlib.xcconfig ├── libz.exp ├── NMakefile ├── Makefile └── zlib.proj /zlib/contrib/blast/test.txt: -------------------------------------------------------------------------------- 1 | AIAIAIAIAIAIA -------------------------------------------------------------------------------- /zlib/contrib/infback9/README: -------------------------------------------------------------------------------- 1 | See infback9.h for what this is and how to use it. 2 | -------------------------------------------------------------------------------- /zlib/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/zlib.3.pdf -------------------------------------------------------------------------------- /zlib/doc/crc-doc.1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/doc/crc-doc.1.0.pdf -------------------------------------------------------------------------------- /zlib/contrib/blast/README: -------------------------------------------------------------------------------- 1 | Read blast.h for purpose and usage. 2 | 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | -------------------------------------------------------------------------------- /zlib/contrib/blast/test.pk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/blast/test.pk -------------------------------------------------------------------------------- /zlib/contrib/puff/zeros.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/puff/zeros.raw -------------------------------------------------------------------------------- /zlib.modulemap: -------------------------------------------------------------------------------- 1 | module zlib [system] { 2 | header "zconf.h" 3 | header "zlib.h" 4 | 5 | export * 6 | link "z" 7 | } 8 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib.chm -------------------------------------------------------------------------------- /zlib/contrib/masmx64/bld_ml64.bat: -------------------------------------------------------------------------------- 1 | ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 2 | ml64.exe /Flgvmat64 /c /Zi gvmat64.asm 3 | -------------------------------------------------------------------------------- /zlib/contrib/masmx86/bld_ml32.bat: -------------------------------------------------------------------------------- 1 | ml /coff /Zi /c /Flmatch686.lst match686.asm 2 | ml /coff /Zi /c /Flinffas32.lst inffas32.asm 3 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/DotZLib.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/DotZLib.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/CodecBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/CodecBase.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/Deflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/Deflater.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/GZipStream.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/GZipStream.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/Inflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/Inflater.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apple-oss-distributions/zlib/HEAD/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs -------------------------------------------------------------------------------- /zlib/win32/VisualC.txt: -------------------------------------------------------------------------------- 1 | 2 | To build zlib using the Microsoft Visual C++ environment, 3 | use the appropriate project from the contrib/vstudio/ directory. 4 | -------------------------------------------------------------------------------- /zlib/old/README: -------------------------------------------------------------------------------- 1 | This directory contains files that have not been updated for zlib 1.2.x 2 | 3 | (Volunteers are encouraged to help clean this up. Thanks.) 4 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/MiniZip64_Changes.txt: -------------------------------------------------------------------------------- 1 | 2 | MiniZip 1.1 was derrived from MiniZip at version 1.01f 3 | 4 | Change in 1.0 (Okt 2009) 5 | - **TODO - Add history** 6 | 7 | -------------------------------------------------------------------------------- /zlib/contrib/blast/Makefile: -------------------------------------------------------------------------------- 1 | blast: blast.c blast.h 2 | cc -DTEST -o blast blast.c 3 | 4 | test: blast 5 | blast < test.pk | cmp - test.txt 6 | 7 | clean: 8 | rm -f blast blast.o 9 | -------------------------------------------------------------------------------- /zlib/nintendods/README: -------------------------------------------------------------------------------- 1 | This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template. 2 | 3 | Eduardo Costa 4 | January 3, 2009 5 | 6 | -------------------------------------------------------------------------------- /zlib/contrib/delphi/ZLibConst.pas: -------------------------------------------------------------------------------- 1 | unit ZLibConst; 2 | 3 | interface 4 | 5 | resourcestring 6 | sTargetBufferTooSmall = 'ZLib error: target buffer may be too small'; 7 | sInvalidStreamOp = 'Invalid stream operation'; 8 | 9 | implementation 10 | 11 | end. 12 | -------------------------------------------------------------------------------- /zlib/contrib/testzlib/testzlib.txt: -------------------------------------------------------------------------------- 1 | To build testzLib with Visual Studio 2005: 2 | 3 | copy to a directory file from : 4 | - root of zLib tree 5 | - contrib/testzlib 6 | - contrib/masmx86 7 | - contrib/masmx64 8 | - contrib/vstudio/vc7 9 | 10 | and open testzlib8.sln -------------------------------------------------------------------------------- /zlib/contrib/untgz/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-g 3 | 4 | untgz: untgz.o ../../libz.a 5 | $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz 6 | 7 | untgz.o: untgz.c ../../zlib.h 8 | $(CC) $(CFLAGS) -c -I../.. untgz.c 9 | 10 | ../../libz.a: 11 | cd ../..; ./configure; make 12 | 13 | clean: 14 | rm -f untgz untgz.o *~ 15 | -------------------------------------------------------------------------------- /zlib/zlib.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | sharedlibdir=${libdir} 5 | includedir=${prefix}/include 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: 1.2.12 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /zlib/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /zlib.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Latest 7 | 8 | 9 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/minizip.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@/minizip 5 | 6 | Name: minizip 7 | Description: Minizip zip file manipulation library 8 | Requires: 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -lminizip 11 | Libs.private: -lz 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /zlib/zlib.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@INSTALL_LIB_DIR@ 4 | sharedlibdir=@INSTALL_LIB_DIR@ 5 | includedir=@INSTALL_INC_DIR@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /zlib/contrib/untgz/Makefile.msc: -------------------------------------------------------------------------------- 1 | CC=cl 2 | CFLAGS=-MD 3 | 4 | untgz.exe: untgz.obj ..\..\zlib.lib 5 | $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib 6 | 7 | untgz.obj: untgz.c ..\..\zlib.h 8 | $(CC) $(CFLAGS) -c -I..\.. untgz.c 9 | 10 | ..\..\zlib.lib: 11 | cd ..\.. 12 | $(MAKE) -f win32\makefile.msc 13 | cd contrib\untgz 14 | 15 | clean: 16 | -del untgz.obj 17 | -del untgz.exe 18 | -------------------------------------------------------------------------------- /scripts/t_zlib_torture.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | binary=$1/usr/local/bin/t_zlib_verify 4 | test_dir=$2 5 | script=$(pwd)/scripts/t_zlib_all.pl 6 | 7 | function run 8 | { 9 | cmd=$1 10 | 11 | echo "RUN $cmd" 12 | eval $cmd 13 | rc=$? 14 | if [[ $rc != 0 ]] then; 15 | echo "FAIL $cmd" 16 | exit 1 17 | fi; 18 | } 19 | 20 | run "cd $test_dir" 21 | for opts in '-t' '-t -f' '-t -f -r' '-t -r'; 22 | do 23 | run "$script -d . -b \"$binary -e 1 -d 1 $opts\"" 24 | done 25 | -------------------------------------------------------------------------------- /zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /zlib/contrib/iostream3/TODO: -------------------------------------------------------------------------------- 1 | Possible upgrades to gzfilebuf: 2 | 3 | - The ability to do putback (e.g. putbackfail) 4 | 5 | - The ability to seek (zlib supports this, but could be slow/tricky) 6 | 7 | - Simultaneous read/write access (does it make sense?) 8 | 9 | - Support for ios_base::ate open mode 10 | 11 | - Locale support? 12 | 13 | - Check public interface to see which calls give problems 14 | (due to dependence on library internals) 15 | 16 | - Override operator<<(ostream&, gzfilebuf*) to allow direct copying 17 | of stream buffer to stream ( i.e. os << is.rdbuf(); ) 18 | -------------------------------------------------------------------------------- /zlib/contrib/ada/zlib.gpr: -------------------------------------------------------------------------------- 1 | project Zlib is 2 | 3 | for Languages use ("Ada"); 4 | for Source_Dirs use ("."); 5 | for Object_Dir use "."; 6 | for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); 7 | 8 | package Compiler is 9 | for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); 10 | end Compiler; 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use ("-lz"); 14 | end Linker; 15 | 16 | package Builder is 17 | for Default_Switches ("ada") use ("-s", "-gnatQ"); 18 | end Builder; 19 | 20 | end Zlib; 21 | -------------------------------------------------------------------------------- /zlib/contrib/iostream/test.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "zfstream.h" 3 | 4 | int main() { 5 | 6 | // Construct a stream object with this filebuffer. Anything sent 7 | // to this stream will go to standard out. 8 | gzofstream os( 1, ios::out ); 9 | 10 | // This text is getting compressed and sent to stdout. 11 | // To prove this, run 'test | zcat'. 12 | os << "Hello, Mommy" << endl; 13 | 14 | os << setcompressionlevel( Z_NO_COMPRESSION ); 15 | os << "hello, hello, hi, ho!" << endl; 16 | 17 | setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) 18 | << "I'm compressing again" << endl; 19 | 20 | os.close(); 21 | 22 | return 0; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS := $(CFLAGS) -O -I../.. 3 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a 6 | 7 | .c.o: 8 | $(CC) -c $(CFLAGS) $*.c 9 | 10 | all: miniunz minizip 11 | 12 | miniunz: $(UNZ_OBJS) 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) 14 | 15 | minizip: $(ZIP_OBJS) 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) 17 | 18 | test: miniunz minizip 19 | @rm -f test.* 20 | @echo hello hello hello > test.txt 21 | ./minizip test test.txt 22 | ./miniunz -l test.zip 23 | @mv test.txt test.old 24 | ./miniunz test.zip 25 | @cmp test.txt test.old 26 | @rm -f test.* 27 | 28 | clean: 29 | /bin/rm -f *.o *~ minizip miniunz test.* 30 | -------------------------------------------------------------------------------- /AddOn/ZTests/ztest_fuzzer.c: -------------------------------------------------------------------------------- 1 | #include "zlib.h" 2 | #include "ztest_common.h" 3 | 4 | // Ref. https://confluence.sd.apple.com/display/DT/Fuzz+Testing+with+LibFuzzer 5 | 6 | int LLVMFuzzerTestOneInput(const uint8_t* buffer, size_t size); 7 | 8 | int LLVMFuzzerTestOneInput(const uint8_t* buffer, size_t size) 9 | { 10 | // Allocate buffer 11 | const size_t dst_size = 1 << 20; 12 | uint8_t* dst_buffer = malloc(dst_size); 13 | if (dst_buffer == NULL) return -1; // Malloc failed 14 | 15 | // From time to time, show that we are still working 16 | if ((rand() & 0xfff) == 0) printf(" -> alive\n"); 17 | 18 | // Decode 19 | zlib_decode_torture(dst_buffer, dst_size, (uint8_t*)buffer, size, 0); 20 | 21 | // Free buffer 22 | free(dst_buffer); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /zlib/contrib/iostream2/zstream_test.cpp: -------------------------------------------------------------------------------- 1 | #include "zstream.h" 2 | #include 3 | #include 4 | #include 5 | 6 | void main() { 7 | char h[256] = "Hello"; 8 | char* g = "Goodbye"; 9 | ozstream out("temp.gz"); 10 | out < "This works well" < h < g; 11 | out.close(); 12 | 13 | izstream in("temp.gz"); // read it back 14 | char *x = read_string(in), *y = new char[256], z[256]; 15 | in > y > z; 16 | in.close(); 17 | cout << x << endl << y << endl << z << endl; 18 | 19 | out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results 20 | out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; 21 | out << z << endl << y << endl << x << endl; 22 | out << 1.1234567890123456789 << endl; 23 | 24 | delete[] x; delete[] y; 25 | } 26 | -------------------------------------------------------------------------------- /scripts/t_bats_zlib.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # BATS entry point for zlib tests 3 | 4 | use File::Basename; 5 | 6 | # Get our location 7 | my $scripts_dir = dirname(__FILE__); 8 | 9 | # Figure out which code to run 10 | my $uname = `uname -m -p`; 11 | my $bindir = 'osx'; 12 | $bindir = 'ios' if ( $uname =~ /arm/ ); 13 | $bindir = 'wos' if ( $uname =~ /Watch/ ); 14 | $bindir = $scripts_dir.'/../bin/'.$bindir; 15 | my $datadir = $scripts_dir.'/../data'; 16 | 17 | if ( not -d $bindir ) { 18 | print STDERR "ERROR: binary directory not found: $bindir\n"; 19 | exit(1); 20 | } 21 | if ( not -d $datadir ) { 22 | print STDERR "ERROR: binary directory not found: $datadir\n"; 23 | exit(1); 24 | } 25 | 26 | my $cmd = "$scripts_dir/t_zlib_all.pl -d \"$datadir\" -b $bindir/t_zlib"; 27 | system($cmd); 28 | 29 | exit(1) if ( $? != 0 ); # failed 30 | exit(0); #OK 31 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com]) 5 | AC_CONFIG_SRCDIR([minizip.c]) 6 | AM_INIT_AUTOMAKE([foreign]) 7 | LT_INIT 8 | 9 | AC_MSG_CHECKING([whether to build example programs]) 10 | AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs])) 11 | AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) 12 | if test "$enable_demos" = yes 13 | then 14 | AC_MSG_RESULT([yes]) 15 | else 16 | AC_MSG_RESULT([no]) 17 | fi 18 | 19 | case "${host}" in 20 | *-mingw* | mingw*) 21 | WIN32="yes" 22 | ;; 23 | *) 24 | ;; 25 | esac 26 | AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) 27 | 28 | 29 | AC_SUBST([HAVE_UNISTD_H], [0]) 30 | AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) 31 | AC_CONFIG_FILES([Makefile minizip.pc]) 32 | AC_OUTPUT 33 | -------------------------------------------------------------------------------- /zlib.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpenSourceProject 6 | zlib 7 | OpenSourceVersion 8 | 1.2.12 9 | OpenSourceWebsiteURL 10 | http://www.zlib.net/ 11 | OpenSourceURL 12 | https://zlib.net/zlib-1.2.12.tar.gz 13 | OpenSourceMD5 14 | 5fc414a9726be31427b440b434d05f78 15 | OpenSourceImportDate 16 | 2022-08-26 17 | OpenSourceModifications 18 | 19 | Minor changes to fix building 20 | Some performance optimizations 21 | 22 | OpenSourceLicense 23 | other 24 | OpenSourceLicenseFile 25 | zlib.txt 26 | 27 | 28 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 22 | void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); 23 | void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); 24 | void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /zlib.xcconfig: -------------------------------------------------------------------------------- 1 | #include "/Makefiles/CoreOS/Xcode/BSD.xcconfig" 2 | 3 | ARCHS = $(ARCHS_STANDARD_32_64_BIT) 4 | ONLY_ACTIVE_ARCH = NO 5 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 6 | CODE_SIGN_IDENTITY = - 7 | INSTALL_PATH = /usr/lib 8 | DYLIB_COMPATIBILITY_VERSION = 1 9 | DYLIB_CURRENT_VERSION = 1.2.12 10 | DEAD_CODE_STRIPPING = YES 11 | EXPORTED_SYMBOLS_FILE = libz.exp 12 | EXECUTABLE_PREFIX = lib 13 | PRODUCT_NAME = z.$(DYLIB_COMPATIBILITY_VERSION) 14 | STRIP_STYLE = non-global 15 | PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/include 16 | ALWAYS_SEARCH_USER_PATHS = NO 17 | CURRENT_PROJECT_VERSION = $(RC_ProjectSourceVersion) 18 | VERSION_INFO_PREFIX = __ 19 | VERSIONING_SYSTEM = apple-generic 20 | GCC_C_LANGUAGE_STANDARD = gnu11 21 | GCC_ENABLE_PASCAL_STRINGS = NO 22 | GCC_PREPROCESSOR_DEFINITIONS = USE_MMAP VEC_OPTIMIZE INFFAST_OPT 23 | GCC_WARN_ABOUT_RETURN_TYPE = YES 24 | GCC_WARN_UNUSED_VARIABLE = YES 25 | PREBINDING = NO 26 | USE_HEADERMAP = NO 27 | ZERO_LINK = NO 28 | -------------------------------------------------------------------------------- /zlib/contrib/masmx86/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Summary 3 | ------- 4 | This directory contains ASM implementations of the functions 5 | longest_match() and inflate_fast(). 6 | 7 | 8 | Use instructions 9 | ---------------- 10 | Assemble using MASM, and copy the object files into the zlib source 11 | directory, then run the appropriate makefile, as suggested below. You can 12 | donwload MASM from here: 13 | 14 | http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 15 | 16 | You can also get objects files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | Build instructions 21 | ------------------ 22 | * With Microsoft C and MASM: 23 | nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" 24 | 25 | * With Borland C and TASM: 26 | make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" 27 | 28 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET 13 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET 14 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET 15 | {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /zlib/old/os2/zlib.def: -------------------------------------------------------------------------------- 1 | ; 2 | ; Slightly modified version of ../nt/zlib.dnt :-) 3 | ; 4 | 5 | LIBRARY Z 6 | DESCRIPTION "Zlib compression library for OS/2" 7 | CODE PRELOAD MOVEABLE DISCARDABLE 8 | DATA PRELOAD MOVEABLE MULTIPLE 9 | 10 | EXPORTS 11 | adler32 12 | compress 13 | crc32 14 | deflate 15 | deflateCopy 16 | deflateEnd 17 | deflateInit2_ 18 | deflateInit_ 19 | deflateParams 20 | deflateReset 21 | deflateSetDictionary 22 | gzclose 23 | gzdopen 24 | gzerror 25 | gzflush 26 | gzopen 27 | gzread 28 | gzwrite 29 | inflate 30 | inflateEnd 31 | inflateInit2_ 32 | inflateInit_ 33 | inflateReset 34 | inflateSetDictionary 35 | inflateSync 36 | uncompress 37 | zlibVersion 38 | gzprintf 39 | gzputc 40 | gzgetc 41 | gzseek 42 | gzrewind 43 | gztell 44 | gzeof 45 | gzsetparams 46 | zError 47 | inflateSyncPoint 48 | get_crc_table 49 | compress2 50 | gzputs 51 | gzgets 52 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/make_vms.com: -------------------------------------------------------------------------------- 1 | $ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig 2 | $ open/write zdef vmsdefs.h 3 | $ copy sys$input: zdef 4 | $ deck 5 | #define unix 6 | #define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from 7 | #define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator 8 | #define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord 9 | #define Write_EndOfCentralDirectoryRecord Write_EoDRecord 10 | $ eod 11 | $ close zdef 12 | $ copy vmsdefs.h,ioapi.h_orig ioapi.h 13 | $ cc/include=[--]/prefix=all ioapi.c 14 | $ cc/include=[--]/prefix=all miniunz.c 15 | $ cc/include=[--]/prefix=all unzip.c 16 | $ cc/include=[--]/prefix=all minizip.c 17 | $ cc/include=[--]/prefix=all zip.c 18 | $ link miniunz,unzip,ioapi,[--]libz.olb/lib 19 | $ link minizip,zip,ioapi,[--]libz.olb/lib 20 | $ mcr []minizip test minizip_info.txt 21 | $ mcr []miniunz -l test.zip 22 | $ rename minizip_info.txt; minizip_info.txt_old 23 | $ mcr []miniunz test.zip 24 | $ delete test.zip;* 25 | $exit 26 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {048af943-022b-4db6-beeb-a54c34774ee2} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {0844199a-966b-4f19-81db-1e0125e141b9} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/minizip.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c0419b40-bf50-40da-b153-ff74215b79de} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {bb87b070-735b-478e-92ce-7383abb2f36c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {f46ab6a6-548f-43cb-ae96-681abb5bd5db} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libminizip.la 2 | 3 | if COND_DEMOS 4 | bin_PROGRAMS = miniunzip minizip 5 | endif 6 | 7 | zlib_top_srcdir = $(top_srcdir)/../.. 8 | zlib_top_builddir = $(top_builddir)/../.. 9 | 10 | AM_CPPFLAGS = -I$(zlib_top_srcdir) 11 | AM_LDFLAGS = -L$(zlib_top_builddir) 12 | 13 | if WIN32 14 | iowin32_src = iowin32.c 15 | iowin32_h = iowin32.h 16 | endif 17 | 18 | libminizip_la_SOURCES = \ 19 | ioapi.c \ 20 | mztools.c \ 21 | unzip.c \ 22 | zip.c \ 23 | ${iowin32_src} 24 | 25 | libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz 26 | 27 | minizip_includedir = $(includedir)/minizip 28 | minizip_include_HEADERS = \ 29 | crypt.h \ 30 | ioapi.h \ 31 | mztools.h \ 32 | unzip.h \ 33 | zip.h \ 34 | ${iowin32_h} 35 | 36 | pkgconfigdir = $(libdir)/pkgconfig 37 | pkgconfig_DATA = minizip.pc 38 | 39 | EXTRA_PROGRAMS = miniunzip minizip 40 | 41 | miniunzip_SOURCES = miniunz.c 42 | miniunzip_LDADD = libminizip.la 43 | 44 | minizip_SOURCES = minizip.c 45 | minizip_LDADD = libminizip.la -lz 46 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fa61a89f-93fc-4c89-b29e-36224b7592f4} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {d4b85da0-2ba2-4934-b57f-e2584e3848ee} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {e573e075-00bd-4a7d-bd67-a8cc9bfc5aca} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc12/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1, 2, 12, 0 6 | PRODUCTVERSION 1, 2, 12, 0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.12\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc14/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1, 2, 12, 0 6 | PRODUCTVERSION 1, 2, 12, 0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.12\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1, 2, 12, 0 6 | PRODUCTVERSION 1, 2, 12, 0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.12\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc11/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1, 2, 12, 0 6 | PRODUCTVERSION 1, 2, 12, 0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.12\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc9/zlib.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define IDR_VERSION1 1 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 5 | FILEVERSION 1, 2, 12, 0 6 | PRODUCTVERSION 1, 2, 12, 0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_DOS_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 // not used 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "040904E4" 16 | //language ID = U.S. English, char set = Windows, Multilingual 17 | 18 | BEGIN 19 | VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" 20 | VALUE "FileVersion", "1.2.12\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlibwapi.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" 26 | END 27 | END 28 | BLOCK "VarFileInfo" 29 | BEGIN 30 | VALUE "Translation", 0x0409, 1252 31 | END 32 | END 33 | -------------------------------------------------------------------------------- /scripts/t_zlib_all.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # Run t_zlib on all regular files in the specified directory 3 | 4 | 5 | use Getopt::Std; 6 | use File::Temp; 7 | 8 | our $opt_d = '.'; 9 | our $opt_h = 0; 10 | our $opt_b = '.'; 11 | 12 | getopts('hvsd:a:r:b:'); 13 | 14 | if ($opt_h) { 15 | print STDERR "Usage: t_zlib_all.pl [-h] [-d dataDir] [-b tester]\n"; 16 | print STDERR "-h print usage and quit\n"; 17 | print STDERR "-d directory providing test files\n"; 18 | print STDERR "-b path to tester\n"; 19 | 20 | exit(1); 21 | } 22 | my $dataDir = $opt_d; 23 | my $status = 0; 24 | my $binFile = $opt_b; 25 | 26 | open(FILE,"find \"$dataDir\" -type f|") or die "find"; 27 | 28 | LINE: while (my $f = ) { 29 | chop($f); 30 | next LINE if ( $f =~ /\.svn\// ); # skip subversion stuff 31 | next LINE if ( $f =~ /\.git\// ); # skip git stuff 32 | next LINE if ( $f =~ /\.DS_Store$/ ); # skip .DS_Store 33 | next LINE unless ( -f $f ); 34 | my $sz = (-s $f); 35 | 36 | next LINE if ( $sz < 1 or $sz > (2 << 30)); # alloc will fail if too large 37 | my $cmd = $binFile.' "'.$f.'"'; 38 | print STDERR "$cmd "; 39 | $status = system($cmd); 40 | exit(1) if ( $status != 0 ); # return 1 if failed 41 | } 42 | 43 | close(FILE); 44 | exit(0); #OK 45 | -------------------------------------------------------------------------------- /zlib/win32/zlib1.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../zlib.h" 3 | 4 | #ifdef GCC_WINDRES 5 | VS_VERSION_INFO VERSIONINFO 6 | #else 7 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 8 | #endif 9 | FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 10 | PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 12 | #ifdef _DEBUG 13 | FILEFLAGS 1 14 | #else 15 | FILEFLAGS 0 16 | #endif 17 | FILEOS VOS__WINDOWS32 18 | FILETYPE VFT_DLL 19 | FILESUBTYPE 0 // not used 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904E4" 24 | //language ID = U.S. English, char set = Windows, Multilingual 25 | BEGIN 26 | VALUE "FileDescription", "zlib data compression library\0" 27 | VALUE "FileVersion", ZLIB_VERSION "\0" 28 | VALUE "InternalName", "zlib1.dll\0" 29 | VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" 30 | VALUE "OriginalFilename", "zlib1.dll\0" 31 | VALUE "ProductName", "zlib\0" 32 | VALUE "ProductVersion", ZLIB_VERSION "\0" 33 | VALUE "Comments", "For more information visit http://www.zlib.net/\0" 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x0409, 1252 39 | END 40 | END 41 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib.build: -------------------------------------------------------------------------------- 1 | 2 | 3 | A .Net wrapper library around ZLib1.dll 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /zlib/contrib/masmx64/readme.txt: -------------------------------------------------------------------------------- 1 | Summary 2 | ------- 3 | This directory contains ASM implementations of the functions 4 | longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), 5 | for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. 6 | 7 | gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits 8 | assembly optimized version from Jean-loup Gailly original longest_match function 9 | 10 | inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing 11 | original function from Mark Adler 12 | 13 | Use instructions 14 | ---------------- 15 | Assemble the .asm files using MASM and put the object files into the zlib source 16 | directory. You can also get object files here: 17 | 18 | http://www.winimage.com/zLibDll/zlib124_masm_obj.zip 19 | 20 | define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, 21 | and inffasx64.obj and gvmat64.obj as object to link. 22 | 23 | 24 | Build instructions 25 | ------------------ 26 | run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) 27 | 28 | ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK 29 | 30 | You can get Windows 2003 server DDK with ml64 and cl for AMD64 from 31 | http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) 32 | -------------------------------------------------------------------------------- /libz.exp: -------------------------------------------------------------------------------- 1 | _zlibVersion 2 | _deflate 3 | _deflateEnd 4 | _inflate 5 | _inflateEnd 6 | _deflateSetDictionary 7 | _deflateCopy 8 | _deflateReset 9 | _deflateParams 10 | _deflateTune 11 | _deflateBound 12 | _deflatePrime 13 | _deflateSetHeader 14 | _inflateSetDictionary 15 | _inflateSync 16 | _inflateCopy 17 | _inflateReset 18 | _inflateReset2 19 | _inflatePrime 20 | _inflateGetHeader 21 | _inflateBack 22 | _inflateBackEnd 23 | _inflateMark 24 | _inflateUndermine 25 | _zlibCompileFlags 26 | _compress 27 | _compress2 28 | _compressBound 29 | _uncompress 30 | _gzopen 31 | _gzdopen 32 | _gzsetparams 33 | _gzread 34 | _gzwrite 35 | _gzprintf 36 | _gzputs 37 | _gzgets 38 | _gzputc 39 | _gzgetc 40 | _gzungetc 41 | _gzflush 42 | _gzseek 43 | _gzrewind 44 | _gztell 45 | _gzeof 46 | _gzdirect 47 | _gzclose 48 | _gzclose_r 49 | _gzclose_w 50 | _gzerror 51 | _gzclearerr 52 | _gzbuffer 53 | _gzoffset 54 | _adler32 55 | _adler32_combine 56 | _crc32 57 | _crc32_combine 58 | _deflateInit_ 59 | _inflateInit_ 60 | _deflateInit2_ 61 | _inflateInit2_ 62 | _inflateBackInit_ 63 | _zError 64 | _inflateSyncPoint 65 | _get_crc_table 66 | _deflatePending 67 | _deflateResetKeep 68 | _gzgetc_ 69 | _inflateResetKeep 70 | _inflateGetDictionary 71 | _deflateGetDictionary 72 | _gzvprintf 73 | _adler32_z 74 | _crc32_z 75 | _gzfread 76 | _gzfwrite 77 | _uncompress2 78 | _inflateValidate 79 | _inflateCodesUsed 80 | _crc32_combine_gen 81 | _crc32_combine_op 82 | -------------------------------------------------------------------------------- /NMakefile: -------------------------------------------------------------------------------- 1 | # Makefile for Windows build of zlib 2 | 3 | !if "$(PLATFORM)" == "x86_amd64" 4 | bits=64 5 | !else 6 | bits=32 7 | !endif 8 | 9 | name=zlib 10 | project=$(name)-1.2.11 11 | bin_dir=bin$(bits) 12 | lib_dir=lib$(bits) 13 | sym_dir=public$(bits)\sym 14 | 15 | 16 | install: 17 | xcopy $(name) "$(SRCROOT)\$(project)" /s/v/i/h/y 18 | cd "$(SRCROOT)\$(project)" 19 | nmake -f win32\Makefile.msc clean 20 | nmake -f win32\Makefile.msc PLATFORM=$(PLATFORM) 21 | xcopy "$(SRCROOT)\$(project)\*.dll" "$(DSTROOT)\AppleInternal\$(bin_dir)" /s/v/i/h/y 22 | -mkdir "$(DSTROOT)\AppleInternal\$(sym_dir)" 23 | copy "$(SRCROOT)\$(project)\zlib1.pdb" "$(DSTROOT)\AppleInternal\$(sym_dir)\" /v/y 24 | xcopy "$(SRCROOT)\$(project)\*.h" "$(DSTROOT)\AppleInternal\include\zlib" /s/v/i/h/y 25 | xcopy "$(SRCROOT)\$(project)\*.lib" "$(DSTROOT)\AppleInternal\$(lib_dir)" /s/v/i/h/y 26 | 27 | install_DEBUG: 28 | xcopy $(name) "$(SRCROOT)\$(project)" /s/v/i/h/y 29 | cd "$(SRCROOT)\$(project)" 30 | nmake -f win32\Makefile.msc clean 31 | nmake -f win32\Makefile.msc DEBUG=1 PLATFORM=$(PLATFORM) 32 | xcopy "$(SRCROOT)\$(project)\*.dll" "$(DSTROOT)\AppleInternal\$(bin_dir)" /s/v/i/h/y 33 | xcopy "$(SRCROOT)\$(project)\*.lib" "$(DSTROOT)\AppleInternal\$(lib_dir)" /s/v/i/h/y 34 | -mkdir "$(DSTROOT)\AppleInternal\$(sym_dir)" 35 | copy "$(SRCROOT)\$(project)\zlib1_debug.pdb" "$(DSTROOT)\AppleInternal\$(sym_dir)\" /v/y 36 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /zlib/contrib/puff/puff.h: -------------------------------------------------------------------------------- 1 | /* puff.h 2 | Copyright (C) 2002-2013 Mark Adler, all rights reserved 3 | version 2.3, 21 Jan 2013 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * See puff.c for purpose and usage. 27 | */ 28 | #ifndef NIL 29 | # define NIL ((unsigned char *)0) /* for no output option */ 30 | #endif 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | const unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | -------------------------------------------------------------------------------- /zlib/watcom/watcom_l.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom large model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_l.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc 18 | LINKER = wcl 19 | CFLAGS = -zq -ml -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_l.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /zlib/watcom/watcom_f.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # OpenWatcom flat model 3 | # Last updated: 28-Dec-2005 4 | 5 | # To use, do "wmake -f watcom_f.mak" 6 | 7 | C_SOURCE = adler32.c compress.c crc32.c deflate.c & 8 | gzclose.c gzlib.c gzread.c gzwrite.c & 9 | infback.c inffast.c inflate.c inftrees.c & 10 | trees.c uncompr.c zutil.c 11 | 12 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj & 13 | gzclose.obj gzlib.obj gzread.obj gzwrite.obj & 14 | infback.obj inffast.obj inflate.obj inftrees.obj & 15 | trees.obj uncompr.obj zutil.obj 16 | 17 | CC = wcc386 18 | LINKER = wcl386 19 | CFLAGS = -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx 20 | ZLIB_LIB = zlib_f.lib 21 | 22 | .C.OBJ: 23 | $(CC) $(CFLAGS) $[@ 24 | 25 | all: $(ZLIB_LIB) example.exe minigzip.exe 26 | 27 | $(ZLIB_LIB): $(OBJS) 28 | wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj 29 | wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj 30 | wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj 31 | wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj 32 | wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj 33 | 34 | example.exe: $(ZLIB_LIB) example.obj 35 | $(LINKER) -ldos32a -fe=example.exe example.obj $(ZLIB_LIB) 36 | 37 | minigzip.exe: $(ZLIB_LIB) minigzip.obj 38 | $(LINKER) -ldos32a -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) 39 | 40 | clean: .SYMBOLIC 41 | del *.obj 42 | del $(ZLIB_LIB) 43 | @echo Cleaning done 44 | -------------------------------------------------------------------------------- /zlib/contrib/iostream3/README: -------------------------------------------------------------------------------- 1 | These classes provide a C++ stream interface to the zlib library. It allows you 2 | to do things like: 3 | 4 | gzofstream outf("blah.gz"); 5 | outf << "These go into the gzip file " << 123 << endl; 6 | 7 | It does this by deriving a specialized stream buffer for gzipped files, which is 8 | the way Stroustrup would have done it. :-> 9 | 10 | The gzifstream and gzofstream classes were originally written by Kevin Ruland 11 | and made available in the zlib contrib/iostream directory. The older version still 12 | compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of 13 | this version. 14 | 15 | The new classes are as standard-compliant as possible, closely following the 16 | approach of the standard library's fstream classes. It compiles under gcc versions 17 | 3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard 18 | library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs 19 | from the previous one in the following respects: 20 | - added showmanyc 21 | - added setbuf, with support for unbuffered output via setbuf(0,0) 22 | - a few bug fixes of stream behavior 23 | - gzipped output file opened with default compression level instead of maximum level 24 | - setcompressionlevel()/strategy() members replaced by single setcompression() 25 | 26 | The code is provided "as is", with the permission to use, copy, modify, distribute 27 | and sell it for any purpose without fee. 28 | 29 | Ludwig Schwardt 30 | 31 | 32 | DSP Lab 33 | Electrical & Electronic Engineering Department 34 | University of Stellenbosch 35 | South Africa 36 | -------------------------------------------------------------------------------- /scripts/zlib_tests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python -u 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | from bats.test.parambulator import Parambulator 6 | 7 | class Test(Parambulator): 8 | def set_up(self): 9 | super(Test, self).set_up() 10 | 11 | # copy and decompress test files on the device 12 | filename = 'zlib_test_files.zip' 13 | tar_command = 'cd {}; tar -xzf zlib_test_files.zip' 14 | self.copy_to_device(filename, self.device_tmp_dir, 15 | on_error="Failed to copy test files to device.") 16 | 17 | self.run_setup_on_device(tar_command.format( 18 | self.device_tmp_dir)) 19 | 20 | if not self.is_watchos(): 21 | filename = 'zlib_large_test_files.zip' 22 | tar_command = 'cd {}; tar -xzf zlib_large_test_files.zip' 23 | self.copy_to_device(filename, self.device_tmp_dir, 24 | on_error="Failed to copy test files to device.") 25 | 26 | self.run_setup_on_device(tar_command.format( 27 | self.device_tmp_dir)) 28 | 29 | def run_parambulator_iteration(self): 30 | results = {} 31 | 32 | # Run tests and gather results 33 | so, se, rc = self.run_test_on_device( 34 | 'perl {}'.format(os.path.join(self.device_tmp_dir, 35 | 'scripts/t_bats_zlib.pl')), 36 | as_root=True, 37 | # test will return non-zero if anything fails 38 | on_error="Test had non-zero exit status.") 39 | 40 | return results 41 | 42 | Test.execute_tests() 43 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/minizip.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .TH minizip 1 "May 2, 2001" 3 | .\" Please adjust this date whenever revising the manpage. 4 | .\" 5 | .\" Some roff macros, for reference: 6 | .\" .nh disable hyphenation 7 | .\" .hy enable hyphenation 8 | .\" .ad l left justify 9 | .\" .ad b justify to both left and right margins 10 | .\" .nf disable filling 11 | .\" .fi enable filling 12 | .\" .br insert line break 13 | .\" .sp insert n+1 empty lines 14 | .\" for manpage-specific macros, see man(7) 15 | .SH NAME 16 | minizip - create ZIP archives 17 | .SH SYNOPSIS 18 | .B minizip 19 | .RI [ -o ] 20 | zipfile [ " files" ... ] 21 | .SH DESCRIPTION 22 | .B minizip 23 | is a simple tool which allows the creation of compressed file archives 24 | in the ZIP format used by the MS-DOS utility PKZIP. It was written as 25 | a demonstration of the 26 | .IR zlib (3) 27 | library and therefore lack many of the features of the 28 | .IR zip (1) 29 | program. 30 | .SH OPTIONS 31 | The first argument supplied is the name of the ZIP archive to create or 32 | .RI -o 33 | in which case it is ignored and the second argument treated as the 34 | name of the ZIP file. If the ZIP file already exists it will be 35 | overwritten. 36 | .PP 37 | Subsequent arguments specify a list of files to place in the ZIP 38 | archive. If none are specified then an empty archive will be created. 39 | .SH SEE ALSO 40 | .BR miniunzip (1), 41 | .BR zlib (3), 42 | .BR zip (1). 43 | .SH AUTHOR 44 | This program was written by Gilles Vollant. This manual page was 45 | written by Mark Brown . 46 | 47 | -------------------------------------------------------------------------------- /zlib/contrib/iostream3/test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Test program for gzifstream and gzofstream 3 | * 4 | * by Ludwig Schwardt 5 | * original version by Kevin Ruland 6 | */ 7 | 8 | #include "zfstream.h" 9 | #include // for cout 10 | 11 | int main() { 12 | 13 | gzofstream outf; 14 | gzifstream inf; 15 | char buf[80]; 16 | 17 | outf.open("test1.txt.gz"); 18 | outf << "The quick brown fox sidestepped the lazy canine\n" 19 | << 1.3 << "\nPlan " << 9 << std::endl; 20 | outf.close(); 21 | std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n" 22 | << "The quick brown fox sidestepped the lazy canine\n" 23 | << 1.3 << "\nPlan " << 9 << std::endl; 24 | 25 | std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n"; 26 | inf.open("test1.txt.gz"); 27 | while (inf.getline(buf,80,'\n')) { 28 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 29 | } 30 | inf.close(); 31 | 32 | outf.rdbuf()->pubsetbuf(0,0); 33 | outf.open("test2.txt.gz"); 34 | outf << setcompression(Z_NO_COMPRESSION) 35 | << "The quick brown fox sidestepped the lazy canine\n" 36 | << 1.3 << "\nPlan " << 9 << std::endl; 37 | outf.close(); 38 | std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form"; 39 | 40 | std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n"; 41 | inf.rdbuf()->pubsetbuf(0,0); 42 | inf.open("test2.txt.gz"); 43 | while (inf.getline(buf,80,'\n')) { 44 | std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; 45 | } 46 | inf.close(); 47 | 48 | return 0; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /zlib/old/descrip.mms: -------------------------------------------------------------------------------- 1 | # descrip.mms: MMS description file for building zlib on VMS 2 | # written by Martin P.J. Zinser 3 | 4 | cc_defs = 5 | c_deb = 6 | 7 | .ifdef __DECC__ 8 | pref = /prefix=all 9 | .endif 10 | 11 | OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ 12 | deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ 13 | inftrees.obj, infcodes.obj, infutil.obj, inffast.obj 14 | 15 | CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) 16 | 17 | all : example.exe minigzip.exe 18 | @ write sys$output " Example applications available" 19 | libz.olb : libz.olb($(OBJS)) 20 | @ write sys$output " libz available" 21 | 22 | example.exe : example.obj libz.olb 23 | link example,libz.olb/lib 24 | 25 | minigzip.exe : minigzip.obj libz.olb 26 | link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib 27 | 28 | clean : 29 | delete *.obj;*,libz.olb;* 30 | 31 | 32 | # Other dependencies. 33 | adler32.obj : zutil.h zlib.h zconf.h 34 | compress.obj : zlib.h zconf.h 35 | crc32.obj : zutil.h zlib.h zconf.h 36 | deflate.obj : deflate.h zutil.h zlib.h zconf.h 37 | example.obj : zlib.h zconf.h 38 | gzio.obj : zutil.h zlib.h zconf.h 39 | infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 40 | infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h 41 | inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h 42 | inflate.obj : zutil.h zlib.h zconf.h infblock.h 43 | inftrees.obj : zutil.h zlib.h zconf.h inftrees.h 44 | infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h 45 | minigzip.obj : zlib.h zconf.h 46 | trees.obj : deflate.h zutil.h zlib.h zconf.h 47 | uncompr.obj : zlib.h zconf.h 48 | zutil.obj : zutil.h zlib.h zconf.h 49 | -------------------------------------------------------------------------------- /zlib/contrib/infback9/infback9.h: -------------------------------------------------------------------------------- 1 | /* infback9.h -- header for using inflateBack9 functions 2 | * Copyright (C) 2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* 7 | * This header file and associated patches provide a decoder for PKWare's 8 | * undocumented deflate64 compression method (method 9). Use with infback9.c, 9 | * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported. 10 | * This should be compiled with zlib, since it uses zutil.h and zutil.o. 11 | * This code has not yet been tested on 16-bit architectures. See the 12 | * comments in zlib.h for inflateBack() usage. These functions are used 13 | * identically, except that there is no windowBits parameter, and a 64K 14 | * window must be provided. Also if int's are 16 bits, then a zero for 15 | * the third parameter of the "out" function actually means 65536UL. 16 | * zlib.h must be included before this header file. 17 | */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, 24 | in_func in, void FAR *in_desc, 25 | out_func out, void FAR *out_desc)); 26 | ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); 27 | ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, 28 | unsigned char FAR *window, 29 | const char *version, 30 | int stream_size)); 31 | #define inflateBack9Init(strm, window) \ 32 | inflateBack9Init_((strm), (window), \ 33 | ZLIB_VERSION, sizeof(z_stream)) 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /zlib/msdos/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DZLIB_DEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 37 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /zlib/old/Makefile.emx: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.emx; make test -fmakefile.emx 8 | # 9 | 10 | CC=gcc -Zwin32 11 | 12 | #CFLAGS=-MMD -O 13 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 14 | #CFLAGS=-MMD -g -DZLIB_DEBUG 15 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 16 | -Wstrict-prototypes -Wmissing-prototypes 17 | 18 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 19 | CP=copy /Y 20 | # If gnu install.exe is available, replace $(CP) with ginstall. 21 | INSTALL=$(CP) 22 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 23 | RM=del 24 | LDLIBS=-L. -lzlib 25 | LD=$(CC) -s -o 26 | LDSHARED=$(CC) 27 | 28 | INCL=zlib.h zconf.h 29 | LIBS=zlib.a 30 | 31 | AR=ar rcs 32 | 33 | prefix=/usr/local 34 | exec_prefix = $(prefix) 35 | 36 | OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \ 37 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 38 | 39 | TEST_OBJS = example.o minigzip.o 40 | 41 | all: example.exe minigzip.exe 42 | 43 | test: all 44 | ./example 45 | echo hello world | .\minigzip | .\minigzip -d 46 | 47 | %.o : %.c 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | zlib.a: $(OBJS) 51 | $(AR) $@ $(OBJS) 52 | 53 | %.exe : %.o $(LIBS) 54 | $(LD) $@ $< $(LDLIBS) 55 | 56 | 57 | .PHONY : clean 58 | 59 | clean: 60 | $(RM) *.d 61 | $(RM) *.o 62 | $(RM) *.exe 63 | $(RM) zlib.a 64 | $(RM) foo.gz 65 | 66 | DEPS := $(wildcard *.d) 67 | ifneq ($(DEPS),) 68 | include $(DEPS) 69 | endif 70 | -------------------------------------------------------------------------------- /zlib/contrib/asm686/README.686: -------------------------------------------------------------------------------- 1 | This is a patched version of zlib, modified to use 2 | Pentium-Pro-optimized assembly code in the deflation algorithm. The 3 | files changed/added by this patch are: 4 | 5 | README.686 6 | match.S 7 | 8 | The speedup that this patch provides varies, depending on whether the 9 | compiler used to build the original version of zlib falls afoul of the 10 | PPro's speed traps. My own tests show a speedup of around 10-20% at 11 | the default compression level, and 20-30% using -9, against a version 12 | compiled using gcc 2.7.2.3. Your mileage may vary. 13 | 14 | Note that this code has been tailored for the PPro/PII in particular, 15 | and will not perform particuarly well on a Pentium. 16 | 17 | If you are using an assembler other than GNU as, you will have to 18 | translate match.S to use your assembler's syntax. (Have fun.) 19 | 20 | Brian Raiter 21 | breadbox@muppetlabs.com 22 | April, 1998 23 | 24 | 25 | Added for zlib 1.1.3: 26 | 27 | The patches come from 28 | http://www.muppetlabs.com/~breadbox/software/assembly.html 29 | 30 | To compile zlib with this asm file, copy match.S to the zlib directory 31 | then do: 32 | 33 | CFLAGS="-O3 -DASMV" ./configure 34 | make OBJA=match.o 35 | 36 | 37 | Update: 38 | 39 | I've been ignoring these assembly routines for years, believing that 40 | gcc's generated code had caught up with it sometime around gcc 2.95 41 | and the major rearchitecting of the Pentium 4. However, I recently 42 | learned that, despite what I believed, this code still has some life 43 | in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% 44 | faster than the code produced by gcc 4.1. 45 | 46 | In acknowledgement of its continuing usefulness, I've altered the 47 | license to match that of the rest of zlib. Share and Enjoy! 48 | 49 | Brian Raiter 50 | breadbox@muppetlabs.com 51 | April, 2007 52 | -------------------------------------------------------------------------------- /AddOn/ZTests/ztest_common.h: -------------------------------------------------------------------------------- 1 | // ZLIB tests tools 2 | // CM 2022/08/29 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "zlib.h" 10 | 11 | #define PLOG(F, ...) do { fprintf(stderr, F"\n", ##__VA_ARGS__); } while (0) 12 | #define PFAIL(F, ...) do { PLOG("[ERR "__FILE__":%s:%d] "F, __FUNCTION__, __LINE__, ##__VA_ARGS__); exit(1); } while (0) 13 | 14 | #pragma mark - BENCHMARKING 15 | 16 | int kpc_cycles_init(void); 17 | uint64_t kpc_get_cycles(void); 18 | 19 | #pragma mark - BUFFER API 20 | 21 | // Encode buffer using zlib. Return number of compressed bytes, 0 on failure. 22 | size_t zlib_encode_buffer(uint8_t* dst_buffer, size_t dst_size, 23 | uint8_t* src_buffer, size_t src_size, int level, int rfc1950, int fixed); 24 | 25 | // Decode buffer using zlib. Return number of uncompressed bytes, 0 on failure. 26 | // Supports truncated decodes. 27 | size_t zlib_decode_buffer(uint8_t* dst_buffer, size_t dst_size, 28 | uint8_t* src_buffer, size_t src_size, int rfc1950); 29 | 30 | // Decode buffer using zlib using infback interface. Return number of uncompressed bytes, 0 on failure. 31 | // Supports truncated decodes. 32 | size_t zlib_decode_infback(uint8_t* dst_buffer, size_t dst_size, 33 | uint8_t* src_buffer, size_t src_size); 34 | 35 | // Decode buffer using zlib. Torture streaming API. Return number of uncompressed bytes, 0 on failure. 36 | size_t zlib_decode_torture(uint8_t* dst_buffer, size_t dst_size, 37 | uint8_t* src_buffer, size_t src_size, int rfc1950); 38 | 39 | #pragma mark - CHECKSUMS 40 | 41 | // Return Crc32 of DATA[LEN]. Naive implementation. 42 | uint32_t simple_crc32(uint8_t* src_buffer, const size_t src_size); 43 | 44 | // Return Adler32 of DATA[LEN]. Naive implementation. 45 | uint32_t simple_adler32(const unsigned char* src, const size_t src_size); 46 | -------------------------------------------------------------------------------- /zlib/os400/README400: -------------------------------------------------------------------------------- 1 | ZLIB version 1.2.12 for OS/400 installation instructions 2 | 3 | 1) Download and unpack the zlib tarball to some IFS directory. 4 | (i.e.: /path/to/the/zlib/ifs/source/directory) 5 | 6 | If the installed IFS command suppors gzip format, this is straightforward, 7 | else you have to unpack first to some directory on a system supporting it, 8 | then move the whole directory to the IFS via the network (via SMB or FTP). 9 | 10 | 2) Edit the configuration parameters in the compilation script. 11 | 12 | EDTF STMF('/path/to/the/zlib/ifs/source/directory/os400/make.sh') 13 | 14 | Tune the parameters according to your needs if not matching the defaults. 15 | Save the file and exit after edition. 16 | 17 | 3) Enter qshell, then work in the zlib OS/400 specific directory. 18 | 19 | QSH 20 | cd /path/to/the/zlib/ifs/source/directory/os400 21 | 22 | 4) Compile and install 23 | 24 | sh make.sh 25 | 26 | The script will: 27 | - create the libraries, objects and IFS directories for the zlib environment, 28 | - compile all modules, 29 | - create a service program, 30 | - create a static and a dynamic binding directory, 31 | - install header files for C/C++ and for ILE/RPG, both for compilation in 32 | DB2 and IFS environments. 33 | 34 | That's all. 35 | 36 | 37 | Notes: For OS/400 ILE RPG programmers, a /copy member defining the ZLIB 38 | API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC). 39 | In the ILE environment, the same definitions are available from 40 | file zlib.inc located in the same IFS include directory as the 41 | C/C++ header files. 42 | Please read comments in this member for more information. 43 | 44 | Remember that most foreign textual data are ASCII coded: this 45 | implementation does not handle conversion from/to ASCII, so 46 | text data code conversions must be done explicitely. 47 | 48 | Mainly for the reason above, always open zipped files in binary mode. 49 | -------------------------------------------------------------------------------- /zlib/contrib/puff/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O 2 | 3 | puff: puff.o pufftest.o 4 | 5 | puff.o: puff.h 6 | 7 | pufftest.o: puff.h 8 | 9 | test: puff 10 | puff zeros.raw 11 | 12 | puft: puff.c puff.h pufftest.o 13 | cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o 14 | 15 | # puff full coverage test (should say 100%) 16 | cov: puft 17 | @rm -f *.gcov *.gcda 18 | @puft -w zeros.raw 2>&1 | cat > /dev/null 19 | @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 20 | @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 21 | @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254 22 | @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 23 | @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 24 | @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 25 | @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 26 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 27 | @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249 28 | @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 29 | @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null 30 | @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 31 | @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245 32 | @puft -f zeros.raw 2>&1 | cat > /dev/null 33 | @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253 34 | @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252 35 | @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251 36 | @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248 37 | @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250 38 | @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247 39 | @gcov -n puff.c 40 | 41 | clean: 42 | rm -f puff puft *.o *.gc* 43 | -------------------------------------------------------------------------------- /zlib/zlib.map: -------------------------------------------------------------------------------- 1 | ZLIB_1.2.0 { 2 | global: 3 | compressBound; 4 | deflateBound; 5 | inflateBack; 6 | inflateBackEnd; 7 | inflateBackInit_; 8 | inflateCopy; 9 | local: 10 | deflate_copyright; 11 | inflate_copyright; 12 | inflate_fast; 13 | inflate_table; 14 | zcalloc; 15 | zcfree; 16 | z_errmsg; 17 | gz_error; 18 | gz_intmax; 19 | _*; 20 | }; 21 | 22 | ZLIB_1.2.0.2 { 23 | gzclearerr; 24 | gzungetc; 25 | zlibCompileFlags; 26 | } ZLIB_1.2.0; 27 | 28 | ZLIB_1.2.0.8 { 29 | deflatePrime; 30 | } ZLIB_1.2.0.2; 31 | 32 | ZLIB_1.2.2 { 33 | adler32_combine; 34 | crc32_combine; 35 | deflateSetHeader; 36 | inflateGetHeader; 37 | } ZLIB_1.2.0.8; 38 | 39 | ZLIB_1.2.2.3 { 40 | deflateTune; 41 | gzdirect; 42 | } ZLIB_1.2.2; 43 | 44 | ZLIB_1.2.2.4 { 45 | inflatePrime; 46 | } ZLIB_1.2.2.3; 47 | 48 | ZLIB_1.2.3.3 { 49 | adler32_combine64; 50 | crc32_combine64; 51 | gzopen64; 52 | gzseek64; 53 | gztell64; 54 | inflateUndermine; 55 | } ZLIB_1.2.2.4; 56 | 57 | ZLIB_1.2.3.4 { 58 | inflateReset2; 59 | inflateMark; 60 | } ZLIB_1.2.3.3; 61 | 62 | ZLIB_1.2.3.5 { 63 | gzbuffer; 64 | gzoffset; 65 | gzoffset64; 66 | gzclose_r; 67 | gzclose_w; 68 | } ZLIB_1.2.3.4; 69 | 70 | ZLIB_1.2.5.1 { 71 | deflatePending; 72 | } ZLIB_1.2.3.5; 73 | 74 | ZLIB_1.2.5.2 { 75 | deflateResetKeep; 76 | gzgetc_; 77 | inflateResetKeep; 78 | } ZLIB_1.2.5.1; 79 | 80 | ZLIB_1.2.7.1 { 81 | inflateGetDictionary; 82 | gzvprintf; 83 | } ZLIB_1.2.5.2; 84 | 85 | ZLIB_1.2.9 { 86 | inflateCodesUsed; 87 | inflateValidate; 88 | uncompress2; 89 | gzfread; 90 | gzfwrite; 91 | deflateGetDictionary; 92 | adler32_z; 93 | crc32_z; 94 | } ZLIB_1.2.7.1; 95 | 96 | ZLIB_1.2.12 { 97 | crc32_combine_gen; 98 | crc32_combine_gen64; 99 | crc32_combine_op; 100 | } ZLIB_1.2.9; 101 | -------------------------------------------------------------------------------- /zlib/win32/zlib.def: -------------------------------------------------------------------------------- 1 | ; zlib data compression library 2 | EXPORTS 3 | ; basic functions 4 | zlibVersion 5 | deflate 6 | deflateEnd 7 | inflate 8 | inflateEnd 9 | ; advanced functions 10 | deflateSetDictionary 11 | deflateGetDictionary 12 | deflateCopy 13 | deflateReset 14 | deflateParams 15 | deflateTune 16 | deflateBound 17 | deflatePending 18 | deflatePrime 19 | deflateSetHeader 20 | inflateSetDictionary 21 | inflateGetDictionary 22 | inflateSync 23 | inflateCopy 24 | inflateReset 25 | inflateReset2 26 | inflatePrime 27 | inflateMark 28 | inflateGetHeader 29 | inflateBack 30 | inflateBackEnd 31 | zlibCompileFlags 32 | ; utility functions 33 | compress 34 | compress2 35 | compressBound 36 | uncompress 37 | uncompress2 38 | gzopen 39 | gzdopen 40 | gzbuffer 41 | gzsetparams 42 | gzread 43 | gzfread 44 | gzwrite 45 | gzfwrite 46 | gzprintf 47 | gzvprintf 48 | gzputs 49 | gzgets 50 | gzputc 51 | gzgetc 52 | gzungetc 53 | gzflush 54 | gzseek 55 | gzrewind 56 | gztell 57 | gzoffset 58 | gzeof 59 | gzdirect 60 | gzclose 61 | gzclose_r 62 | gzclose_w 63 | gzerror 64 | gzclearerr 65 | ; large file functions 66 | gzopen64 67 | gzseek64 68 | gztell64 69 | gzoffset64 70 | adler32_combine64 71 | crc32_combine64 72 | crc32_combine_gen64 73 | ; checksum functions 74 | adler32 75 | adler32_z 76 | crc32 77 | crc32_z 78 | adler32_combine 79 | crc32_combine 80 | crc32_combine_gen 81 | crc32_combine_op 82 | ; various hacks, don't look :) 83 | deflateInit_ 84 | deflateInit2_ 85 | inflateInit_ 86 | inflateInit2_ 87 | inflateBackInit_ 88 | gzgetc_ 89 | zError 90 | inflateSyncPoint 91 | get_crc_table 92 | inflateUndermine 93 | inflateValidate 94 | inflateCodesUsed 95 | inflateResetKeep 96 | deflateResetKeep 97 | gzopen_w 98 | -------------------------------------------------------------------------------- /zlib/amiga/Makefile.sas: -------------------------------------------------------------------------------- 1 | # SMakefile for zlib 2 | # Modified from the standard UNIX Makefile Copyright Jean-loup Gailly 3 | # Osma Ahvenlampi 4 | # Amiga, SAS/C 6.56 & Smake 5 | 6 | CC=sc 7 | CFLAGS=OPT 8 | #CFLAGS=OPT CPU=68030 9 | #CFLAGS=DEBUG=LINE 10 | LDFLAGS=LIB z.lib 11 | 12 | SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ 13 | NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \ 14 | DEF=POSTINC 15 | 16 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 17 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 18 | 19 | TEST_OBJS = example.o minigzip.o 20 | 21 | all: SCOPTIONS example minigzip 22 | 23 | check: test 24 | test: all 25 | example 26 | echo hello world | minigzip | minigzip -d 27 | 28 | install: z.lib 29 | copy clone zlib.h zconf.h INCLUDE: 30 | copy clone z.lib LIB: 31 | 32 | z.lib: $(OBJS) 33 | oml z.lib r $(OBJS) 34 | 35 | example: example.o z.lib 36 | $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS) 37 | 38 | minigzip: minigzip.o z.lib 39 | $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS) 40 | 41 | mostlyclean: clean 42 | clean: 43 | -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS 44 | 45 | SCOPTIONS: Makefile.sas 46 | copy to $@ insert n+1 empty lines 14 | .\" for manpage-specific macros, see man(7) 15 | .SH NAME 16 | miniunzip - uncompress and examine ZIP archives 17 | .SH SYNOPSIS 18 | .B miniunzip 19 | .RI [ -exvlo ] 20 | zipfile [ files_to_extract ] [-d tempdir] 21 | .SH DESCRIPTION 22 | .B minizip 23 | is a simple tool which allows the extraction of compressed file 24 | archives in the ZIP format used by the MS-DOS utility PKZIP. It was 25 | written as a demonstration of the 26 | .IR zlib (3) 27 | library and therefore lack many of the features of the 28 | .IR unzip (1) 29 | program. 30 | .SH OPTIONS 31 | A number of options are supported. With the exception of 32 | .BI \-d\ tempdir 33 | these must be supplied before any 34 | other arguments and are: 35 | .TP 36 | .BI \-l\ ,\ \-\-v 37 | List the files in the archive without extracting them. 38 | .TP 39 | .B \-o 40 | Overwrite files without prompting for confirmation. 41 | .TP 42 | .B \-x 43 | Extract files (default). 44 | .PP 45 | The 46 | .I zipfile 47 | argument is the name of the archive to process. The next argument can be used 48 | to specify a single file to extract from the archive. 49 | 50 | Lastly, the following option can be specified at the end of the command-line: 51 | .TP 52 | .BI \-d\ tempdir 53 | Extract the archive in the directory 54 | .I tempdir 55 | rather than the current directory. 56 | .SH SEE ALSO 57 | .BR minizip (1), 58 | .BR zlib (3), 59 | .BR unzip (1). 60 | .SH AUTHOR 61 | This program was written by Gilles Vollant. This manual page was 62 | written by Mark Brown . The -d tempdir option 63 | was added by Dirk Eddelbuettel . 64 | -------------------------------------------------------------------------------- /zlib/contrib/infback9/inflate9.h: -------------------------------------------------------------------------------- 1 | /* inflate9.h -- internal inflate state definition 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Possible inflate modes between inflate() calls */ 12 | typedef enum { 13 | TYPE, /* i: waiting for type bits, including last-flag bit */ 14 | STORED, /* i: waiting for stored size (length and complement) */ 15 | TABLE, /* i: waiting for dynamic block table lengths */ 16 | LEN, /* i: waiting for length/lit code */ 17 | DONE, /* finished check, done -- remain here until reset */ 18 | BAD /* got a data error -- remain here until reset */ 19 | } inflate_mode; 20 | 21 | /* 22 | State transitions between above modes - 23 | 24 | (most modes can go to the BAD mode -- not shown for clarity) 25 | 26 | Read deflate blocks: 27 | TYPE -> STORED or TABLE or LEN or DONE 28 | STORED -> TYPE 29 | TABLE -> LENLENS -> CODELENS -> LEN 30 | Read deflate codes: 31 | LEN -> LEN or TYPE 32 | */ 33 | 34 | /* state maintained between inflate() calls. Approximately 7K bytes. */ 35 | struct inflate_state { 36 | /* sliding window */ 37 | unsigned char FAR *window; /* allocated sliding window, if needed */ 38 | /* dynamic table building */ 39 | unsigned ncode; /* number of code length code lengths */ 40 | unsigned nlen; /* number of length code lengths */ 41 | unsigned ndist; /* number of distance code lengths */ 42 | unsigned have; /* number of code lengths in lens[] */ 43 | code FAR *next; /* next available space in codes[] */ 44 | unsigned short lens[320]; /* temporary storage for code lengths */ 45 | unsigned short work[288]; /* work area for code table building */ 46 | code codes[ENOUGH]; /* space for code tables */ 47 | }; 48 | -------------------------------------------------------------------------------- /zlib/examples/README.examples: -------------------------------------------------------------------------------- 1 | This directory contains examples of the use of zlib and other relevant 2 | programs and documentation. 3 | 4 | enough.c 5 | calculation and justification of ENOUGH parameter in inftrees.h 6 | - calculates the maximum table space used in inflate tree 7 | construction over all possible Huffman codes 8 | 9 | fitblk.c 10 | compress just enough input to nearly fill a requested output size 11 | - zlib isn't designed to do this, but fitblk does it anyway 12 | 13 | gun.c 14 | uncompress a gzip file 15 | - illustrates the use of inflateBack() for high speed file-to-file 16 | decompression using call-back functions 17 | - is approximately twice as fast as gzip -d 18 | - also provides Unix uncompress functionality, again twice as fast 19 | 20 | gzappend.c 21 | append to a gzip file 22 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 23 | - illustrates the use of deflatePrime() to start at any bit 24 | 25 | gzjoin.c 26 | join gzip files without recalculating the crc or recompressing 27 | - illustrates the use of the Z_BLOCK flush parameter for inflate() 28 | - illustrates the use of crc32_combine() 29 | 30 | gzlog.c 31 | gzlog.h 32 | efficiently and robustly maintain a message log file in gzip format 33 | - illustrates use of raw deflate, Z_PARTIAL_FLUSH, deflatePrime(), 34 | and deflateSetDictionary() 35 | - illustrates use of a gzip header extra field 36 | 37 | gznorm.c 38 | normalize a gzip file by combining members into a single member 39 | - demonstrates how to concatenate deflate streams using Z_BLOCK 40 | 41 | zlib_how.html 42 | painfully comprehensive description of zpipe.c (see below) 43 | - describes in excruciating detail the use of deflate() and inflate() 44 | 45 | zpipe.c 46 | reads and writes zlib streams from stdin to stdout 47 | - illustrates the proper use of deflate() and inflate() 48 | - deeply commented in zlib_how.html (see above) 49 | 50 | zran.c 51 | zran.h 52 | index a zlib or gzip stream and randomly access it 53 | - illustrates the use of Z_BLOCK, inflatePrime(), and 54 | inflateSetDictionary() to provide random access 55 | -------------------------------------------------------------------------------- /zlib/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /zlib/amiga/Makefile.pup: -------------------------------------------------------------------------------- 1 | # Amiga powerUP (TM) Makefile 2 | # makefile for libpng and SAS C V6.58/7.00 PPC compiler 3 | # Copyright (C) 1998 by Andreas R. Kleinert 4 | 5 | LIBNAME = libzip.a 6 | 7 | CC = scppc 8 | CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \ 9 | OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER 10 | AR = ppc-amigaos-ar cr 11 | RANLIB = ppc-amigaos-ranlib 12 | LD = ppc-amigaos-ld -r 13 | LDFLAGS = -o 14 | LDLIBS = LIB:scppc.a LIB:end.o 15 | RM = delete quiet 16 | 17 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 18 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 19 | 20 | TEST_OBJS = example.o minigzip.o 21 | 22 | all: example minigzip 23 | 24 | check: test 25 | test: all 26 | example 27 | echo hello world | minigzip | minigzip -d 28 | 29 | $(LIBNAME): $(OBJS) 30 | $(AR) $@ $(OBJS) 31 | -$(RANLIB) $@ 32 | 33 | example: example.o $(LIBNAME) 34 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 35 | 36 | minigzip: minigzip.o $(LIBNAME) 37 | $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) 38 | 39 | mostlyclean: clean 40 | clean: 41 | $(RM) *.o example minigzip $(LIBNAME) foo.gz 42 | 43 | zip: 44 | zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \ 45 | descrip.mms *.[ch] 46 | 47 | tgz: 48 | cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \ 49 | zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch] 50 | 51 | # DO NOT DELETE THIS LINE -- make depend depends on it. 52 | 53 | adler32.o: zlib.h zconf.h 54 | compress.o: zlib.h zconf.h 55 | crc32.o: crc32.h zlib.h zconf.h 56 | deflate.o: deflate.h zutil.h zlib.h zconf.h 57 | example.o: zlib.h zconf.h 58 | gzclose.o: zlib.h zconf.h gzguts.h 59 | gzlib.o: zlib.h zconf.h gzguts.h 60 | gzread.o: zlib.h zconf.h gzguts.h 61 | gzwrite.o: zlib.h zconf.h gzguts.h 62 | inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 63 | inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 64 | infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 65 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h 66 | minigzip.o: zlib.h zconf.h 67 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 68 | uncompr.o: zlib.h zconf.h 69 | zutil.o: zutil.h zlib.h zconf.h 70 | -------------------------------------------------------------------------------- /zlib/examples/zran.h: -------------------------------------------------------------------------------- 1 | /* zran.h -- example of zlib/gzip stream indexing and random access 2 | * Copyright (C) 2005, 2012, 2018 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | * Version 1.2 14 Oct 2018 Mark Adler */ 5 | 6 | #include 7 | #include "zlib.h" 8 | 9 | /* Access point list. */ 10 | struct deflate_index { 11 | int have; /* number of list entries */ 12 | int gzip; /* 1 if the index is of a gzip file, 0 if it is of a 13 | zlib stream */ 14 | off_t length; /* total length of uncompressed data */ 15 | void *list; /* allocated list of entries */ 16 | }; 17 | 18 | /* Make one entire pass through a zlib or gzip compressed stream and build an 19 | index, with access points about every span bytes of uncompressed output. 20 | gzip files with multiple members are indexed in their entirety. span should 21 | be chosen to balance the speed of random access against the memory 22 | requirements of the list, about 32K bytes per access point. The return value 23 | is the number of access points on success (>= 1), Z_MEM_ERROR for out of 24 | memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a file 25 | read error. On success, *built points to the resulting index. */ 26 | int deflate_index_build(FILE *in, off_t span, struct deflate_index **built); 27 | 28 | /* Deallocate an index built by deflate_index_build() */ 29 | void deflate_index_free(struct deflate_index *index); 30 | 31 | /* Use the index to read len bytes from offset into buf. Return bytes read or 32 | negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past 33 | the end of the uncompressed data, then deflate_index_extract() will return a 34 | value less than len, indicating how much was actually read into buf. This 35 | function should not return a data error unless the file was modified since 36 | the index was generated, since deflate_index_build() validated all of the 37 | input. deflate_index_extract() will return Z_ERRNO if there is an error on 38 | reading or seeking the input file. */ 39 | int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, 40 | unsigned char *buf, int len); 41 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c1f6a2e3-5da5-4955-8653-310d3efe05a9} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {c2aaffdc-2c95-4d6f-8466-4bec5890af2c} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {c274fe07-05f2-461c-964b-f6341e4e7eb5} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | -------------------------------------------------------------------------------- /zlib/contrib/ada/readme.txt: -------------------------------------------------------------------------------- 1 | ZLib for Ada thick binding (ZLib.Ada) 2 | Release 1.3 3 | 4 | ZLib.Ada is a thick binding interface to the popular ZLib data 5 | compression library, available at http://www.gzip.org/zlib/. 6 | It provides Ada-style access to the ZLib C library. 7 | 8 | 9 | Here are the main changes since ZLib.Ada 1.2: 10 | 11 | - Attension: ZLib.Read generic routine have a initialization requirement 12 | for Read_Last parameter now. It is a bit incompartible with previous version, 13 | but extends functionality, we could use new parameters Allow_Read_Some and 14 | Flush now. 15 | 16 | - Added Is_Open routines to ZLib and ZLib.Streams packages. 17 | 18 | - Add pragma Assert to check Stream_Element is 8 bit. 19 | 20 | - Fix extraction to buffer with exact known decompressed size. Error reported by 21 | Steve Sangwine. 22 | 23 | - Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits 24 | computers. Patch provided by Pascal Obry. 25 | 26 | - Add Status_Error exception definition. 27 | 28 | - Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit. 29 | 30 | 31 | How to build ZLib.Ada under GNAT 32 | 33 | You should have the ZLib library already build on your computer, before 34 | building ZLib.Ada. Make the directory of ZLib.Ada sources current and 35 | issue the command: 36 | 37 | gnatmake test -largs -L -lz 38 | 39 | Or use the GNAT project file build for GNAT 3.15 or later: 40 | 41 | gnatmake -Pzlib.gpr -L 42 | 43 | 44 | How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 45 | 46 | 1. Make a project with all *.ads and *.adb files from the distribution. 47 | 2. Build the libz.a library from the ZLib C sources. 48 | 3. Rename libz.a to z.lib. 49 | 4. Add the library z.lib to the project. 50 | 5. Add the libc.lib library from the ObjectAda distribution to the project. 51 | 6. Build the executable using test.adb as a main procedure. 52 | 53 | 54 | How to use ZLib.Ada 55 | 56 | The source files test.adb and read.adb are small demo programs that show 57 | the main functionality of ZLib.Ada. 58 | 59 | The routines from the package specifications are commented. 60 | 61 | 62 | Homepage: http://zlib-ada.sourceforge.net/ 63 | Author: Dmitriy Anisimkov 64 | 65 | Contributors: Pascal Obry , Steve Sangwine 66 | -------------------------------------------------------------------------------- /zlib/contrib/README.contrib: -------------------------------------------------------------------------------- 1 | All files under this contrib directory are UNSUPPORTED. There were 2 | provided by users of zlib and were not tested by the authors of zlib. 3 | Use at your own risk. Please contact the authors of the contributions 4 | for help about these, not the zlib authors. Thanks. 5 | 6 | 7 | ada/ by Dmitriy Anisimkov 8 | Support for Ada 9 | See http://zlib-ada.sourceforge.net/ 10 | 11 | blast/ by Mark Adler 12 | Decompressor for output of PKWare Data Compression Library (DCL) 13 | 14 | delphi/ by Cosmin Truta 15 | Support for Delphi and C++ Builder 16 | 17 | dotzlib/ by Henrik Ravn 18 | Support for Microsoft .Net and Visual C++ .Net 19 | 20 | gcc_gvmat64/by Gilles Vollant 21 | GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64 22 | assembler to replace longest_match() and inflate_fast() 23 | 24 | infback9/ by Mark Adler 25 | Unsupported diffs to infback to decode the deflate64 format 26 | 27 | iostream/ by Kevin Ruland 28 | A C++ I/O streams interface to the zlib gz* functions 29 | 30 | iostream2/ by Tyge Løvset 31 | Another C++ I/O streams interface 32 | 33 | iostream3/ by Ludwig Schwardt 34 | and Kevin Ruland 35 | Yet another C++ I/O streams interface 36 | 37 | minizip/ by Gilles Vollant 38 | Mini zip and unzip based on zlib 39 | Includes Zip64 support by Mathias Svensson 40 | See http://www.winimage.com/zLibDll/minizip.html 41 | 42 | pascal/ by Bob Dellaca et al. 43 | Support for Pascal 44 | 45 | puff/ by Mark Adler 46 | Small, low memory usage inflate. Also serves to provide an 47 | unambiguous description of the deflate format. 48 | 49 | testzlib/ by Gilles Vollant 50 | Example of the use of zlib 51 | 52 | untgz/ by Pedro A. Aranda Gutierrez 53 | A very simple tar.gz file extractor using zlib 54 | 55 | vstudio/ by Gilles Vollant 56 | Building a minizip-enhanced zlib with Microsoft Visual Studio 57 | Includes vc11 from kreuzerkrieg and vc12 from davispuh 58 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a .Net wrapper class library for the ZLib1.dll 2 | 3 | The wrapper includes support for inflating/deflating memory buffers, 4 | .Net streaming wrappers for the gz streams part of zlib, and wrappers 5 | for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. 6 | 7 | Directory structure: 8 | -------------------- 9 | 10 | LICENSE_1_0.txt - License file. 11 | readme.txt - This file. 12 | DotZLib.chm - Class library documentation 13 | DotZLib.build - NAnt build file 14 | DotZLib.sln - Microsoft Visual Studio 2003 solution file 15 | 16 | DotZLib\*.cs - Source files for the class library 17 | 18 | Unit tests: 19 | ----------- 20 | The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher. 21 | To include unit tests in the build, define nunit before building. 22 | 23 | 24 | Build instructions: 25 | ------------------- 26 | 27 | 1. Using Visual Studio.Net 2003: 28 | Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) 29 | will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on 30 | you are building the release or debug version of the library. Check 31 | DotZLib/UnitTests.cs for instructions on how to include unit tests in the 32 | build. 33 | 34 | 2. Using NAnt: 35 | Open a command prompt with access to the build environment and run nant 36 | in the same directory as the DotZLib.build file. 37 | You can define 2 properties on the nant command-line to control the build: 38 | debug={true|false} to toggle between release/debug builds (default=true). 39 | nunit={true|false} to include or esclude unit tests (default=true). 40 | Also the target clean will remove binaries. 41 | Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release 42 | or ./DotZLib/bin/debug, depending on whether you are building the release 43 | or debug version of the library. 44 | 45 | Examples: 46 | nant -D:debug=false -D:nunit=false 47 | will build a release mode version of the library without unit tests. 48 | nant 49 | will build a debug version of the library with unit tests 50 | nant clean 51 | will remove all previously built files. 52 | 53 | 54 | --------------------------------- 55 | Copyright (c) Henrik Ravn 2004 56 | 57 | Use, modification and distribution are subject to the Boost Software License, Version 1.0. 58 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 59 | -------------------------------------------------------------------------------- /AddOn/zopt_defs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Dirty way to disable optimizations 4 | //#undef VEC_OPTIMIZE 5 | //#undef INFFAST_OPT 6 | 7 | #pragma mark - CRC32 and ADLER32 8 | 9 | #ifdef VEC_OPTIMIZE 10 | 11 | extern uLong adler32_vec(unsigned int adler, unsigned int sum2, const Bytef* buf, int len); 12 | extern uint32_t crc32_little_aligned_vector(uint32_t crc, const unsigned char *buf, uint32_t len); 13 | 14 | #endif 15 | 16 | #pragma mark - INFFAST 17 | 18 | #ifdef INFFAST_OPT 19 | 20 | typedef __attribute__((__ext_vector_type__(16))) uint8_t vector_uchar16; 21 | typedef __attribute__((__ext_vector_type__(16),__aligned__(1))) uint8_t packed_uchar16; 22 | typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) unsigned short packed_ushort8; 23 | typedef __attribute__((__aligned__(1))) uint64_t packed_uint64_t; 24 | typedef __attribute__((__aligned__(1))) uint32_t packed_uint32_t; 25 | typedef __attribute__((__aligned__(1))) uint16_t packed_uint16_t; 26 | 27 | // Build Huffman tables. Return 0 on success, 1 on error. 28 | int inffast_tables(z_streamp strm); 29 | 30 | #define ASMINF // Disable inffast 31 | #undef INFLATE_MIN_INPUT 32 | #define INFLATE_MIN_INPUT ((15+15+(15+5)+(15+13)+64+64)/8) // Be safe, use generous upper bound 33 | #undef INFLATE_MIN_OUTPUT 34 | #define INFLATE_MIN_OUTPUT (2+258+63) // 2 literals, match + excess 35 | 36 | /* 37 | zlib defaults to 9 lenbits and 6 distbits. Thus, zlib reserves ENOUGH (=1444) 38 | codes in its state. We try to use larger Huffman lookup tables. Usually, 39 | 1444 codes are enough for 10 lenbits and 7 distbits. If tree construction 40 | fails, we fallback to the default values. 41 | */ 42 | #define INFLATE_LEN_BITS_OPT 10 // See ENOUGH*, max 1334 entries needed 43 | #define INFLATE_DIST_BITS_OPT 7 // See ENOUGH*, max 400 entries needed 44 | 45 | /* 46 | INFFAST_OPT decodes the next Huffman symbol while processing the current one. 47 | To step over the current symbol, we need to consume the extra bits of a 48 | length/distance symbol in one step. Therefore, we modify the Huffman codes. 49 | We need to transform the codes back for the classic "wrapper" code to work. 50 | */ 51 | #define INFLATE_ADD_EXTRA_BITS(here) \ 52 | { \ 53 | const int8_t mask = -((here.op >> 4) & 1) & 15; \ 54 | here.bits += here.op & mask; /* add extra bits */ \ 55 | } 56 | #define INFLATE_SUB_EXTRA_BITS(here) \ 57 | { \ 58 | const int8_t mask = -((here.op >> 4) & 1) & 15; \ 59 | here.bits -= here.op & mask; /* sub extra bits */ \ 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | // 9 | [assembly: AssemblyTitle("DotZLib")] 10 | [assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("Henrik Ravn")] 13 | [assembly: AssemblyProduct("")] 14 | [assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Revision and Build Numbers 27 | // by using the '*' as shown below: 28 | 29 | [assembly: AssemblyVersion("1.0.*")] 30 | 31 | // 32 | // In order to sign your assembly you must specify a key to use. Refer to the 33 | // Microsoft .NET Framework documentation for more information on assembly signing. 34 | // 35 | // Use the attributes below to control which key is used for signing. 36 | // 37 | // Notes: 38 | // (*) If no key is specified, the assembly is not signed. 39 | // (*) KeyName refers to a key that has been installed in the Crypto Service 40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains 41 | // a key. 42 | // (*) If the KeyFile and the KeyName values are both specified, the 43 | // following processing occurs: 44 | // (1) If the KeyName can be found in the CSP, that key is used. 45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key 46 | // in the KeyFile is installed into the CSP and used. 47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. 48 | // When specifying the KeyFile, the location of the KeyFile should be 49 | // relative to the project output directory which is 50 | // %Project Directory%\obj\. For example, if your KeyFile is 51 | // located in the project directory, you would specify the AssemblyKeyFile 52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] 53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework 54 | // documentation for more information on this. 55 | // 56 | [assembly: AssemblyDelaySign(false)] 57 | [assembly: AssemblyKeyFile("")] 58 | [assembly: AssemblyKeyName("")] 59 | -------------------------------------------------------------------------------- /zlib/contrib/delphi/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Overview 3 | ======== 4 | 5 | This directory contains an update to the ZLib interface unit, 6 | distributed by Borland as a Delphi supplemental component. 7 | 8 | The original ZLib unit is Copyright (c) 1997,99 Borland Corp., 9 | and is based on zlib version 1.0.4. There are a series of bugs 10 | and security problems associated with that old zlib version, and 11 | we recommend the users to update their ZLib unit. 12 | 13 | 14 | Summary of modifications 15 | ======================== 16 | 17 | - Improved makefile, adapted to zlib version 1.2.1. 18 | 19 | - Some field types from TZStreamRec are changed from Integer to 20 | Longint, for consistency with the zlib.h header, and for 64-bit 21 | readiness. 22 | 23 | - The zlib_version constant is updated. 24 | 25 | - The new Z_RLE strategy has its corresponding symbolic constant. 26 | 27 | - The allocation and deallocation functions and function types 28 | (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, 29 | and _malloc and _free are added as C RTL stubs. As a result, 30 | the original C sources of zlib can be compiled out of the box, 31 | and linked to the ZLib unit. 32 | 33 | 34 | Suggestions for improvements 35 | ============================ 36 | 37 | Currently, the ZLib unit provides only a limited wrapper around 38 | the zlib library, and much of the original zlib functionality is 39 | missing. Handling compressed file formats like ZIP/GZIP or PNG 40 | cannot be implemented without having this functionality. 41 | Applications that handle these formats are either using their own, 42 | duplicated code, or not using the ZLib unit at all. 43 | 44 | Here are a few suggestions: 45 | 46 | - Checksum class wrappers around adler32() and crc32(), similar 47 | to the Java classes that implement the java.util.zip.Checksum 48 | interface. 49 | 50 | - The ability to read and write raw deflate streams, without the 51 | zlib stream header and trailer. Raw deflate streams are used 52 | in the ZIP file format. 53 | 54 | - The ability to read and write gzip streams, used in the GZIP 55 | file format, and normally produced by the gzip program. 56 | 57 | - The ability to select a different compression strategy, useful 58 | to PNG and MNG image compression, and to multimedia compression 59 | in general. Besides the compression level 60 | 61 | TCompressionLevel = (clNone, clFastest, clDefault, clMax); 62 | 63 | which, in fact, could have used the 'z' prefix and avoided 64 | TColor-like symbols 65 | 66 | TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); 67 | 68 | there could be a compression strategy 69 | 70 | TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); 71 | 72 | - ZIP and GZIP stream handling via TStreams. 73 | 74 | 75 | -- 76 | Cosmin Truta 77 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | Source Files 14 | 15 | 16 | Source Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | -------------------------------------------------------------------------------- /zlib/contrib/delphi/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /zlib/contrib/pascal/zlibd32.mak: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # For use with Delphi and C++ Builder under Win32 3 | # Updated for zlib 1.2.x by Cosmin Truta 4 | 5 | # ------------ Borland C++ ------------ 6 | 7 | # This project uses the Delphi (fastcall/register) calling convention: 8 | LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl 9 | 10 | CC = bcc32 11 | LD = bcc32 12 | AR = tlib 13 | # do not use "-pr" in CFLAGS 14 | CFLAGS = -a -d -k- -O2 $(LOC) 15 | LDFLAGS = 16 | 17 | 18 | # variables 19 | ZLIB_LIB = zlib.lib 20 | 21 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 22 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 23 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 24 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 25 | 26 | 27 | # targets 28 | all: $(ZLIB_LIB) example.exe minigzip.exe 29 | 30 | .c.obj: 31 | $(CC) -c $(CFLAGS) $*.c 32 | 33 | adler32.obj: adler32.c zlib.h zconf.h 34 | 35 | compress.obj: compress.c zlib.h zconf.h 36 | 37 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 38 | 39 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 40 | 41 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 42 | 43 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 44 | 45 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 46 | 47 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 48 | 49 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 50 | inffast.h inffixed.h 51 | 52 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 53 | inffast.h 54 | 55 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 56 | inffast.h inffixed.h 57 | 58 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 59 | 60 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 61 | 62 | uncompr.obj: uncompr.c zlib.h zconf.h 63 | 64 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 65 | 66 | example.obj: test/example.c zlib.h zconf.h 67 | 68 | minigzip.obj: test/minigzip.c zlib.h zconf.h 69 | 70 | 71 | # For the sake of the old Borland make, 72 | # the command line is cut to fit in the MS-DOS 128 byte limit: 73 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 74 | -del $(ZLIB_LIB) 75 | $(AR) $(ZLIB_LIB) $(OBJP1) 76 | $(AR) $(ZLIB_LIB) $(OBJP2) 77 | 78 | 79 | # testing 80 | test: example.exe minigzip.exe 81 | example 82 | echo hello world | minigzip | minigzip -d 83 | 84 | example.exe: example.obj $(ZLIB_LIB) 85 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 86 | 87 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 88 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 89 | 90 | 91 | # cleanup 92 | clean: 93 | -del *.obj 94 | -del *.exe 95 | -del *.lib 96 | -del *.tds 97 | -del zlib.bak 98 | -del foo.gz 99 | 100 | -------------------------------------------------------------------------------- /zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | const uInt max = (uInt)-1; 32 | uLong left; 33 | 34 | left = *destLen; 35 | *destLen = 0; 36 | 37 | stream.zalloc = (alloc_func)0; 38 | stream.zfree = (free_func)0; 39 | stream.opaque = (voidpf)0; 40 | 41 | err = deflateInit(&stream, level); 42 | if (err != Z_OK) return err; 43 | 44 | stream.next_out = dest; 45 | stream.avail_out = 0; 46 | stream.next_in = (z_const Bytef *)source; 47 | stream.avail_in = 0; 48 | 49 | do { 50 | if (stream.avail_out == 0) { 51 | stream.avail_out = left > (uLong)max ? max : (uInt)left; 52 | left -= stream.avail_out; 53 | } 54 | if (stream.avail_in == 0) { 55 | stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; 56 | sourceLen -= stream.avail_in; 57 | } 58 | err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); 59 | } while (err == Z_OK); 60 | 61 | *destLen = stream.total_out; 62 | deflateEnd(&stream); 63 | return err == Z_STREAM_END ? Z_OK : err; 64 | } 65 | 66 | /* =========================================================================== 67 | */ 68 | int ZEXPORT compress (dest, destLen, source, sourceLen) 69 | Bytef *dest; 70 | uLongf *destLen; 71 | const Bytef *source; 72 | uLong sourceLen; 73 | { 74 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 75 | } 76 | 77 | /* =========================================================================== 78 | If the default memLevel or windowBits for deflateInit() is changed, then 79 | this function needs to be updated. 80 | */ 81 | uLong ZEXPORT compressBound (sourceLen) 82 | uLong sourceLen; 83 | { 84 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 85 | (sourceLen >> 25) + 13; 86 | } 87 | -------------------------------------------------------------------------------- /zlib/win32/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ for Win32 3 | # 4 | # Usage: 5 | # make -f win32/Makefile.bor 6 | 7 | # ------------ Borland C++ ------------ 8 | 9 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 10 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or 11 | # added to the declaration of LOC here: 12 | LOC = $(LOCAL_ZLIB) 13 | 14 | CC = bcc32 15 | AS = bcc32 16 | LD = bcc32 17 | AR = tlib 18 | CFLAGS = -a -d -k- -O2 $(LOC) 19 | ASFLAGS = $(LOC) 20 | LDFLAGS = $(LOC) 21 | 22 | 23 | # variables 24 | ZLIB_LIB = zlib.lib 25 | 26 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 27 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 28 | #OBJA = 29 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 30 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 31 | #OBJPA= 32 | 33 | 34 | # targets 35 | all: $(ZLIB_LIB) example.exe minigzip.exe 36 | 37 | .c.obj: 38 | $(CC) -c $(CFLAGS) $< 39 | 40 | .asm.obj: 41 | $(AS) -c $(ASFLAGS) $< 42 | 43 | adler32.obj: adler32.c zlib.h zconf.h 44 | 45 | compress.obj: compress.c zlib.h zconf.h 46 | 47 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 48 | 49 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 50 | 51 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 52 | 53 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 54 | 55 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 56 | 57 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 58 | 59 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 60 | inffast.h inffixed.h 61 | 62 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 63 | inffast.h 64 | 65 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 66 | inffast.h inffixed.h 67 | 68 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 69 | 70 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 71 | 72 | uncompr.obj: uncompr.c zlib.h zconf.h 73 | 74 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 75 | 76 | example.obj: test/example.c zlib.h zconf.h 77 | 78 | minigzip.obj: test/minigzip.c zlib.h zconf.h 79 | 80 | 81 | # For the sake of the old Borland make, 82 | # the command line is cut to fit in the MS-DOS 128 byte limit: 83 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) 84 | -del $(ZLIB_LIB) 85 | $(AR) $(ZLIB_LIB) $(OBJP1) 86 | $(AR) $(ZLIB_LIB) $(OBJP2) 87 | $(AR) $(ZLIB_LIB) $(OBJPA) 88 | 89 | 90 | # testing 91 | test: example.exe minigzip.exe 92 | example 93 | echo hello world | minigzip | minigzip -d 94 | 95 | example.exe: example.obj $(ZLIB_LIB) 96 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 97 | 98 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 99 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 100 | 101 | 102 | # cleanup 103 | clean: 104 | -del $(ZLIB_LIB) 105 | -del *.obj 106 | -del *.exe 107 | -del *.tds 108 | -del zlib.bak 109 | -del foo.gz 110 | -------------------------------------------------------------------------------- /zlib/contrib/infback9/inftree9.h: -------------------------------------------------------------------------------- 1 | /* inftree9.h -- header to use inftree9.c 2 | * Copyright (C) 1995-2008 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 100eeeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1446, which is the sum of 852 for literal/length codes and 594 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 32 6 15" for distance codes returns 594. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in infback9.c. If the root table size is changed, 47 | then these maximum sizes would be need to be recalculated and updated. */ 48 | #define ENOUGH_LENS 852 49 | #define ENOUGH_DISTS 594 50 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 51 | 52 | /* Type of code to build for inflate_table9() */ 53 | typedef enum { 54 | CODES, 55 | LENS, 56 | DISTS 57 | } codetype; 58 | 59 | extern int inflate_table9 OF((codetype type, unsigned short FAR *lens, 60 | unsigned codes, code FAR * FAR *table, 61 | unsigned FAR *bits, unsigned short FAR *work)); 62 | -------------------------------------------------------------------------------- /zlib/contrib/iostream/zfstream.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef zfstream_h 3 | #define zfstream_h 4 | 5 | #include 6 | #include "zlib.h" 7 | 8 | class gzfilebuf : public streambuf { 9 | 10 | public: 11 | 12 | gzfilebuf( ); 13 | virtual ~gzfilebuf(); 14 | 15 | gzfilebuf *open( const char *name, int io_mode ); 16 | gzfilebuf *attach( int file_descriptor, int io_mode ); 17 | gzfilebuf *close(); 18 | 19 | int setcompressionlevel( int comp_level ); 20 | int setcompressionstrategy( int comp_strategy ); 21 | 22 | inline int is_open() const { return (file !=NULL); } 23 | 24 | virtual streampos seekoff( streamoff, ios::seek_dir, int ); 25 | 26 | virtual int sync(); 27 | 28 | protected: 29 | 30 | virtual int underflow(); 31 | virtual int overflow( int = EOF ); 32 | 33 | private: 34 | 35 | gzFile file; 36 | short mode; 37 | short own_file_descriptor; 38 | 39 | int flushbuf(); 40 | int fillbuf(); 41 | 42 | }; 43 | 44 | class gzfilestream_common : virtual public ios { 45 | 46 | friend class gzifstream; 47 | friend class gzofstream; 48 | friend gzofstream &setcompressionlevel( gzofstream &, int ); 49 | friend gzofstream &setcompressionstrategy( gzofstream &, int ); 50 | 51 | public: 52 | virtual ~gzfilestream_common(); 53 | 54 | void attach( int fd, int io_mode ); 55 | void open( const char *name, int io_mode ); 56 | void close(); 57 | 58 | protected: 59 | gzfilestream_common(); 60 | 61 | private: 62 | gzfilebuf *rdbuf(); 63 | 64 | gzfilebuf buffer; 65 | 66 | }; 67 | 68 | class gzifstream : public gzfilestream_common, public istream { 69 | 70 | public: 71 | 72 | gzifstream(); 73 | gzifstream( const char *name, int io_mode = ios::in ); 74 | gzifstream( int fd, int io_mode = ios::in ); 75 | 76 | virtual ~gzifstream(); 77 | 78 | }; 79 | 80 | class gzofstream : public gzfilestream_common, public ostream { 81 | 82 | public: 83 | 84 | gzofstream(); 85 | gzofstream( const char *name, int io_mode = ios::out ); 86 | gzofstream( int fd, int io_mode = ios::out ); 87 | 88 | virtual ~gzofstream(); 89 | 90 | }; 91 | 92 | template class gzomanip { 93 | friend gzofstream &operator<<(gzofstream &, const gzomanip &); 94 | public: 95 | gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { } 96 | private: 97 | gzofstream &(*func)(gzofstream &, T); 98 | T val; 99 | }; 100 | 101 | template gzofstream &operator<<(gzofstream &s, const gzomanip &m) 102 | { 103 | return (*m.func)(s, m.val); 104 | } 105 | 106 | inline gzofstream &setcompressionlevel( gzofstream &s, int l ) 107 | { 108 | (s.rdbuf())->setcompressionlevel(l); 109 | return s; 110 | } 111 | 112 | inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) 113 | { 114 | (s.rdbuf())->setcompressionstrategy(l); 115 | return s; 116 | } 117 | 118 | inline gzomanip setcompressionlevel(int l) 119 | { 120 | return gzomanip(&setcompressionlevel,l); 121 | } 122 | 123 | inline gzomanip setcompressionstrategy(int l) 124 | { 125 | return gzomanip(&setcompressionstrategy,l); 126 | } 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /zlib/msdos/Makefile.dj2: -------------------------------------------------------------------------------- 1 | # Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. 2 | # Copyright (C) 1995-1998 Jean-loup Gailly. 3 | # For conditions of distribution and use, see copyright notice in zlib.h 4 | 5 | # To compile, or to compile and test, type: 6 | # 7 | # make -fmakefile.dj2; make test -fmakefile.dj2 8 | # 9 | # To install libz.a, zconf.h and zlib.h in the djgpp directories, type: 10 | # 11 | # make install -fmakefile.dj2 12 | # 13 | # after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as 14 | # in the sample below if the pattern of the DJGPP distribution is to 15 | # be followed. Remember that, while 'es around <=> are ignored in 16 | # makefiles, they are *not* in batch files or in djgpp.env. 17 | # - - - - - 18 | # [make] 19 | # INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include 20 | # LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib 21 | # BUTT=-m486 22 | # - - - - - 23 | # Alternately, these variables may be defined below, overriding the values 24 | # in djgpp.env, as 25 | # INCLUDE_PATH=c:\usr\include 26 | # LIBRARY_PATH=c:\usr\lib 27 | 28 | CC=gcc 29 | 30 | #CFLAGS=-MMD -O 31 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 32 | #CFLAGS=-MMD -g -DZLIB_DEBUG 33 | CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 34 | -Wstrict-prototypes -Wmissing-prototypes 35 | 36 | # If cp.exe is available, replace "copy /Y" with "cp -fp" . 37 | CP=copy /Y 38 | # If gnu install.exe is available, replace $(CP) with ginstall. 39 | INSTALL=$(CP) 40 | # The default value of RM is "rm -f." If "rm.exe" is found, comment out: 41 | RM=del 42 | LDLIBS=-L. -lz 43 | LD=$(CC) -s -o 44 | LDSHARED=$(CC) 45 | 46 | INCL=zlib.h zconf.h 47 | LIBS=libz.a 48 | 49 | AR=ar rcs 50 | 51 | prefix=/usr/local 52 | exec_prefix = $(prefix) 53 | 54 | OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ 55 | uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 56 | 57 | OBJA = 58 | # to use the asm code: make OBJA=match.o 59 | 60 | TEST_OBJS = example.o minigzip.o 61 | 62 | all: example.exe minigzip.exe 63 | 64 | check: test 65 | test: all 66 | ./example 67 | echo hello world | .\minigzip | .\minigzip -d 68 | 69 | %.o : %.c 70 | $(CC) $(CFLAGS) -c $< -o $@ 71 | 72 | libz.a: $(OBJS) $(OBJA) 73 | $(AR) $@ $(OBJS) $(OBJA) 74 | 75 | %.exe : %.o $(LIBS) 76 | $(LD) $@ $< $(LDLIBS) 77 | 78 | # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 79 | 80 | .PHONY : uninstall clean 81 | 82 | install: $(INCL) $(LIBS) 83 | -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) 84 | -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) 85 | $(INSTALL) zlib.h $(INCLUDE_PATH) 86 | $(INSTALL) zconf.h $(INCLUDE_PATH) 87 | $(INSTALL) libz.a $(LIBRARY_PATH) 88 | 89 | uninstall: 90 | $(RM) $(INCLUDE_PATH)\zlib.h 91 | $(RM) $(INCLUDE_PATH)\zconf.h 92 | $(RM) $(LIBRARY_PATH)\libz.a 93 | 94 | clean: 95 | $(RM) *.d 96 | $(RM) *.o 97 | $(RM) *.exe 98 | $(RM) libz.a 99 | $(RM) foo.gz 100 | 101 | DEPS := $(wildcard *.d) 102 | ifneq ($(DEPS),) 103 | include $(DEPS) 104 | endif 105 | -------------------------------------------------------------------------------- /zlib/msdos/Makefile.tc: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Turbo C 2.01, Turbo C++ 1.01 3 | # Last updated: 15-Mar-2003 4 | 5 | # To use, do "make -fmakefile.tc" 6 | # To compile in small model, set below: MODEL=s 7 | 8 | # WARNING: the small model is supported but only for small values of 9 | # MAX_WBITS and MAX_MEM_LEVEL. For example: 10 | # -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 11 | # If you wish to reduce the memory requirements (default 256K for big 12 | # objects plus a few K), you can add to CFLAGS below: 13 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14 | # See zconf.h for details about the memory requirements. 15 | 16 | # ------------ Turbo C 2.01, Turbo C++ 1.01 ------------ 17 | MODEL=l 18 | CC=tcc 19 | LD=tcc 20 | AR=tlib 21 | # CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 22 | CFLAGS=-O2 -G -Z -m$(MODEL) 23 | LDFLAGS=-m$(MODEL) -f- 24 | 25 | 26 | # variables 27 | ZLIB_LIB = zlib_$(MODEL).lib 28 | 29 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 30 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 31 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 32 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $*.c 40 | 41 | adler32.obj: adler32.c zlib.h zconf.h 42 | 43 | compress.obj: compress.c zlib.h zconf.h 44 | 45 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 46 | 47 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 48 | 49 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 50 | 51 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 52 | 53 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 54 | 55 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 56 | 57 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 58 | inffast.h inffixed.h 59 | 60 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h 62 | 63 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h inffixed.h 65 | 66 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 67 | 68 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 69 | 70 | uncompr.obj: uncompr.c zlib.h zconf.h 71 | 72 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 73 | 74 | example.obj: test/example.c zlib.h zconf.h 75 | 76 | minigzip.obj: test/minigzip.c zlib.h zconf.h 77 | 78 | 79 | # the command line is cut to fit in the MS-DOS 128 byte limit: 80 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 81 | -del $(ZLIB_LIB) 82 | $(AR) $(ZLIB_LIB) $(OBJP1) 83 | $(AR) $(ZLIB_LIB) $(OBJP2) 84 | 85 | example.exe: example.obj $(ZLIB_LIB) 86 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 87 | 88 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 89 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 90 | 91 | test: example.exe minigzip.exe 92 | example 93 | echo hello world | minigzip | minigzip -d 94 | 95 | clean: 96 | -del *.obj 97 | -del *.lib 98 | -del *.exe 99 | -del zlib_*.bak 100 | -del foo.gz 101 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Common options 2 | CONFIG ?= Release 3 | RELEASE ?= Sunburst 4 | SANITIZE ?= 0 5 | 6 | # OSX build options 7 | OSX_SDK ?= macosx.internal 8 | OSX_ARCHS ?= x86_64 arm64e 9 | OSX_DSTROOT := /tmp/zlib-osx.dst 10 | OSX_LOG := /tmp/compression-osx.log 11 | 12 | # IOS build options 13 | IOS_SDK ?= iphoneos.internal 14 | IOS_ARCHS ?= arm64 arm64e 15 | 16 | # WatchOS build options 17 | WOS_SDK ?= watchos.internal 18 | WOS_ARCHS ?= armv7k arm64_32 19 | 20 | # Buildit record name 21 | BUILDIT_RECORD_NAME ?= zlib 22 | 23 | ifeq ($(SANITIZE),0) 24 | SANITIZER_OPT := 25 | else 26 | SANITIZER_OPT := -enableAddressSanitizer YES 27 | endif 28 | 29 | LOG_EXT := > ./build/log.txt 2>&1 || ( cat ./build/log.txt && exit 1 ) 30 | ARCH_DATE := $(shell date +"%Y%m%d") 31 | ARCH_FILE := $(HOME)/BNNS-$(ARCH_DATE).tgz 32 | 33 | # Color option printing 34 | define PRINT_OPT 35 | @echo "\033[1;34m$(1)\033[0m = $(2)" 36 | endef 37 | 38 | all: osx 39 | 40 | tests: clean osx 41 | xcodebuild -sdk $(OSX_SDK) -configuration $(CONFIG) -target t_zlib_verify ARCHS="$(OSX_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT) 42 | ./build/Release/t_zlib_verify -t -e 0 -d 10 /Volumes/Data/Sets/CanterburyCorpus/* 43 | ./build/Release/t_zlib_verify -t -e 0 -d 10 -f /Volumes/Data/Sets/CanterburyCorpus/* 44 | 45 | fuzzer: 46 | xcodebuild -sdk $(OSX_SDK) -configuration $(CONFIG) -target f_zlib ARCHS="$(OSX_ARCHS)" DSTROOT=$(OSX_DSTROOT) $(SANITIZER_OPT) install > $(OSX_LOG) 2>&1 || cat $(OSX_LOG) 47 | $(OSX_DSTROOT)/usr/local/bin/f_zlib /Volumes/Data/Work/CompressionTests.git/Fuzzing/zlib_zlib 48 | 49 | osx: 50 | $(call PRINT_OPT,CONFIG ,$(CONFIG)) 51 | $(call PRINT_OPT,OSX_SDK ,$(OSX_SDK)) 52 | $(call PRINT_OPT,OSX_ARCHS,$(OSX_ARCHS)) 53 | $(call PRINT_OPT,SANITIZE ,$(SANITIZE)) 54 | @/bin/rm -rf $(OSX_DSTROOT) 55 | xcodebuild -sdk $(OSX_SDK) -configuration $(CONFIG) -target all ARCHS="$(OSX_ARCHS)" DSTROOT=$(OSX_DSTROOT) $(SANITIZER_OPT) install > $(OSX_LOG) 2>&1 || cat $(OSX_LOG) 56 | 57 | osx-install: osx 58 | ./scripts/t_install_roots.pl -d $(OSX_DSTROOT) -s $(OSX_SDK) 59 | ./scripts/t_install_roots.pl -d $(OSX_DSTROOT) -s $(OSX_SDK) -r 60 | 61 | # Run: make osx-test SANITIZE=1 62 | osx-test: osx 63 | sudo ./scripts/t_zlib_torture.sh $(OSX_DSTROOT) /Volumes/Data/Work/CompressionTests.git/SilesiaCorpus 64 | sudo ./scripts/t_zlib_torture.sh $(OSX_DSTROOT) /Volumes/Data/Work/CompressionTests.git/CanterburyCorpus 65 | sudo ./scripts/t_zlib_torture.sh $(OSX_DSTROOT) /Volumes/Data/Work/CompressionTests.git/CalgaryCorpus 66 | sudo ./scripts/t_zlib_torture.sh $(OSX_DSTROOT) /bin 67 | 68 | ios: 69 | @[ -d ./build ] || mkdir -p ./build 70 | xcodebuild -sdk $(IOS_SDK) -configuration $(CONFIG) -target all ARCHS="$(IOS_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT) 71 | wos: 72 | @[ -d ./build ] || mkdir -p ./build 73 | xcodebuild -sdk $(WOS_SDK) -configuration $(CONFIG) -target all ARCHS="$(WOS_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT) 74 | 75 | buildit-archive: clean 76 | xbs buildit . -noverify -project zlib -update Prevailing$(RELEASE) -buildAllAliases -buildRecordName zlib -archive 77 | @cd /tmp/$(BUILDIT_RECORD_NAME).roots/BuildRecords && find . -type f -ls | egrep '\/(SDKContent)?Root\/' 78 | 79 | clean: 80 | /bin/rm -rf ./build /tmp/zlib.dst $(OSX_DSTROOT) 81 | -------------------------------------------------------------------------------- /scripts/t_install_roots.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # Install SDK/runtime roots 3 | # EB Jan 2020 4 | 5 | # Split the contents of -d dir between runtime contents and SDK contents, then 6 | # darwinup the runtime to / and the SDK to the specified -s sdk 7 | 8 | use strict; 9 | use warnings; 10 | use Cwd qw/ realpath /; 11 | use Getopt::Std; 12 | use File::Temp qw/ tempdir /; 13 | use File::Basename; 14 | 15 | our $opt_d = ''; # -d dstroot 16 | our $opt_s = ''; # -s sdk 17 | our $opt_o = ''; # -o archive (optional) 18 | our $opt_v = 1; 19 | our $opt_r = 0; # -r = install runtime, default is install SDK 20 | my $tmp_runtime = tempdir( CLEANUP => 1 ); 21 | my $tmp_sdk = tempdir( CLEANUP => 1 ); 22 | my $usage = <<'EOF'; 23 | Usage: t_install_roots.pl -d dstroot -s sdk [-v] 24 | EOF 25 | 26 | getopts('vrd:s:o:'); 27 | my $dstroot = realpath($opt_d); 28 | unless ( -d $dstroot ) { print $usage; exit(1); } 29 | my $sdkroot = `xcrun --sdk $opt_s -show-sdk-path`; 30 | chop($sdkroot); 31 | unless ( -d $sdkroot ) { print "Invalid sdk: $opt_s\n"; print $usage; exit(1); } 32 | 33 | my $action = "Installing"; 34 | $action = "Archiving" if ($opt_o ne ''); 35 | my $roots = "SDK"; 36 | $roots = "Runtime" if ($opt_r); 37 | 38 | if ($opt_v) { 39 | print STDERR "Processing roots from: $dstroot\n"; 40 | print STDERR "Target SDK $opt_s -> $sdkroot\n"; 41 | print STDERR "$action $roots\n"; 42 | } 43 | 44 | open(FILE,"find $dstroot -type f -o -type l |") or die "Running find"; 45 | F: while () { 46 | chop; 47 | my $full_path = $_; 48 | my $path = $full_path; 49 | $path =~ s/\Q$dstroot\/\E//; 50 | my $is_runtime = 0; 51 | my $is_sdk = 0; 52 | my $file_info = `file $full_path`; 53 | $is_runtime = 1 if ($path =~ /\.dylib$/); 54 | $is_sdk = 1 if ($path =~ /\.h$/); 55 | $is_sdk = 1 if ($path =~ /lib.*\.a$/); 56 | $is_sdk = 1 if ($path =~ /module.*modulemap$/); 57 | $is_sdk = 1 if ($path =~ /\.tbd$/); 58 | $is_sdk = 1 if ($path =~ /\.swiftmodule\//); 59 | $is_sdk = 1 if ($path =~ /\/OpenSource/); 60 | $is_runtime = 1 if (!$is_sdk && $file_info =~ /Mach-O.*binary/); 61 | $is_runtime = 1 if ($path =~ /\/man\/man.\//); 62 | die "File not labelled: $path" if ($is_runtime == $is_sdk); 63 | if ($opt_v) { 64 | print STDERR $is_runtime?"RUNTIME":"SDK "; 65 | print STDERR " $path\n"; 66 | } 67 | my $dpath; 68 | if ($is_runtime) { 69 | $dpath = dirname("$tmp_runtime/$path"); 70 | } else { 71 | $dpath = dirname("$tmp_sdk/$path"); 72 | } 73 | system("mkdir -p $dpath"); 74 | system("cp -af \"$full_path\" \"$dpath\""); 75 | } 76 | 77 | my $darwinup = "sudo darwinup -f"; 78 | $darwinup .= " -v" if ($opt_v); 79 | 80 | # If -o is specified, archive instead of darwinup 81 | if ($opt_o ne '') { 82 | print STDERR "Archiving $roots to $opt_o...\n"; 83 | if ($opt_r) { 84 | system("tar cvzf \"$opt_o\" -C $tmp_runtime ."); 85 | } else { 86 | system("tar cvzf \"$opt_o\" -C $tmp_sdk ."); 87 | } 88 | } else { 89 | # Always print this before the script asks for a password 90 | print STDERR "Running darwinup $roots...\n"; 91 | if ($opt_r) { 92 | system("$darwinup install $tmp_runtime"); 93 | } else { 94 | system("$darwinup -p \"$sdkroot\" install $tmp_sdk"); 95 | } 96 | } 97 | 98 | exit(0); 99 | -------------------------------------------------------------------------------- /zlib/contrib/pascal/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory contains a Pascal (Delphi, Kylix) interface to the 3 | zlib data compression library. 4 | 5 | 6 | Directory listing 7 | ================= 8 | 9 | zlibd32.mak makefile for Borland C++ 10 | example.pas usage example of zlib 11 | zlibpas.pas the Pascal interface to zlib 12 | readme.txt this file 13 | 14 | 15 | Compatibility notes 16 | =================== 17 | 18 | - Although the name "zlib" would have been more normal for the 19 | zlibpas unit, this name is already taken by Borland's ZLib unit. 20 | This is somehow unfortunate, because that unit is not a genuine 21 | interface to the full-fledged zlib functionality, but a suite of 22 | class wrappers around zlib streams. Other essential features, 23 | such as checksums, are missing. 24 | It would have been more appropriate for that unit to have a name 25 | like "ZStreams", or something similar. 26 | 27 | - The C and zlib-supplied types int, uInt, long, uLong, etc. are 28 | translated directly into Pascal types of similar sizes (Integer, 29 | LongInt, etc.), to avoid namespace pollution. In particular, 30 | there is no conversion of unsigned int into a Pascal unsigned 31 | integer. The Word type is non-portable and has the same size 32 | (16 bits) both in a 16-bit and in a 32-bit environment, unlike 33 | Integer. Even if there is a 32-bit Cardinal type, there is no 34 | real need for unsigned int in zlib under a 32-bit environment. 35 | 36 | - Except for the callbacks, the zlib function interfaces are 37 | assuming the calling convention normally used in Pascal 38 | (__pascal for DOS and Windows16, __fastcall for Windows32). 39 | Since the cdecl keyword is used, the old Turbo Pascal does 40 | not work with this interface. 41 | 42 | - The gz* function interfaces are not translated, to avoid 43 | interfacing problems with the C runtime library. Besides, 44 | gzprintf(gzFile file, const char *format, ...) 45 | cannot be translated into Pascal. 46 | 47 | 48 | Legal issues 49 | ============ 50 | 51 | The zlibpas interface is: 52 | Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler. 53 | Copyright (C) 1998 by Bob Dellaca. 54 | Copyright (C) 2003 by Cosmin Truta. 55 | 56 | The example program is: 57 | Copyright (C) 1995-2003 by Jean-loup Gailly. 58 | Copyright (C) 1998,1999,2000 by Jacques Nomssi Nzali. 59 | Copyright (C) 2003 by Cosmin Truta. 60 | 61 | This software is provided 'as-is', without any express or implied 62 | warranty. In no event will the author be held liable for any damages 63 | arising from the use of this software. 64 | 65 | Permission is granted to anyone to use this software for any purpose, 66 | including commercial applications, and to alter it and redistribute it 67 | freely, subject to the following restrictions: 68 | 69 | 1. The origin of this software must not be misrepresented; you must not 70 | claim that you wrote the original software. If you use this software 71 | in a product, an acknowledgment in the product documentation would be 72 | appreciated but is not required. 73 | 2. Altered source versions must be plainly marked as such, and must not be 74 | misrepresented as being the original software. 75 | 3. This notice may not be removed or altered from any source distribution. 76 | 77 | -------------------------------------------------------------------------------- /zlib/contrib/puff/README: -------------------------------------------------------------------------------- 1 | Puff -- A Simple Inflate 2 | 3 Mar 2003 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | 6 | What this is -- 7 | 8 | puff.c provides the routine puff() to decompress the deflate data format. It 9 | does so more slowly than zlib, but the code is about one-fifth the size of the 10 | inflate code in zlib, and written to be very easy to read. 11 | 12 | Why I wrote this -- 13 | 14 | puff.c was written to document the deflate format unambiguously, by virtue of 15 | being working C code. It is meant to supplement RFC 1951, which formally 16 | describes the deflate format. I have received many questions on details of the 17 | deflate format, and I hope that reading this code will answer those questions. 18 | puff.c is heavily commented with details of the deflate format, especially 19 | those little nooks and cranies of the format that might not be obvious from a 20 | specification. 21 | 22 | puff.c may also be useful in applications where code size or memory usage is a 23 | very limited resource, and speed is not as important. 24 | 25 | How to use it -- 26 | 27 | Well, most likely you should just be reading puff.c and using zlib for actual 28 | applications, but if you must ... 29 | 30 | Include puff.h in your code, which provides this prototype: 31 | 32 | int puff(unsigned char *dest, /* pointer to destination pointer */ 33 | unsigned long *destlen, /* amount of output space */ 34 | unsigned char *source, /* pointer to source data pointer */ 35 | unsigned long *sourcelen); /* amount of input available */ 36 | 37 | Then you can call puff() to decompress a deflate stream that is in memory in 38 | its entirety at source, to a sufficiently sized block of memory for the 39 | decompressed data at dest. puff() is the only external symbol in puff.c The 40 | only C library functions that puff.c needs are setjmp() and longjmp(), which 41 | are used to simplify error checking in the code to improve readabilty. puff.c 42 | does no memory allocation, and uses less than 2K bytes off of the stack. 43 | 44 | If destlen is not enough space for the uncompressed data, then inflate will 45 | return an error without writing more than destlen bytes. Note that this means 46 | that in order to decompress the deflate data successfully, you need to know 47 | the size of the uncompressed data ahead of time. 48 | 49 | If needed, puff() can determine the size of the uncompressed data with no 50 | output space. This is done by passing dest equal to (unsigned char *)0. Then 51 | the initial value of *destlen is ignored and *destlen is set to the length of 52 | the uncompressed data. So if the size of the uncompressed data is not known, 53 | then two passes of puff() can be used--first to determine the size, and second 54 | to do the actual inflation after allocating the appropriate memory. Not 55 | pretty, but it works. (This is one of the reasons you should be using zlib.) 56 | 57 | The deflate format is self-terminating. If the deflate stream does not end 58 | in *sourcelen bytes, puff() will return an error without reading at or past 59 | endsource. 60 | 61 | On return, *sourcelen is updated to the amount of input data consumed, and 62 | *destlen is updated to the size of the uncompressed data. See the comments 63 | in puff.c for the possible return codes for puff(). 64 | -------------------------------------------------------------------------------- /zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. *sourceLen is 13 | the byte length of the source buffer. Upon entry, *destLen is the total size 14 | of the destination buffer, which must be large enough to hold the entire 15 | uncompressed data. (The size of the uncompressed data must have been saved 16 | previously by the compressor and transmitted to the decompressor by some 17 | mechanism outside the scope of this compression library.) Upon exit, 18 | *destLen is the size of the decompressed data and *sourceLen is the number 19 | of source bytes consumed. Upon return, source + *sourceLen points to the 20 | first unused input byte. 21 | 22 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough 23 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, or 24 | Z_DATA_ERROR if the input data was corrupted, including if the input data is 25 | an incomplete zlib stream. 26 | */ 27 | int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) 28 | Bytef *dest; 29 | uLongf *destLen; 30 | const Bytef *source; 31 | uLong *sourceLen; 32 | { 33 | z_stream stream; 34 | int err; 35 | const uInt max = (uInt)-1; 36 | uLong len, left; 37 | Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ 38 | 39 | len = *sourceLen; 40 | if (*destLen) { 41 | left = *destLen; 42 | *destLen = 0; 43 | } 44 | else { 45 | left = 1; 46 | dest = buf; 47 | } 48 | 49 | stream.next_in = (z_const Bytef *)source; 50 | stream.avail_in = 0; 51 | stream.zalloc = (alloc_func)0; 52 | stream.zfree = (free_func)0; 53 | stream.opaque = (voidpf)0; 54 | 55 | err = inflateInit(&stream); 56 | if (err != Z_OK) return err; 57 | 58 | stream.next_out = dest; 59 | stream.avail_out = 0; 60 | 61 | do { 62 | if (stream.avail_out == 0) { 63 | stream.avail_out = left > (uLong)max ? max : (uInt)left; 64 | left -= stream.avail_out; 65 | } 66 | if (stream.avail_in == 0) { 67 | stream.avail_in = len > (uLong)max ? max : (uInt)len; 68 | len -= stream.avail_in; 69 | } 70 | err = inflate(&stream, Z_NO_FLUSH); 71 | } while (err == Z_OK); 72 | 73 | *sourceLen -= len + stream.avail_in; 74 | if (dest != buf) 75 | *destLen = stream.total_out; 76 | else if (stream.total_out && err == Z_BUF_ERROR) 77 | left = 1; 78 | 79 | inflateEnd(&stream); 80 | return err == Z_STREAM_END ? Z_OK : 81 | err == Z_NEED_DICT ? Z_DATA_ERROR : 82 | err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR : 83 | err; 84 | } 85 | 86 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 87 | Bytef *dest; 88 | uLongf *destLen; 89 | const Bytef *source; 90 | uLong sourceLen; 91 | { 92 | return uncompress2(dest, destLen, source, &sourceLen); 93 | } 94 | -------------------------------------------------------------------------------- /zlib/contrib/minizip/MiniZip64_info.txt: -------------------------------------------------------------------------------- 1 | MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson 2 | 3 | Introduction 4 | --------------------- 5 | MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0. 8 | All possible work was done for compatibility. 9 | 10 | 11 | Background 12 | --------------------- 13 | When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 14 | support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) 15 | 16 | That was used as a starting point. And after that ZIP64 support was added to zip.c 17 | some refactoring and code cleanup was also done. 18 | 19 | 20 | Changed from MiniZip 1.0 to MiniZip 1.1 21 | --------------------------------------- 22 | * Added ZIP64 support for unzip ( by Even Rouault ) 23 | * Added ZIP64 support for zip ( by Mathias Svensson ) 24 | * Reverted some changed that Even Rouault did. 25 | * Bunch of patches received from Gulles Vollant that he received for MiniZip from various users. 26 | * Added unzip patch for BZIP Compression method (patch create by Daniel Borca) 27 | * Added BZIP Compress method for zip 28 | * Did some refactoring and code cleanup 29 | 30 | 31 | Credits 32 | 33 | Gilles Vollant - Original MiniZip author 34 | Even Rouault - ZIP64 unzip Support 35 | Daniel Borca - BZip Compression method support in unzip 36 | Mathias Svensson - ZIP64 zip support 37 | Mathias Svensson - BZip Compression method support in zip 38 | 39 | Resources 40 | 41 | ZipLayout http://result42.com/projects/ZipFileLayout 42 | Command line tool for Windows that shows the layout and information of the headers in a zip archive. 43 | Used when debugging and validating the creation of zip files using MiniZip64 44 | 45 | 46 | ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT 47 | Zip File specification 48 | 49 | 50 | Notes. 51 | * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined. 52 | 53 | License 54 | ---------------------------------------------------------- 55 | Condition of use and distribution are the same than zlib : 56 | 57 | This software is provided 'as-is', without any express or implied 58 | warranty. In no event will the authors be held liable for any damages 59 | arising from the use of this software. 60 | 61 | Permission is granted to anyone to use this software for any purpose, 62 | including commercial applications, and to alter it and redistribute it 63 | freely, subject to the following restrictions: 64 | 65 | 1. The origin of this software must not be misrepresented; you must not 66 | claim that you wrote the original software. If you use this software 67 | in a product, an acknowledgment in the product documentation would be 68 | appreciated but is not required. 69 | 2. Altered source versions must be plainly marked as such, and must not be 70 | misrepresented as being the original software. 71 | 3. This notice may not be removed or altered from any source distribution. 72 | 73 | ---------------------------------------------------------- 74 | 75 | -------------------------------------------------------------------------------- /zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | 2 | /* inftrees.h -- header to use inftrees.c 3 | * Copyright (C) 1995-2005, 2010 Mark Adler 4 | * For conditions of distribution and use, see copyright notice in zlib.h 5 | */ 6 | 7 | /* WARNING: this file should *not* be used by applications. It is 8 | part of the implementation of the compression library and is 9 | subject to change. Applications should only use zlib.h. 10 | */ 11 | 12 | /* Structure for decoding tables. Each entry provides either the 13 | information needed to do the operation requested by the code that 14 | indexed that table entry, or it provides a pointer to another 15 | table that indexes more bits of the code. op indicates whether 16 | the entry is a pointer to another table, a literal, a length or 17 | distance, an end-of-block, or an invalid code. For a table 18 | pointer, the low four bits of op is the number of index bits of 19 | that table. For a length or distance, the low four bits of op 20 | is the number of extra bits to get after the code. bits is 21 | the number of bits in this code or part of the code to drop off 22 | of the bit buffer. val is the actual byte to output in the case 23 | of a literal, the base length or distance, or the offset from 24 | the current table to the next table. Each entry is four bytes. */ 25 | typedef struct { 26 | #if defined(INFFAST_OPT) 27 | unsigned char bits; /* bits in this part of the code */ 28 | unsigned char op; /* operation, extra bits, table bits */ 29 | #else 30 | unsigned char op; /* operation, extra bits, table bits */ 31 | unsigned char bits; /* bits in this part of the code */ 32 | #endif 33 | unsigned short val; /* offset in table or code value */ 34 | } code; 35 | 36 | /* op values as set by inflate_table(): 37 | 00000000 - literal 38 | 0000tttt - table link, tttt != 0 is the number of table index bits 39 | 0001eeee - length or distance, eeee is the number of extra bits 40 | 01100000 - end of block 41 | 01000000 - invalid code 42 | */ 43 | 44 | /* Maximum size of the dynamic table. The maximum number of code structures is 45 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 46 | codes. These values were found by exhaustive searches using the program 47 | examples/enough.c found in the zlib distribtution. The arguments to that 48 | program are the number of symbols, the initial root table size, and the 49 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 50 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 51 | The initial root table size (9 or 6) is found in the fifth argument of the 52 | inflate_table() calls in inflate.c and infback.c. If the root table size is 53 | changed, then these maximum sizes would be need to be recalculated and 54 | updated. */ 55 | #define ENOUGH_LENS 852 56 | #define ENOUGH_DISTS 592 57 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 58 | 59 | /* Type of code to build for inflate_table() */ 60 | typedef enum { 61 | CODES, 62 | LENS, 63 | DISTS 64 | } codetype; 65 | 66 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 67 | unsigned codes, code FAR * FAR *table, 68 | unsigned FAR *bits, unsigned short FAR *work, 69 | unsigned enough)); 70 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/readme.txt: -------------------------------------------------------------------------------- 1 | Building instructions for the DLL versions of Zlib 1.2.12 2 | ======================================================== 3 | 4 | This directory contains projects that build zlib and minizip using 5 | Microsoft Visual C++ 9.0/10.0. 6 | 7 | You don't need to build these projects yourself. You can download the 8 | binaries from: 9 | http://www.winimage.com/zLibDll 10 | 11 | More information can be found at this site. 12 | 13 | 14 | 15 | 16 | 17 | Build instructions for Visual Studio 2008 (32 bits or 64 bits) 18 | -------------------------------------------------------------- 19 | - Decompress current zlib, including all contrib/* files 20 | - Compile assembly code (with Visual Studio Command Prompt) by running: 21 | bld_ml64.bat (in contrib\masmx64) 22 | bld_ml32.bat (in contrib\masmx86) 23 | - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 24 | - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" 25 | 26 | Build instructions for Visual Studio 2010 (32 bits or 64 bits) 27 | -------------------------------------------------------------- 28 | - Decompress current zlib, including all contrib/* files 29 | - Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 30 | 31 | Build instructions for Visual Studio 2012 (32 bits or 64 bits) 32 | -------------------------------------------------------------- 33 | - Decompress current zlib, including all contrib/* files 34 | - Open contrib\vstudio\vc11\zlibvc.sln with Microsoft Visual C++ 2012 35 | 36 | Build instructions for Visual Studio 2013 (32 bits or 64 bits) 37 | -------------------------------------------------------------- 38 | - Decompress current zlib, including all contrib/* files 39 | - Open contrib\vstudio\vc12\zlibvc.sln with Microsoft Visual C++ 2013 40 | 41 | Build instructions for Visual Studio 2015 (32 bits or 64 bits) 42 | -------------------------------------------------------------- 43 | - Decompress current zlib, including all contrib/* files 44 | - Open contrib\vstudio\vc14\zlibvc.sln with Microsoft Visual C++ 2015 45 | 46 | 47 | Important 48 | --------- 49 | - To use zlibwapi.dll in your application, you must define the 50 | macro ZLIB_WINAPI when compiling your application's source files. 51 | 52 | 53 | Additional notes 54 | ---------------- 55 | - This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built 56 | by Gilles Vollant from the zlib 1.1.x sources, and distributed at 57 | http://www.winimage.com/zLibDll 58 | It uses the WINAPI calling convention for the exported functions, and 59 | includes the minizip functionality. If your application needs that 60 | particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. 61 | 62 | - The new DLL was renamed because there exist several incompatible 63 | versions of zlib.dll on the Internet. 64 | 65 | - There is also an official DLL build of zlib, named zlib1.dll. This one 66 | is exporting the functions using the CDECL convention. See the file 67 | win32\DLL_FAQ.txt found in this zlib distribution. 68 | 69 | - There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol 70 | has a slightly different effect. To avoid compatibility problems, do 71 | not define it here. 72 | 73 | 74 | Gilles Vollant 75 | info@winimage.com 76 | 77 | Visual Studio 2013 and 2015 Projects from Sean Hunt 78 | seandhunt_7@yahoo.com 79 | -------------------------------------------------------------------------------- /zlib.xcodeproj/xcshareddata/xcschemes/t_zlib_verify.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 66 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /zlib/msdos/Makefile.msc: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Microsoft C 5.1 or later 3 | # Last updated: 19-Mar-2003 4 | 5 | # To use, do "make makefile.msc" 6 | # To compile in small model, set below: MODEL=S 7 | 8 | # If you wish to reduce the memory requirements (default 256K for big 9 | # objects plus a few K), you can add to the LOC macro below: 10 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 11 | # See zconf.h for details about the memory requirements. 12 | 13 | # ------------- Microsoft C 5.1 and later ------------- 14 | 15 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 16 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added 17 | # to the declaration of LOC here: 18 | LOC = $(LOCAL_ZLIB) 19 | 20 | # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. 21 | CPU_TYP = 0 22 | 23 | # Memory model: one of S, M, C, L (small, medium, compact, large) 24 | MODEL=L 25 | 26 | CC=cl 27 | CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC) 28 | #-Ox generates bad code with MSC 5.1 29 | LIB_CFLAGS=-Zl $(CFLAGS) 30 | 31 | LD=link 32 | LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode 33 | # "/farcall/packcode" are only useful for `large code' memory models 34 | # but should be a "no-op" for small code models. 35 | 36 | 37 | # variables 38 | ZLIB_LIB = zlib_$(MODEL).lib 39 | 40 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 41 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 42 | 43 | 44 | # targets 45 | all: $(ZLIB_LIB) example.exe minigzip.exe 46 | 47 | .c.obj: 48 | $(CC) -c $(LIB_CFLAGS) $*.c 49 | 50 | adler32.obj: adler32.c zlib.h zconf.h 51 | 52 | compress.obj: compress.c zlib.h zconf.h 53 | 54 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 55 | 56 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 57 | 58 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 59 | 60 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 61 | 62 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 63 | 64 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 65 | 66 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67 | inffast.h inffixed.h 68 | 69 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 70 | inffast.h 71 | 72 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 73 | inffast.h inffixed.h 74 | 75 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 76 | 77 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 78 | 79 | uncompr.obj: uncompr.c zlib.h zconf.h 80 | 81 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 82 | 83 | example.obj: test/example.c zlib.h zconf.h 84 | $(CC) -c $(CFLAGS) $*.c 85 | 86 | minigzip.obj: test/minigzip.c zlib.h zconf.h 87 | $(CC) -c $(CFLAGS) $*.c 88 | 89 | 90 | # the command line is cut to fit in the MS-DOS 128 byte limit: 91 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 92 | if exist $(ZLIB_LIB) del $(ZLIB_LIB) 93 | lib $(ZLIB_LIB) $(OBJ1); 94 | lib $(ZLIB_LIB) $(OBJ2); 95 | 96 | example.exe: example.obj $(ZLIB_LIB) 97 | $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB); 98 | 99 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 100 | $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB); 101 | 102 | test: example.exe minigzip.exe 103 | example 104 | echo hello world | minigzip | minigzip -d 105 | 106 | clean: 107 | -del *.obj 108 | -del *.lib 109 | -del *.exe 110 | -del *.map 111 | -del zlib_*.bak 112 | -del foo.gz 113 | -------------------------------------------------------------------------------- /zlib.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 19 | 20 | $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\Setup\VC@ProductDir) 21 | $(VCINSTALLDIR) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /zlib/msdos/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ 3 | # Last updated: 15-Mar-2003 4 | 5 | # To use, do "make -fmakefile.bor" 6 | # To compile in small model, set below: MODEL=s 7 | 8 | # WARNING: the small model is supported but only for small values of 9 | # MAX_WBITS and MAX_MEM_LEVEL. For example: 10 | # -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3 11 | # If you wish to reduce the memory requirements (default 256K for big 12 | # objects plus a few K), you can add to the LOC macro below: 13 | # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14 | # See zconf.h for details about the memory requirements. 15 | 16 | # ------------ Turbo C++, Borland C++ ------------ 17 | 18 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 19 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added 20 | # to the declaration of LOC here: 21 | LOC = $(LOCAL_ZLIB) 22 | 23 | # type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. 24 | CPU_TYP = 0 25 | 26 | # memory model: one of s, m, c, l (small, medium, compact, large) 27 | MODEL=l 28 | 29 | # replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version 30 | CC=bcc 31 | LD=bcc 32 | AR=tlib 33 | 34 | # compiler flags 35 | # replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0 36 | CFLAGS=-O2 -Z -m$(MODEL) $(LOC) 37 | 38 | LDFLAGS=-m$(MODEL) -f- 39 | 40 | 41 | # variables 42 | ZLIB_LIB = zlib_$(MODEL).lib 43 | 44 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 45 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 46 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 47 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 48 | 49 | 50 | # targets 51 | all: $(ZLIB_LIB) example.exe minigzip.exe 52 | 53 | .c.obj: 54 | $(CC) -c $(CFLAGS) $*.c 55 | 56 | adler32.obj: adler32.c zlib.h zconf.h 57 | 58 | compress.obj: compress.c zlib.h zconf.h 59 | 60 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 61 | 62 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 63 | 64 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 65 | 66 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 67 | 68 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 69 | 70 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 71 | 72 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 73 | inffast.h inffixed.h 74 | 75 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 76 | inffast.h 77 | 78 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 79 | inffast.h inffixed.h 80 | 81 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 82 | 83 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 84 | 85 | uncompr.obj: uncompr.c zlib.h zconf.h 86 | 87 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 88 | 89 | example.obj: test/example.c zlib.h zconf.h 90 | 91 | minigzip.obj: test/minigzip.c zlib.h zconf.h 92 | 93 | 94 | # the command line is cut to fit in the MS-DOS 128 byte limit: 95 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) 96 | -del $(ZLIB_LIB) 97 | $(AR) $(ZLIB_LIB) $(OBJP1) 98 | $(AR) $(ZLIB_LIB) $(OBJP2) 99 | 100 | example.exe: example.obj $(ZLIB_LIB) 101 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 102 | 103 | minigzip.exe: minigzip.obj $(ZLIB_LIB) 104 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 105 | 106 | test: example.exe minigzip.exe 107 | example 108 | echo hello world | minigzip | minigzip -d 109 | 110 | clean: 111 | -del *.obj 112 | -del *.lib 113 | -del *.exe 114 | -del zlib_*.bak 115 | -del foo.gz 116 | -------------------------------------------------------------------------------- /zlib/treebuild.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | zip compression library 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 117 | -------------------------------------------------------------------------------- /zlib/contrib/ada/zlib-thin.adb: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------- 2 | -- ZLib for Ada thick binding. -- 3 | -- -- 4 | -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- 5 | -- -- 6 | -- Open source license information is in the zlib.ads file. -- 7 | ---------------------------------------------------------------- 8 | 9 | -- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $ 10 | 11 | package body ZLib.Thin is 12 | 13 | ZLIB_VERSION : constant Chars_Ptr := zlibVersion; 14 | 15 | Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit; 16 | 17 | -------------- 18 | -- Avail_In -- 19 | -------------- 20 | 21 | function Avail_In (Strm : in Z_Stream) return UInt is 22 | begin 23 | return Strm.Avail_In; 24 | end Avail_In; 25 | 26 | --------------- 27 | -- Avail_Out -- 28 | --------------- 29 | 30 | function Avail_Out (Strm : in Z_Stream) return UInt is 31 | begin 32 | return Strm.Avail_Out; 33 | end Avail_Out; 34 | 35 | ------------------ 36 | -- Deflate_Init -- 37 | ------------------ 38 | 39 | function Deflate_Init 40 | (strm : Z_Streamp; 41 | level : Int; 42 | method : Int; 43 | windowBits : Int; 44 | memLevel : Int; 45 | strategy : Int) 46 | return Int is 47 | begin 48 | return deflateInit2 49 | (strm, 50 | level, 51 | method, 52 | windowBits, 53 | memLevel, 54 | strategy, 55 | ZLIB_VERSION, 56 | Z_Stream_Size); 57 | end Deflate_Init; 58 | 59 | ------------------ 60 | -- Inflate_Init -- 61 | ------------------ 62 | 63 | function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is 64 | begin 65 | return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size); 66 | end Inflate_Init; 67 | 68 | ------------------------ 69 | -- Last_Error_Message -- 70 | ------------------------ 71 | 72 | function Last_Error_Message (Strm : in Z_Stream) return String is 73 | use Interfaces.C.Strings; 74 | begin 75 | if Strm.msg = Null_Ptr then 76 | return ""; 77 | else 78 | return Value (Strm.msg); 79 | end if; 80 | end Last_Error_Message; 81 | 82 | ------------ 83 | -- Set_In -- 84 | ------------ 85 | 86 | procedure Set_In 87 | (Strm : in out Z_Stream; 88 | Buffer : in Voidp; 89 | Size : in UInt) is 90 | begin 91 | Strm.Next_In := Buffer; 92 | Strm.Avail_In := Size; 93 | end Set_In; 94 | 95 | ------------------ 96 | -- Set_Mem_Func -- 97 | ------------------ 98 | 99 | procedure Set_Mem_Func 100 | (Strm : in out Z_Stream; 101 | Opaque : in Voidp; 102 | Alloc : in alloc_func; 103 | Free : in free_func) is 104 | begin 105 | Strm.opaque := Opaque; 106 | Strm.zalloc := Alloc; 107 | Strm.zfree := Free; 108 | end Set_Mem_Func; 109 | 110 | ------------- 111 | -- Set_Out -- 112 | ------------- 113 | 114 | procedure Set_Out 115 | (Strm : in out Z_Stream; 116 | Buffer : in Voidp; 117 | Size : in UInt) is 118 | begin 119 | Strm.Next_Out := Buffer; 120 | Strm.Avail_Out := Size; 121 | end Set_Out; 122 | 123 | -------------- 124 | -- Total_In -- 125 | -------------- 126 | 127 | function Total_In (Strm : in Z_Stream) return ULong is 128 | begin 129 | return Strm.Total_In; 130 | end Total_In; 131 | 132 | --------------- 133 | -- Total_Out -- 134 | --------------- 135 | 136 | function Total_Out (Strm : in Z_Stream) return ULong is 137 | begin 138 | return Strm.Total_Out; 139 | end Total_Out; 140 | 141 | end ZLib.Thin; 142 | -------------------------------------------------------------------------------- /zlib/contrib/blast/blast.h: -------------------------------------------------------------------------------- 1 | /* blast.h -- interface for blast.c 2 | Copyright (C) 2003, 2012, 2013 Mark Adler 3 | version 1.3, 24 Aug 2013 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * blast() decompresses the PKWare Data Compression Library (DCL) compressed 27 | * format. It provides the same functionality as the explode() function in 28 | * that library. (Note: PKWare overused the "implode" verb, and the format 29 | * used by their library implode() function is completely different and 30 | * incompatible with the implode compression method supported by PKZIP.) 31 | * 32 | * The binary mode for stdio functions should be used to assure that the 33 | * compressed data is not corrupted when read or written. For example: 34 | * fopen(..., "rb") and fopen(..., "wb"). 35 | */ 36 | 37 | 38 | typedef unsigned (*blast_in)(void *how, unsigned char **buf); 39 | typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len); 40 | /* Definitions for input/output functions passed to blast(). See below for 41 | * what the provided functions need to do. 42 | */ 43 | 44 | 45 | int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow, 46 | unsigned *left, unsigned char **in); 47 | /* Decompress input to output using the provided infun() and outfun() calls. 48 | * On success, the return value of blast() is zero. If there is an error in 49 | * the source data, i.e. it is not in the proper format, then a negative value 50 | * is returned. If there is not enough input available or there is not enough 51 | * output space, then a positive error is returned. 52 | * 53 | * The input function is invoked: len = infun(how, &buf), where buf is set by 54 | * infun() to point to the input buffer, and infun() returns the number of 55 | * available bytes there. If infun() returns zero, then blast() returns with 56 | * an input error. (blast() only asks for input if it needs it.) inhow is for 57 | * use by the application to pass an input descriptor to infun(), if desired. 58 | * 59 | * If left and in are not NULL and *left is not zero when blast() is called, 60 | * then the *left bytes at *in are consumed for input before infun() is used. 61 | * 62 | * The output function is invoked: err = outfun(how, buf, len), where the bytes 63 | * to be written are buf[0..len-1]. If err is not zero, then blast() returns 64 | * with an output error. outfun() is always called with len <= 4096. outhow 65 | * is for use by the application to pass an output descriptor to outfun(), if 66 | * desired. 67 | * 68 | * If there is any unused input, *left is set to the number of bytes that were 69 | * read and *in points to them. Otherwise *left is set to zero and *in is set 70 | * to NULL. If left or in are NULL, then they are not set. 71 | * 72 | * The return codes are: 73 | * 74 | * 2: ran out of input before completing decompression 75 | * 1: output error before completing decompression 76 | * 0: successful decompression 77 | * -1: literal flag not zero or one 78 | * -2: dictionary size not in 4..6 79 | * -3: distance is too far back 80 | * 81 | * At the bottom of blast.c is an example program that uses blast() that can be 82 | * compiled to produce a command-line decompression filter by defining TEST. 83 | */ 84 | -------------------------------------------------------------------------------- /zlib/contrib/ada/buffer_demo.adb: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------- 2 | -- ZLib for Ada thick binding. -- 3 | -- -- 4 | -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- 5 | -- -- 6 | -- Open source license information is in the zlib.ads file. -- 7 | ---------------------------------------------------------------- 8 | -- 9 | -- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $ 10 | 11 | -- This demo program provided by Dr Steve Sangwine 12 | -- 13 | -- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer 14 | -- of exactly the correct size is used for decompressed data, and the last 15 | -- few bytes passed in to Zlib are checksum bytes. 16 | 17 | -- This program compresses a string of text, and then decompresses the 18 | -- compressed text into a buffer of the same size as the original text. 19 | 20 | with Ada.Streams; use Ada.Streams; 21 | with Ada.Text_IO; 22 | 23 | with ZLib; use ZLib; 24 | 25 | procedure Buffer_Demo is 26 | EOL : Character renames ASCII.LF; 27 | Text : constant String 28 | := "Four score and seven years ago our fathers brought forth," & EOL & 29 | "upon this continent, a new nation, conceived in liberty," & EOL & 30 | "and dedicated to the proposition that `all men are created equal'."; 31 | 32 | Source : Stream_Element_Array (1 .. Text'Length); 33 | for Source'Address use Text'Address; 34 | 35 | begin 36 | Ada.Text_IO.Put (Text); 37 | Ada.Text_IO.New_Line; 38 | Ada.Text_IO.Put_Line 39 | ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes"); 40 | 41 | declare 42 | Compressed_Data : Stream_Element_Array (1 .. Text'Length); 43 | L : Stream_Element_Offset; 44 | begin 45 | Compress : declare 46 | Compressor : Filter_Type; 47 | I : Stream_Element_Offset; 48 | begin 49 | Deflate_Init (Compressor); 50 | 51 | -- Compress the whole of T at once. 52 | 53 | Translate (Compressor, Source, I, Compressed_Data, L, Finish); 54 | pragma Assert (I = Source'Last); 55 | 56 | Close (Compressor); 57 | 58 | Ada.Text_IO.Put_Line 59 | ("Compressed size : " 60 | & Stream_Element_Offset'Image (L) & " bytes"); 61 | end Compress; 62 | 63 | -- Now we decompress the data, passing short blocks of data to Zlib 64 | -- (because this demonstrates the problem - the last block passed will 65 | -- contain checksum information and there will be no output, only a 66 | -- check inside Zlib that the checksum is correct). 67 | 68 | Decompress : declare 69 | Decompressor : Filter_Type; 70 | 71 | Uncompressed_Data : Stream_Element_Array (1 .. Text'Length); 72 | 73 | Block_Size : constant := 4; 74 | -- This makes sure that the last block contains 75 | -- only Adler checksum data. 76 | 77 | P : Stream_Element_Offset := Compressed_Data'First - 1; 78 | O : Stream_Element_Offset; 79 | begin 80 | Inflate_Init (Decompressor); 81 | 82 | loop 83 | Translate 84 | (Decompressor, 85 | Compressed_Data 86 | (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)), 87 | P, 88 | Uncompressed_Data 89 | (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last), 90 | O, 91 | No_Flush); 92 | 93 | Ada.Text_IO.Put_Line 94 | ("Total in : " & Count'Image (Total_In (Decompressor)) & 95 | ", out : " & Count'Image (Total_Out (Decompressor))); 96 | 97 | exit when P = L; 98 | end loop; 99 | 100 | Ada.Text_IO.New_Line; 101 | Ada.Text_IO.Put_Line 102 | ("Decompressed text matches original text : " 103 | & Boolean'Image (Uncompressed_Data = Source)); 104 | end Decompress; 105 | end; 106 | end Buffer_Demo; 107 | -------------------------------------------------------------------------------- /zlib/old/Makefile.riscos: -------------------------------------------------------------------------------- 1 | # Project: zlib_1_03 2 | # Patched for zlib 1.1.2 rw@shadow.org.uk 19980430 3 | # test works out-of-the-box, installs `somewhere' on demand 4 | 5 | # Toolflags: 6 | CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah 7 | C++flags = -c -depend !Depend -IC: -throwback 8 | Linkflags = -aif -c++ -o $@ 9 | ObjAsmflags = -throwback -NoCache -depend !Depend 10 | CMHGflags = 11 | LibFileflags = -c -l -o $@ 12 | Squeezeflags = -o $@ 13 | 14 | # change the line below to where _you_ want the library installed. 15 | libdest = lib:zlib 16 | 17 | # Final targets: 18 | @.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ 19 | @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ 20 | @.o.uncompr @.o.zutil 21 | LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ 22 | @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ 23 | @.o.trees @.o.uncompr @.o.zutil 24 | test: @.minigzip @.example @.lib 25 | @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV 26 | @echo running tests: hang on. 27 | @/@.minigzip -f -9 libc 28 | @/@.minigzip -d libc-gz 29 | @/@.minigzip -f -1 libc 30 | @/@.minigzip -d libc-gz 31 | @/@.minigzip -h -9 libc 32 | @/@.minigzip -d libc-gz 33 | @/@.minigzip -h -1 libc 34 | @/@.minigzip -d libc-gz 35 | @/@.minigzip -9 libc 36 | @/@.minigzip -d libc-gz 37 | @/@.minigzip -1 libc 38 | @/@.minigzip -d libc-gz 39 | @diff @.lib @.libc 40 | @echo that should have reported '@.lib and @.libc identical' if you have diff. 41 | @/@.example @.fred @.fred 42 | @echo that will have given lots of hello!'s. 43 | 44 | @.minigzip: @.o.minigzip @.lib C:o.Stubs 45 | Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs 46 | @.example: @.o.example @.lib C:o.Stubs 47 | Link $(Linkflags) @.o.example @.lib C:o.Stubs 48 | 49 | install: @.lib 50 | cdir $(libdest) 51 | cdir $(libdest).h 52 | @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV 53 | @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV 54 | @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV 55 | @echo okay, installed zlib in $(libdest) 56 | 57 | clean:; remove @.minigzip 58 | remove @.example 59 | remove @.libc 60 | -wipe @.o.* F~r~cV 61 | remove @.fred 62 | 63 | # User-editable dependencies: 64 | .c.o: 65 | cc $(ccflags) -o $@ $< 66 | 67 | # Static dependencies: 68 | 69 | # Dynamic dependencies: 70 | o.example: c.example 71 | o.example: h.zlib 72 | o.example: h.zconf 73 | o.minigzip: c.minigzip 74 | o.minigzip: h.zlib 75 | o.minigzip: h.zconf 76 | o.adler32: c.adler32 77 | o.adler32: h.zlib 78 | o.adler32: h.zconf 79 | o.compress: c.compress 80 | o.compress: h.zlib 81 | o.compress: h.zconf 82 | o.crc32: c.crc32 83 | o.crc32: h.zlib 84 | o.crc32: h.zconf 85 | o.deflate: c.deflate 86 | o.deflate: h.deflate 87 | o.deflate: h.zutil 88 | o.deflate: h.zlib 89 | o.deflate: h.zconf 90 | o.gzio: c.gzio 91 | o.gzio: h.zutil 92 | o.gzio: h.zlib 93 | o.gzio: h.zconf 94 | o.infblock: c.infblock 95 | o.infblock: h.zutil 96 | o.infblock: h.zlib 97 | o.infblock: h.zconf 98 | o.infblock: h.infblock 99 | o.infblock: h.inftrees 100 | o.infblock: h.infcodes 101 | o.infblock: h.infutil 102 | o.infcodes: c.infcodes 103 | o.infcodes: h.zutil 104 | o.infcodes: h.zlib 105 | o.infcodes: h.zconf 106 | o.infcodes: h.inftrees 107 | o.infcodes: h.infblock 108 | o.infcodes: h.infcodes 109 | o.infcodes: h.infutil 110 | o.infcodes: h.inffast 111 | o.inffast: c.inffast 112 | o.inffast: h.zutil 113 | o.inffast: h.zlib 114 | o.inffast: h.zconf 115 | o.inffast: h.inftrees 116 | o.inffast: h.infblock 117 | o.inffast: h.infcodes 118 | o.inffast: h.infutil 119 | o.inffast: h.inffast 120 | o.inflate: c.inflate 121 | o.inflate: h.zutil 122 | o.inflate: h.zlib 123 | o.inflate: h.zconf 124 | o.inflate: h.infblock 125 | o.inftrees: c.inftrees 126 | o.inftrees: h.zutil 127 | o.inftrees: h.zlib 128 | o.inftrees: h.zconf 129 | o.inftrees: h.inftrees 130 | o.inftrees: h.inffixed 131 | o.infutil: c.infutil 132 | o.infutil: h.zutil 133 | o.infutil: h.zlib 134 | o.infutil: h.zconf 135 | o.infutil: h.infblock 136 | o.infutil: h.inftrees 137 | o.infutil: h.infcodes 138 | o.infutil: h.infutil 139 | o.trees: c.trees 140 | o.trees: h.deflate 141 | o.trees: h.zutil 142 | o.trees: h.zlib 143 | o.trees: h.zconf 144 | o.trees: h.trees 145 | o.uncompr: c.uncompr 146 | o.uncompr: h.zlib 147 | o.uncompr: h.zconf 148 | o.zutil: c.zutil 149 | o.zutil: h.zutil 150 | o.zutil: h.zlib 151 | o.zutil: h.zconf 152 | -------------------------------------------------------------------------------- /zlib/os400/bndsrc: -------------------------------------------------------------------------------- 1 | STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') 2 | 3 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 4 | /* Version 1.1.3 entry points. */ 5 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 6 | 7 | EXPORT SYMBOL("adler32") 8 | EXPORT SYMBOL("compress") 9 | EXPORT SYMBOL("compress2") 10 | EXPORT SYMBOL("crc32") 11 | EXPORT SYMBOL("get_crc_table") 12 | EXPORT SYMBOL("deflate") 13 | EXPORT SYMBOL("deflateEnd") 14 | EXPORT SYMBOL("deflateSetDictionary") 15 | EXPORT SYMBOL("deflateCopy") 16 | EXPORT SYMBOL("deflateReset") 17 | EXPORT SYMBOL("deflateParams") 18 | EXPORT SYMBOL("deflatePrime") 19 | EXPORT SYMBOL("deflateInit_") 20 | EXPORT SYMBOL("deflateInit2_") 21 | EXPORT SYMBOL("gzopen") 22 | EXPORT SYMBOL("gzdopen") 23 | EXPORT SYMBOL("gzsetparams") 24 | EXPORT SYMBOL("gzread") 25 | EXPORT SYMBOL("gzwrite") 26 | EXPORT SYMBOL("gzprintf") 27 | EXPORT SYMBOL("gzputs") 28 | EXPORT SYMBOL("gzgets") 29 | EXPORT SYMBOL("gzputc") 30 | EXPORT SYMBOL("gzgetc") 31 | EXPORT SYMBOL("gzflush") 32 | EXPORT SYMBOL("gzseek") 33 | EXPORT SYMBOL("gzrewind") 34 | EXPORT SYMBOL("gztell") 35 | EXPORT SYMBOL("gzeof") 36 | EXPORT SYMBOL("gzclose") 37 | EXPORT SYMBOL("gzerror") 38 | EXPORT SYMBOL("inflate") 39 | EXPORT SYMBOL("inflateEnd") 40 | EXPORT SYMBOL("inflateSetDictionary") 41 | EXPORT SYMBOL("inflateSync") 42 | EXPORT SYMBOL("inflateReset") 43 | EXPORT SYMBOL("inflateInit_") 44 | EXPORT SYMBOL("inflateInit2_") 45 | EXPORT SYMBOL("inflateSyncPoint") 46 | EXPORT SYMBOL("uncompress") 47 | EXPORT SYMBOL("zlibVersion") 48 | EXPORT SYMBOL("zError") 49 | EXPORT SYMBOL("z_errmsg") 50 | 51 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 52 | /* Version 1.2.1 additional entry points. */ 53 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 54 | 55 | EXPORT SYMBOL("compressBound") 56 | EXPORT SYMBOL("deflateBound") 57 | EXPORT SYMBOL("deflatePending") 58 | EXPORT SYMBOL("gzungetc") 59 | EXPORT SYMBOL("gzclearerr") 60 | EXPORT SYMBOL("inflateBack") 61 | EXPORT SYMBOL("inflateBackEnd") 62 | EXPORT SYMBOL("inflateBackInit_") 63 | EXPORT SYMBOL("inflateCopy") 64 | EXPORT SYMBOL("zlibCompileFlags") 65 | 66 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 67 | /* Version 1.2.4 additional entry points. */ 68 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 69 | 70 | EXPORT SYMBOL("adler32_combine") 71 | EXPORT SYMBOL("adler32_combine64") 72 | EXPORT SYMBOL("crc32_combine") 73 | EXPORT SYMBOL("crc32_combine64") 74 | EXPORT SYMBOL("deflateSetHeader") 75 | EXPORT SYMBOL("deflateTune") 76 | EXPORT SYMBOL("gzbuffer") 77 | EXPORT SYMBOL("gzclose_r") 78 | EXPORT SYMBOL("gzclose_w") 79 | EXPORT SYMBOL("gzdirect") 80 | EXPORT SYMBOL("gzoffset") 81 | EXPORT SYMBOL("gzoffset64") 82 | EXPORT SYMBOL("gzopen64") 83 | EXPORT SYMBOL("gzseek64") 84 | EXPORT SYMBOL("gztell64") 85 | EXPORT SYMBOL("inflateGetHeader") 86 | EXPORT SYMBOL("inflateMark") 87 | EXPORT SYMBOL("inflatePrime") 88 | EXPORT SYMBOL("inflateReset2") 89 | EXPORT SYMBOL("inflateUndermine") 90 | 91 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 92 | /* Version 1.2.6 additional entry points. */ 93 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 94 | 95 | EXPORT SYMBOL("deflateResetKeep") 96 | EXPORT SYMBOL("gzgetc_") 97 | EXPORT SYMBOL("inflateResetKeep") 98 | 99 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 100 | /* Version 1.2.8 additional entry points. */ 101 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 102 | 103 | EXPORT SYMBOL("gzvprintf") 104 | EXPORT SYMBOL("inflateGetDictionary") 105 | 106 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 107 | /* Version 1.2.9 additional entry points. */ 108 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ 109 | 110 | EXPORT SYMBOL("adler32_z") 111 | EXPORT SYMBOL("crc32_z") 112 | EXPORT SYMBOL("deflateGetDictionary") 113 | EXPORT SYMBOL("gzfread") 114 | EXPORT SYMBOL("gzfwrite") 115 | EXPORT SYMBOL("inflateCodesUsed") 116 | EXPORT SYMBOL("inflateValidate") 117 | EXPORT SYMBOL("uncompress2") 118 | 119 | ENDPGMEXP 120 | -------------------------------------------------------------------------------- /zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {07934a85-8b61-443d-a0ee-b2eedb74f3cd} 6 | cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90 7 | 8 | 9 | {1d99675b-433d-4a21-9e50-ed4ab8b19762} 10 | h;hpp;hxx;hm;inl;fi;fd 11 | 12 | 13 | {431c0958-fa71-44d0-9084-2d19d100c0cc} 14 | ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | 80 | 81 | Source Files 82 | 83 | 84 | 85 | 86 | Source Files 87 | 88 | 89 | 90 | 91 | Header Files 92 | 93 | 94 | Header Files 95 | 96 | 97 | Header Files 98 | 99 | 100 | Header Files 101 | 102 | 103 | Header Files 104 | 105 | 106 | Header Files 107 | 108 | 109 | Header Files 110 | 111 | 112 | Header Files 113 | 114 | 115 | Header Files 116 | 117 | 118 | -------------------------------------------------------------------------------- /AddOn/zopt_inffast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "zopt_defs.h" 4 | 5 | #if defined(INFFAST_OPT) 6 | 7 | #if defined(__SSE2__) 8 | #include 9 | #endif 10 | 11 | #if defined __arm64__ 12 | #include 13 | #endif 14 | 15 | #define INFLATE_INLINE static inline __attribute__((__always_inline__)) __attribute__((__overloadable__)) 16 | 17 | #ifndef __has_builtin 18 | # define __has_builtin(x) 0 19 | #endif 20 | 21 | #if __has_builtin(__builtin_expect) 22 | # define likely(x) __builtin_expect((x),1) 23 | # define unlikely(x) __builtin_expect((x),0) 24 | #else 25 | # define likely(x) (x) 26 | # define unlikely(x) (x) 27 | #endif 28 | 29 | #pragma mark - MATCH COPY 30 | 31 | // Shuffle vector X using permutation PERM. 32 | INFLATE_INLINE vector_uchar16 inflate_shuffle(vector_uchar16 x, vector_uchar16 perm) // OK 33 | { 34 | #if defined(__SSE2__) 35 | return _mm_shuffle_epi8(x, perm); 36 | #elif defined(__arm64__) 37 | return vqtbl1q_u8(x, perm); 38 | #endif 39 | } 40 | 41 | // Copy 1-15 bytes from SRC to DST. 42 | INFLATE_INLINE void inflate_copy_tail(uint8_t* dst, const uint8_t* src, uint32_t len) // OK 43 | { 44 | if (len & 1) { *dst++ = *src++; } 45 | if (len & 2) { *(packed_uint16_t*)dst = *(packed_uint16_t*)src; src += 2; dst += 2; } 46 | if (len & 4) { *(packed_uint32_t*)dst = *(packed_uint32_t*)src; src += 4; dst += 4; } 47 | if (len & 8) { *(packed_uint64_t*)dst = *(packed_uint64_t*)src; src += 8; dst += 8; } 48 | } 49 | 50 | // Copy LEN bytes from DST-DISTANCE to DST with overlap. 51 | INFLATE_INLINE void inflate_copy_with_overlap(uint8_t* dst, uint32_t distance, uint32_t len) // OK 52 | { 53 | #if defined(__SSE2__) || defined(__arm64__) 54 | const static vector_uchar16 repeat_perm[16] = { 55 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 56 | {15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15}, 57 | {14,15,14,15,14,15,14,15,14,15,14,15,14,15,14,15}, 58 | {13,14,15,13,14,15,13,14,15,13,14,15,13,14,15,13}, 59 | {12,13,14,15,12,13,14,15,12,13,14,15,12,13,14,15}, 60 | {11,12,13,14,15,11,12,13,14,15,11,12,13,14,15,11}, 61 | {10,11,12,13,14,15,10,11,12,13,14,15,10,11,12,13}, 62 | { 9,10,11,12,13,14,15, 9,10,11,12,13,14,15, 9,10}, 63 | { 8, 9,10,11,12,13,14,15, 8, 9,10,11,12,13,14,15}, 64 | { 7, 8, 9,10,11,12,13,14,15, 7, 8, 9,10,11,12,13}, 65 | { 6, 7, 8, 9,10,11,12,13,14,15, 6, 7, 8, 9,10,11}, 66 | { 5, 6, 7, 8, 9,10,11,12,13,14,15, 5, 6, 7, 8, 9}, 67 | { 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 4, 5, 6, 7}, 68 | { 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 3, 4, 5}, 69 | { 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 2, 3}, 70 | { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 1} 71 | }; 72 | const static uint8_t repeat_distance[16] = {0,1+16,2+16,3+15,4+16,5+15,6+12,7+14,8+16,9+9,10+10,11+11,12+12,13+13,14+14,15+15}; 73 | 74 | // Small overlap? 75 | if (distance < 16) 76 | { 77 | const vector_uchar16 pattern = inflate_shuffle(*(packed_uchar16*)(dst - 16), repeat_perm[distance]); 78 | 79 | // Small length? 80 | if (likely(len < 16)) 81 | { 82 | inflate_copy_tail(dst, (const uint8_t*)&pattern, len); 83 | return; 84 | } 85 | 86 | // Copy pattern and transition to distance >= 16 87 | *(packed_uchar16*)dst = pattern; 88 | len -= 16; 89 | dst += 16; 90 | distance = repeat_distance[distance]; 91 | } 92 | 93 | // Copy vectors with distance >= 16 94 | for (; len >= 16; len -= 16) 95 | { 96 | *(packed_uchar16*)dst = *(packed_uchar16*)(dst - distance); 97 | dst += 16; 98 | } 99 | // Copy tail 100 | inflate_copy_tail(dst, dst - distance, len); 101 | #else 102 | for (; len > 0; len--, dst++) *dst = *(dst - distance); 103 | #endif 104 | } 105 | 106 | // Copy w/o overlap with <= 15 bytes left excess. Does NEVER write beyond DST+LEN. 107 | INFLATE_INLINE void inflate_copy_without_overlap(uint8_t* dst, const uint8_t* src, uint32_t len) // OK 108 | { 109 | const uint32_t left_excess = -len & 15; 110 | uint8_t* left = dst - 16; 111 | dst -= left_excess; // NEVER write beyond DST+LEN 112 | src -= left_excess; 113 | 114 | // Save context 115 | const vector_uchar16 save_left = *(packed_uchar16*)left; 116 | 117 | // Copy first 16 bytes 118 | *(packed_uchar16*)dst = *(packed_uchar16*)src; 119 | 120 | // Copy remaining vectors 121 | for (; len > 16; len -= 16) 122 | { 123 | dst += 16; 124 | src += 16; 125 | *(packed_uchar16*)dst = *(packed_uchar16*)src; 126 | } 127 | 128 | // Restore context 129 | *(packed_uchar16*)left = save_left; 130 | } 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /zlib/zlib2ansi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Transform K&R C function definitions into ANSI equivalent. 4 | # 5 | # Author: Paul Marquess 6 | # Version: 1.0 7 | # Date: 3 October 2006 8 | 9 | # TODO 10 | # 11 | # Asumes no function pointer parameters. unless they are typedefed. 12 | # Assumes no literal strings that look like function definitions 13 | # Assumes functions start at the beginning of a line 14 | 15 | use strict; 16 | use warnings; 17 | 18 | local $/; 19 | $_ = <>; 20 | 21 | my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments 22 | 23 | my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ; 24 | my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ; 25 | my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ; 26 | 27 | 28 | while (s/^ 29 | ( # Start $1 30 | ( # Start $2 31 | .*? # Minimal eat content 32 | ( ^ \w [\w\s\*]+ ) # $3 -- function name 33 | \s* # optional whitespace 34 | ) # $2 - Matched up to before parameter list 35 | 36 | \( \s* # Literal "(" + optional whitespace 37 | ( [^\)]+ ) # $4 - one or more anythings except ")" 38 | \s* \) # optional whitespace surrounding a Literal ")" 39 | 40 | ( (?: $dList )+ ) # $5 41 | 42 | $sp ^ { # literal "{" at start of line 43 | ) # Remember to $1 44 | //xsom 45 | ) 46 | { 47 | my $all = $1 ; 48 | my $prefix = $2; 49 | my $param_list = $4 ; 50 | my $params = $5; 51 | 52 | StripComments($params); 53 | StripComments($param_list); 54 | $param_list =~ s/^\s+//; 55 | $param_list =~ s/\s+$//; 56 | 57 | my $i = 0 ; 58 | my %pList = map { $_ => $i++ } 59 | split /\s*,\s*/, $param_list; 60 | my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ; 61 | 62 | my @params = split /\s*;\s*/, $params; 63 | my @outParams = (); 64 | foreach my $p (@params) 65 | { 66 | if ($p =~ /,/) 67 | { 68 | my @bits = split /\s*,\s*/, $p; 69 | my $first = shift @bits; 70 | $first =~ s/^\s*//; 71 | push @outParams, $first; 72 | $first =~ /^(\w+\s*)/; 73 | my $type = $1 ; 74 | push @outParams, map { $type . $_ } @bits; 75 | } 76 | else 77 | { 78 | $p =~ s/^\s+//; 79 | push @outParams, $p; 80 | } 81 | } 82 | 83 | 84 | my %tmp = map { /$pMatch/; $_ => $pList{$1} } 85 | @outParams ; 86 | 87 | @outParams = map { " $_" } 88 | sort { $tmp{$a} <=> $tmp{$b} } 89 | @outParams ; 90 | 91 | print $prefix ; 92 | print "(\n" . join(",\n", @outParams) . ")\n"; 93 | print "{" ; 94 | 95 | } 96 | 97 | # Output any trailing code. 98 | print ; 99 | exit 0; 100 | 101 | 102 | sub StripComments 103 | { 104 | 105 | no warnings; 106 | 107 | # Strip C & C++ coments 108 | # From the perlfaq 109 | $_[0] =~ 110 | 111 | s{ 112 | /\* ## Start of /* ... */ comment 113 | [^*]*\*+ ## Non-* followed by 1-or-more *'s 114 | ( 115 | [^/*][^*]*\*+ 116 | )* ## 0-or-more things which don't start with / 117 | ## but do end with '*' 118 | / ## End of /* ... */ comment 119 | 120 | | ## OR C++ Comment 121 | // ## Start of C++ comment // 122 | [^\n]* ## followed by 0-or-more non end of line characters 123 | 124 | | ## OR various things which aren't comments: 125 | 126 | ( 127 | " ## Start of " ... " string 128 | ( 129 | \\. ## Escaped char 130 | | ## OR 131 | [^"\\] ## Non "\ 132 | )* 133 | " ## End of " ... " string 134 | 135 | | ## OR 136 | 137 | ' ## Start of ' ... ' string 138 | ( 139 | \\. ## Escaped char 140 | | ## OR 141 | [^'\\] ## Non '\ 142 | )* 143 | ' ## End of ' ... ' string 144 | 145 | | ## OR 146 | 147 | . ## Anything other char 148 | [^/"'\\]* ## Chars which doesn't start a comment, string or escape 149 | ) 150 | }{$2}gxs; 151 | 152 | } 153 | -------------------------------------------------------------------------------- /zlib/old/os2/Makefile.os2: -------------------------------------------------------------------------------- 1 | # Makefile for zlib under OS/2 using GCC (PGCC) 2 | # For conditions of distribution and use, see copyright notice in zlib.h 3 | 4 | # To compile and test, type: 5 | # cp Makefile.os2 .. 6 | # cd .. 7 | # make -f Makefile.os2 test 8 | 9 | # This makefile will build a static library z.lib, a shared library 10 | # z.dll and a import library zdll.lib. You can use either z.lib or 11 | # zdll.lib by specifying either -lz or -lzdll on gcc's command line 12 | 13 | CC=gcc -Zomf -s 14 | 15 | CFLAGS=-O6 -Wall 16 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 17 | #CFLAGS=-g -DZLIB_DEBUG 18 | #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 19 | # -Wstrict-prototypes -Wmissing-prototypes 20 | 21 | #################### BUG WARNING: ##################### 22 | ## infcodes.c hits a bug in pgcc-1.0, so you have to use either 23 | ## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem) 24 | ## This bug is reportedly fixed in pgcc >1.0, but this was not tested 25 | CFLAGS+=-fno-force-mem 26 | 27 | LDFLAGS=-s -L. -lzdll -Zcrtdll 28 | LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll 29 | 30 | VER=1.1.0 31 | ZLIB=z.lib 32 | SHAREDLIB=z.dll 33 | SHAREDLIBIMP=zdll.lib 34 | LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP) 35 | 36 | AR=emxomfar cr 37 | IMPLIB=emximp 38 | RANLIB=echo 39 | TAR=tar 40 | SHELL=bash 41 | 42 | prefix=/usr/local 43 | exec_prefix = $(prefix) 44 | 45 | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 46 | zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o 47 | 48 | TEST_OBJS = example.o minigzip.o 49 | 50 | DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ 51 | algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ 52 | nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \ 53 | contrib/asm386/*.asm contrib/asm386/*.c \ 54 | contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ 55 | contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \ 56 | contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 57 | 58 | all: example.exe minigzip.exe 59 | 60 | test: all 61 | @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ 62 | echo hello world | ./minigzip | ./minigzip -d || \ 63 | echo ' *** minigzip test FAILED ***' ; \ 64 | if ./example; then \ 65 | echo ' *** zlib test OK ***'; \ 66 | else \ 67 | echo ' *** zlib test FAILED ***'; \ 68 | fi 69 | 70 | $(ZLIB): $(OBJS) 71 | $(AR) $@ $(OBJS) 72 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 73 | 74 | $(SHAREDLIB): $(OBJS) os2/z.def 75 | $(LDSHARED) -o $@ $^ 76 | 77 | $(SHAREDLIBIMP): os2/z.def 78 | $(IMPLIB) -o $@ $^ 79 | 80 | example.exe: example.o $(LIBS) 81 | $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 82 | 83 | minigzip.exe: minigzip.o $(LIBS) 84 | $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) 85 | 86 | clean: 87 | rm -f *.o *~ example minigzip libz.a libz.so* foo.gz 88 | 89 | distclean: clean 90 | 91 | zip: 92 | mv Makefile Makefile~; cp -p Makefile.in Makefile 93 | rm -f test.c ztest*.c 94 | v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ 95 | zip -ul9 zlib$$v $(DISTFILES) 96 | mv Makefile~ Makefile 97 | 98 | dist: 99 | mv Makefile Makefile~; cp -p Makefile.in Makefile 100 | rm -f test.c ztest*.c 101 | d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ 102 | rm -f $$d.tar.gz; \ 103 | if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ 104 | files=""; \ 105 | for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ 106 | cd ..; \ 107 | GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \ 108 | if test ! -d $$d; then rm -f $$d; fi 109 | mv Makefile~ Makefile 110 | 111 | tags: 112 | etags *.[ch] 113 | 114 | depend: 115 | makedepend -- $(CFLAGS) -- *.[ch] 116 | 117 | # DO NOT DELETE THIS LINE -- make depend depends on it. 118 | 119 | adler32.o: zlib.h zconf.h 120 | compress.o: zlib.h zconf.h 121 | crc32.o: zlib.h zconf.h 122 | deflate.o: deflate.h zutil.h zlib.h zconf.h 123 | example.o: zlib.h zconf.h 124 | gzio.o: zutil.h zlib.h zconf.h 125 | infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h 126 | infcodes.o: zutil.h zlib.h zconf.h 127 | infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h 128 | inffast.o: zutil.h zlib.h zconf.h inftrees.h 129 | inffast.o: infblock.h infcodes.h infutil.h inffast.h 130 | inflate.o: zutil.h zlib.h zconf.h infblock.h 131 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h 132 | infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 133 | minigzip.o: zlib.h zconf.h 134 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 135 | uncompr.o: zlib.h zconf.h 136 | zutil.o: zutil.h zlib.h zconf.h 137 | --------------------------------------------------------------------------------