├── .gitignore ├── .vscode └── launch.json ├── CMakeLists.txt ├── CMakeSettings.json ├── LICENSE ├── README.md ├── auctionmatrix.h ├── bionj.cpp ├── bionj2.cpp ├── bionj2.h ├── clustertree.h ├── copy_to_iqtree2_master.sh ├── decentTree.sln ├── decentTree.vcxproj ├── decenttree.cpp ├── decenttree_config.h.in ├── decenttree_msvc_config.h ├── decenttree_update.sh ├── distancematrix.h ├── doco ├── API_Reference.md ├── Algorithms.md ├── Code_Examples.md ├── Command_Line_Examples.md ├── Compilation.md ├── Compilation_on_Linux.md ├── Compilation_on_MacOS_X.md ├── Compilation_on_Windows.md ├── Installation.md ├── Running_DecentTree.md └── pydecenttree.md ├── example ├── 3x3.phy ├── CMakeLists.txt ├── compressed_example.dist.gz ├── compressed_example.phy.gz ├── differentvector.cpp ├── example.dist ├── example.phy ├── example_matrix.cpp ├── example_matrix.h ├── fakevector.h ├── headeronlydecenttree.cpp ├── interleaved_example.phy ├── simulated_1k.fa.gz ├── uncorrected.dist └── vectordecenttree.cpp ├── executables └── mac_os │ └── wintel_13.2.1 │ ├── decenttree.gz │ └── pydecenttree.cpython-311-darwin.so.gz ├── fancyrapidnj.h ├── flatmatrix.cpp ├── flatmatrix.h ├── hashrow.h ├── headeronlydecenttree.cpp ├── iqtree_config.h.in ├── lib ├── libiomp5md.dll ├── libomp.a ├── libompstatic.a ├── pthreadGC2.dll ├── pthreadGC2_64.dll ├── pthreadVC2.dll └── pthreadVC2.lib ├── lib32 ├── libiomp5md.dll ├── libiomp5md.lib.dll ├── libomp.a ├── pthreadVC2.dll └── pthreadVC2.lib ├── libmac └── libomp.a ├── nj.h ├── omp.h ├── pydecenttree ├── CMakeLists.txt ├── __init__.py ├── pydecenttree.cpp ├── setup.py └── test_pydecenttree.py ├── rapidnj.h ├── sequence.cpp ├── sequence.h ├── starttree.cpp ├── starttree.h ├── stitchup.cpp ├── upgma.h ├── utils ├── argument.cpp ├── argument.h ├── gzstream.cpp ├── gzstream.h ├── hammingdistance.h ├── heapsort.h ├── my_assert.h ├── operatingsystem.cpp ├── operatingsystem.h ├── parallel_mergesort.h ├── parallel_sort.h ├── progress.cpp ├── progress.h ├── safe_io.h ├── stringfunctions.cpp ├── stringfunctions.h ├── timeutil.h ├── vectortypes.cpp └── vectortypes.h ├── vectorclass ├── CMakeLists.txt ├── changelog.txt ├── instrset.h ├── instrset_detect.cpp ├── license.txt ├── vectorclass.h ├── vectorf128.h ├── vectorf256.h ├── vectorf256e.h ├── vectorf512.h ├── vectorf512e.h ├── vectorf64.h ├── vectori128.h ├── vectori256.h ├── vectori256e.h ├── vectori512.h ├── vectori512e.h ├── vectormath_common.h ├── vectormath_exp.h ├── vectormath_hyp.h ├── vectormath_lib.h └── vectormath_trig.h └── zlib-1.2.7 ├── CMakeLists.txt ├── ChangeLog ├── FAQ ├── INDEX ├── Makefile ├── Makefile.in ├── README ├── adler32.c ├── amiga ├── Makefile.pup └── Makefile.sas ├── as400 ├── bndsrc ├── compile.clp ├── readme.txt └── zlib.inc ├── compress.c ├── configure ├── contrib ├── README.contrib ├── ada │ ├── buffer_demo.adb │ ├── mtest.adb │ ├── read.adb │ ├── readme.txt │ ├── test.adb │ ├── zlib-streams.adb │ ├── zlib-streams.ads │ ├── zlib-thin.adb │ ├── zlib-thin.ads │ ├── zlib.adb │ ├── zlib.ads │ └── zlib.gpr ├── amd64 │ └── amd64-match.S ├── asm686 │ ├── README.686 │ └── match.S ├── blast │ ├── Makefile │ ├── README │ ├── blast.c │ ├── blast.h │ ├── test.pk │ └── test.txt ├── delphi │ ├── ZLib.pas │ ├── ZLibConst.pas │ ├── readme.txt │ └── zlibd32.mak ├── dotzlib │ ├── DotZLib.build │ ├── DotZLib.chm │ ├── DotZLib.sln │ ├── DotZLib │ │ ├── AssemblyInfo.cs │ │ ├── ChecksumImpl.cs │ │ ├── CircularBuffer.cs │ │ ├── CodecBase.cs │ │ ├── Deflater.cs │ │ ├── DotZLib.cs │ │ ├── DotZLib.csproj │ │ ├── GZipStream.cs │ │ ├── Inflater.cs │ │ └── UnitTests.cs │ ├── LICENSE_1_0.txt │ └── readme.txt ├── gcc_gvmat64 │ └── gvmat64.S ├── infback9 │ ├── README │ ├── infback9.c │ ├── infback9.h │ ├── inffix9.h │ ├── inflate9.h │ ├── inftree9.c │ └── inftree9.h ├── inflate86 │ ├── inffas86.c │ └── inffast.S ├── iostream │ ├── test.cpp │ ├── zfstream.cpp │ └── zfstream.h ├── iostream2 │ ├── zstream.h │ └── zstream_test.cpp ├── iostream3 │ ├── README │ ├── TODO │ ├── test.cc │ ├── zfstream.cc │ └── zfstream.h ├── masmx64 │ ├── bld_ml64.bat │ ├── gvmat64.asm │ ├── inffas8664.c │ ├── inffasx64.asm │ └── readme.txt ├── masmx86 │ ├── bld_ml32.bat │ ├── inffas32.asm │ ├── match686.asm │ └── readme.txt ├── minizip │ ├── Makefile │ ├── Makefile.am │ ├── MiniZip64_Changes.txt │ ├── MiniZip64_info.txt │ ├── configure.ac │ ├── crypt.h │ ├── ioapi.c │ ├── ioapi.h │ ├── iowin32.c │ ├── iowin32.h │ ├── make_vms.com │ ├── miniunz.c │ ├── minizip.c │ ├── minizip.pc.in │ ├── mztools.c │ ├── mztools.h │ ├── unzip.c │ ├── unzip.h │ ├── zip.c │ └── zip.h ├── pascal │ ├── example.pas │ ├── readme.txt │ ├── zlibd32.mak │ └── zlibpas.pas ├── puff │ ├── Makefile │ ├── README │ ├── puff.c │ ├── puff.h │ ├── pufftest.c │ └── zeros.raw ├── testzlib │ ├── testzlib.c │ └── testzlib.txt ├── untgz │ ├── Makefile │ ├── Makefile.msc │ └── untgz.c └── vstudio │ ├── readme.txt │ ├── vc10 │ ├── miniunz.vcxproj │ ├── miniunz.vcxproj.filters │ ├── miniunz.vcxproj.user │ ├── minizip.vcxproj │ ├── minizip.vcxproj.filters │ ├── minizip.vcxproj.user │ ├── testzlib.vcxproj │ ├── testzlib.vcxproj.filters │ ├── testzlib.vcxproj.user │ ├── testzlibdll.vcxproj │ ├── testzlibdll.vcxproj.filters │ ├── testzlibdll.vcxproj.user │ ├── zlib.rc │ ├── zlibstat.vcxproj │ ├── zlibstat.vcxproj.filters │ ├── zlibstat.vcxproj.user │ ├── zlibvc.def │ ├── zlibvc.sln │ ├── zlibvc.vcxproj │ ├── zlibvc.vcxproj.filters │ └── zlibvc.vcxproj.user │ └── vc9 │ ├── miniunz.vcproj │ ├── minizip.vcproj │ ├── testzlib.vcproj │ ├── testzlibdll.vcproj │ ├── zlib.rc │ ├── zlibstat.vcproj │ ├── zlibvc.def │ ├── zlibvc.sln │ └── zlibvc.vcproj ├── crc32.c ├── crc32.h ├── deflate.c ├── deflate.h ├── doc ├── algorithm.txt ├── rfc1950.txt ├── rfc1951.txt ├── rfc1952.txt └── txtvsbin.txt ├── examples ├── README.examples ├── enough.c ├── fitblk.c ├── gun.c ├── gzappend.c ├── gzjoin.c ├── gzlog.c ├── gzlog.h ├── zlib_how.html ├── zpipe.c └── zran.c ├── gzclose.c ├── gzguts.h ├── gzlib.c ├── gzread.c ├── gzwrite.c ├── infback.c ├── inffast.c ├── inffast.h ├── inffixed.h ├── inflate.c ├── inflate.h ├── inftrees.c ├── inftrees.h ├── make_vms.com ├── msdos ├── Makefile.bor ├── Makefile.dj2 ├── Makefile.emx ├── Makefile.msc └── Makefile.tc ├── nintendods ├── Makefile └── README ├── old ├── Makefile.emx ├── Makefile.riscos ├── README ├── descrip.mms ├── os2 │ ├── Makefile.os2 │ └── zlib.def └── visual-basic.txt ├── qnx └── package.qpg ├── test ├── example.c ├── infcover.c └── minigzip.c ├── treebuild.xml ├── trees.c ├── trees.h ├── uncompr.c ├── watcom ├── watcom_f.mak └── watcom_l.mak ├── win32 ├── DLL_FAQ.txt ├── Makefile.bor ├── Makefile.gcc ├── Makefile.msc ├── README-WIN32.txt ├── VisualC.txt ├── zlib.def └── zlib1.rc ├── zconf.h.cmakein ├── zconf.h.in ├── zconf.h.included ├── zlib.3 ├── zlib.3.pdf ├── zlib.h ├── zlib.map ├── zlib.pc.cmakein ├── zlib.pc.in ├── zlib2ansi ├── zutil.c └── zutil.h /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .cproject 3 | .settings 4 | .project 5 | .vs 6 | x64 7 | Debug 8 | build/ 9 | decentTree.vcxproj.user 10 | james_notes.txt 11 | pydecenttree/dist 12 | pydecenttree/pydecenttree.egg-info 13 | copy_to_iqtree2_dev.sh -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "decenttree", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${workspaceRoot}/build/decenttree", 12 | "args": [ "-in", "../example/example.dist", 13 | "-out", "nj.newick", 14 | "-t", "NJ", "-nt", "16", 15 | "-no-banner"], 16 | "cwd": "${workspaceRoot}/build", 17 | "externalConsole": false, 18 | 19 | //Windows and gcc 20 | //"MIMode": "gdb", 21 | //"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe" 22 | 23 | //Windows and Clang 24 | //"MIMode": "lldb", 25 | //"miDebuggerPath": "D:\\VisualStudioCode\\mingw\bin\\gdb.exe" 26 | 27 | "environment": [] 28 | }, 29 | { 30 | "name": "dmatrix", 31 | "type": "cppdbg", 32 | "request": "launch", 33 | "program": "${workspaceRoot}/build/decenttree", 34 | "args": [ "-phylip", "../example/example.phy", 35 | "-dist-out", "example2.dist", 36 | "-uncorrected", 37 | "-out-format", "lower", 38 | "-no-banner", "-no-out", "-t", "NONE"], 39 | "cwd": "${workspaceRoot}/build", 40 | "externalConsole": false, 41 | 42 | //Windows and gcc 43 | //"MIMode": "gdb", 44 | //"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe" 45 | 46 | //MacOS: 47 | //"MIMode": "lldb" 48 | "environment": [] 49 | }, 50 | 51 | { 52 | "name": "differentvector", 53 | "type": "cppdbg", 54 | "request": "launch", 55 | "program": "${workspaceRoot}/build/example/differentvector", 56 | "args": [], 57 | "stopAtEntry": false, 58 | "cwd": "${workspaceRoot}/build/example", 59 | "externalConsole": false, 60 | //MacOS: 61 | //"MIMode": "lldb" 62 | "environment": [] 63 | 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "-DDECENTTREE_FLAGS=avx", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "", 13 | "variables": [] 14 | }, 15 | { 16 | "name": "x64-Release", 17 | "generator": "Ninja", 18 | "configurationType": "RelWithDebInfo", 19 | "buildRoot": "${projectDir}\\out\\build\\${name}", 20 | "installRoot": "${projectDir}\\out\\install\\${name}", 21 | "cmakeCommandArgs": "-DDECENTTREE_FLAGS=avx", 22 | "buildCommandArgs": "", 23 | "ctestCommandArgs": "", 24 | "inheritEnvironments": [ "msvc_x64_x64" ], 25 | "variables": [] 26 | }, 27 | { 28 | "name": "x64-Clang-Debug", 29 | "generator": "Ninja", 30 | "configurationType": "Debug", 31 | "buildRoot": "${projectDir}\\out\\build\\${name}", 32 | "installRoot": "${projectDir}\\out\\install\\${name}", 33 | "cmakeCommandArgs": "-DDECENTTREE_FLAGS=avx", 34 | "buildCommandArgs": "", 35 | "ctestCommandArgs": "", 36 | "inheritEnvironments": [ "clang_cl_x64" ], 37 | "variables": [] 38 | }, 39 | { 40 | "name": "x64-Clang-Release", 41 | "generator": "Ninja", 42 | "configurationType": "RelWithDebInfo", 43 | "buildRoot": "${projectDir}\\out\\build\\${name}", 44 | "installRoot": "${projectDir}\\out\\install\\${name}", 45 | "cmakeCommandArgs": "-DDECENTTREE_FLAGS=avx", 46 | "buildCommandArgs": "", 47 | "ctestCommandArgs": "", 48 | "inheritEnvironments": [ "clang_cl_x64" ], 49 | "variables": [] 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /auctionmatrix.h: -------------------------------------------------------------------------------- 1 | // 2 | // auctionmatrix.h 3 | // iqtree 4 | // 5 | // Created by James Barbetti on 14/11/20. 6 | // 7 | 8 | #ifndef auctionmatrix_h 9 | #define auctionmatrix_h 10 | 11 | #include "rapidnj.h" 12 | 13 | namespace StartTree { 14 | template > 15 | class AuctionMatrix: public BoundingMatrix { 16 | // 17 | //A reverse auction algorithm: each row "bids" to be clustered 18 | //(lowest bid wins) based on the difference between the best join 19 | //involving it (and another lower-numbered cluster) and the 20 | //second-best. if there aren't two lower-numbered clusters, 21 | //no bid is placed (infiniteDistance is returned). 22 | // 23 | //This is a little faster than actually looking at all of the 24 | //distances! And it practice, yields answers that aren't that 25 | //much worse. 26 | // 27 | public: 28 | typedef StartTree::BoundingMatrix super; 29 | using super::clusterToRow; 30 | using super::entryToCluster; 31 | using super::entriesSorted; 32 | using super::purgeRow; 33 | virtual std::string getAlgorithmName() const override { 34 | return "Auction" + M::getAlgorithmName(); 35 | } 36 | virtual StartTree::Position getRowMinimum(intptr_t row, T maxTot, T qBest) const override { 37 | StartTree::Position pos(row, 0, infiniteDistance, 0); 38 | const T* rowData = entriesSorted.rows[row]; 39 | const int* toCluster = entryToCluster.rows[row]; 40 | size_t i = 0; 41 | int bestOtherRow; 42 | for (i=0; rowData[i]> DistanceAuctionMatrix; 70 | } 71 | 72 | #endif /* auctionmatrix_h */ 73 | -------------------------------------------------------------------------------- /bionj2.h: -------------------------------------------------------------------------------- 1 | // 2 | // bionj2.h 3 | // alignment 4 | // 5 | // Created by James Barbetti on 18/6/20. 6 | // 7 | 8 | #ifndef bionj2_h 9 | #define bionj2_h 10 | 11 | #include 12 | #include 13 | class BIONJ2 14 | { 15 | public: 16 | void constructTree 17 | ( const std::string &distanceMatrixFilePath 18 | , const std::string & newickTreeFilePath); 19 | void constructTreeRapid 20 | ( const std::string &distanceMatrixFilePath 21 | , const std::string & newickTreeFilePath); 22 | }; 23 | 24 | #endif /* bionj2_hpp */ 25 | -------------------------------------------------------------------------------- /copy_to_iqtree2_master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #Copies the current versions of files to iqtree2 (dev branch). 3 | #Opposite of decenttree_update.sh 4 | # 5 | export DMT=../iqtree_master/distancematrixtree 6 | cp decenttree.cpp flatmatrix.cpp flatmatrix.h starttree.cpp starttree.h ${DMT} 7 | cp bionj.cpp bionj2.cpp bionj2.h upgma.h nj.h rapidnj.h auctionmatrix.h ${DMT} 8 | cp clustertree.h distancematrix.h stitchup.cpp sequence.cpp sequence.h ${DMT} 9 | cp hashrow.h fancyrapidnj.h ${DMT} 10 | cd utils 11 | export UTILS=../../iqtree_master/utils 12 | cp argument.cpp argument.h ${UTILS} 13 | cp gzstream.cpp gzstream.h heapsort.h ${UTILS} 14 | cp progress.cpp progress.h ${UTILS} 15 | cp operatingsystem.cpp operatingsystem.h ${UTILS} 16 | cp timeutil.h my_assert.h safe_io.h ${UTILS} 17 | cp parallel_mergesort.h parallel_sort.h ${UTILS} 18 | cp vectortypes.cpp vectortypes.h ${UTILS} 19 | cp hammingdistance.h ${UTILS} 20 | cp stringfunctions.h stringfunctions.cpp ${UTILS} 21 | cd .. 22 | -------------------------------------------------------------------------------- /decentTree.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30413.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decentTree", "decentTree.vcxproj", "{029CAE61-6032-4F2E-ADCC-4B632EB5C531}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Debug|x64.ActiveCfg = Debug|x64 17 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Debug|x64.Build.0 = Debug|x64 18 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Debug|x86.ActiveCfg = Debug|Win32 19 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Debug|x86.Build.0 = Debug|Win32 20 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Release|x64.ActiveCfg = Release|x64 21 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Release|x64.Build.0 = Release|x64 22 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Release|x86.ActiveCfg = Release|Win32 23 | {029CAE61-6032-4F2E-ADCC-4B632EB5C531}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {514FB501-D6DE-414F-ADEB-D47617145553} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /decenttree_config.h.in: -------------------------------------------------------------------------------- 1 | #define decenttree_VERSION_MAJOR @decenttree_VERSION_MAJOR@ 2 | #define decenttree_VERSION_MINOR @decenttree_VERSION_MINOR@ 3 | #define decenttree_VERSION_PATCH "@decenttree_VERSION_PATCH@" 4 | 5 | /* does the platform provide gettimeofday functions? */ 6 | #cmakedefine HAVE_GETTIMEOFDAY 7 | /* does the platform provide getrusage functions? */ 8 | #cmakedefine HAVE_GETRUSAGE 9 | /* does the platform provide popen functions? */ 10 | /*#cmakedefine HAVE_POPEN*/ 11 | /* does the platform provide pclose functions? */ 12 | /*#cmakedefine HAVE_PCLOSE*/ 13 | /* does the platform provide GlobalMemoryStatusEx functions? */ 14 | #cmakedefine HAVE_GLOBALMEMORYSTATUSEX 15 | #cmakedefine HAVE_STRNDUP 16 | #cmakedefine HAVE_STRTOK_R 17 | 18 | /* does the platform provide backtrace functions? */ 19 | #cmakedefine Backtrace_FOUND 20 | -------------------------------------------------------------------------------- /decenttree_msvc_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define decenttree_VERSION_MAJOR 1 3 | #define decenttree_VERSION_MINOR 0 4 | #define decenttree_VERSION_PATCH "0" 5 | -------------------------------------------------------------------------------- /decenttree_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | #Copies over the current versions of files from iqtree2 (dev branch). 4 | #Every source file, apart from: 5 | # 1. decenttree_config.h.in 6 | # 2. decentree_config.h 7 | # 3. decenttree_msvc_config.h 8 | # 4. headeronlydecenttree.cpp 9 | # 5. CMakeLists.txt 10 | # 6. CMakeSettings.json 11 | #. 7. This file (decenttree_update.sh) 12 | # 13 | cd ../iqtree2/distancematrixtree 14 | cp decenttree.cpp flatmatrix.cpp flatmatrix.h starttree.cpp starttree.h ../../decenttree 15 | cp bionj.cpp bionj2.cpp bionj2.h upgma.h nj.h rapidnj.h auctionmatrix.h ../../decenttree 16 | cp clustertree.h distancematrix.h stitchup.cpp sequence.cpp sequence.h ../../decenttree 17 | cp hashrow.h fancyrapidnj.h ../../decenttree 18 | cd ../utils 19 | cp argument.cpp argument.h ../../decenttree/utils 20 | cp gzstream.cpp gzstream.h heapsort.h ../../decenttree/utils 21 | cp progress.cpp progress.h ../../decenttree/utils 22 | cp operatingsystem.cpp operatingsystem.h ../../decenttree/utils 23 | cp timeutil.h my_assert.h safe_io.h ../../decenttree/utils 24 | cp parallel_mergesort.h parallel_sort.h ../../decenttree/utils 25 | cp vectortypes.cpp vectortypes.h ../../decenttree/utils 26 | cp hammingdistance.h ../../decenttree/utils 27 | cp stringfunctions.h stringfunctions.cpp ../../decenttree/utils 28 | cd .. 29 | cp -R zlib-1.2.7 ../decenttree 30 | cp -R lib ../decenttree 31 | cp -R lib32 ../decenttree 32 | cp -R libmac ../decenttree 33 | cp -R vectorclass ../decenttree 34 | cp iqtree_config.h.in ../decenttree 35 | cp LICENSE ../decenttree 36 | cd ../decentTree 37 | -------------------------------------------------------------------------------- /doco/Code_Examples.md: -------------------------------------------------------------------------------- 1 |

Code examples for decenttree

2 |

List of files

3 | 4 | |File|Content| 5 | |----|-------| 6 | | headeronlydecenttree.cpp | This example shows how to use decent tree as a header-only library. | 7 | | vectordecenttree.cpp | This example shows how to use one of decenttree's vectorized neighbour-joining algorithms (the vectorisation only works on Intel hardware) | 8 | | examplematrix.h
examplematrix.cpp | These two files define the example distance matrix that is used by headeronlydecenttree.cpp and vectordecenttree.cpp 9 | | fakevector.h
differentvector.cpp | These files illustrate how you could use a _different_ vector class implementation (on non-Wintel hardware) with decenttree. fakevector.h shows what member functions a class must support, if it is to be used to specialize the vectorized neighbour-joining algorithms in the decenttree library. | 10 | -------------------------------------------------------------------------------- /doco/Compilation.md: -------------------------------------------------------------------------------- 1 |

Compiling decenttree

2 |

Supported operating systems

3 | The decenttree command-line application can be built under Windows (using Microsoft Visual Studio or Clang, or GCC, with Microsoft Code), on Intel Macintosh (with Clang, or GCC), or on Linux (using GCC). 4 | As yet, it does not build (M1/M2) Apple Silicon. 5 | 6 | 7 | | Operating System | Hardware | For | You may need to | 8 | | ---------------- | -------- | --------------- | ---------- | 9 | | Macintosh | 64-bit | Parallelization | Link with libmac/libomp.a | 10 | | Unix/Linux | 64-bit | Parallelization | Link with lib/libomp.a or lib/libomp.a | 11 | | Unix/Linux. | 32-bit | Parallelization | Link with lib32/libomp.a | 12 | | Windows | 64-bit | Parallelization | Ensure that lib/libiomp5md.dll is in a folder in the PATH (if building with Microsoft Visual Studio)| 13 | | Windows | 32-bit | Parallelization | Ensure that lib32/libiomp5md.dll and lib32/libiomp5md.lib.dll are in the PATH (if building with Microsoft Visual Studio) | 14 | 15 |

Compiling on specific operating systems

16 | Instructions are (or will shortly be) available for compilying pydecenttree on the following operating systems: 17 | 18 | - [Macintosh OS X](Compilation_on_MacOS_X.md) 19 | - [Linux](Compilation_on_Linux.md) 20 | - [Windows](Compilation_on_Windows.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /doco/Compilation_on_Linux.md: -------------------------------------------------------------------------------- 1 |

Compiling decenttree on Linux

2 | These instructions have not yet been written. 3 | 4 | -------------------------------------------------------------------------------- /doco/Compilation_on_Windows.md: -------------------------------------------------------------------------------- 1 |

Compiling decenttree on Windows

2 | The easiest way to build decenttree is with Microsoft Visual Studio 2022 (Community Edition). It should be possible to build 32-bit or 64-bit versions (but 64-bit builds are recommended). 3 | 4 |

Compiling using Visual Studio

5 | decenttree has been built with Visual Studio 2017, 2019, and 2022. If you have Visual Studio (Community Edition) installed, this is the easiest way to build decenttree on Windows. [todo: explain how - it boils down to "point VS at the github repository and build!" but more detail would be good.] 6 |

Compiling using Visual Studio and Clang

7 |
8 | 9 |

Compiling using Microsoft Code

10 | 11 | You may need to download Ninja to get Clang and GCC builds to work, by downloading a recent version from the official Ninja website, and put that somewhere in your path (one of the folders listed by the PATH environment variable). 12 | 13 |

Compiling with Microsoft Code and Clang

14 | [todo: this bit not written yet. There are two different ways to do this, one where you build with a version of Clang that mimics the Microsoft C++ Compiler (badly), using the Microsoft include folders, and another where you build with a MingW version of Clang running in a pretend Linux environment, with its own include folders and Open MP libraries. I can't 15 | recommend either option! I had serious problems getting the Open MP libraries to link, and worse problems getting the vectorization to work!] 16 |

17 | 18 |

Compiling with Microsoft Code and GCC

19 |

Compiling with Microsoft Code and GCC 9.2

20 | Building decenttree on Windows with GCC 9.2 is not recommended. 21 | The compiler may not be installed with the OpenMP libraries that are needed (the problematic files are libgomp.a, libgomp.dll.a, libgomp.spec), which may may linking difficult. 22 |

23 |

Compiling with Microsoft Code and GCC 12.2

24 | At present (October 2022), the version of CMake that MS Code uses (3.23 or 3.24) doesn't automatically recognize the compiler. 25 | Builds may fail outright (with no error messages), due to missing DLLs (libisl-23.dll, for example) (the version number might vary). If you are installing GCC using MSYS2 and pacman you may find it necessary to copy files from c:\msys64\user\bin (where pacman puts them!) into c:\msys64\mingw64\bin (which is where pacman probably should put them, but might not). 26 |

27 |

Compiling with Microsoft Code and the Visual Studio Compiler

28 | On Windows 10 (and 11) workstations, decenttree will compile with Visual Studio 2017 through Visual Studio 2022. 29 | It's recommended that you compile 64 bit versions (using the - x86_amd64 rather than the - amd64_x86 compiler toolkit, if both choices are available). 30 | 31 | 32 | -------------------------------------------------------------------------------- /doco/Installation.md: -------------------------------------------------------------------------------- 1 |

Installing decenttree

2 |

MacOS

3 | On MacOS, the decenttree executable is statically linked, so it is ready to run as is (once you unzip it with gzip -d). 4 | 5 |

Windows

6 | On Windows, the decenttree executable is dynamically linked, with Open MP link libraries, so you will need to ensure that those are in the path. 7 | -------------------------------------------------------------------------------- /doco/Running_DecentTree.md: -------------------------------------------------------------------------------- 1 |

Running decenttree

2 |

Command-line options

3 | 4 | | Option | Argument | Description | 5 | | ------ | -------- | ----------- | 6 | | -nt | number (1 or more) | Specify number of threads of execution (if built with OMP) | 7 | | -no-banner | | Suppress banner | 8 | | -v | | Verbose output | 9 | | -bar | | Turns on the display of progress bars | 10 | | -q | | Silent | 11 | | -in | dist input file path | Supply path of a distance matrix file. | 12 | | -fasta | fasta input file path | Supply path of a fasta format file containing an alignment | 13 | | -phylip | phylip input file path | supply path of a phylip alignment file | 14 | | -uncorrected | | with -fasta, do not apply Jukes-Cantor distance correction to calculated distances | 15 | | -max-dist | number | specify the maximum distance that is to be allowed, when generating a distance matrix file (the default maximum is 10) | 16 | | -not-dna | | with -fasta, indicates input is (not) DNA | 17 | | -alphabet | list of characters | with -fasta, recognized nucleotide characters | 18 | | -unknown | list of characters | with -fasta, characters that indicate unknown | 19 | | -strip-name | list of characters | Characters to strip from taxon names (case sensitive) | 20 | | -name-replace | list of characters | Characters to replace the stripped characters with | 21 | | -truncate-name-at | list of characters | Truncate taxon name on one of these characters | 22 | | -num | | Replace all taxon names with numbered names of the form A_i_ (_i_ is taxon number, starting at 1) | 23 | | -filter | | with -fasta, Filter sequences that have zero distances | 24 | | -no-matrix | | with -fasta, save memory by *not* constructing the input matrix in memory (only has an effect with -t NONE) | 25 | | -msa-out | msa output file path | given -fasta or -phylip, rewrite alignment in msa format | 26 | | -dist | dist output file path | Supply path to which to write a distance matrix (makes sense with -in, -fasta or -phylip). Use STDOUT to write to standard output. | 27 | | -dist-out | distance matrix output file path | Synonym for -dist. | 28 | | -t | algorithm name | Specify the algorithm to use to construct the tree (or none) | 29 | | -out | newick output file path | Use STDOUT to write it to standard output | 30 | | -std-out | | Equivalent to -out STDOUT | 31 | | -no-out | | Do not generate a newick output file | 32 | | -gz | | Write outputs in gzip format | 33 | | -out-format | square, upper, lower | format for writing distance matrix output | 34 | | -f | number 1-15 | Digits of precision, to write in the output | 35 | | -c | number 0-9 | Compression level to use when writing gzip files | 36 | -------------------------------------------------------------------------------- /example/3x3.phy: -------------------------------------------------------------------------------- 1 | 3 3 2 | cat CAT 3 | tac TAC 4 | act ACT 5 | -------------------------------------------------------------------------------- /example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(hod_tree 2 | headeronlydecenttree.cpp example_matrix.cpp 3 | ../utils/progress.cpp ../utils/progress.h 4 | ../utils/operatingsystem.cpp ../utils/operatingsystem.h) 5 | 6 | add_executable(vectordecenttree 7 | vectordecenttree.cpp example_matrix.cpp 8 | ../utils/progress.cpp ../utils/progress.h 9 | ../utils/operatingsystem.cpp ../utils/operatingsystem.h) 10 | 11 | add_executable(differentvector 12 | differentvector.cpp example_matrix.cpp 13 | ../utils/progress.cpp ../utils/progress.h 14 | ../utils/operatingsystem.cpp ../utils/operatingsystem.h) 15 | 16 | -------------------------------------------------------------------------------- /example/compressed_example.dist.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/example/compressed_example.dist.gz -------------------------------------------------------------------------------- /example/compressed_example.phy.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/example/compressed_example.phy.gz -------------------------------------------------------------------------------- /example/differentvector.cpp: -------------------------------------------------------------------------------- 1 | #undef USE_PROGRESS_DISPLAY 2 | #undef USE_VECTORCLASS_LIBRARY 3 | #undef DECENT_TREE 4 | #undef USE_GZSTREAM 5 | #define USE_PROGRESS_DISPLAY 1 //Even though there's not much point on an input this small. 6 | #define USE_VECTORCLASS_LIBRARY 1 //For an input this small, vectorisation doesn't matter. 7 | #define DECENT_TREE 1 //Tells shared headers that decenttree, rather than 8 | //iqtree2, is being built. 9 | #define USE_GZSTREAM 0 //Don't need this, not zipping or unzipping 10 | 11 | #include "example_matrix.h" 12 | #include "fakevector.h" 13 | #include 14 | 15 | typedef StartTree::VectorizedBoundingMatrix 16 | 17 | MyVBM; 18 | 19 | int main(int argc, char* argv[]) { 20 | 21 | progress_display::setProgressDisplay(true); 22 | 23 | MyVBM r; 24 | std::istringstream input_file(example_matrix); 25 | loadDistanceMatrixFromOpenFile(input_file, false, r); 26 | r.constructTree(); 27 | 28 | int precision = 6; 29 | std::string newickTreeFilePath = "STDOUT"; 30 | r.writeTreeFile(precision, newickTreeFilePath); 31 | return 0; 32 | } -------------------------------------------------------------------------------- /example/example.dist: -------------------------------------------------------------------------------- 1 | 17 2 | LngfishAu 0.0000000 0.4394262 0.4253346 0.4739334 0.6469595 0.8072464 0.7697307 0.7867055 0.7850803 0.6959920 0.6336127 0.6997504 0.6793033 0.7120045 0.7344446 0.7318557 0.6820929 3 | LngfishSA 0.4394262 0.0000000 0.3370420 0.6028511 0.7361390 0.8116547 0.7978951 0.7651678 0.6988087 0.7598439 0.7003997 0.7643007 0.7378452 0.7195253 0.8065221 0.7439359 0.6178323 4 | LngfishAf 0.4253346 0.3370420 0.0000000 0.5921847 0.7020407 0.8573580 0.9137406 0.8639154 0.7878422 0.8294442 0.7505365 0.7882964 0.7551778 0.7706974 0.8561868 0.7818997 0.6850401 5 | Frog 0.4739334 0.6028511 0.5921847 0.0000000 0.6268957 0.8150864 0.7705955 0.8145647 0.7573321 0.7166360 0.6626602 0.6762896 0.6809187 0.7005612 0.7136883 0.6974592 0.6449470 6 | Turtle 0.6469595 0.7361390 0.7020407 0.6268957 0.0000000 0.5416702 0.5841215 0.5399763 0.4849490 0.5861821 0.5383720 0.5458270 0.5612534 0.5632785 0.6088667 0.5946969 0.5778748 7 | Sphenodon 0.8072464 0.8116547 0.8573580 0.8150864 0.5416702 0.0000000 0.6723304 0.6249144 0.5897511 0.6946471 0.6787380 0.6565584 0.6772154 0.6833316 0.7476896 0.7240949 0.6518428 8 | Lizard 0.7697307 0.7978951 0.9137406 0.7705955 0.5841215 0.6723304 0.0000000 0.7160903 0.6480652 0.7386573 0.7042574 0.7513723 0.7675040 0.6849374 0.7926459 0.7473559 0.6709445 9 | Crocodile 0.7867055 0.7651678 0.8639154 0.8145647 0.5399763 0.6249144 0.7160903 0.0000000 0.4906657 0.7432287 0.7493887 0.7488493 0.8057593 0.8317762 0.8413625 0.7521970 0.7769550 10 | Bird 0.7850803 0.6988087 0.7878422 0.7573321 0.4849490 0.5897511 0.6480652 0.4906657 0.0000000 0.6755495 0.6691967 0.6860033 0.6905877 0.7565543 0.7504430 0.6842440 0.6705485 11 | Human 0.6959920 0.7598439 0.8294442 0.7166360 0.5861821 0.6946471 0.7386573 0.7432287 0.6755495 0.0000000 0.2750272 0.2814737 0.2961226 0.3590137 0.3757584 0.4477864 0.4220981 12 | Seal 0.6336127 0.7003997 0.7505365 0.6626602 0.5383720 0.6787380 0.7042574 0.7493887 0.6691967 0.2750272 0.0000000 0.1931946 0.2118470 0.2817599 0.3180795 0.3787176 0.3496224 13 | Cow 0.6997504 0.7643007 0.7882964 0.6762896 0.5458270 0.6565584 0.7513723 0.7488493 0.6860033 0.2814737 0.1931946 0.0000000 0.1754464 0.3199376 0.3320971 0.4013694 0.3449257 14 | Whale 0.6793033 0.7378452 0.7551778 0.6809187 0.5612534 0.6772154 0.7675040 0.8057593 0.6905877 0.2961226 0.2118470 0.1754464 0.0000000 0.3251485 0.3558385 0.3925798 0.3595924 15 | Mouse 0.7120045 0.7195253 0.7706974 0.7005612 0.5632785 0.6833316 0.6849374 0.8317762 0.7565543 0.3590137 0.2817599 0.3199376 0.3251485 0.0000000 0.1447365 0.4099219 0.3487804 16 | Rat 0.7344446 0.8065221 0.8561868 0.7136883 0.6088667 0.7476896 0.7926459 0.8413625 0.7504430 0.3757584 0.3180795 0.3320971 0.3558385 0.1447365 0.0000000 0.4419960 0.4050277 17 | Platypus 0.7318557 0.7439359 0.7818997 0.6974592 0.5946969 0.7240949 0.7473559 0.7521970 0.6842440 0.4477864 0.3787176 0.4013694 0.3925798 0.4099219 0.4419960 0.0000000 0.3202751 18 | Opossum 0.6820929 0.6178323 0.6850401 0.6449470 0.5778748 0.6518428 0.6709445 0.7769550 0.6705485 0.4220981 0.3496224 0.3449257 0.3595924 0.3487804 0.4050277 0.3202751 0.0000000 19 | -------------------------------------------------------------------------------- /example/example_matrix.cpp: -------------------------------------------------------------------------------- 1 | const char* example_matrix = "17\n" 2 | "LngfishAu 0.0000000 0.4394262 0.4253346 0.4739334 0.6469595 0.8072464 0.7697307 0.7867055 0.7850803 0.6959920 0.6336127 0.6997504 0.6793033 0.7120045 0.7344446 0.7318557 0.6820929\n" 3 | "LngfishSA 0.4394262 0.0000000 0.3370420 0.6028511 0.7361390 0.8116547 0.7978951 0.7651678 0.6988087 0.7598439 0.7003997 0.7643007 0.7378452 0.7195253 0.8065221 0.7439359 0.6178323\n" 4 | "LngfishAf 0.4253346 0.3370420 0.0000000 0.5921847 0.7020407 0.8573580 0.9137406 0.8639154 0.7878422 0.8294442 0.7505365 0.7882964 0.7551778 0.7706974 0.8561868 0.7818997 0.6850401\n" 5 | "Frog 0.4739334 0.6028511 0.5921847 0.0000000 0.6268957 0.8150864 0.7705955 0.8145647 0.7573321 0.7166360 0.6626602 0.6762896 0.6809187 0.7005612 0.7136883 0.6974592 0.6449470\n" 6 | "Turtle 0.6469595 0.7361390 0.7020407 0.6268957 0.0000000 0.5416702 0.5841215 0.5399763 0.4849490 0.5861821 0.5383720 0.5458270 0.5612534 0.5632785 0.6088667 0.5946969 0.5778748\n" 7 | "Sphenodon 0.8072464 0.8116547 0.8573580 0.8150864 0.5416702 0.0000000 0.6723304 0.6249144 0.5897511 0.6946471 0.6787380 0.6565584 0.6772154 0.6833316 0.7476896 0.7240949 0.6518428\n" 8 | "Lizard 0.7697307 0.7978951 0.9137406 0.7705955 0.5841215 0.6723304 0.0000000 0.7160903 0.6480652 0.7386573 0.7042574 0.7513723 0.7675040 0.6849374 0.7926459 0.7473559 0.6709445\n" 9 | "Crocodile 0.7867055 0.7651678 0.8639154 0.8145647 0.5399763 0.6249144 0.7160903 0.0000000 0.4906657 0.7432287 0.7493887 0.7488493 0.8057593 0.8317762 0.8413625 0.7521970 0.7769550\n" 10 | "Bird 0.7850803 0.6988087 0.7878422 0.7573321 0.4849490 0.5897511 0.6480652 0.4906657 0.0000000 0.6755495 0.6691967 0.6860033 0.6905877 0.7565543 0.7504430 0.6842440 0.6705485\n" 11 | "Human 0.6959920 0.7598439 0.8294442 0.7166360 0.5861821 0.6946471 0.7386573 0.7432287 0.6755495 0.0000000 0.2750272 0.2814737 0.2961226 0.3590137 0.3757584 0.4477864 0.4220981\n" 12 | "Seal 0.6336127 0.7003997 0.7505365 0.6626602 0.5383720 0.6787380 0.7042574 0.7493887 0.6691967 0.2750272 0.0000000 0.1931946 0.2118470 0.2817599 0.3180795 0.3787176 0.3496224\n" 13 | "Cow 0.6997504 0.7643007 0.7882964 0.6762896 0.5458270 0.6565584 0.7513723 0.7488493 0.6860033 0.2814737 0.1931946 0.0000000 0.1754464 0.3199376 0.3320971 0.4013694 0.3449257\n" 14 | "Whale 0.6793033 0.7378452 0.7551778 0.6809187 0.5612534 0.6772154 0.7675040 0.8057593 0.6905877 0.2961226 0.2118470 0.1754464 0.0000000 0.3251485 0.3558385 0.3925798 0.3595924\n" 15 | "Mouse 0.7120045 0.7195253 0.7706974 0.7005612 0.5632785 0.6833316 0.6849374 0.8317762 0.7565543 0.3590137 0.2817599 0.3199376 0.3251485 0.0000000 0.1447365 0.4099219 0.3487804\n" 16 | "Rat 0.7344446 0.8065221 0.8561868 0.7136883 0.6088667 0.7476896 0.7926459 0.8413625 0.7504430 0.3757584 0.3180795 0.3320971 0.3558385 0.1447365 0.0000000 0.4419960 0.4050277\n" 17 | "Platypus 0.7318557 0.7439359 0.7818997 0.6974592 0.5946969 0.7240949 0.7473559 0.7521970 0.6842440 0.4477864 0.3787176 0.4013694 0.3925798 0.4099219 0.4419960 0.0000000 0.3202751\n" 18 | "Opossum 0.6820929 0.6178323 0.6850401 0.6449470 0.5778748 0.6518428 0.6709445 0.7769550 0.6705485 0.4220981 0.3496224 0.3449257 0.3595924 0.3487804 0.4050277 0.3202751 0.0000000\n"; 19 | -------------------------------------------------------------------------------- /example/example_matrix.h: -------------------------------------------------------------------------------- 1 | extern const char* example_matrix; 2 | -------------------------------------------------------------------------------- /example/fakevector.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | template class FakeVector { 4 | public: 5 | T data[n]; //so that operator < can see it 6 | FakeVector() { 7 | for (int i=0; i MyFloatVector; 43 | typedef FakeVector MyBoolVector; 44 | 45 | template 46 | FakeVector operator< 47 | ( const FakeVector& left, const FakeVector& right ) { 48 | FakeVector result; 49 | for (int i=0; i 56 | FakeVector select ( const FakeVector& isLeft, 57 | const FakeVector& left, 58 | const FakeVector& right ) { 59 | FakeVector result; 60 | for (int i=0; i //for loadDistanceMatrixFromOpenFile 29 | #include //for RapidNJ 30 | #include //for std::istringstream 31 | #include "example_matrix.h" //for example_matrix string 32 | 33 | void example_1() { 34 | StartTree::RapidNJ r; 35 | 36 | std::istringstream input_file(example_matrix); 37 | loadDistanceMatrixFromOpenFile(input_file, false, r); 38 | r.constructTree(); 39 | 40 | int precision = 6; 41 | std::string newickTreeFilePath = "STDOUT"; 42 | r.writeTreeFile(precision, newickTreeFilePath); 43 | } 44 | 45 | int main(int argc, char* argv[]) { 46 | example_1(); 47 | return 0; 48 | } -------------------------------------------------------------------------------- /example/simulated_1k.fa.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/example/simulated_1k.fa.gz -------------------------------------------------------------------------------- /example/uncorrected.dist: -------------------------------------------------------------------------------- 1 | 17 2 | LngfishAu 3 | LngfishSA 0.24024024 4 | LngfishAf 0.23773774 0.20470470 5 | Frog 0.24724725 0.28128128 0.28078078 6 | Turtle 0.29329329 0.30980981 0.30480480 0.28828829 7 | Sphenodon 0.31981982 0.32432432 0.33483483 0.33133133 0.26976977 8 | Lizard 0.32582583 0.32682683 0.34734735 0.32632633 0.28378378 0.30130130 9 | Crocodile 0.32482482 0.32282282 0.33883884 0.32932933 0.27727728 0.29879880 0.31831832 10 | Bird 0.31831832 0.30730731 0.32232232 0.31381381 0.25775776 0.28678679 0.29679680 0.25975976 11 | Human 0.30080080 0.31931932 0.33283283 0.30680681 0.28228228 0.30480480 0.31431431 0.32232232 0.30030030 12 | Seal 0.28178178 0.30380380 0.31431431 0.29129129 0.26826827 0.29979980 0.30630631 0.31881882 0.29529530 0.18318318 13 | Cow 0.29629630 0.31281281 0.31881882 0.29129129 0.26776777 0.29779780 0.31331331 0.31781782 0.29979980 0.18318318 0.13963964 14 | Whale 0.29279279 0.31281281 0.31531532 0.29879880 0.27177177 0.30030030 0.32182182 0.33333333 0.30080080 0.19169169 0.15115115 0.13263263 15 | Mouse 0.30230230 0.30830831 0.32032032 0.30780781 0.27177177 0.30030030 0.30880881 0.34034034 0.31831832 0.21621622 0.18018018 0.19469469 0.19969970 16 | Rat 0.30230230 0.32432432 0.33533534 0.30930931 0.28278278 0.31481481 0.32632633 0.33783784 0.31431431 0.21871872 0.19319319 0.19819820 0.21071071 0.11361361 17 | Platypus 0.31081081 0.31381381 0.32232232 0.30230230 0.28228228 0.31281281 0.31981982 0.32182182 0.30330330 0.25225225 0.21971972 0.22622623 0.22472472 0.23373373 0.24174174 18 | Opossum 0.30430430 0.28878879 0.30330330 0.29079079 0.27477477 0.29279279 0.30430430 0.32982983 0.29829830 0.23973974 0.20720721 0.20520521 0.21171171 0.20770771 0.22822823 0.20270270 19 | -------------------------------------------------------------------------------- /example/vectordecenttree.cpp: -------------------------------------------------------------------------------- 1 | //If you want to use Open MP, on Windows, you will need to ensure that 2 | //the (64-bit) version of libiomp5md.dll can be found in the library path 3 | //when your executable runs. 4 | 5 | #undef USE_GZSTREAM 6 | #undef USE_PROGRESS_DISPLAY 7 | #undef USE_VECTORCLASS_LIBRARY 8 | #undef DECENT_TREE 9 | 10 | #define USE_GZSTREAM 0 //If you linked in gzstream.cpp, this could be set to 1. 11 | //(not that this example needs gz formatting) 12 | #define USE_PROGRESS_DISPLAY 1 //If you linked in progress.cpp, this could be set to 1. 13 | //to get progress bars (not much point on small inputs!) 14 | //Progress reporting depends on functions in the progress.cpp 15 | //in the main decenttree folder. 16 | #define USE_VECTORCLASS_LIBRARY 1 //For an input this small, vectorisation doesn't matter. 17 | #define DECENT_TREE 1 //Tells shared headers that decenttree, rather than 18 | //iqtree2, is being built. 19 | 20 | #include //for loadDistanceMatrixFromOpenFile 21 | #include //for RapidNJ 22 | #include //for std::istringstream 23 | #include "example_matrix.h" //for example_matrix string 24 | 25 | template void testMatrix 26 | (const std::string &infile_name, bool silent, T& r) { 27 | loadDistanceMatrixInto(infile_name, silent, r); 28 | r.constructTree(); 29 | } 30 | 31 | void example_2() { 32 | const std::string input_file("./example.dist"); 33 | 34 | std::ofstream dist; 35 | dist.open(input_file.c_str(), std::ios_base::out); 36 | dist << example_matrix; 37 | dist.close(); 38 | 39 | StartTree::NJMatrix r1; 40 | StartTree::VectorNJ r2; 41 | StartTree::RapidNJ r3; 42 | 43 | testMatrix(input_file, true, r1); 44 | testMatrix(input_file, true, r2); 45 | testMatrix(input_file, true, r3); 46 | 47 | StartTree::RapidNJ r4; 48 | r4.beSilent(); 49 | 50 | testMatrix(input_file, false, r4); 51 | } 52 | 53 | int main(int argc, char* argv[]) { 54 | printf("Try a conventional NJ and a vectorized NJ implementation\n"); 55 | example_2(); 56 | return 0; 57 | } -------------------------------------------------------------------------------- /executables/mac_os/wintel_13.2.1/decenttree.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/executables/mac_os/wintel_13.2.1/decenttree.gz -------------------------------------------------------------------------------- /executables/mac_os/wintel_13.2.1/pydecenttree.cpython-311-darwin.so.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/executables/mac_os/wintel_13.2.1/pydecenttree.cpython-311-darwin.so.gz -------------------------------------------------------------------------------- /iqtree_config.h.in: -------------------------------------------------------------------------------- 1 | #define iqtree_VERSION_MAJOR @iqtree_VERSION_MAJOR@ 2 | #define iqtree_VERSION_MINOR @iqtree_VERSION_MINOR@ 3 | #define iqtree_VERSION_PATCH "@iqtree_VERSION_PATCH@" 4 | 5 | /* does the platform provide gettimeofday functions? */ 6 | #cmakedefine HAVE_GETTIMEOFDAY 7 | /* does the platform provide getrusage functions? */ 8 | #cmakedefine HAVE_GETRUSAGE 9 | /* does the platform provide popen functions? */ 10 | /*#cmakedefine HAVE_POPEN*/ 11 | /* does the platform provide pclose functions? */ 12 | /*#cmakedefine HAVE_PCLOSE*/ 13 | /* does the platform provide GlobalMemoryStatusEx functions? */ 14 | #cmakedefine HAVE_GLOBALMEMORYSTATUSEX 15 | #cmakedefine HAVE_STRNDUP 16 | #cmakedefine HAVE_STRTOK_R 17 | 18 | /* does the platform provide backtrace functions? */ 19 | #cmakedefine Backtrace_FOUND 20 | -------------------------------------------------------------------------------- /lib/libiomp5md.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/libiomp5md.dll -------------------------------------------------------------------------------- /lib/libomp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/libomp.a -------------------------------------------------------------------------------- /lib/libompstatic.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/libompstatic.a -------------------------------------------------------------------------------- /lib/pthreadGC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/pthreadGC2.dll -------------------------------------------------------------------------------- /lib/pthreadGC2_64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/pthreadGC2_64.dll -------------------------------------------------------------------------------- /lib/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/pthreadVC2.dll -------------------------------------------------------------------------------- /lib/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib/pthreadVC2.lib -------------------------------------------------------------------------------- /lib32/libiomp5md.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib32/libiomp5md.dll -------------------------------------------------------------------------------- /lib32/libiomp5md.lib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib32/libiomp5md.lib.dll -------------------------------------------------------------------------------- /lib32/libomp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib32/libomp.a -------------------------------------------------------------------------------- /lib32/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib32/pthreadVC2.dll -------------------------------------------------------------------------------- /lib32/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/lib32/pthreadVC2.lib -------------------------------------------------------------------------------- /libmac/libomp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/libmac/libomp.a -------------------------------------------------------------------------------- /pydecenttree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # was: find_package(PythonInterp 3.5 REQUIRED) 2 | # was: find_package(PythonLibs 3.5 REQUIRED) 3 | 4 | set( Python_ADDITIONAL_VERSIONS "3.9") 5 | 6 | find_package(Python3 COMPONENTS Development Interpreter NumPy) 7 | set(PYTHON_REALLY_FOUND "FALSE") 8 | if(Python3_FOUND) 9 | if ("${PYTHON_INCLUDE_DIR}" STREQUAL "") 10 | #No Python 11 | elseif ("${PYTHON_LIBRARIES}" STREQUAL "") 12 | #No Python 13 | else() 14 | set (PYTHON_REALLY_FOUND "TRUE") 15 | endif() 16 | endif() 17 | 18 | message("Python Available: ${PYTHON_REALLY_FOUND}") 19 | if(PYTHON_REALLY_FOUND STREQUAL "TRUE") 20 | message("Python Include directory: ${PYTHON_INCLUDE_DIR}") 21 | include_directories(${PYTHON_INCLUDE_DIR}) 22 | message("Python Libraries: ${PYTHON_LIBRARIES}") 23 | 24 | message("Python Executable: ${PYTHON_EXECUTABLE}") 25 | exec_program(${PYTHON_EXECUTABLE} 26 | ARGS "-c \"import numpy; print(numpy.get_include())\"" 27 | OUTPUT_VARIABLE NUMPY_INCLUDE_DIR 28 | RETURN_VALUE NUMPY_NOT_FOUND 29 | ) 30 | 31 | if(NUMPY_NOT_FOUND) 32 | #message(FATAL_ERROR "NumPy headers not found") 33 | message("NumPy headers not found") 34 | add_definitions(-DUSE_NUMPY_HEADERS=0) 35 | else(NUMPY_NOT_FOUND) 36 | message("Numpy Include directory: ${NUMPY_INCLUDE_DIR}") 37 | include_directories(${NUMPY_INCLUDE_DIR}) 38 | add_definitions(-DUSE_NUMPY_HEADERS=1) 39 | #message("Numpy Linker flags: ${NUMPY_EXE_LINKER_FLAGS}") 40 | #set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${NUMPY_EXE_LINKER_FLAGS}") 41 | endif() 42 | 43 | add_library(pydecenttree SHARED 44 | pydecenttree.cpp 45 | ../starttree.cpp ../starttree.h ../bionj.cpp ../bionj2.cpp 46 | ../flatmatrix.cpp ../flatmatrix.h 47 | ../utils/vectortypes.cpp ../utils/vectortypes.h 48 | ../utils/stringfunctions.cpp ../utils/stringfunctions.h 49 | ../utils/gzstream.cpp ../utils/gzstream.h 50 | ../utils/progress.cpp ../utils/progress.h 51 | ../utils/operatingsystem.cpp ../utils/operatingsystem.h 52 | ) 53 | # ../flatmatrix.cpp for flat matrix functions for writing to files 54 | # Stuff in ../utils : 55 | # vectortypes.cpp for contains() 56 | # stringfunctions.cpp for StrVector::contains() 57 | # gzstream.cpp for zip and unzip support, pigzstream class. 58 | # progress.cpp for progress bar stuff, progress_display class. 59 | # operatingsystem.cpp for isStandardOutputATerminal() 60 | 61 | if(NUMPY_NOT_FOUND) 62 | target_link_libraries(pydecenttree ${PYTHON_LIBRARIES}) 63 | else(NUMPY_NOT_FOUND) 64 | target_link_libraries(pydecenttree ${PYTHON_LIBRARIES} Python3::NumPy) 65 | endif(NUMPY_NOT_FOUND) 66 | 67 | if(ZLIB_FOUND) 68 | target_link_libraries(pydecenttree ${ZLIB_LIBRARIES}) 69 | else(ZLIB_FOUND) 70 | target_link_libraries(pydecenttree zlibstatic) 71 | endif(ZLIB_FOUND) 72 | 73 | if (APPLE) 74 | set(CMAKE_SHARED_LIBRARY_SUFFIX .so) 75 | message("Shared library suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}") 76 | endif (APPLE) 77 | 78 | if (APPLE OR WIN32 ) 79 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -pthread") 80 | else() 81 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread") 82 | endif() 83 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz") 84 | #set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") 85 | #set_target_properties(pydecenttree PROPERTIES PREFIX "" OUTPUT_NAME "pydecenttree" LINKER_LANGUAGE C) 86 | message("Open MP Linker flags: ${OpenMP_EXE_LINKER_FLAGS}") 87 | message("C++ Linker flags: ${CMAKE_EXE_LINKER_FLAGS}") 88 | message("C++ Compiler: ${CMAKE_CXX_COMPILER}") 89 | target_link_libraries(pydecenttree omp) 90 | 91 | if(ZLIB_FOUND) 92 | message("Zlib libraries: ${ZLIB_LIBRARIES}") 93 | target_link_libraries(pydecenttree "-static ${ZLIB_LIBRARIES}") 94 | else(ZLIB_FOUND) 95 | message("Zlib libraries: zlibstatic") 96 | target_link_libraries(pydecenttree zlibstatic) 97 | endif(ZLIB_FOUND) 98 | else() 99 | message("Python3 Not Found") 100 | endif() -------------------------------------------------------------------------------- /pydecenttree/__init__.py: -------------------------------------------------------------------------------- 1 | import pydecenttree 2 | -------------------------------------------------------------------------------- /pydecenttree/setup.py: -------------------------------------------------------------------------------- 1 | #from sysconfig import get_paths 2 | import numpy 3 | from distutils.core import setup, Extension 4 | 5 | numpy_include = numpy.get_include() 6 | 7 | #python_include = get_paths() 8 | #(but this doesn't seem necessary, so I've commented it out) 9 | 10 | dirs = [numpy_include, "..", "../build", "../zlib-1.2.7", "../build/zlib-1.2.7"] 11 | flags = ['-std=c++11'] 12 | link_flags = [] 13 | 14 | # 15 | #This is how I hacked OpenMP support on OS X 12.4 16 | #Outside setup.py.. run these: 17 | # 18 | #> export CFLAGS="-Xpreprocessor -fopenmp $CFLAGS" 19 | #> export CXXFLAGS="-Xpreprocessor -fopenmp $CXXFLAGS" 20 | #b 21 | #(you need to set both CFLAGS and CXXFLAGS! Don't know why) 22 | #...but I get lots of repeated warnings out of signal.h when I build. 23 | # 24 | import os 25 | if ('CXXFLAGS' in os.environ): 26 | if (os.environ['CXXFLAGS'].find('-Xpreprocessor')!=-1): 27 | link_flags.append('-lomp') 28 | dirs.append('/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include') 29 | 30 | module1 = Extension("pydecenttree", 31 | define_macros = [('DECENT_TREE', '1'), 32 | ('USE_VECTORCLASS_LIBRARY', '1'), 33 | ('USE_PROGRESS_DISPLAY', '1'), 34 | ('USE_BIONJ_2009', '0')], 35 | sources = ["pydecenttree.cpp", "../starttree.cpp", 36 | "../bionj2.cpp", "../flatmatrix.cpp", 37 | "../utils/vectortypes.cpp", 38 | "../utils/stringfunctions.cpp", 39 | "../utils/progress.cpp", 40 | "../utils/operatingsystem.cpp" ], 41 | include_dirs = dirs, 42 | extra_compile_args = flags, 43 | extra_link_args= link_flags, 44 | language = "c++") 45 | 46 | #If USE_PROGRESS_DISPLAY is set, ../utils/progress.cpp 47 | #and ../utils/operatingsystem.cpp are needed. 48 | 49 | #Todo: Consider adding additional macros: 50 | #USE_GZSTREAM=1 51 | # 52 | #Todo: want extra_compile_args "-fopenmp=libomp" 53 | #But the compiler Python is defaulting to doesn't allow it. 54 | 55 | #Might eventually need these... 56 | #Old BIONJ (but I don't plan to support this!) 57 | # ../bionj.cpp 58 | #Compression: 59 | # ../utils/gzstream.cpp ../utils/gzstream.h 60 | # 61 | 62 | def main(): 63 | setup(name="pydecenttree", 64 | version="1.0.0", 65 | description="Python interface for the decenttree library function", 66 | author="James Barbetti (2022)", 67 | author_email="james_barbetti@yahoo.com", 68 | ext_modules=[module1], 69 | setup_requires = ["numpy"], 70 | install_requires = ["numpy"]) 71 | 72 | if __name__ == "__main__": 73 | main() 74 | -------------------------------------------------------------------------------- /utils/my_assert.h: -------------------------------------------------------------------------------- 1 | // 2 | // my_assert.h 3 | // iqtree 4 | // 5 | //_my_assert function, originally created by 6 | //BUI Quang Minh 21-Aug-2016. 7 | //This file: created by James Barbetti on 17-Dec-2020. 8 | //(decentTree needs _my_assert and ASSERT, but 9 | // doesn't need anything from the rest of tools.h) 10 | // 11 | 12 | #ifndef assert_h 13 | #define assert_h 14 | 15 | #include 16 | #include 17 | #include //for strrchr (needed for GCC 9.2 builds) 18 | 19 | // for MSVC 20 | #ifndef __func__ 21 | #define __func__ __FUNCTION__ 22 | #endif 23 | 24 | // redefine assertion 25 | inline void _my_assert(const char* expression, const char *func, const char* file, int line) 26 | { 27 | const char *sfile = strrchr(file, '/'); 28 | if (!sfile) { 29 | sfile = file; 30 | } 31 | else { 32 | ++sfile; 33 | } 34 | std::cerr << sfile << ":" << line << ": " << func 35 | << ": Assertion `" << expression << "' failed." << std::endl; 36 | abort(); 37 | } 38 | 39 | inline void _my_assert(const std::string &str_expression, const char *func, const char* file, int line) { 40 | _my_assert(str_expression.c_str(), func, file, line); 41 | } 42 | 43 | 44 | #ifdef NDEBUG 45 | #define ASSERT(EXPRESSION) ((void)0) 46 | #else 47 | #if defined(__GNUC__) || defined(__clang__) 48 | #define ASSERT(EXPRESSION) ((EXPRESSION) ? (void)0 : _my_assert(#EXPRESSION, __PRETTY_FUNCTION__, __FILE__, __LINE__)) 49 | #else 50 | #define ASSERT(EXPRESSION) ((EXPRESSION) ? (void)0 : _my_assert(#EXPRESSION, __func__, __FILE__, __LINE__)) 51 | #endif 52 | #endif 53 | 54 | #if defined(__GNUC__) || defined(__clang__) 55 | #define FUNCTION_NOT_IMPLEMENTED \ 56 | _my_assert(std::string(__PRETTY_FUNCTION__) + " is not implemented", \ 57 | __PRETTY_FUNCTION__, __FILE__, __LINE__) 58 | #else 59 | #define FUNCTION_NOT_IMPLEMENTED \ 60 | _my_assert(std::string(__func__) + " is not implemented", \ 61 | __func__, __FILE__, __LINE__) 62 | #endif 63 | 64 | #endif /* assert_h */ 65 | -------------------------------------------------------------------------------- /utils/operatingsystem.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // operatingsystem.cpp 3 | // alignment 4 | // 5 | // Created by James Barbetti on 29/7/20. 6 | // 7 | 8 | #include "operatingsystem.h" 9 | #include 10 | #include 11 | #if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) 12 | #include //for _isatty 13 | #include //for _fileno (explicit include needed for GCC 9.2 builds) 14 | #else 15 | #include //for isatty 16 | #endif 17 | 18 | std::string getOSName() { 19 | std::stringstream out; 20 | #if defined _WIN32 || defined WIN32 || defined WIN64 21 | out << "Windows"; 22 | #elif defined __APPLE__ || defined __MACH__ 23 | out << "Mac OS X"; 24 | #elif defined __linux__ 25 | out << "Linux"; 26 | #elif defined __unix__ || defined __unix 27 | out << "Unix"; 28 | #else 29 | out << "Unknown Platform"; 30 | #endif 31 | out << " " << 8*sizeof(void*) << "-bit"; 32 | return out.str(); 33 | } 34 | 35 | bool isStandardOutputATerminal() { 36 | #if defined(WIN32) || defined(WIN64) 37 | return _isatty(_fileno(stdout)); 38 | #else 39 | return isatty(fileno(stdout)); 40 | #endif 41 | } 42 | -------------------------------------------------------------------------------- /utils/operatingsystem.h: -------------------------------------------------------------------------------- 1 | // 2 | // operatingsystem.h 3 | // iqtree 4 | // 5 | // Created by James Barbetti on 29/7/20. 6 | // 7 | 8 | #ifndef operatingsystem_h 9 | #define operatingsystem_h 10 | 11 | #include 12 | 13 | #if defined(CLANG_UNDER_VS) || defined(WIN32) || defined(WIN64) 14 | #define CONSOLE_FILE "CON:" 15 | #else 16 | #define CONSOLE_FILE "/dev/tty" 17 | #endif 18 | 19 | std::string getOSName(); 20 | 21 | bool isStandardOutputATerminal(); 22 | 23 | #endif /* operatingsystem_h */ 24 | -------------------------------------------------------------------------------- /utils/parallel_sort.h: -------------------------------------------------------------------------------- 1 | // 2 | // parallel_sort.h 3 | // iqtree 4 | // 5 | // Created by James Barbetti on 17/3/21. 6 | // 7 | 8 | #ifndef parallel_sort_h 9 | #define parallel_sort_h 10 | 11 | #include //for definition of intptr_t 12 | #include //for definition of std::vector template class 13 | 14 | template class ParallelSorter { 15 | public: 16 | virtual void parallel_sort (T* data, intptr_t count) = 0; 17 | virtual void single_thread_sort(T* data, intptr_t count) = 0; 18 | virtual ~ParallelSorter() = default; 19 | }; 20 | 21 | template class ParallelMirrorSorter { 22 | public: 23 | virtual void parallel_mirror_sort (T* data, intptr_t count, U* auxiliary) = 0; 24 | virtual void single_thread_mirror_sort(T* data, intptr_t count, U* auxiliary) = 0; 25 | virtual ~ParallelMirrorSorter() = default; 26 | }; 27 | 28 | template class ValueAndSattelite { 29 | public: 30 | T t; 31 | U u; 32 | ValueAndSattelite() = default; 33 | ValueAndSattelite(const ValueAndSattelite& rhs) = default; 34 | ValueAndSattelite(const T& first, const U& second) : t(first), u(second) {} 35 | ValueAndSattelite& operator=(const ValueAndSattelite& rhs) = default; 36 | bool operator < ( const ValueAndSattelite& rhs ) const { return t < rhs.t; } 37 | bool operator <= ( const ValueAndSattelite& rhs ) const { return t <= rhs.t; } 38 | }; 39 | 40 | template , 41 | class S=ParallelSorter

> 42 | class ParallelMirrorSorterBase: public S, public ParallelMirrorSorter { 43 | protected: 44 | std::vector

copy; 45 | void loadCopy(T* data, intptr_t count, U* auxiliary) { 46 | copy.resize(count); 47 | for (int i=0;i 3 | #include //for std::stringstream 4 | 5 | StrVector::StrVector(size_t size): super(size) { 6 | } 7 | 8 | bool StrVector::contains(const char* find_me) const { 9 | for (std::string s : *this) { 10 | if (s==find_me) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | 17 | bool StrVector::contains(const std::string& find_me) const { 18 | for (std::string s : *this) { 19 | if (s==find_me) { 20 | return true; 21 | } 22 | } 23 | return false; 24 | } 25 | 26 | std::string StrVector::join(const char* sep) const { 27 | std::stringstream result; 28 | const char* next_sep = ""; 29 | for (const std::string& s : *this) { 30 | result << next_sep << s; 31 | next_sep = sep; 32 | } 33 | return result.str(); 34 | } 35 | 36 | std::string StrVector::join(const std::string& sep) const { 37 | return join(sep.c_str()); 38 | } 39 | 40 | void StrVector::sort() { 41 | std::sort(begin(), end()); 42 | } 43 | -------------------------------------------------------------------------------- /vectorclass/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(vectorclass 2 | instrset_detect.cpp 3 | instrset.h 4 | vectorclass.h 5 | vectorf64.h 6 | vectorf128.h 7 | vectorf256.h 8 | vectorf512.h 9 | ) 10 | -------------------------------------------------------------------------------- /vectorclass/vectorclass.h: -------------------------------------------------------------------------------- 1 | /**************************** vectorclass.h ******************************** 2 | * Author: Agner Fog 3 | * Date created: 2012-05-30 4 | * Last modified: 2017-05-10 5 | * Version: 1.29 6 | * Project: vector classes 7 | * Description: 8 | * Header file defining vector classes as interface to intrinsic functions 9 | * in x86 microprocessors with SSE2 and later instruction sets up to AVX512. 10 | * 11 | * Instructions: 12 | * Use Gnu, Clang, Intel or Microsoft C++ compiler. Compile for the desired 13 | * instruction set, which must be at least SSE2. Specify the supported 14 | * instruction set by a command line define, e.g. __SSE4_1__ if the 15 | * compiler does not automatically do so. 16 | * 17 | * Each vector object is represented internally in the CPU as a vector 18 | * register with 128, 256 or 512 bits. 19 | * 20 | * This header file includes the appropriate header files depending on the 21 | * supported instruction set 22 | * 23 | * For detailed instructions, see VectorClass.pdf 24 | * 25 | * (c) Copyright 2012-2017 GNU General Public License www.gnu.org/licenses 26 | ******************************************************************************/ 27 | #ifndef VECTORCLASS_H 28 | #define VECTORCLASS_H 129 29 | 30 | // Maximum vector size, bits. Allowed values are 128, 256, 512 31 | #ifndef MAX_VECTOR_SIZE 32 | #define MAX_VECTOR_SIZE 256 33 | #endif 34 | 35 | #include "instrset.h" // Select supported instruction set 36 | 37 | #if INSTRSET < 2 // SSE2 required 38 | #error Please compile for the SSE2 instruction set or higher 39 | #else 40 | 41 | #include "vectori128.h" // 128-bit integer vectors 42 | #include "vectorf128.h" // 128-bit floating point vectors 43 | 44 | #if MAX_VECTOR_SIZE >= 256 45 | #if INSTRSET >= 8 46 | #include "vectori256.h" // 256-bit integer vectors, requires AVX2 instruction set 47 | #else 48 | #include "vectori256e.h" // 256-bit integer vectors, emulated 49 | #endif // INSTRSET >= 8 50 | #if INSTRSET >= 7 51 | #include "vectorf256.h" // 256-bit floating point vectors, requires AVX instruction set 52 | #else 53 | #include "vectorf256e.h" // 256-bit floating point vectors, emulated 54 | #endif // INSTRSET >= 7 55 | #endif // MAX_VECTOR_SIZE >= 256 56 | 57 | #if MAX_VECTOR_SIZE >= 512 58 | #if INSTRSET >= 9 59 | #include "vectori512.h" // 512-bit integer vectors, requires AVX512 instruction set 60 | #include "vectorf512.h" // 512-bit floating point vectors, requires AVX512 instruction set 61 | #else 62 | #include "vectori512e.h" // 512-bit integer vectors, emulated 63 | #include "vectorf512e.h" // 512-bit floating point vectors, emulated 64 | #endif // INSTRSET >= 9 65 | #endif // MAX_VECTOR_SIZE >= 512 66 | 67 | #endif // INSTRSET >= 2 68 | 69 | #endif // VECTORCLASS_H 70 | -------------------------------------------------------------------------------- /vectorclass/vectormath_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/vectorclass/vectormath_common.h -------------------------------------------------------------------------------- /zlib-1.2.7/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/ChangeLog -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | -@echo "Please use ./configure first. Thank you." 3 | 4 | distclean: 5 | make -f Makefile.in distclean 6 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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 $@ 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/README.contrib -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/contrib/blast/README: -------------------------------------------------------------------------------- 1 | Read blast.h for purpose and usage. 2 | 3 | Mark Adler 4 | madler@alumni.caltech.edu 5 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/blast/blast.h: -------------------------------------------------------------------------------- 1 | /* blast.h -- interface for blast.c 2 | Copyright (C) 2003 Mark Adler 3 | version 1.1, 16 Feb 2003 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 | 33 | 34 | typedef unsigned (*blast_in)(void *how, unsigned char **buf); 35 | typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len); 36 | /* Definitions for input/output functions passed to blast(). See below for 37 | * what the provided functions need to do. 38 | */ 39 | 40 | 41 | int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow); 42 | /* Decompress input to output using the provided infun() and outfun() calls. 43 | * On success, the return value of blast() is zero. If there is an error in 44 | * the source data, i.e. it is not in the proper format, then a negative value 45 | * is returned. If there is not enough input available or there is not enough 46 | * output space, then a positive error is returned. 47 | * 48 | * The input function is invoked: len = infun(how, &buf), where buf is set by 49 | * infun() to point to the input buffer, and infun() returns the number of 50 | * available bytes there. If infun() returns zero, then blast() returns with 51 | * an input error. (blast() only asks for input if it needs it.) inhow is for 52 | * use by the application to pass an input descriptor to infun(), if desired. 53 | * 54 | * The output function is invoked: err = outfun(how, buf, len), where the bytes 55 | * to be written are buf[0..len-1]. If err is not zero, then blast() returns 56 | * with an output error. outfun() is always called with len <= 4096. outhow 57 | * is for use by the application to pass an output descriptor to outfun(), if 58 | * desired. 59 | * 60 | * The return codes are: 61 | * 62 | * 2: ran out of input before completing decompression 63 | * 1: output error before completing decompression 64 | * 0: successful decompression 65 | * -1: literal flag not zero or one 66 | * -2: dictionary size not in 4..6 67 | * -3: distance is too far back 68 | * 69 | * At the bottom of blast.c is an example program that uses blast() that can be 70 | * compiled to produce a command-line decompression filter by defining TEST. 71 | */ 72 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/blast/test.pk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/blast/test.pk -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/blast/test.txt: -------------------------------------------------------------------------------- 1 | AIAIAIAIAIAIA -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/contrib/dotzlib/DotZLib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib.chm -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/contrib/dotzlib/DotZLib/ChecksumImpl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/ChecksumImpl.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/CircularBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/CircularBuffer.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/CodecBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/CodecBase.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/Deflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/Deflater.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/GZipStream.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/GZipStream.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/Inflater.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/Inflater.cs -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/dotzlib/DotZLib/UnitTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/dotzlib/DotZLib/UnitTests.cs -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/infback9/README: -------------------------------------------------------------------------------- 1 | See infback9.h for what this is and how to use it. 2 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/contrib/masmx64/bld_ml64.bat: -------------------------------------------------------------------------------- 1 | ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 2 | ml64.exe /Flgvmat64 /c /Zi gvmat64.asm 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/contrib/minizip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | 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 | ./minizip test readme.txt 20 | ./miniunz -l test.zip 21 | mv readme.txt readme.old 22 | ./miniunz test.zip 23 | 24 | clean: 25 | /bin/rm -f *.o *~ minizip miniunz 26 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/contrib/minizip/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([minizip], [1.2.7], [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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/contrib/puff/puff.h: -------------------------------------------------------------------------------- 1 | /* puff.h 2 | Copyright (C) 2002-2010 Mark Adler, all rights reserved 3 | version 2.2, 25 Apr 2010 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-1.2.7/contrib/puff/zeros.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/contrib/puff/zeros.raw -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/vstudio/readme.txt: -------------------------------------------------------------------------------- 1 | Building instructions for the DLL versions of Zlib 1.2.7 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 | - Uncompress 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 | - Uncompress current zlib, including all contrib/* files 29 | - Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 30 | 31 | 32 | Important 33 | --------- 34 | - To use zlibwapi.dll in your application, you must define the 35 | macro ZLIB_WINAPI when compiling your application's source files. 36 | 37 | 38 | Additional notes 39 | ---------------- 40 | - This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built 41 | by Gilles Vollant from the zlib 1.1.x sources, and distributed at 42 | http://www.winimage.com/zLibDll 43 | It uses the WINAPI calling convention for the exported functions, and 44 | includes the minizip functionality. If your application needs that 45 | particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. 46 | 47 | - The new DLL was renamed because there exist several incompatible 48 | versions of zlib.dll on the Internet. 49 | 50 | - There is also an official DLL build of zlib, named zlib1.dll. This one 51 | is exporting the functions using the CDECL convention. See the file 52 | win32\DLL_FAQ.txt found in this zlib distribution. 53 | 54 | - There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol 55 | has a slightly different effect. To avoid compatibility problems, do 56 | not define it here. 57 | 58 | 59 | Gilles Vollant 60 | info@winimage.com 61 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/contrib/vstudio/vc10/minizip.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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.7,0 6 | PRODUCTVERSION 1.2.7,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.7\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2012 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-1.2.7/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-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib-1.2.7/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.7,0 6 | PRODUCTVERSION 1.2.7,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.7\0" 21 | VALUE "InternalName", "zlib\0" 22 | VALUE "OriginalFilename", "zlib.dll\0" 23 | VALUE "ProductName", "ZLib.DLL\0" 24 | VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 25 | VALUE "LegalCopyright", "(C) 1995-2012 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-1.2.7/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 | zlib_how.html 38 | painfully comprehensive description of zpipe.c (see below) 39 | - describes in excruciating detail the use of deflate() and inflate() 40 | 41 | zpipe.c 42 | reads and writes zlib streams from stdin to stdout 43 | - illustrates the proper use of deflate() and inflate() 44 | - deeply commented in zlib_how.html (see above) 45 | 46 | zran.c 47 | index a zlib or gzip stream and randomly access it 48 | - illustrates the use of Z_BLOCK, inflatePrime(), and 49 | inflateSetDictionary() to provide random access 50 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 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 | /* 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 | 0001eeee - 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 | 1444, which is the sum of 852 for literal/length codes and 592 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 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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 -DDEBUG 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-1.2.7/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 -DDEBUG 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-1.2.7/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-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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 -DDEBUG 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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/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-1.2.7/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 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 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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-1.2.7/win32/Makefile.bor: -------------------------------------------------------------------------------- 1 | # Makefile for zlib 2 | # Borland C++ for Win32 3 | # 4 | # Usage: 5 | # make -f win32/Makefile.bor 6 | # make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj 7 | 8 | # ------------ Borland C++ ------------ 9 | 10 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 11 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or 12 | # added to the declaration of LOC here: 13 | LOC = $(LOCAL_ZLIB) 14 | 15 | CC = bcc32 16 | AS = bcc32 17 | LD = bcc32 18 | AR = tlib 19 | CFLAGS = -a -d -k- -O2 $(LOC) 20 | ASFLAGS = $(LOC) 21 | LDFLAGS = $(LOC) 22 | 23 | 24 | # variables 25 | ZLIB_LIB = zlib.lib 26 | 27 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 28 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 29 | #OBJA = 30 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 31 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 32 | #OBJPA= 33 | 34 | 35 | # targets 36 | all: $(ZLIB_LIB) example.exe minigzip.exe 37 | 38 | .c.obj: 39 | $(CC) -c $(CFLAGS) $< 40 | 41 | .asm.obj: 42 | $(AS) -c $(ASFLAGS) $< 43 | 44 | adler32.obj: adler32.c zlib.h zconf.h 45 | 46 | compress.obj: compress.c zlib.h zconf.h 47 | 48 | crc32.obj: crc32.c zlib.h zconf.h crc32.h 49 | 50 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 51 | 52 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 53 | 54 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 55 | 56 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h 57 | 58 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 59 | 60 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 61 | inffast.h inffixed.h 62 | 63 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 64 | inffast.h 65 | 66 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67 | inffast.h inffixed.h 68 | 69 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 70 | 71 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 72 | 73 | uncompr.obj: uncompr.c zlib.h zconf.h 74 | 75 | zutil.obj: zutil.c zutil.h zlib.h zconf.h 76 | 77 | example.obj: test/example.c zlib.h zconf.h 78 | 79 | minigzip.obj: test/minigzip.c zlib.h zconf.h 80 | 81 | 82 | # For the sake of the old Borland make, 83 | # the command line is cut to fit in the MS-DOS 128 byte limit: 84 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) 85 | -del $(ZLIB_LIB) 86 | $(AR) $(ZLIB_LIB) $(OBJP1) 87 | $(AR) $(ZLIB_LIB) $(OBJP2) 88 | $(AR) $(ZLIB_LIB) $(OBJPA) 89 | 90 | 91 | # testing 92 | test: example.exe minigzip.exe 93 | example 94 | echo hello world | minigzip | minigzip -d 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 | 103 | # cleanup 104 | clean: 105 | -del $(ZLIB_LIB) 106 | -del *.obj 107 | -del *.exe 108 | -del *.tds 109 | -del zlib.bak 110 | -del foo.gz 111 | -------------------------------------------------------------------------------- /zlib-1.2.7/win32/VisualC.txt: -------------------------------------------------------------------------------- 1 | 2 | To build zlib using the Microsoft Visual C++ environment, 3 | use the appropriate project from the projects/ directory. 4 | -------------------------------------------------------------------------------- /zlib-1.2.7/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 | deflateCopy 12 | deflateReset 13 | deflateParams 14 | deflateTune 15 | deflateBound 16 | deflatePending 17 | deflatePrime 18 | deflateSetHeader 19 | inflateSetDictionary 20 | inflateSync 21 | inflateCopy 22 | inflateReset 23 | inflateReset2 24 | inflatePrime 25 | inflateMark 26 | inflateGetHeader 27 | inflateBack 28 | inflateBackEnd 29 | zlibCompileFlags 30 | ; utility functions 31 | compress 32 | compress2 33 | compressBound 34 | uncompress 35 | gzopen 36 | gzdopen 37 | gzbuffer 38 | gzsetparams 39 | gzread 40 | gzwrite 41 | gzprintf 42 | gzputs 43 | gzgets 44 | gzputc 45 | gzgetc 46 | gzungetc 47 | gzflush 48 | gzseek 49 | gzrewind 50 | gztell 51 | gzoffset 52 | gzeof 53 | gzdirect 54 | gzclose 55 | gzclose_r 56 | gzclose_w 57 | gzerror 58 | gzclearerr 59 | ; large file functions 60 | gzopen64 61 | gzseek64 62 | gztell64 63 | gzoffset64 64 | adler32_combine64 65 | crc32_combine64 66 | ; checksum functions 67 | adler32 68 | crc32 69 | adler32_combine 70 | crc32_combine 71 | ; various hacks, don't look :) 72 | deflateInit_ 73 | deflateInit2_ 74 | inflateInit_ 75 | inflateInit2_ 76 | inflateBackInit_ 77 | gzgetc_ 78 | zError 79 | inflateSyncPoint 80 | get_crc_table 81 | inflateUndermine 82 | inflateResetKeep 83 | deflateResetKeep 84 | gzopen_w 85 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-2006 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-1.2.7/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iqtree/decenttree/c106c86aee9a404588ef96bc09ff204b6eb6ea71/zlib-1.2.7/zlib.3.pdf -------------------------------------------------------------------------------- /zlib-1.2.7/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 | -------------------------------------------------------------------------------- /zlib-1.2.7/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-1.2.7/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 | --------------------------------------------------------------------------------