Added pristine code for zlib-1.2.11
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Oct 2017 21:05:43 -0700
changeset 5219ed2f7d4a251
parent 520 cbeadb934a60
child 522 cdbdf5652e8e
Added pristine code for zlib-1.2.11
external/zlib-1.2.11/CMakeLists.txt
external/zlib-1.2.11/ChangeLog
external/zlib-1.2.11/FAQ
external/zlib-1.2.11/INDEX
external/zlib-1.2.11/Makefile.in
external/zlib-1.2.11/README
external/zlib-1.2.11/adler32.c
external/zlib-1.2.11/amiga/Makefile.pup
external/zlib-1.2.11/amiga/Makefile.sas
external/zlib-1.2.11/compress.c
external/zlib-1.2.11/configure
external/zlib-1.2.11/contrib/README.contrib
external/zlib-1.2.11/contrib/ada/buffer_demo.adb
external/zlib-1.2.11/contrib/ada/mtest.adb
external/zlib-1.2.11/contrib/ada/read.adb
external/zlib-1.2.11/contrib/ada/readme.txt
external/zlib-1.2.11/contrib/ada/test.adb
external/zlib-1.2.11/contrib/ada/zlib-streams.adb
external/zlib-1.2.11/contrib/ada/zlib-streams.ads
external/zlib-1.2.11/contrib/ada/zlib-thin.adb
external/zlib-1.2.11/contrib/ada/zlib-thin.ads
external/zlib-1.2.11/contrib/ada/zlib.adb
external/zlib-1.2.11/contrib/ada/zlib.ads
external/zlib-1.2.11/contrib/ada/zlib.gpr
external/zlib-1.2.11/contrib/amd64/amd64-match.S
external/zlib-1.2.11/contrib/asm686/README.686
external/zlib-1.2.11/contrib/asm686/match.S
external/zlib-1.2.11/contrib/blast/README
external/zlib-1.2.11/contrib/blast/blast.c
external/zlib-1.2.11/contrib/blast/blast.h
external/zlib-1.2.11/contrib/blast/test.pk
external/zlib-1.2.11/contrib/blast/test.txt
external/zlib-1.2.11/contrib/delphi/ZLib.pas
external/zlib-1.2.11/contrib/delphi/ZLibConst.pas
external/zlib-1.2.11/contrib/delphi/readme.txt
external/zlib-1.2.11/contrib/delphi/zlibd32.mak
external/zlib-1.2.11/contrib/dotzlib/DotZLib.build
external/zlib-1.2.11/contrib/dotzlib/DotZLib.chm
external/zlib-1.2.11/contrib/dotzlib/DotZLib.sln
external/zlib-1.2.11/contrib/dotzlib/DotZLib/AssemblyInfo.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/ChecksumImpl.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/CircularBuffer.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/CodecBase.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/Deflater.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/DotZLib.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/DotZLib.csproj
external/zlib-1.2.11/contrib/dotzlib/DotZLib/GZipStream.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/Inflater.cs
external/zlib-1.2.11/contrib/dotzlib/DotZLib/UnitTests.cs
external/zlib-1.2.11/contrib/dotzlib/LICENSE_1_0.txt
external/zlib-1.2.11/contrib/dotzlib/readme.txt
external/zlib-1.2.11/contrib/gcc_gvmat64/gvmat64.S
external/zlib-1.2.11/contrib/infback9/README
external/zlib-1.2.11/contrib/infback9/infback9.c
external/zlib-1.2.11/contrib/infback9/infback9.h
external/zlib-1.2.11/contrib/infback9/inffix9.h
external/zlib-1.2.11/contrib/infback9/inflate9.h
external/zlib-1.2.11/contrib/infback9/inftree9.c
external/zlib-1.2.11/contrib/infback9/inftree9.h
external/zlib-1.2.11/contrib/inflate86/inffas86.c
external/zlib-1.2.11/contrib/inflate86/inffast.S
external/zlib-1.2.11/contrib/iostream/test.cpp
external/zlib-1.2.11/contrib/iostream/zfstream.cpp
external/zlib-1.2.11/contrib/iostream/zfstream.h
external/zlib-1.2.11/contrib/iostream2/zstream.h
external/zlib-1.2.11/contrib/iostream2/zstream_test.cpp
external/zlib-1.2.11/contrib/iostream3/README
external/zlib-1.2.11/contrib/iostream3/TODO
external/zlib-1.2.11/contrib/iostream3/test.cc
external/zlib-1.2.11/contrib/iostream3/zfstream.cc
external/zlib-1.2.11/contrib/iostream3/zfstream.h
external/zlib-1.2.11/contrib/masmx64/bld_ml64.bat
external/zlib-1.2.11/contrib/masmx64/gvmat64.asm
external/zlib-1.2.11/contrib/masmx64/inffas8664.c
external/zlib-1.2.11/contrib/masmx64/inffasx64.asm
external/zlib-1.2.11/contrib/masmx64/readme.txt
external/zlib-1.2.11/contrib/masmx86/bld_ml32.bat
external/zlib-1.2.11/contrib/masmx86/inffas32.asm
external/zlib-1.2.11/contrib/masmx86/match686.asm
external/zlib-1.2.11/contrib/masmx86/readme.txt
external/zlib-1.2.11/contrib/minizip/Makefile.am
external/zlib-1.2.11/contrib/minizip/MiniZip64_Changes.txt
external/zlib-1.2.11/contrib/minizip/MiniZip64_info.txt
external/zlib-1.2.11/contrib/minizip/configure.ac
external/zlib-1.2.11/contrib/minizip/crypt.h
external/zlib-1.2.11/contrib/minizip/ioapi.c
external/zlib-1.2.11/contrib/minizip/ioapi.h
external/zlib-1.2.11/contrib/minizip/iowin32.c
external/zlib-1.2.11/contrib/minizip/iowin32.h
external/zlib-1.2.11/contrib/minizip/make_vms.com
external/zlib-1.2.11/contrib/minizip/miniunz.c
external/zlib-1.2.11/contrib/minizip/miniunzip.1
external/zlib-1.2.11/contrib/minizip/minizip.1
external/zlib-1.2.11/contrib/minizip/minizip.c
external/zlib-1.2.11/contrib/minizip/minizip.pc.in
external/zlib-1.2.11/contrib/minizip/mztools.c
external/zlib-1.2.11/contrib/minizip/mztools.h
external/zlib-1.2.11/contrib/minizip/unzip.c
external/zlib-1.2.11/contrib/minizip/unzip.h
external/zlib-1.2.11/contrib/minizip/zip.c
external/zlib-1.2.11/contrib/minizip/zip.h
external/zlib-1.2.11/contrib/pascal/example.pas
external/zlib-1.2.11/contrib/pascal/readme.txt
external/zlib-1.2.11/contrib/pascal/zlibd32.mak
external/zlib-1.2.11/contrib/pascal/zlibpas.pas
external/zlib-1.2.11/contrib/puff/README
external/zlib-1.2.11/contrib/puff/puff.c
external/zlib-1.2.11/contrib/puff/puff.h
external/zlib-1.2.11/contrib/puff/pufftest.c
external/zlib-1.2.11/contrib/puff/zeros.raw
external/zlib-1.2.11/contrib/testzlib/testzlib.c
external/zlib-1.2.11/contrib/testzlib/testzlib.txt
external/zlib-1.2.11/contrib/untgz/Makefile.msc
external/zlib-1.2.11/contrib/untgz/untgz.c
external/zlib-1.2.11/contrib/vstudio/readme.txt
external/zlib-1.2.11/contrib/vstudio/vc10/miniunz.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/miniunz.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc10/minizip.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/minizip.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc10/testzlib.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/testzlib.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc10/testzlibdll.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc10/zlib.rc
external/zlib-1.2.11/contrib/vstudio/vc10/zlibstat.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/zlibstat.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc10/zlibvc.def
external/zlib-1.2.11/contrib/vstudio/vc10/zlibvc.sln
external/zlib-1.2.11/contrib/vstudio/vc10/zlibvc.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc10/zlibvc.vcxproj.filters
external/zlib-1.2.11/contrib/vstudio/vc11/miniunz.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc11/minizip.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc11/testzlib.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc11/testzlibdll.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc11/zlib.rc
external/zlib-1.2.11/contrib/vstudio/vc11/zlibstat.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc11/zlibvc.def
external/zlib-1.2.11/contrib/vstudio/vc11/zlibvc.sln
external/zlib-1.2.11/contrib/vstudio/vc11/zlibvc.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/miniunz.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/minizip.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/testzlib.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/testzlibdll.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/zlib.rc
external/zlib-1.2.11/contrib/vstudio/vc12/zlibstat.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc12/zlibvc.def
external/zlib-1.2.11/contrib/vstudio/vc12/zlibvc.sln
external/zlib-1.2.11/contrib/vstudio/vc12/zlibvc.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/miniunz.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/minizip.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/testzlib.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/testzlibdll.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/zlib.rc
external/zlib-1.2.11/contrib/vstudio/vc14/zlibstat.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc14/zlibvc.def
external/zlib-1.2.11/contrib/vstudio/vc14/zlibvc.sln
external/zlib-1.2.11/contrib/vstudio/vc14/zlibvc.vcxproj
external/zlib-1.2.11/contrib/vstudio/vc9/miniunz.vcproj
external/zlib-1.2.11/contrib/vstudio/vc9/minizip.vcproj
external/zlib-1.2.11/contrib/vstudio/vc9/testzlib.vcproj
external/zlib-1.2.11/contrib/vstudio/vc9/testzlibdll.vcproj
external/zlib-1.2.11/contrib/vstudio/vc9/zlib.rc
external/zlib-1.2.11/contrib/vstudio/vc9/zlibstat.vcproj
external/zlib-1.2.11/contrib/vstudio/vc9/zlibvc.def
external/zlib-1.2.11/contrib/vstudio/vc9/zlibvc.sln
external/zlib-1.2.11/contrib/vstudio/vc9/zlibvc.vcproj
external/zlib-1.2.11/crc32.c
external/zlib-1.2.11/crc32.h
external/zlib-1.2.11/deflate.c
external/zlib-1.2.11/deflate.h
external/zlib-1.2.11/doc/algorithm.txt
external/zlib-1.2.11/doc/rfc1950.txt
external/zlib-1.2.11/doc/rfc1951.txt
external/zlib-1.2.11/doc/rfc1952.txt
external/zlib-1.2.11/doc/txtvsbin.txt
external/zlib-1.2.11/examples/README.examples
external/zlib-1.2.11/examples/enough.c
external/zlib-1.2.11/examples/fitblk.c
external/zlib-1.2.11/examples/gun.c
external/zlib-1.2.11/examples/gzappend.c
external/zlib-1.2.11/examples/gzjoin.c
external/zlib-1.2.11/examples/gzlog.c
external/zlib-1.2.11/examples/gzlog.h
external/zlib-1.2.11/examples/zlib_how.html
external/zlib-1.2.11/examples/zpipe.c
external/zlib-1.2.11/examples/zran.c
external/zlib-1.2.11/gzclose.c
external/zlib-1.2.11/gzguts.h
external/zlib-1.2.11/gzlib.c
external/zlib-1.2.11/gzread.c
external/zlib-1.2.11/gzwrite.c
external/zlib-1.2.11/infback.c
external/zlib-1.2.11/inffast.c
external/zlib-1.2.11/inffast.h
external/zlib-1.2.11/inffixed.h
external/zlib-1.2.11/inflate.c
external/zlib-1.2.11/inflate.h
external/zlib-1.2.11/inftrees.c
external/zlib-1.2.11/inftrees.h
external/zlib-1.2.11/make_vms.com
external/zlib-1.2.11/msdos/Makefile.bor
external/zlib-1.2.11/msdos/Makefile.dj2
external/zlib-1.2.11/msdos/Makefile.emx
external/zlib-1.2.11/msdos/Makefile.msc
external/zlib-1.2.11/msdos/Makefile.tc
external/zlib-1.2.11/nintendods/README
external/zlib-1.2.11/old/Makefile.emx
external/zlib-1.2.11/old/Makefile.riscos
external/zlib-1.2.11/old/README
external/zlib-1.2.11/old/descrip.mms
external/zlib-1.2.11/old/os2/Makefile.os2
external/zlib-1.2.11/old/os2/zlib.def
external/zlib-1.2.11/old/visual-basic.txt
external/zlib-1.2.11/os400/README400
external/zlib-1.2.11/os400/bndsrc
external/zlib-1.2.11/os400/make.sh
external/zlib-1.2.11/os400/zlib.inc
external/zlib-1.2.11/qnx/package.qpg
external/zlib-1.2.11/test/example.c
external/zlib-1.2.11/test/infcover.c
external/zlib-1.2.11/test/minigzip.c
external/zlib-1.2.11/treebuild.xml
external/zlib-1.2.11/trees.c
external/zlib-1.2.11/trees.h
external/zlib-1.2.11/uncompr.c
external/zlib-1.2.11/watcom/watcom_f.mak
external/zlib-1.2.11/watcom/watcom_l.mak
external/zlib-1.2.11/win32/DLL_FAQ.txt
external/zlib-1.2.11/win32/Makefile.bor
external/zlib-1.2.11/win32/Makefile.gcc
external/zlib-1.2.11/win32/Makefile.msc
external/zlib-1.2.11/win32/README-WIN32.txt
external/zlib-1.2.11/win32/VisualC.txt
external/zlib-1.2.11/win32/zlib.def
external/zlib-1.2.11/win32/zlib1.rc
external/zlib-1.2.11/zconf.h
external/zlib-1.2.11/zconf.h.cmakein
external/zlib-1.2.11/zconf.h.in
external/zlib-1.2.11/zlib.3
external/zlib-1.2.11/zlib.3.pdf
external/zlib-1.2.11/zlib.h
external/zlib-1.2.11/zlib.map
external/zlib-1.2.11/zlib.pc.cmakein
external/zlib-1.2.11/zlib.pc.in
external/zlib-1.2.11/zlib2ansi
external/zlib-1.2.11/zutil.c
external/zlib-1.2.11/zutil.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/external/zlib-1.2.11/CMakeLists.txt	Sat Oct 21 21:05:43 2017 -0700
     1.3 @@ -0,0 +1,249 @@
     1.4 +cmake_minimum_required(VERSION 2.4.4)
     1.5 +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
     1.6 +
     1.7 +project(zlib C)
     1.8 +
     1.9 +set(VERSION "1.2.11")
    1.10 +
    1.11 +option(ASM686 "Enable building i686 assembly implementation")
    1.12 +option(AMD64 "Enable building amd64 assembly implementation")
    1.13 +
    1.14 +set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
    1.15 +set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
    1.16 +set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
    1.17 +set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
    1.18 +set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
    1.19 +
    1.20 +include(CheckTypeSize)
    1.21 +include(CheckFunctionExists)
    1.22 +include(CheckIncludeFile)
    1.23 +include(CheckCSourceCompiles)
    1.24 +enable_testing()
    1.25 +
    1.26 +check_include_file(sys/types.h HAVE_SYS_TYPES_H)
    1.27 +check_include_file(stdint.h    HAVE_STDINT_H)
    1.28 +check_include_file(stddef.h    HAVE_STDDEF_H)
    1.29 +
    1.30 +#
    1.31 +# Check to see if we have large file support
    1.32 +#
    1.33 +set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
    1.34 +# We add these other definitions here because CheckTypeSize.cmake
    1.35 +# in CMake 2.4.x does not automatically do so and we want
    1.36 +# compatibility with CMake 2.4.x.
    1.37 +if(HAVE_SYS_TYPES_H)
    1.38 +    list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
    1.39 +endif()
    1.40 +if(HAVE_STDINT_H)
    1.41 +    list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
    1.42 +endif()
    1.43 +if(HAVE_STDDEF_H)
    1.44 +    list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
    1.45 +endif()
    1.46 +check_type_size(off64_t OFF64_T)
    1.47 +if(HAVE_OFF64_T)
    1.48 +   add_definitions(-D_LARGEFILE64_SOURCE=1)
    1.49 +endif()
    1.50 +set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
    1.51 +
    1.52 +#
    1.53 +# Check for fseeko
    1.54 +#
    1.55 +check_function_exists(fseeko HAVE_FSEEKO)
    1.56 +if(NOT HAVE_FSEEKO)
    1.57 +    add_definitions(-DNO_FSEEKO)
    1.58 +endif()
    1.59 +
    1.60 +#
    1.61 +# Check for unistd.h
    1.62 +#
    1.63 +check_include_file(unistd.h Z_HAVE_UNISTD_H)
    1.64 +
    1.65 +if(MSVC)
    1.66 +    set(CMAKE_DEBUG_POSTFIX "d")
    1.67 +    add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
    1.68 +    add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
    1.69 +    include_directories(${CMAKE_CURRENT_SOURCE_DIR})
    1.70 +endif()
    1.71 +
    1.72 +if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
    1.73 +    # If we're doing an out of source build and the user has a zconf.h
    1.74 +    # in their source tree...
    1.75 +    if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
    1.76 +        message(STATUS "Renaming")
    1.77 +        message(STATUS "    ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
    1.78 +        message(STATUS "to 'zconf.h.included' because this file is included with zlib")
    1.79 +        message(STATUS "but CMake generates it automatically in the build directory.")
    1.80 +        file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
    1.81 +  endif()
    1.82 +endif()
    1.83 +
    1.84 +set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
    1.85 +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
    1.86 +		${ZLIB_PC} @ONLY)
    1.87 +configure_file(	${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
    1.88 +		${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
    1.89 +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
    1.90 +
    1.91 +
    1.92 +#============================================================================
    1.93 +# zlib
    1.94 +#============================================================================
    1.95 +
    1.96 +set(ZLIB_PUBLIC_HDRS
    1.97 +    ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
    1.98 +    zlib.h
    1.99 +)
   1.100 +set(ZLIB_PRIVATE_HDRS
   1.101 +    crc32.h
   1.102 +    deflate.h
   1.103 +    gzguts.h
   1.104 +    inffast.h
   1.105 +    inffixed.h
   1.106 +    inflate.h
   1.107 +    inftrees.h
   1.108 +    trees.h
   1.109 +    zutil.h
   1.110 +)
   1.111 +set(ZLIB_SRCS
   1.112 +    adler32.c
   1.113 +    compress.c
   1.114 +    crc32.c
   1.115 +    deflate.c
   1.116 +    gzclose.c
   1.117 +    gzlib.c
   1.118 +    gzread.c
   1.119 +    gzwrite.c
   1.120 +    inflate.c
   1.121 +    infback.c
   1.122 +    inftrees.c
   1.123 +    inffast.c
   1.124 +    trees.c
   1.125 +    uncompr.c
   1.126 +    zutil.c
   1.127 +)
   1.128 +
   1.129 +if(NOT MINGW)
   1.130 +    set(ZLIB_DLL_SRCS
   1.131 +        win32/zlib1.rc # If present will override custom build rule below.
   1.132 +    )
   1.133 +endif()
   1.134 +
   1.135 +if(CMAKE_COMPILER_IS_GNUCC)
   1.136 +    if(ASM686)
   1.137 +        set(ZLIB_ASMS contrib/asm686/match.S)
   1.138 +    elseif (AMD64)
   1.139 +        set(ZLIB_ASMS contrib/amd64/amd64-match.S)
   1.140 +    endif ()
   1.141 +
   1.142 +	if(ZLIB_ASMS)
   1.143 +		add_definitions(-DASMV)
   1.144 +		set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
   1.145 +	endif()
   1.146 +endif()
   1.147 +
   1.148 +if(MSVC)
   1.149 +    if(ASM686)
   1.150 +		ENABLE_LANGUAGE(ASM_MASM)
   1.151 +        set(ZLIB_ASMS
   1.152 +			contrib/masmx86/inffas32.asm
   1.153 +			contrib/masmx86/match686.asm
   1.154 +		)
   1.155 +    elseif (AMD64)
   1.156 +		ENABLE_LANGUAGE(ASM_MASM)
   1.157 +        set(ZLIB_ASMS
   1.158 +			contrib/masmx64/gvmat64.asm
   1.159 +			contrib/masmx64/inffasx64.asm
   1.160 +		)
   1.161 +    endif()
   1.162 +
   1.163 +	if(ZLIB_ASMS)
   1.164 +		add_definitions(-DASMV -DASMINF)
   1.165 +	endif()
   1.166 +endif()
   1.167 +
   1.168 +# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
   1.169 +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
   1.170 +string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
   1.171 +    "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
   1.172 +
   1.173 +if(MINGW)
   1.174 +    # This gets us DLL resource information when compiling on MinGW.
   1.175 +    if(NOT CMAKE_RC_COMPILER)
   1.176 +        set(CMAKE_RC_COMPILER windres.exe)
   1.177 +    endif()
   1.178 +
   1.179 +    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
   1.180 +                       COMMAND ${CMAKE_RC_COMPILER}
   1.181 +                            -D GCC_WINDRES
   1.182 +                            -I ${CMAKE_CURRENT_SOURCE_DIR}
   1.183 +                            -I ${CMAKE_CURRENT_BINARY_DIR}
   1.184 +                            -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
   1.185 +                            -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
   1.186 +    set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
   1.187 +endif(MINGW)
   1.188 +
   1.189 +add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
   1.190 +add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
   1.191 +set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
   1.192 +set_target_properties(zlib PROPERTIES SOVERSION 1)
   1.193 +
   1.194 +if(NOT CYGWIN)
   1.195 +    # This property causes shared libraries on Linux to have the full version
   1.196 +    # encoded into their final filename.  We disable this on Cygwin because
   1.197 +    # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
   1.198 +    # seems to be the default.
   1.199 +    #
   1.200 +    # This has no effect with MSVC, on that platform the version info for
   1.201 +    # the DLL comes from the resource file win32/zlib1.rc
   1.202 +    set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
   1.203 +endif()
   1.204 +
   1.205 +if(UNIX)
   1.206 +    # On unix-like platforms the library is almost always called libz
   1.207 +   set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
   1.208 +   if(NOT APPLE)
   1.209 +     set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
   1.210 +   endif()
   1.211 +elseif(BUILD_SHARED_LIBS AND WIN32)
   1.212 +    # Creates zlib1.dll when building shared library version
   1.213 +    set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
   1.214 +endif()
   1.215 +
   1.216 +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
   1.217 +    install(TARGETS zlib zlibstatic
   1.218 +        RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
   1.219 +        ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
   1.220 +        LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
   1.221 +endif()
   1.222 +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
   1.223 +    install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
   1.224 +endif()
   1.225 +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
   1.226 +    install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
   1.227 +endif()
   1.228 +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
   1.229 +    install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
   1.230 +endif()
   1.231 +
   1.232 +#============================================================================
   1.233 +# Example binaries
   1.234 +#============================================================================
   1.235 +
   1.236 +add_executable(example test/example.c)
   1.237 +target_link_libraries(example zlib)
   1.238 +add_test(example example)
   1.239 +
   1.240 +add_executable(minigzip test/minigzip.c)
   1.241 +target_link_libraries(minigzip zlib)
   1.242 +
   1.243 +if(HAVE_OFF64_T)
   1.244 +    add_executable(example64 test/example.c)
   1.245 +    target_link_libraries(example64 zlib)
   1.246 +    set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
   1.247 +    add_test(example64 example64)
   1.248 +
   1.249 +    add_executable(minigzip64 test/minigzip.c)
   1.250 +    target_link_libraries(minigzip64 zlib)
   1.251 +    set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
   1.252 +endif()
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/external/zlib-1.2.11/ChangeLog	Sat Oct 21 21:05:43 2017 -0700
     2.3 @@ -0,0 +1,1515 @@
     2.4 +
     2.5 +                ChangeLog file for zlib
     2.6 +
     2.7 +Changes in 1.2.11 (15 Jan 2017)
     2.8 +- Fix deflate stored bug when pulling last block from window
     2.9 +- Permit immediate deflateParams changes before any deflate input
    2.10 +
    2.11 +Changes in 1.2.10 (2 Jan 2017)
    2.12 +- Avoid warnings on snprintf() return value
    2.13 +- Fix bug in deflate_stored() for zero-length input
    2.14 +- Fix bug in gzwrite.c that produced corrupt gzip files
    2.15 +- Remove files to be installed before copying them in Makefile.in
    2.16 +- Add warnings when compiling with assembler code
    2.17 +
    2.18 +Changes in 1.2.9 (31 Dec 2016)
    2.19 +- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
    2.20 +- Improve contrib/blast to return unused bytes
    2.21 +- Assure that gzoffset() is correct when appending
    2.22 +- Improve compress() and uncompress() to support large lengths
    2.23 +- Fix bug in test/example.c where error code not saved
    2.24 +- Remedy Coverity warning [Randers-Pehrson]
    2.25 +- Improve speed of gzprintf() in transparent mode
    2.26 +- Fix inflateInit2() bug when windowBits is 16 or 32
    2.27 +- Change DEBUG macro to ZLIB_DEBUG
    2.28 +- Avoid uninitialized access by gzclose_w()
    2.29 +- Allow building zlib outside of the source directory
    2.30 +- Fix bug that accepted invalid zlib header when windowBits is zero
    2.31 +- Fix gzseek() problem on MinGW due to buggy _lseeki64 there
    2.32 +- Loop on write() calls in gzwrite.c in case of non-blocking I/O
    2.33 +- Add --warn (-w) option to ./configure for more compiler warnings
    2.34 +- Reject a window size of 256 bytes if not using the zlib wrapper
    2.35 +- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
    2.36 +- Add --debug (-d) option to ./configure to define ZLIB_DEBUG
    2.37 +- Fix bugs in creating a very large gzip header
    2.38 +- Add uncompress2() function, which returns the input size used
    2.39 +- Assure that deflateParams() will not switch functions mid-block
    2.40 +- Dramatically speed up deflation for level 0 (storing)
    2.41 +- Add gzfread(), duplicating the interface of fread()
    2.42 +- Add gzfwrite(), duplicating the interface of fwrite()
    2.43 +- Add deflateGetDictionary() function
    2.44 +- Use snprintf() for later versions of Microsoft C
    2.45 +- Fix *Init macros to use z_ prefix when requested
    2.46 +- Replace as400 with os400 for OS/400 support [Monnerat]
    2.47 +- Add crc32_z() and adler32_z() functions with size_t lengths
    2.48 +- Update Visual Studio project files [AraHaan]
    2.49 +
    2.50 +Changes in 1.2.8 (28 Apr 2013)
    2.51 +- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
    2.52 +- Do not force Z_CONST for C++
    2.53 +- Clean up contrib/vstudio [Roß]
    2.54 +- Correct spelling error in zlib.h
    2.55 +- Fix mixed line endings in contrib/vstudio
    2.56 +
    2.57 +Changes in 1.2.7.3 (13 Apr 2013)
    2.58 +- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc
    2.59 +
    2.60 +Changes in 1.2.7.2 (13 Apr 2013)
    2.61 +- Change check for a four-byte type back to hexadecimal
    2.62 +- Fix typo in win32/Makefile.msc
    2.63 +- Add casts in gzwrite.c for pointer differences
    2.64 +
    2.65 +Changes in 1.2.7.1 (24 Mar 2013)
    2.66 +- Replace use of unsafe string functions with snprintf if available
    2.67 +- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink]
    2.68 +- Fix gzgetc undefine when Z_PREFIX set [Turk]
    2.69 +- Eliminate use of mktemp in Makefile (not always available)
    2.70 +- Fix bug in 'F' mode for gzopen()
    2.71 +- Add inflateGetDictionary() function
    2.72 +- Correct comment in deflate.h
    2.73 +- Use _snprintf for snprintf in Microsoft C
    2.74 +- On Darwin, only use /usr/bin/libtool if libtool is not Apple
    2.75 +- Delete "--version" file if created by "ar --version" [Richard G.]
    2.76 +- Fix configure check for veracity of compiler error return codes
    2.77 +- Fix CMake compilation of static lib for MSVC2010 x64
    2.78 +- Remove unused variable in infback9.c
    2.79 +- Fix argument checks in gzlog_compress() and gzlog_write()
    2.80 +- Clean up the usage of z_const and respect const usage within zlib
    2.81 +- Clean up examples/gzlog.[ch] comparisons of different types
    2.82 +- Avoid shift equal to bits in type (caused endless loop)
    2.83 +- Fix uninitialized value bug in gzputc() introduced by const patches
    2.84 +- Fix memory allocation error in examples/zran.c [Nor]
    2.85 +- Fix bug where gzopen(), gzclose() would write an empty file
    2.86 +- Fix bug in gzclose() when gzwrite() runs out of memory
    2.87 +- Check for input buffer malloc failure in examples/gzappend.c
    2.88 +- Add note to contrib/blast to use binary mode in stdio
    2.89 +- Fix comparisons of differently signed integers in contrib/blast
    2.90 +- Check for invalid code length codes in contrib/puff
    2.91 +- Fix serious but very rare decompression bug in inftrees.c
    2.92 +- Update inflateBack() comments, since inflate() can be faster
    2.93 +- Use underscored I/O function names for WINAPI_FAMILY
    2.94 +- Add _tr_flush_bits to the external symbols prefixed by --zprefix
    2.95 +- Add contrib/vstudio/vc10 pre-build step for static only
    2.96 +- Quote --version-script argument in CMakeLists.txt
    2.97 +- Don't specify --version-script on Apple platforms in CMakeLists.txt
    2.98 +- Fix casting error in contrib/testzlib/testzlib.c
    2.99 +- Fix types in contrib/minizip to match result of get_crc_table()
   2.100 +- Simplify contrib/vstudio/vc10 with 'd' suffix
   2.101 +- Add TOP support to win32/Makefile.msc
   2.102 +- Suport i686 and amd64 assembler builds in CMakeLists.txt
   2.103 +- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
   2.104 +- Add vc11 and vc12 build files to contrib/vstudio
   2.105 +- Add gzvprintf() as an undocumented function in zlib
   2.106 +- Fix configure for Sun shell
   2.107 +- Remove runtime check in configure for four-byte integer type
   2.108 +- Add casts and consts to ease user conversion to C++
   2.109 +- Add man pages for minizip and miniunzip
   2.110 +- In Makefile uninstall, don't rm if preceding cd fails
   2.111 +- Do not return Z_BUF_ERROR if deflateParam() has nothing to write
   2.112 +
   2.113 +Changes in 1.2.7 (2 May 2012)
   2.114 +- Replace use of memmove() with a simple copy for portability
   2.115 +- Test for existence of strerror
   2.116 +- Restore gzgetc_ for backward compatibility with 1.2.6
   2.117 +- Fix build with non-GNU make on Solaris
   2.118 +- Require gcc 4.0 or later on Mac OS X to use the hidden attribute
   2.119 +- Include unistd.h for Watcom C
   2.120 +- Use __WATCOMC__ instead of __WATCOM__
   2.121 +- Do not use the visibility attribute if NO_VIZ defined
   2.122 +- Improve the detection of no hidden visibility attribute
   2.123 +- Avoid using __int64 for gcc or solo compilation
   2.124 +- Cast to char * in gzprintf to avoid warnings [Zinser]
   2.125 +- Fix make_vms.com for VAX [Zinser]
   2.126 +- Don't use library or built-in byte swaps
   2.127 +- Simplify test and use of gcc hidden attribute
   2.128 +- Fix bug in gzclose_w() when gzwrite() fails to allocate memory
   2.129 +- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
   2.130 +- Fix bug in test/minigzip.c for configure --solo
   2.131 +- Fix contrib/vstudio project link errors [Mohanathas]
   2.132 +- Add ability to choose the builder in make_vms.com [Schweda]
   2.133 +- Add DESTDIR support to mingw32 win32/Makefile.gcc
   2.134 +- Fix comments in win32/Makefile.gcc for proper usage
   2.135 +- Allow overriding the default install locations for cmake
   2.136 +- Generate and install the pkg-config file with cmake
   2.137 +- Build both a static and a shared version of zlib with cmake
   2.138 +- Include version symbols for cmake builds
   2.139 +- If using cmake with MSVC, add the source directory to the includes
   2.140 +- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta]
   2.141 +- Move obsolete emx makefile to old [Truta]
   2.142 +- Allow the use of -Wundef when compiling or using zlib
   2.143 +- Avoid the use of the -u option with mktemp
   2.144 +- Improve inflate() documentation on the use of Z_FINISH
   2.145 +- Recognize clang as gcc
   2.146 +- Add gzopen_w() in Windows for wide character path names
   2.147 +- Rename zconf.h in CMakeLists.txt to move it out of the way
   2.148 +- Add source directory in CMakeLists.txt for building examples
   2.149 +- Look in build directory for zlib.pc in CMakeLists.txt
   2.150 +- Remove gzflags from zlibvc.def in vc9 and vc10
   2.151 +- Fix contrib/minizip compilation in the MinGW environment
   2.152 +- Update ./configure for Solaris, support --64 [Mooney]
   2.153 +- Remove -R. from Solaris shared build (possible security issue)
   2.154 +- Avoid race condition for parallel make (-j) running example
   2.155 +- Fix type mismatch between get_crc_table() and crc_table
   2.156 +- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler]
   2.157 +- Fix the path to zlib.map in CMakeLists.txt
   2.158 +- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]
   2.159 +- Add instructions to win32/Makefile.gcc for shared install [Torri]
   2.160 +
   2.161 +Changes in 1.2.6.1 (12 Feb 2012)
   2.162 +- Avoid the use of the Objective-C reserved name "id"
   2.163 +- Include io.h in gzguts.h for Microsoft compilers
   2.164 +- Fix problem with ./configure --prefix and gzgetc macro
   2.165 +- Include gz_header definition when compiling zlib solo
   2.166 +- Put gzflags() functionality back in zutil.c
   2.167 +- Avoid library header include in crc32.c for Z_SOLO
   2.168 +- Use name in GCC_CLASSIC as C compiler for coverage testing, if set
   2.169 +- Minor cleanup in contrib/minizip/zip.c [Vollant]
   2.170 +- Update make_vms.com [Zinser]
   2.171 +- Remove unnecessary gzgetc_ function
   2.172 +- Use optimized byte swap operations for Microsoft and GNU [Snyder]
   2.173 +- Fix minor typo in zlib.h comments [Rzesniowiecki]
   2.174 +
   2.175 +Changes in 1.2.6 (29 Jan 2012)
   2.176 +- Update the Pascal interface in contrib/pascal
   2.177 +- Fix function numbers for gzgetc_ in zlibvc.def files
   2.178 +- Fix configure.ac for contrib/minizip [Schiffer]
   2.179 +- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
   2.180 +- Have ./configure use the compiler return code for error indication
   2.181 +- Fix CMakeLists.txt for cross compilation [McClure]
   2.182 +- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
   2.183 +- Fix compilation of contrib/minizip on FreeBSD [Marquez]
   2.184 +- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
   2.185 +- Include io.h for Turbo C / Borland C on all platforms [Truta]
   2.186 +- Make version explicit in contrib/minizip/configure.ac [Bosmans]
   2.187 +- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
   2.188 +- Minor cleanup up contrib/minizip/unzip.c [Vollant]
   2.189 +- Fix bug when compiling minizip with C++ [Vollant]
   2.190 +- Protect for long name and extra fields in contrib/minizip [Vollant]
   2.191 +- Avoid some warnings in contrib/minizip [Vollant]
   2.192 +- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
   2.193 +- Add missing libs to minizip linker command
   2.194 +- Add support for VPATH builds in contrib/minizip
   2.195 +- Add an --enable-demos option to contrib/minizip/configure
   2.196 +- Add the generation of configure.log by ./configure
   2.197 +- Exit when required parameters not provided to win32/Makefile.gcc
   2.198 +- Have gzputc return the character written instead of the argument
   2.199 +- Use the -m option on ldconfig for BSD systems [Tobias]
   2.200 +- Correct in zlib.map when deflateResetKeep was added
   2.201 +
   2.202 +Changes in 1.2.5.3 (15 Jan 2012)
   2.203 +- Restore gzgetc function for binary compatibility
   2.204 +- Do not use _lseeki64 under Borland C++ [Truta]
   2.205 +- Update win32/Makefile.msc to build test/*.c [Truta]
   2.206 +- Remove old/visualc6 given CMakefile and other alternatives
   2.207 +- Update AS400 build files and documentation [Monnerat]
   2.208 +- Update win32/Makefile.gcc to build test/*.c [Truta]
   2.209 +- Permit stronger flushes after Z_BLOCK flushes
   2.210 +- Avoid extraneous empty blocks when doing empty flushes
   2.211 +- Permit Z_NULL arguments to deflatePending
   2.212 +- Allow deflatePrime() to insert bits in the middle of a stream
   2.213 +- Remove second empty static block for Z_PARTIAL_FLUSH
   2.214 +- Write out all of the available bits when using Z_BLOCK
   2.215 +- Insert the first two strings in the hash table after a flush
   2.216 +
   2.217 +Changes in 1.2.5.2 (17 Dec 2011)
   2.218 +- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
   2.219 +- use relative symlinks for shared libs
   2.220 +- Avoid searching past window for Z_RLE strategy
   2.221 +- Assure that high-water mark initialization is always applied in deflate
   2.222 +- Add assertions to fill_window() in deflate.c to match comments
   2.223 +- Update python link in README
   2.224 +- Correct spelling error in gzread.c
   2.225 +- Fix bug in gzgets() for a concatenated empty gzip stream
   2.226 +- Correct error in comment for gz_make()
   2.227 +- Change gzread() and related to ignore junk after gzip streams
   2.228 +- Allow gzread() and related to continue after gzclearerr()
   2.229 +- Allow gzrewind() and gzseek() after a premature end-of-file
   2.230 +- Simplify gzseek() now that raw after gzip is ignored
   2.231 +- Change gzgetc() to a macro for speed (~40% speedup in testing)
   2.232 +- Fix gzclose() to return the actual error last encountered
   2.233 +- Always add large file support for windows
   2.234 +- Include zconf.h for windows large file support
   2.235 +- Include zconf.h.cmakein for windows large file support
   2.236 +- Update zconf.h.cmakein on make distclean
   2.237 +- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
   2.238 +- Clarify how gzopen() appends in zlib.h comments
   2.239 +- Correct documentation of gzdirect() since junk at end now ignored
   2.240 +- Add a transparent write mode to gzopen() when 'T' is in the mode
   2.241 +- Update python link in zlib man page
   2.242 +- Get inffixed.h and MAKEFIXED result to match
   2.243 +- Add a ./config --solo option to make zlib subset with no library use
   2.244 +- Add undocumented inflateResetKeep() function for CAB file decoding
   2.245 +- Add --cover option to ./configure for gcc coverage testing
   2.246 +- Add #define ZLIB_CONST option to use const in the z_stream interface
   2.247 +- Add comment to gzdopen() in zlib.h to use dup() when using fileno()
   2.248 +- Note behavior of uncompress() to provide as much data as it can
   2.249 +- Add files in contrib/minizip to aid in building libminizip
   2.250 +- Split off AR options in Makefile.in and configure
   2.251 +- Change ON macro to Z_ARG to avoid application conflicts
   2.252 +- Facilitate compilation with Borland C++ for pragmas and vsnprintf
   2.253 +- Include io.h for Turbo C / Borland C++
   2.254 +- Move example.c and minigzip.c to test/
   2.255 +- Simplify incomplete code table filling in inflate_table()
   2.256 +- Remove code from inflate.c and infback.c that is impossible to execute
   2.257 +- Test the inflate code with full coverage
   2.258 +- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw)
   2.259 +- Add deflateResetKeep and fix inflateResetKeep to retain dictionary
   2.260 +- Fix gzwrite.c to accommodate reduced memory zlib compilation
   2.261 +- Have inflate() with Z_FINISH avoid the allocation of a window
   2.262 +- Do not set strm->adler when doing raw inflate
   2.263 +- Fix gzeof() to behave just like feof() when read is not past end of file
   2.264 +- Fix bug in gzread.c when end-of-file is reached
   2.265 +- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF
   2.266 +- Document gzread() capability to read concurrently written files
   2.267 +- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]
   2.268 +
   2.269 +Changes in 1.2.5.1 (10 Sep 2011)
   2.270 +- Update FAQ entry on shared builds (#13)
   2.271 +- Avoid symbolic argument to chmod in Makefile.in
   2.272 +- Fix bug and add consts in contrib/puff [Oberhumer]
   2.273 +- Update contrib/puff/zeros.raw test file to have all block types
   2.274 +- Add full coverage test for puff in contrib/puff/Makefile
   2.275 +- Fix static-only-build install in Makefile.in
   2.276 +- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
   2.277 +- Add libz.a dependency to shared in Makefile.in for parallel builds
   2.278 +- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
   2.279 +- Replace $(...) with `...` in configure for non-bash sh [Bowler]
   2.280 +- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
   2.281 +- Add solaris* to Linux* in configure to allow gcc use [Groffen]
   2.282 +- Add *bsd* to Linux* case in configure [Bar-Lev]
   2.283 +- Add inffast.obj to dependencies in win32/Makefile.msc
   2.284 +- Correct spelling error in deflate.h [Kohler]
   2.285 +- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
   2.286 +- Add test to configure for GNU C looking for gcc in output of $cc -v
   2.287 +- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
   2.288 +- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
   2.289 +- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
   2.290 +- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
   2.291 +- Make stronger test in zconf.h to include unistd.h for LFS
   2.292 +- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
   2.293 +- Fix zlib.h LFS support when Z_PREFIX used
   2.294 +- Add updated as400 support (removed from old) [Monnerat]
   2.295 +- Avoid deflate sensitivity to volatile input data
   2.296 +- Avoid division in adler32_combine for NO_DIVIDE
   2.297 +- Clarify the use of Z_FINISH with deflateBound() amount of space
   2.298 +- Set binary for output file in puff.c
   2.299 +- Use u4 type for crc_table to avoid conversion warnings
   2.300 +- Apply casts in zlib.h to avoid conversion warnings
   2.301 +- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
   2.302 +- Improve inflateSync() documentation to note indeterminancy
   2.303 +- Add deflatePending() function to return the amount of pending output
   2.304 +- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
   2.305 +- Add a check in configure for stdarg.h, use for gzprintf()
   2.306 +- Check that pointers fit in ints when gzprint() compiled old style
   2.307 +- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
   2.308 +- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
   2.309 +- Add debug records in assmebler code [Londer]
   2.310 +- Update RFC references to use http://tools.ietf.org/html/... [Li]
   2.311 +- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
   2.312 +
   2.313 +Changes in 1.2.5 (19 Apr 2010)
   2.314 +- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
   2.315 +- Default to libdir as sharedlibdir in configure [Nieder]
   2.316 +- Update copyright dates on modified source files
   2.317 +- Update trees.c to be able to generate modified trees.h
   2.318 +- Exit configure for MinGW, suggesting win32/Makefile.gcc
   2.319 +- Check for NULL path in gz_open [Homurlu]
   2.320 +
   2.321 +Changes in 1.2.4.5 (18 Apr 2010)
   2.322 +- Set sharedlibdir in configure [Torok]
   2.323 +- Set LDFLAGS in Makefile.in [Bar-Lev]
   2.324 +- Avoid mkdir objs race condition in Makefile.in [Bowler]
   2.325 +- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
   2.326 +- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
   2.327 +- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
   2.328 +
   2.329 +Changes in 1.2.4.4 (18 Apr 2010)
   2.330 +- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
   2.331 +- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
   2.332 +- Try to use bash or ksh regardless of functionality of /bin/sh
   2.333 +- Fix configure incompatibility with NetBSD sh
   2.334 +- Remove attempt to run under bash or ksh since have better NetBSD fix
   2.335 +- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
   2.336 +- Add diagnostic messages when using CROSS_PREFIX in configure
   2.337 +- Added --sharedlibdir option to configure [Weigelt]
   2.338 +- Use hidden visibility attribute when available [Frysinger]
   2.339 +
   2.340 +Changes in 1.2.4.3 (10 Apr 2010)
   2.341 +- Only use CROSS_PREFIX in configure for ar and ranlib if they exist
   2.342 +- Use CROSS_PREFIX for nm [Bar-Lev]
   2.343 +- Assume _LARGEFILE64_SOURCE defined is equivalent to true
   2.344 +- Avoid use of undefined symbols in #if with && and ||
   2.345 +- Make *64 prototypes in gzguts.h consistent with functions
   2.346 +- Add -shared load option for MinGW in configure [Bowler]
   2.347 +- Move z_off64_t to public interface, use instead of off64_t
   2.348 +- Remove ! from shell test in configure (not portable to Solaris)
   2.349 +- Change +0 macro tests to -0 for possibly increased portability
   2.350 +
   2.351 +Changes in 1.2.4.2 (9 Apr 2010)
   2.352 +- Add consistent carriage returns to readme.txt's in masmx86 and masmx64
   2.353 +- Really provide prototypes for *64 functions when building without LFS
   2.354 +- Only define unlink() in minigzip.c if unistd.h not included
   2.355 +- Update README to point to contrib/vstudio project files
   2.356 +- Move projects/vc6 to old/ and remove projects/
   2.357 +- Include stdlib.h in minigzip.c for setmode() definition under WinCE
   2.358 +- Clean up assembler builds in win32/Makefile.msc [Rowe]
   2.359 +- Include sys/types.h for Microsoft for off_t definition
   2.360 +- Fix memory leak on error in gz_open()
   2.361 +- Symbolize nm as $NM in configure [Weigelt]
   2.362 +- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt]
   2.363 +- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined
   2.364 +- Fix bug in gzeof() to take into account unused input data
   2.365 +- Avoid initialization of structures with variables in puff.c
   2.366 +- Updated win32/README-WIN32.txt [Rowe]
   2.367 +
   2.368 +Changes in 1.2.4.1 (28 Mar 2010)
   2.369 +- Remove the use of [a-z] constructs for sed in configure [gentoo 310225]
   2.370 +- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech]
   2.371 +- Restore "for debugging" comment on sprintf() in gzlib.c
   2.372 +- Remove fdopen for MVS from gzguts.h
   2.373 +- Put new README-WIN32.txt in win32 [Rowe]
   2.374 +- Add check for shell to configure and invoke another shell if needed
   2.375 +- Fix big fat stinking bug in gzseek() on uncompressed files
   2.376 +- Remove vestigial F_OPEN64 define in zutil.h
   2.377 +- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
   2.378 +- Avoid errors on non-LFS systems when applications define LFS macros
   2.379 +- Set EXE to ".exe" in configure for MINGW [Kahle]
   2.380 +- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill]
   2.381 +- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev]
   2.382 +- Add DLL install in win32/makefile.gcc [Bar-Lev]
   2.383 +- Allow Linux* or linux* from uname in configure [Bar-Lev]
   2.384 +- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev]
   2.385 +- Add cross-compilation prefixes to configure [Bar-Lev]
   2.386 +- Match type exactly in gz_load() invocation in gzread.c
   2.387 +- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func
   2.388 +- Provide prototypes for *64 functions when building zlib without LFS
   2.389 +- Don't use -lc when linking shared library on MinGW
   2.390 +- Remove errno.h check in configure and vestigial errno code in zutil.h
   2.391 +
   2.392 +Changes in 1.2.4 (14 Mar 2010)
   2.393 +- Fix VER3 extraction in configure for no fourth subversion
   2.394 +- Update zlib.3, add docs to Makefile.in to make .pdf out of it
   2.395 +- Add zlib.3.pdf to distribution
   2.396 +- Don't set error code in gzerror() if passed pointer is NULL
   2.397 +- Apply destination directory fixes to CMakeLists.txt [Lowman]
   2.398 +- Move #cmakedefine's to a new zconf.in.cmakein
   2.399 +- Restore zconf.h for builds that don't use configure or cmake
   2.400 +- Add distclean to dummy Makefile for convenience
   2.401 +- Update and improve INDEX, README, and FAQ
   2.402 +- Update CMakeLists.txt for the return of zconf.h [Lowman]
   2.403 +- Update contrib/vstudio/vc9 and vc10 [Vollant]
   2.404 +- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
   2.405 +- Apply license and readme changes to contrib/asm686 [Raiter]
   2.406 +- Check file name lengths and add -c option in minigzip.c [Li]
   2.407 +- Update contrib/amd64 and contrib/masmx86/ [Vollant]
   2.408 +- Avoid use of "eof" parameter in trees.c to not shadow library variable
   2.409 +- Update make_vms.com for removal of zlibdefs.h [Zinser]
   2.410 +- Update assembler code and vstudio projects in contrib [Vollant]
   2.411 +- Remove outdated assembler code contrib/masm686 and contrib/asm586
   2.412 +- Remove old vc7 and vc8 from contrib/vstudio
   2.413 +- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
   2.414 +- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
   2.415 +- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
   2.416 +- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
   2.417 +- Fix bug in void-returning vsprintf() case in gzwrite.c
   2.418 +- Fix name change from inflate.h in contrib/inflate86/inffas86.c
   2.419 +- Check if temporary file exists before removing in make_vms.com [Zinser]
   2.420 +- Fix make install and uninstall for --static option
   2.421 +- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
   2.422 +- Update readme.txt in contrib/masmx64 and masmx86 to assemble
   2.423 +
   2.424 +Changes in 1.2.3.9 (21 Feb 2010)
   2.425 +- Expunge gzio.c
   2.426 +- Move as400 build information to old
   2.427 +- Fix updates in contrib/minizip and contrib/vstudio
   2.428 +- Add const to vsnprintf test in configure to avoid warnings [Weigelt]
   2.429 +- Delete zconf.h (made by configure) [Weigelt]
   2.430 +- Change zconf.in.h to zconf.h.in per convention [Weigelt]
   2.431 +- Check for NULL buf in gzgets()
   2.432 +- Return empty string for gzgets() with len == 1 (like fgets())
   2.433 +- Fix description of gzgets() in zlib.h for end-of-file, NULL return
   2.434 +- Update minizip to 1.1 [Vollant]
   2.435 +- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c
   2.436 +- Note in zlib.h that gzerror() should be used to distinguish from EOF
   2.437 +- Remove use of snprintf() from gzlib.c
   2.438 +- Fix bug in gzseek()
   2.439 +- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant]
   2.440 +- Fix zconf.h generation in CMakeLists.txt [Lowman]
   2.441 +- Improve comments in zconf.h where modified by configure
   2.442 +
   2.443 +Changes in 1.2.3.8 (13 Feb 2010)
   2.444 +- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
   2.445 +- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
   2.446 +- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
   2.447 +- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
   2.448 +- Fix missing error return in gzflush(), add zlib.h note
   2.449 +- Add *64 functions to zlib.map [Levin]
   2.450 +- Fix signed/unsigned comparison in gz_comp()
   2.451 +- Use SFLAGS when testing shared linking in configure
   2.452 +- Add --64 option to ./configure to use -m64 with gcc
   2.453 +- Fix ./configure --help to correctly name options
   2.454 +- Have make fail if a test fails [Levin]
   2.455 +- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
   2.456 +- Remove assembler object files from contrib
   2.457 +
   2.458 +Changes in 1.2.3.7 (24 Jan 2010)
   2.459 +- Always gzopen() with O_LARGEFILE if available
   2.460 +- Fix gzdirect() to work immediately after gzopen() or gzdopen()
   2.461 +- Make gzdirect() more precise when the state changes while reading
   2.462 +- Improve zlib.h documentation in many places
   2.463 +- Catch memory allocation failure in gz_open()
   2.464 +- Complete close operation if seek forward in gzclose_w() fails
   2.465 +- Return Z_ERRNO from gzclose_r() if close() fails
   2.466 +- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
   2.467 +- Return zero for gzwrite() errors to match zlib.h description
   2.468 +- Return -1 on gzputs() error to match zlib.h description
   2.469 +- Add zconf.in.h to allow recovery from configure modification [Weigelt]
   2.470 +- Fix static library permissions in Makefile.in [Weigelt]
   2.471 +- Avoid warnings in configure tests that hide functionality [Weigelt]
   2.472 +- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
   2.473 +- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
   2.474 +- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
   2.475 +- Keep object files in subdirectories to reduce the clutter somewhat
   2.476 +- Remove default Makefile and zlibdefs.h, add dummy Makefile
   2.477 +- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
   2.478 +- Remove zlibdefs.h completely -- modify zconf.h instead
   2.479 +
   2.480 +Changes in 1.2.3.6 (17 Jan 2010)
   2.481 +- Avoid void * arithmetic in gzread.c and gzwrite.c
   2.482 +- Make compilers happier with const char * for gz_error message
   2.483 +- Avoid unused parameter warning in inflate.c
   2.484 +- Avoid signed-unsigned comparison warning in inflate.c
   2.485 +- Indent #pragma's for traditional C
   2.486 +- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
   2.487 +- Correct email address in configure for system options
   2.488 +- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
   2.489 +- Update zlib.map [Brown]
   2.490 +- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
   2.491 +- Apply various fixes to CMakeLists.txt [Lowman]
   2.492 +- Add checks on len in gzread() and gzwrite()
   2.493 +- Add error message for no more room for gzungetc()
   2.494 +- Remove zlib version check in gzwrite()
   2.495 +- Defer compression of gzprintf() result until need to
   2.496 +- Use snprintf() in gzdopen() if available
   2.497 +- Remove USE_MMAP configuration determination (only used by minigzip)
   2.498 +- Remove examples/pigz.c (available separately)
   2.499 +- Update examples/gun.c to 1.6
   2.500 +
   2.501 +Changes in 1.2.3.5 (8 Jan 2010)
   2.502 +- Add space after #if in zutil.h for some compilers
   2.503 +- Fix relatively harmless bug in deflate_fast() [Exarevsky]
   2.504 +- Fix same problem in deflate_slow()
   2.505 +- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
   2.506 +- Add deflate_rle() for faster Z_RLE strategy run-length encoding
   2.507 +- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
   2.508 +- Change name of "write" variable in inffast.c to avoid library collisions
   2.509 +- Fix premature EOF from gzread() in gzio.c [Brown]
   2.510 +- Use zlib header window size if windowBits is 0 in inflateInit2()
   2.511 +- Remove compressBound() call in deflate.c to avoid linking compress.o
   2.512 +- Replace use of errno in gz* with functions, support WinCE [Alves]
   2.513 +- Provide alternative to perror() in minigzip.c for WinCE [Alves]
   2.514 +- Don't use _vsnprintf on later versions of MSVC [Lowman]
   2.515 +- Add CMake build script and input file [Lowman]
   2.516 +- Update contrib/minizip to 1.1 [Svensson, Vollant]
   2.517 +- Moved nintendods directory from contrib to .
   2.518 +- Replace gzio.c with a new set of routines with the same functionality
   2.519 +- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
   2.520 +- Update contrib/minizip to 1.1b
   2.521 +- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
   2.522 +
   2.523 +Changes in 1.2.3.4 (21 Dec 2009)
   2.524 +- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
   2.525 +- Update comments in configure and Makefile.in for default --shared
   2.526 +- Fix test -z's in configure [Marquess]
   2.527 +- Build examplesh and minigzipsh when not testing
   2.528 +- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
   2.529 +- Import LDFLAGS from the environment in configure
   2.530 +- Fix configure to populate SFLAGS with discovered CFLAGS options
   2.531 +- Adapt make_vms.com to the new Makefile.in [Zinser]
   2.532 +- Add zlib2ansi script for C++ compilation [Marquess]
   2.533 +- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
   2.534 +- Add AMD64 assembler code for longest match to contrib [Teterin]
   2.535 +- Include options from $SFLAGS when doing $LDSHARED
   2.536 +- Simplify 64-bit file support by introducing z_off64_t type
   2.537 +- Make shared object files in objs directory to work around old Sun cc
   2.538 +- Use only three-part version number for Darwin shared compiles
   2.539 +- Add rc option to ar in Makefile.in for when ./configure not run
   2.540 +- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
   2.541 +- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
   2.542 +- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
   2.543 +- Rename Makefile.in targets allstatic to static and allshared to shared
   2.544 +- Fix static and shared Makefile.in targets to be independent
   2.545 +- Correct error return bug in gz_open() by setting state [Brown]
   2.546 +- Put spaces before ;;'s in configure for better sh compatibility
   2.547 +- Add pigz.c (parallel implementation of gzip) to examples/
   2.548 +- Correct constant in crc32.c to UL [Leventhal]
   2.549 +- Reject negative lengths in crc32_combine()
   2.550 +- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
   2.551 +- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
   2.552 +- Correct typo in doc/algorithm.txt [Janik]
   2.553 +- Fix bug in adler32_combine() [Zhu]
   2.554 +- Catch missing-end-of-block-code error in all inflates and in puff
   2.555 +    Assures that random input to inflate eventually results in an error
   2.556 +- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
   2.557 +- Update ENOUGH and its usage to reflect discovered bounds
   2.558 +- Fix gzerror() error report on empty input file [Brown]
   2.559 +- Add ush casts in trees.c to avoid pedantic runtime errors
   2.560 +- Fix typo in zlib.h uncompress() description [Reiss]
   2.561 +- Correct inflate() comments with regard to automatic header detection
   2.562 +- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
   2.563 +- Put new version of gzlog (2.0) in examples with interruption recovery
   2.564 +- Add puff compile option to permit invalid distance-too-far streams
   2.565 +- Add puff TEST command options, ability to read piped input
   2.566 +- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
   2.567 +  _LARGEFILE64_SOURCE not defined
   2.568 +- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
   2.569 +- Fix deflateSetDictionary() to use all 32K for output consistency
   2.570 +- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
   2.571 +- Clear bytes after deflate lookahead to avoid use of uninitialized data
   2.572 +- Change a limit in inftrees.c to be more transparent to Coverity Prevent
   2.573 +- Update win32/zlib.def with exported symbols from zlib.h
   2.574 +- Correct spelling errors in zlib.h [Willem, Sobrado]
   2.575 +- Allow Z_BLOCK for deflate() to force a new block
   2.576 +- Allow negative bits in inflatePrime() to delete existing bit buffer
   2.577 +- Add Z_TREES flush option to inflate() to return at end of trees
   2.578 +- Add inflateMark() to return current state information for random access
   2.579 +- Add Makefile for NintendoDS to contrib [Costa]
   2.580 +- Add -w in configure compile tests to avoid spurious warnings [Beucler]
   2.581 +- Fix typos in zlib.h comments for deflateSetDictionary()
   2.582 +- Fix EOF detection in transparent gzread() [Maier]
   2.583 +
   2.584 +Changes in 1.2.3.3 (2 October 2006)
   2.585 +- Make --shared the default for configure, add a --static option
   2.586 +- Add compile option to permit invalid distance-too-far streams
   2.587 +- Add inflateUndermine() function which is required to enable above
   2.588 +- Remove use of "this" variable name for C++ compatibility [Marquess]
   2.589 +- Add testing of shared library in make test, if shared library built
   2.590 +- Use ftello() and fseeko() if available instead of ftell() and fseek()
   2.591 +- Provide two versions of all functions that use the z_off_t type for
   2.592 +  binary compatibility -- a normal version and a 64-bit offset version,
   2.593 +  per the Large File Support Extension when _LARGEFILE64_SOURCE is
   2.594 +  defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
   2.595 +  is defined to be 64
   2.596 +- Add a --uname= option to configure to perhaps help with cross-compiling
   2.597 +
   2.598 +Changes in 1.2.3.2 (3 September 2006)
   2.599 +- Turn off silly Borland warnings [Hay]
   2.600 +- Use off64_t and define _LARGEFILE64_SOURCE when present
   2.601 +- Fix missing dependency on inffixed.h in Makefile.in
   2.602 +- Rig configure --shared to build both shared and static [Teredesai, Truta]
   2.603 +- Remove zconf.in.h and instead create a new zlibdefs.h file
   2.604 +- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
   2.605 +- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
   2.606 +
   2.607 +Changes in 1.2.3.1 (16 August 2006)
   2.608 +- Add watcom directory with OpenWatcom make files [Daniel]
   2.609 +- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
   2.610 +- Update make_vms.com [Zinser]
   2.611 +- Use -fPIC for shared build in configure [Teredesai, Nicholson]
   2.612 +- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
   2.613 +- Use fdopen() (not _fdopen()) for Interix in zutil.h [Bäck]
   2.614 +- Add some FAQ entries about the contrib directory
   2.615 +- Update the MVS question in the FAQ
   2.616 +- Avoid extraneous reads after EOF in gzio.c [Brown]
   2.617 +- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
   2.618 +- Add comments to zlib.h about gzerror() usage [Brown]
   2.619 +- Set extra flags in gzip header in gzopen() like deflate() does
   2.620 +- Make configure options more compatible with double-dash conventions
   2.621 +  [Weigelt]
   2.622 +- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
   2.623 +- Fix uninstall target in Makefile.in [Truta]
   2.624 +- Add pkgconfig support [Weigelt]
   2.625 +- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
   2.626 +- Replace set_data_type() with a more accurate detect_data_type() in
   2.627 +  trees.c, according to the txtvsbin.txt document [Truta]
   2.628 +- Swap the order of #include <stdio.h> and #include "zlib.h" in
   2.629 +  gzio.c, example.c and minigzip.c [Truta]
   2.630 +- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
   2.631 +  Truta] (where?)
   2.632 +- Fix target "clean" from win32/Makefile.bor [Truta]
   2.633 +- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
   2.634 +- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
   2.635 +- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
   2.636 +- Enable browse info in the "Debug" and "ASM Debug" configurations in
   2.637 +  the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
   2.638 +- Add pkgconfig support [Weigelt]
   2.639 +- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
   2.640 +  for use in win32/zlib1.rc [Polushin, Rowe, Truta]
   2.641 +- Add a document that explains the new text detection scheme to
   2.642 +  doc/txtvsbin.txt [Truta]
   2.643 +- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
   2.644 +- Move algorithm.txt into doc/ [Truta]
   2.645 +- Synchronize FAQ with website
   2.646 +- Fix compressBound(), was low for some pathological cases [Fearnley]
   2.647 +- Take into account wrapper variations in deflateBound()
   2.648 +- Set examples/zpipe.c input and output to binary mode for Windows
   2.649 +- Update examples/zlib_how.html with new zpipe.c (also web site)
   2.650 +- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
   2.651 +  that gcc became pickier in 4.0)
   2.652 +- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
   2.653 +  un-versioned, the patch adds versioning only for symbols introduced in
   2.654 +  zlib-1.2.0 or later.  It also declares as local those symbols which are
   2.655 +  not designed to be exported." [Levin]
   2.656 +- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
   2.657 +- Do not initialize global static by default in trees.c, add a response
   2.658 +  NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
   2.659 +- Don't use strerror() in gzio.c under WinCE [Yakimov]
   2.660 +- Don't use errno.h in zutil.h under WinCE [Yakimov]
   2.661 +- Move arguments for AR to its usage to allow replacing ar [Marot]
   2.662 +- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
   2.663 +- Improve inflateInit() and inflateInit2() documentation
   2.664 +- Fix structure size comment in inflate.h
   2.665 +- Change configure help option from --h* to --help [Santos]
   2.666 +
   2.667 +Changes in 1.2.3 (18 July 2005)
   2.668 +- Apply security vulnerability fixes to contrib/infback9 as well
   2.669 +- Clean up some text files (carriage returns, trailing space)
   2.670 +- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
   2.671 +
   2.672 +Changes in 1.2.2.4 (11 July 2005)
   2.673 +- Add inflatePrime() function for starting inflation at bit boundary
   2.674 +- Avoid some Visual C warnings in deflate.c
   2.675 +- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit
   2.676 +  compile
   2.677 +- Fix some spelling errors in comments [Betts]
   2.678 +- Correct inflateInit2() error return documentation in zlib.h
   2.679 +- Add zran.c example of compressed data random access to examples
   2.680 +  directory, shows use of inflatePrime()
   2.681 +- Fix cast for assignments to strm->state in inflate.c and infback.c
   2.682 +- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
   2.683 +- Move declarations of gf2 functions to right place in crc32.c [Oberhumer]
   2.684 +- Add cast in trees.c t avoid a warning [Oberhumer]
   2.685 +- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer]
   2.686 +- Update make_vms.com [Zinser]
   2.687 +- Initialize state->write in inflateReset() since copied in inflate_fast()
   2.688 +- Be more strict on incomplete code sets in inflate_table() and increase
   2.689 +  ENOUGH and MAXD -- this repairs a possible security vulnerability for
   2.690 +  invalid inflate input.  Thanks to Tavis Ormandy and Markus Oberhumer for
   2.691 +  discovering the vulnerability and providing test cases.
   2.692 +- Add ia64 support to configure for HP-UX [Smith]
   2.693 +- Add error return to gzread() for format or i/o error [Levin]
   2.694 +- Use malloc.h for OS/2 [Necasek]
   2.695 +
   2.696 +Changes in 1.2.2.3 (27 May 2005)
   2.697 +- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile
   2.698 +- Typecast fread() return values in gzio.c [Vollant]
   2.699 +- Remove trailing space in minigzip.c outmode (VC++ can't deal with it)
   2.700 +- Fix crc check bug in gzread() after gzungetc() [Heiner]
   2.701 +- Add the deflateTune() function to adjust internal compression parameters
   2.702 +- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack)
   2.703 +- Remove an incorrect assertion in examples/zpipe.c
   2.704 +- Add C++ wrapper in infback9.h [Donais]
   2.705 +- Fix bug in inflateCopy() when decoding fixed codes
   2.706 +- Note in zlib.h how much deflateSetDictionary() actually uses
   2.707 +- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used)
   2.708 +- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer]
   2.709 +- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer]
   2.710 +- Add gzdirect() function to indicate transparent reads
   2.711 +- Update contrib/minizip [Vollant]
   2.712 +- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer]
   2.713 +- Add casts in crc32.c to avoid warnings [Oberhumer]
   2.714 +- Add contrib/masmx64 [Vollant]
   2.715 +- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant]
   2.716 +
   2.717 +Changes in 1.2.2.2 (30 December 2004)
   2.718 +- Replace structure assignments in deflate.c and inflate.c with zmemcpy to
   2.719 +  avoid implicit memcpy calls (portability for no-library compilation)
   2.720 +- Increase sprintf() buffer size in gzdopen() to allow for large numbers
   2.721 +- Add INFLATE_STRICT to check distances against zlib header
   2.722 +- Improve WinCE errno handling and comments [Chang]
   2.723 +- Remove comment about no gzip header processing in FAQ
   2.724 +- Add Z_FIXED strategy option to deflateInit2() to force fixed trees
   2.725 +- Add updated make_vms.com [Coghlan], update README
   2.726 +- Create a new "examples" directory, move gzappend.c there, add zpipe.c,
   2.727 +  fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
   2.728 +- Add FAQ entry and comments in deflate.c on uninitialized memory access
   2.729 +- Add Solaris 9 make options in configure [Gilbert]
   2.730 +- Allow strerror() usage in gzio.c for STDC
   2.731 +- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
   2.732 +- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
   2.733 +- Use z_off_t for adler32_combine() and crc32_combine() lengths
   2.734 +- Make adler32() much faster for small len
   2.735 +- Use OS_CODE in deflate() default gzip header
   2.736 +
   2.737 +Changes in 1.2.2.1 (31 October 2004)
   2.738 +- Allow inflateSetDictionary() call for raw inflate
   2.739 +- Fix inflate header crc check bug for file names and comments
   2.740 +- Add deflateSetHeader() and gz_header structure for custom gzip headers
   2.741 +- Add inflateGetheader() to retrieve gzip headers
   2.742 +- Add crc32_combine() and adler32_combine() functions
   2.743 +- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list
   2.744 +- Use zstreamp consistently in zlib.h (inflate_back functions)
   2.745 +- Remove GUNZIP condition from definition of inflate_mode in inflate.h
   2.746 +  and in contrib/inflate86/inffast.S [Truta, Anderson]
   2.747 +- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson]
   2.748 +- Update projects/README.projects and projects/visualc6 [Truta]
   2.749 +- Update win32/DLL_FAQ.txt [Truta]
   2.750 +- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta]
   2.751 +- Deprecate Z_ASCII; use Z_TEXT instead [Truta]
   2.752 +- Use a new algorithm for setting strm->data_type in trees.c [Truta]
   2.753 +- Do not define an exit() prototype in zutil.c unless DEBUG defined
   2.754 +- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta]
   2.755 +- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate()
   2.756 +- Fix Darwin build version identification [Peterson]
   2.757 +
   2.758 +Changes in 1.2.2 (3 October 2004)
   2.759 +- Update zlib.h comments on gzip in-memory processing
   2.760 +- Set adler to 1 in inflateReset() to support Java test suite [Walles]
   2.761 +- Add contrib/dotzlib [Ravn]
   2.762 +- Update win32/DLL_FAQ.txt [Truta]
   2.763 +- Update contrib/minizip [Vollant]
   2.764 +- Move contrib/visual-basic.txt to old/ [Truta]
   2.765 +- Fix assembler builds in projects/visualc6/ [Truta]
   2.766 +
   2.767 +Changes in 1.2.1.2 (9 September 2004)
   2.768 +- Update INDEX file
   2.769 +- Fix trees.c to update strm->data_type (no one ever noticed!)
   2.770 +- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown]
   2.771 +- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE)
   2.772 +- Add limited multitasking protection to DYNAMIC_CRC_TABLE
   2.773 +- Add NO_vsnprintf for VMS in zutil.h [Mozilla]
   2.774 +- Don't declare strerror() under VMS [Mozilla]
   2.775 +- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize
   2.776 +- Update contrib/ada [Anisimkov]
   2.777 +- Update contrib/minizip [Vollant]
   2.778 +- Fix configure to not hardcode directories for Darwin [Peterson]
   2.779 +- Fix gzio.c to not return error on empty files [Brown]
   2.780 +- Fix indentation; update version in contrib/delphi/ZLib.pas and
   2.781 +  contrib/pascal/zlibpas.pas [Truta]
   2.782 +- Update mkasm.bat in contrib/masmx86 [Truta]
   2.783 +- Update contrib/untgz [Truta]
   2.784 +- Add projects/README.projects [Truta]
   2.785 +- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta]
   2.786 +- Update win32/DLL_FAQ.txt [Truta]
   2.787 +- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta]
   2.788 +- Remove an unnecessary assignment to curr in inftrees.c [Truta]
   2.789 +- Add OS/2 to exe builds in configure [Poltorak]
   2.790 +- Remove err dummy parameter in zlib.h [Kientzle]
   2.791 +
   2.792 +Changes in 1.2.1.1 (9 January 2004)
   2.793 +- Update email address in README
   2.794 +- Several FAQ updates
   2.795 +- Fix a big fat bug in inftrees.c that prevented decoding valid
   2.796 +  dynamic blocks with only literals and no distance codes --
   2.797 +  Thanks to "Hot Emu" for the bug report and sample file
   2.798 +- Add a note to puff.c on no distance codes case.
   2.799 +
   2.800 +Changes in 1.2.1 (17 November 2003)
   2.801 +- Remove a tab in contrib/gzappend/gzappend.c
   2.802 +- Update some interfaces in contrib for new zlib functions
   2.803 +- Update zlib version number in some contrib entries
   2.804 +- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta]
   2.805 +- Support shared libraries on Hurd and KFreeBSD [Brown]
   2.806 +- Fix error in NO_DIVIDE option of adler32.c
   2.807 +
   2.808 +Changes in 1.2.0.8 (4 November 2003)
   2.809 +- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
   2.810 +- Add experimental NO_DIVIDE #define in adler32.c
   2.811 +    - Possibly faster on some processors (let me know if it is)
   2.812 +- Correct Z_BLOCK to not return on first inflate call if no wrap
   2.813 +- Fix strm->data_type on inflate() return to correctly indicate EOB
   2.814 +- Add deflatePrime() function for appending in the middle of a byte
   2.815 +- Add contrib/gzappend for an example of appending to a stream
   2.816 +- Update win32/DLL_FAQ.txt [Truta]
   2.817 +- Delete Turbo C comment in README [Truta]
   2.818 +- Improve some indentation in zconf.h [Truta]
   2.819 +- Fix infinite loop on bad input in configure script [Church]
   2.820 +- Fix gzeof() for concatenated gzip files [Johnson]
   2.821 +- Add example to contrib/visual-basic.txt [Michael B.]
   2.822 +- Add -p to mkdir's in Makefile.in [vda]
   2.823 +- Fix configure to properly detect presence or lack of printf functions
   2.824 +- Add AS400 support [Monnerat]
   2.825 +- Add a little Cygwin support [Wilson]
   2.826 +
   2.827 +Changes in 1.2.0.7 (21 September 2003)
   2.828 +- Correct some debug formats in contrib/infback9
   2.829 +- Cast a type in a debug statement in trees.c
   2.830 +- Change search and replace delimiter in configure from % to # [Beebe]
   2.831 +- Update contrib/untgz to 0.2 with various fixes [Truta]
   2.832 +- Add build support for Amiga [Nikl]
   2.833 +- Remove some directories in old that have been updated to 1.2
   2.834 +- Add dylib building for Mac OS X in configure and Makefile.in
   2.835 +- Remove old distribution stuff from Makefile
   2.836 +- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
   2.837 +- Update links in README
   2.838 +
   2.839 +Changes in 1.2.0.6 (13 September 2003)
   2.840 +- Minor FAQ updates
   2.841 +- Update contrib/minizip to 1.00 [Vollant]
   2.842 +- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
   2.843 +- Update POSTINC comment for 68060 [Nikl]
   2.844 +- Add contrib/infback9 with deflate64 decoding (unsupported)
   2.845 +- For MVS define NO_vsnprintf and undefine FAR [van Burik]
   2.846 +- Add pragma for fdopen on MVS [van Burik]
   2.847 +
   2.848 +Changes in 1.2.0.5 (8 September 2003)
   2.849 +- Add OF to inflateBackEnd() declaration in zlib.h
   2.850 +- Remember start when using gzdopen in the middle of a file
   2.851 +- Use internal off_t counters in gz* functions to properly handle seeks
   2.852 +- Perform more rigorous check for distance-too-far in inffast.c
   2.853 +- Add Z_BLOCK flush option to return from inflate at block boundary
   2.854 +- Set strm->data_type on return from inflate
   2.855 +    - Indicate bits unused, if at block boundary, and if in last block
   2.856 +- Replace size_t with ptrdiff_t in crc32.c, and check for correct size
   2.857 +- Add condition so old NO_DEFLATE define still works for compatibility
   2.858 +- FAQ update regarding the Windows DLL [Truta]
   2.859 +- INDEX update: add qnx entry, remove aix entry [Truta]
   2.860 +- Install zlib.3 into mandir [Wilson]
   2.861 +- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta]
   2.862 +- Adapt the zlib interface to the new DLL convention guidelines [Truta]
   2.863 +- Introduce ZLIB_WINAPI macro to allow the export of functions using
   2.864 +  the WINAPI calling convention, for Visual Basic [Vollant, Truta]
   2.865 +- Update msdos and win32 scripts and makefiles [Truta]
   2.866 +- Export symbols by name, not by ordinal, in win32/zlib.def [Truta]
   2.867 +- Add contrib/ada [Anisimkov]
   2.868 +- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta]
   2.869 +- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant]
   2.870 +- Add contrib/masm686 [Truta]
   2.871 +- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm
   2.872 +  [Truta, Vollant]
   2.873 +- Update contrib/delphi; rename to contrib/pascal; add example [Truta]
   2.874 +- Remove contrib/delphi2; add a new contrib/delphi [Truta]
   2.875 +- Avoid inclusion of the nonstandard <memory.h> in contrib/iostream,
   2.876 +  and fix some method prototypes [Truta]
   2.877 +- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip
   2.878 +  [Truta]
   2.879 +- Avoid the use of backslash (\) in contrib/minizip [Vollant]
   2.880 +- Fix file time handling in contrib/untgz; update makefiles [Truta]
   2.881 +- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines
   2.882 +  [Vollant]
   2.883 +- Remove contrib/vstudio/vc15_16 [Vollant]
   2.884 +- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta]
   2.885 +- Update README.contrib [Truta]
   2.886 +- Invert the assignment order of match_head and s->prev[...] in
   2.887 +  INSERT_STRING [Truta]
   2.888 +- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings
   2.889 +  [Truta]
   2.890 +- Compare function pointers with 0, not with NULL or Z_NULL [Truta]
   2.891 +- Fix prototype of syncsearch in inflate.c [Truta]
   2.892 +- Introduce ASMINF macro to be enabled when using an ASM implementation
   2.893 +  of inflate_fast [Truta]
   2.894 +- Change NO_DEFLATE to NO_GZCOMPRESS [Truta]
   2.895 +- Modify test_gzio in example.c to take a single file name as a
   2.896 +  parameter [Truta]
   2.897 +- Exit the example.c program if gzopen fails [Truta]
   2.898 +- Add type casts around strlen in example.c [Truta]
   2.899 +- Remove casting to sizeof in minigzip.c; give a proper type
   2.900 +  to the variable compared with SUFFIX_LEN [Truta]
   2.901 +- Update definitions of STDC and STDC99 in zconf.h [Truta]
   2.902 +- Synchronize zconf.h with the new Windows DLL interface [Truta]
   2.903 +- Use SYS16BIT instead of __32BIT__ to distinguish between
   2.904 +  16- and 32-bit platforms [Truta]
   2.905 +- Use far memory allocators in small 16-bit memory models for
   2.906 +  Turbo C [Truta]
   2.907 +- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in
   2.908 +  zlibCompileFlags [Truta]
   2.909 +- Cygwin has vsnprintf [Wilson]
   2.910 +- In Windows16, OS_CODE is 0, as in MSDOS [Truta]
   2.911 +- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson]
   2.912 +
   2.913 +Changes in 1.2.0.4 (10 August 2003)
   2.914 +- Minor FAQ updates
   2.915 +- Be more strict when checking inflateInit2's windowBits parameter
   2.916 +- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well
   2.917 +- Add gzip wrapper option to deflateInit2 using windowBits
   2.918 +- Add updated QNX rule in configure and qnx directory [Bonnefoy]
   2.919 +- Make inflate distance-too-far checks more rigorous
   2.920 +- Clean up FAR usage in inflate
   2.921 +- Add casting to sizeof() in gzio.c and minigzip.c
   2.922 +
   2.923 +Changes in 1.2.0.3 (19 July 2003)
   2.924 +- Fix silly error in gzungetc() implementation [Vollant]
   2.925 +- Update contrib/minizip and contrib/vstudio [Vollant]
   2.926 +- Fix printf format in example.c
   2.927 +- Correct cdecl support in zconf.in.h [Anisimkov]
   2.928 +- Minor FAQ updates
   2.929 +
   2.930 +Changes in 1.2.0.2 (13 July 2003)
   2.931 +- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
   2.932 +- Attempt to avoid warnings in crc32.c for pointer-int conversion
   2.933 +- Add AIX to configure, remove aix directory [Bakker]
   2.934 +- Add some casts to minigzip.c
   2.935 +- Improve checking after insecure sprintf() or vsprintf() calls
   2.936 +- Remove #elif's from crc32.c
   2.937 +- Change leave label to inf_leave in inflate.c and infback.c to avoid
   2.938 +  library conflicts
   2.939 +- Remove inflate gzip decoding by default--only enable gzip decoding by
   2.940 +  special request for stricter backward compatibility
   2.941 +- Add zlibCompileFlags() function to return compilation information
   2.942 +- More typecasting in deflate.c to avoid warnings
   2.943 +- Remove leading underscore from _Capital #defines [Truta]
   2.944 +- Fix configure to link shared library when testing
   2.945 +- Add some Windows CE target adjustments [Mai]
   2.946 +- Remove #define ZLIB_DLL in zconf.h [Vollant]
   2.947 +- Add zlib.3 [Rodgers]
   2.948 +- Update RFC URL in deflate.c and algorithm.txt [Mai]
   2.949 +- Add zlib_dll_FAQ.txt to contrib [Truta]
   2.950 +- Add UL to some constants [Truta]
   2.951 +- Update minizip and vstudio [Vollant]
   2.952 +- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
   2.953 +- Expand use of NO_DUMMY_DECL to avoid all dummy structures
   2.954 +- Added iostream3 to contrib [Schwardt]
   2.955 +- Replace rewind() with fseek() for WinCE [Truta]
   2.956 +- Improve setting of zlib format compression level flags
   2.957 +    - Report 0 for huffman and rle strategies and for level == 0 or 1
   2.958 +    - Report 2 only for level == 6
   2.959 +- Only deal with 64K limit when necessary at compile time [Truta]
   2.960 +- Allow TOO_FAR check to be turned off at compile time [Truta]
   2.961 +- Add gzclearerr() function [Souza]
   2.962 +- Add gzungetc() function
   2.963 +
   2.964 +Changes in 1.2.0.1 (17 March 2003)
   2.965 +- Add Z_RLE strategy for run-length encoding [Truta]
   2.966 +    - When Z_RLE requested, restrict matches to distance one
   2.967 +    - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE
   2.968 +- Correct FASTEST compilation to allow level == 0
   2.969 +- Clean up what gets compiled for FASTEST
   2.970 +- Incorporate changes to zconf.in.h [Vollant]
   2.971 +    - Refine detection of Turbo C need for dummy returns
   2.972 +    - Refine ZLIB_DLL compilation
   2.973 +    - Include additional header file on VMS for off_t typedef
   2.974 +- Try to use _vsnprintf where it supplants vsprintf [Vollant]
   2.975 +- Add some casts in inffast.c
   2.976 +- Enchance comments in zlib.h on what happens if gzprintf() tries to
   2.977 +  write more than 4095 bytes before compression
   2.978 +- Remove unused state from inflateBackEnd()
   2.979 +- Remove exit(0) from minigzip.c, example.c
   2.980 +- Get rid of all those darn tabs
   2.981 +- Add "check" target to Makefile.in that does the same thing as "test"
   2.982 +- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in
   2.983 +- Update contrib/inflate86 [Anderson]
   2.984 +- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant]
   2.985 +- Add msdos and win32 directories with makefiles [Truta]
   2.986 +- More additions and improvements to the FAQ
   2.987 +
   2.988 +Changes in 1.2.0 (9 March 2003)
   2.989 +- New and improved inflate code
   2.990 +    - About 20% faster
   2.991 +    - Does not allocate 32K window unless and until needed
   2.992 +    - Automatically detects and decompresses gzip streams
   2.993 +    - Raw inflate no longer needs an extra dummy byte at end
   2.994 +    - Added inflateBack functions using a callback interface--even faster
   2.995 +      than inflate, useful for file utilities (gzip, zip)
   2.996 +    - Added inflateCopy() function to record state for random access on
   2.997 +      externally generated deflate streams (e.g. in gzip files)
   2.998 +    - More readable code (I hope)
   2.999 +- New and improved crc32()
  2.1000 +    - About 50% faster, thanks to suggestions from Rodney Brown
  2.1001 +- Add deflateBound() and compressBound() functions
  2.1002 +- Fix memory leak in deflateInit2()
  2.1003 +- Permit setting dictionary for raw deflate (for parallel deflate)
  2.1004 +- Fix const declaration for gzwrite()
  2.1005 +- Check for some malloc() failures in gzio.c
  2.1006 +- Fix bug in gzopen() on single-byte file 0x1f
  2.1007 +- Fix bug in gzread() on concatenated file with 0x1f at end of buffer
  2.1008 +  and next buffer doesn't start with 0x8b
  2.1009 +- Fix uncompress() to return Z_DATA_ERROR on truncated input
  2.1010 +- Free memory at end of example.c
  2.1011 +- Remove MAX #define in trees.c (conflicted with some libraries)
  2.1012 +- Fix static const's in deflate.c, gzio.c, and zutil.[ch]
  2.1013 +- Declare malloc() and free() in gzio.c if STDC not defined
  2.1014 +- Use malloc() instead of calloc() in zutil.c if int big enough
  2.1015 +- Define STDC for AIX
  2.1016 +- Add aix/ with approach for compiling shared library on AIX
  2.1017 +- Add HP-UX support for shared libraries in configure
  2.1018 +- Add OpenUNIX support for shared libraries in configure
  2.1019 +- Use $cc instead of gcc to build shared library
  2.1020 +- Make prefix directory if needed when installing
  2.1021 +- Correct Macintosh avoidance of typedef Byte in zconf.h
  2.1022 +- Correct Turbo C memory allocation when under Linux
  2.1023 +- Use libz.a instead of -lz in Makefile (assure use of compiled library)
  2.1024 +- Update configure to check for snprintf or vsnprintf functions and their
  2.1025 +  return value, warn during make if using an insecure function
  2.1026 +- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that
  2.1027 +  is lost when library is used--resolution is to build new zconf.h
  2.1028 +- Documentation improvements (in zlib.h):
  2.1029 +    - Document raw deflate and inflate
  2.1030 +    - Update RFCs URL
  2.1031 +    - Point out that zlib and gzip formats are different
  2.1032 +    - Note that Z_BUF_ERROR is not fatal
  2.1033 +    - Document string limit for gzprintf() and possible buffer overflow
  2.1034 +    - Note requirement on avail_out when flushing
  2.1035 +    - Note permitted values of flush parameter of inflate()
  2.1036 +- Add some FAQs (and even answers) to the FAQ
  2.1037 +- Add contrib/inflate86/ for x86 faster inflate
  2.1038 +- Add contrib/blast/ for PKWare Data Compression Library decompression
  2.1039 +- Add contrib/puff/ simple inflate for deflate format description
  2.1040 +
  2.1041 +Changes in 1.1.4 (11 March 2002)
  2.1042 +- ZFREE was repeated on same allocation on some error conditions.
  2.1043 +  This creates a security problem described in
  2.1044 +  http://www.zlib.org/advisory-2002-03-11.txt
  2.1045 +- Returned incorrect error (Z_MEM_ERROR) on some invalid data
  2.1046 +- Avoid accesses before window for invalid distances with inflate window
  2.1047 +  less than 32K.
  2.1048 +- force windowBits > 8 to avoid a bug in the encoder for a window size
  2.1049 +  of 256 bytes. (A complete fix will be available in 1.1.5).
  2.1050 +
  2.1051 +Changes in 1.1.3 (9 July 1998)
  2.1052 +- fix "an inflate input buffer bug that shows up on rare but persistent
  2.1053 +  occasions" (Mark)
  2.1054 +- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
  2.1055 +- fix gzseek(..., SEEK_SET) in write mode
  2.1056 +- fix crc check after a gzeek (Frank Faubert)
  2.1057 +- fix miniunzip when the last entry in a zip file is itself a zip file
  2.1058 +  (J Lillge)
  2.1059 +- add contrib/asm586 and contrib/asm686 (Brian Raiter)
  2.1060 +  See http://www.muppetlabs.com/~breadbox/software/assembly.html
  2.1061 +- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
  2.1062 +- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
  2.1063 +- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
  2.1064 +- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
  2.1065 +- added a FAQ file
  2.1066 +
  2.1067 +- Support gzdopen on Mac with Metrowerks (Jason Linhart)
  2.1068 +- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
  2.1069 +- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
  2.1070 +- avoid some warnings with Borland C (Tom Tanner)
  2.1071 +- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
  2.1072 +- emulate utime() for WIN32 in contrib/untgz  (Gilles Vollant)
  2.1073 +- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
  2.1074 +- use libdir and includedir in Makefile.in (Tim Mooney)
  2.1075 +- support shared libraries on OSF1 V4 (Tim Mooney)
  2.1076 +- remove so_locations in "make clean"  (Tim Mooney)
  2.1077 +- fix maketree.c compilation error (Glenn, Mark)
  2.1078 +- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
  2.1079 +- new Makefile.riscos (Rich Walker)
  2.1080 +- initialize static descriptors in trees.c for embedded targets (Nick Smith)
  2.1081 +- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
  2.1082 +- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
  2.1083 +- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
  2.1084 +- fix maketree.c to allow clean compilation of inffixed.h (Mark)
  2.1085 +- fix parameter check in deflateCopy (Gunther Nikl)
  2.1086 +- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
  2.1087 +- Many portability patches by Christian Spieler:
  2.1088 +  . zutil.c, zutil.h: added "const" for zmem*
  2.1089 +  . Make_vms.com: fixed some typos
  2.1090 +  . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
  2.1091 +  . msdos/Makefile.msc: remove "default rtl link library" info from obj files
  2.1092 +  . msdos/Makefile.*: use model-dependent name for the built zlib library
  2.1093 +  . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
  2.1094 +     new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
  2.1095 +- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
  2.1096 +- replace __far with _far for better portability (Christian Spieler, Tom Lane)
  2.1097 +- fix test for errno.h in configure (Tim Newsham)
  2.1098 +
  2.1099 +Changes in 1.1.2 (19 March 98)
  2.1100 +- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
  2.1101 +  See http://www.winimage.com/zLibDll/unzip.html
  2.1102 +- preinitialize the inflate tables for fixed codes, to make the code
  2.1103 +  completely thread safe (Mark)
  2.1104 +- some simplifications and slight speed-up to the inflate code (Mark)
  2.1105 +- fix gzeof on non-compressed files (Allan Schrum)
  2.1106 +- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
  2.1107 +- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
  2.1108 +- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
  2.1109 +- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
  2.1110 +- do not wrap extern "C" around system includes (Tom Lane)
  2.1111 +- mention zlib binding for TCL in README (Andreas Kupries)
  2.1112 +- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
  2.1113 +- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
  2.1114 +- allow "configure --prefix $HOME" (Tim Mooney)
  2.1115 +- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
  2.1116 +- move Makefile.sas to amiga/Makefile.sas
  2.1117 +
  2.1118 +Changes in 1.1.1 (27 Feb 98)
  2.1119 +- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
  2.1120 +- remove block truncation heuristic which had very marginal effect for zlib
  2.1121 +  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
  2.1122 +  compression ratio on some files. This also allows inlining _tr_tally for
  2.1123 +  matches in deflate_slow.
  2.1124 +- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
  2.1125 +
  2.1126 +Changes in 1.1.0 (24 Feb 98)
  2.1127 +- do not return STREAM_END prematurely in inflate (John Bowler)
  2.1128 +- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
  2.1129 +- compile with -DFASTEST to get compression code optimized for speed only
  2.1130 +- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
  2.1131 +- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
  2.1132 +  on Sun but significant on HP)
  2.1133 +
  2.1134 +- add a pointer to experimental unzip library in README (Gilles Vollant)
  2.1135 +- initialize variable gcc in configure (Chris Herborth)
  2.1136 +
  2.1137 +Changes in 1.0.9 (17 Feb 1998)
  2.1138 +- added gzputs and gzgets functions
  2.1139 +- do not clear eof flag in gzseek (Mark Diekhans)
  2.1140 +- fix gzseek for files in transparent mode (Mark Diekhans)
  2.1141 +- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
  2.1142 +- replace EXPORT with ZEXPORT to avoid conflict with other programs
  2.1143 +- added compress2 in zconf.h, zlib.def, zlib.dnt
  2.1144 +- new asm code from Gilles Vollant in contrib/asm386
  2.1145 +- simplify the inflate code (Mark):
  2.1146 + . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
  2.1147 + . ZALLOC the length list in inflate_trees_fixed() instead of using stack
  2.1148 + . ZALLOC the value area for huft_build() instead of using stack
  2.1149 + . Simplify Z_FINISH check in inflate()
  2.1150 +
  2.1151 +- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
  2.1152 +- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
  2.1153 +- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
  2.1154 +  the declaration of FAR (Gilles VOllant)
  2.1155 +- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
  2.1156 +- read_buf buf parameter of type Bytef* instead of charf*
  2.1157 +- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
  2.1158 +- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
  2.1159 +- fix check for presence of directories in "make install" (Ian Willis)
  2.1160 +
  2.1161 +Changes in 1.0.8 (27 Jan 1998)
  2.1162 +- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
  2.1163 +- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
  2.1164 +- added compress2() to allow setting the compression level
  2.1165 +- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
  2.1166 +- use constant arrays for the static trees in trees.c instead of computing
  2.1167 +  them at run time (thanks to Ken Raeburn for this suggestion). To create
  2.1168 +  trees.h, compile with GEN_TREES_H and run "make test".
  2.1169 +- check return code of example in "make test" and display result
  2.1170 +- pass minigzip command line options to file_compress
  2.1171 +- simplifying code of inflateSync to avoid gcc 2.8 bug
  2.1172 +
  2.1173 +- support CC="gcc -Wall" in configure -s (QingLong)
  2.1174 +- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
  2.1175 +- fix test for shared library support to avoid compiler warnings
  2.1176 +- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
  2.1177 +- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
  2.1178 +- do not use fdopen for Metrowerks on Mac (Brad Pettit))
  2.1179 +- add checks for gzputc and gzputc in example.c
  2.1180 +- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
  2.1181 +- use const for the CRC table (Ken Raeburn)
  2.1182 +- fixed "make uninstall" for shared libraries
  2.1183 +- use Tracev instead of Trace in infblock.c
  2.1184 +- in example.c use correct compressed length for test_sync
  2.1185 +- suppress +vnocompatwarnings in configure for HPUX (not always supported)
  2.1186 +
  2.1187 +Changes in 1.0.7 (20 Jan 1998)
  2.1188 +- fix gzseek which was broken in write mode
  2.1189 +- return error for gzseek to negative absolute position
  2.1190 +- fix configure for Linux (Chun-Chung Chen)
  2.1191 +- increase stack space for MSC (Tim Wegner)
  2.1192 +- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
  2.1193 +- define EXPORTVA for gzprintf (Gilles Vollant)
  2.1194 +- added man page zlib.3 (Rick Rodgers)
  2.1195 +- for contrib/untgz, fix makedir() and improve Makefile
  2.1196 +
  2.1197 +- check gzseek in write mode in example.c
  2.1198 +- allocate extra buffer for seeks only if gzseek is actually called
  2.1199 +- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
  2.1200 +- add inflateSyncPoint in zconf.h
  2.1201 +- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
  2.1202 +
  2.1203 +Changes in 1.0.6 (19 Jan 1998)
  2.1204 +- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
  2.1205 +  gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
  2.1206 +- Fix a deflate bug occurring only with compression level 0 (thanks to
  2.1207 +  Andy Buckler for finding this one).
  2.1208 +- In minigzip, pass transparently also the first byte for .Z files.
  2.1209 +- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
  2.1210 +- check Z_FINISH in inflate (thanks to Marc Schluper)
  2.1211 +- Implement deflateCopy (thanks to Adam Costello)
  2.1212 +- make static libraries by default in configure, add --shared option.
  2.1213 +- move MSDOS or Windows specific files to directory msdos
  2.1214 +- suppress the notion of partial flush to simplify the interface
  2.1215 +  (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
  2.1216 +- suppress history buffer provided by application to simplify the interface
  2.1217 +  (this feature was not implemented anyway in 1.0.4)
  2.1218 +- next_in and avail_in must be initialized before calling inflateInit or
  2.1219 +  inflateInit2
  2.1220 +- add EXPORT in all exported functions (for Windows DLL)
  2.1221 +- added Makefile.nt (thanks to Stephen Williams)
  2.1222 +- added the unsupported "contrib" directory:
  2.1223 +   contrib/asm386/ by Gilles Vollant <info@winimage.com>
  2.1224 +        386 asm code replacing longest_match().
  2.1225 +   contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
  2.1226 +        A C++ I/O streams interface to the zlib gz* functions
  2.1227 +   contrib/iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
  2.1228 +        Another C++ I/O streams interface
  2.1229 +   contrib/untgz/  by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
  2.1230 +        A very simple tar.gz file extractor using zlib
  2.1231 +   contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
  2.1232 +        How to use compress(), uncompress() and the gz* functions from VB.
  2.1233 +- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
  2.1234 +  level) in minigzip (thanks to Tom Lane)
  2.1235 +
  2.1236 +- use const for rommable constants in deflate
  2.1237 +- added test for gzseek and gztell in example.c
  2.1238 +- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
  2.1239 +- add undocumented function zError to convert error code to string
  2.1240 +  (for Tim Smithers)
  2.1241 +- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
  2.1242 +- Use default memcpy for Symantec MSDOS compiler.
  2.1243 +- Add EXPORT keyword for check_func (needed for Windows DLL)
  2.1244 +- add current directory to LD_LIBRARY_PATH for "make test"
  2.1245 +- create also a link for libz.so.1
  2.1246 +- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
  2.1247 +- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
  2.1248 +- added -soname for Linux in configure (Chun-Chung Chen,
  2.1249 +- assign numbers to the exported functions in zlib.def (for Windows DLL)
  2.1250 +- add advice in zlib.h for best usage of deflateSetDictionary
  2.1251 +- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
  2.1252 +- allow compilation with ANSI keywords only enabled for TurboC in large model
  2.1253 +- avoid "versionString"[0] (Borland bug)
  2.1254 +- add NEED_DUMMY_RETURN for Borland
  2.1255 +- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
  2.1256 +- allow compilation with CC
  2.1257 +- defined STDC for OS/2 (David Charlap)
  2.1258 +- limit external names to 8 chars for MVS (Thomas Lund)
  2.1259 +- in minigzip.c, use static buffers only for 16-bit systems
  2.1260 +- fix suffix check for "minigzip -d foo.gz"
  2.1261 +- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
  2.1262 +- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
  2.1263 +- added makelcc.bat for lcc-win32 (Tom St Denis)
  2.1264 +- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
  2.1265 +- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
  2.1266 +- check for unistd.h in configure (for off_t)
  2.1267 +- remove useless check parameter in inflate_blocks_free
  2.1268 +- avoid useless assignment of s->check to itself in inflate_blocks_new
  2.1269 +- do not flush twice in gzclose (thanks to Ken Raeburn)
  2.1270 +- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
  2.1271 +- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
  2.1272 +- work around buggy fclose on pipes for HP/UX
  2.1273 +- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
  2.1274 +- fix configure if CC is already equal to gcc
  2.1275 +
  2.1276 +Changes in 1.0.5 (3 Jan 98)
  2.1277 +- Fix inflate to terminate gracefully when fed corrupted or invalid data
  2.1278 +- Use const for rommable constants in inflate
  2.1279 +- Eliminate memory leaks on error conditions in inflate
  2.1280 +- Removed some vestigial code in inflate
  2.1281 +- Update web address in README
  2.1282 +
  2.1283 +Changes in 1.0.4 (24 Jul 96)
  2.1284 +- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
  2.1285 +  bit, so the decompressor could decompress all the correct data but went
  2.1286 +  on to attempt decompressing extra garbage data. This affected minigzip too.
  2.1287 +- zlibVersion and gzerror return const char* (needed for DLL)
  2.1288 +- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
  2.1289 +- use z_error only for DEBUG (avoid problem with DLLs)
  2.1290 +
  2.1291 +Changes in 1.0.3 (2 Jul 96)
  2.1292 +- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
  2.1293 +  small and medium models; this makes the library incompatible with previous
  2.1294 +  versions for these models. (No effect in large model or on other systems.)
  2.1295 +- return OK instead of BUF_ERROR if previous deflate call returned with
  2.1296 +  avail_out as zero but there is nothing to do
  2.1297 +- added memcmp for non STDC compilers
  2.1298 +- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
  2.1299 +- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
  2.1300 +- better check for 16-bit mode MSC (avoids problem with Symantec)
  2.1301 +
  2.1302 +Changes in 1.0.2 (23 May 96)
  2.1303 +- added Windows DLL support
  2.1304 +- added a function zlibVersion (for the DLL support)
  2.1305 +- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
  2.1306 +- Bytef is define's instead of typedef'd only for Borland C
  2.1307 +- avoid reading uninitialized memory in example.c
  2.1308 +- mention in README that the zlib format is now RFC1950
  2.1309 +- updated Makefile.dj2
  2.1310 +- added algorithm.doc
  2.1311 +
  2.1312 +Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
  2.1313 +- fix array overlay in deflate.c which sometimes caused bad compressed data
  2.1314 +- fix inflate bug with empty stored block
  2.1315 +- fix MSDOS medium model which was broken in 0.99
  2.1316 +- fix deflateParams() which could generate bad compressed data.
  2.1317 +- Bytef is define'd instead of typedef'ed (work around Borland bug)
  2.1318 +- added an INDEX file
  2.1319 +- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
  2.1320 +  Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
  2.1321 +- speed up adler32 for modern machines without auto-increment
  2.1322 +- added -ansi for IRIX in configure
  2.1323 +- static_init_done in trees.c is an int
  2.1324 +- define unlink as delete for VMS
  2.1325 +- fix configure for QNX
  2.1326 +- add configure branch for SCO and HPUX
  2.1327 +- avoid many warnings (unused variables, dead assignments, etc...)
  2.1328 +- no fdopen for BeOS
  2.1329 +- fix the Watcom fix for 32 bit mode (define FAR as empty)
  2.1330 +- removed redefinition of Byte for MKWERKS
  2.1331 +- work around an MWKERKS bug (incorrect merge of all .h files)
  2.1332 +
  2.1333 +Changes in 0.99 (27 Jan 96)
  2.1334 +- allow preset dictionary shared between compressor and decompressor
  2.1335 +- allow compression level 0 (no compression)
  2.1336 +- add deflateParams in zlib.h: allow dynamic change of compression level
  2.1337 +  and compression strategy.
  2.1338 +- test large buffers and deflateParams in example.c
  2.1339 +- add optional "configure" to build zlib as a shared library
  2.1340 +- suppress Makefile.qnx, use configure instead
  2.1341 +- fixed deflate for 64-bit systems (detected on Cray)
  2.1342 +- fixed inflate_blocks for 64-bit systems (detected on Alpha)
  2.1343 +- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
  2.1344 +- always return Z_BUF_ERROR when deflate() has nothing to do
  2.1345 +- deflateInit and inflateInit are now macros to allow version checking
  2.1346 +- prefix all global functions and types with z_ with -DZ_PREFIX
  2.1347 +- make falloc completely reentrant (inftrees.c)
  2.1348 +- fixed very unlikely race condition in ct_static_init
  2.1349 +- free in reverse order of allocation to help memory manager
  2.1350 +- use zlib-1.0/* instead of zlib/* inside the tar.gz
  2.1351 +- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
  2.1352 +  -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
  2.1353 +- allow gzread on concatenated .gz files
  2.1354 +- deflateEnd now returns Z_DATA_ERROR if it was premature
  2.1355 +- deflate is finally (?) fully deterministic (no matches beyond end of input)
  2.1356 +- Document Z_SYNC_FLUSH
  2.1357 +- add uninstall in Makefile
  2.1358 +- Check for __cpluplus in zlib.h
  2.1359 +- Better test in ct_align for partial flush
  2.1360 +- avoid harmless warnings for Borland C++
  2.1361 +- initialize hash_head in deflate.c
  2.1362 +- avoid warning on fdopen (gzio.c) for HP cc -Aa
  2.1363 +- include stdlib.h for STDC compilers
  2.1364 +- include errno.h for Cray
  2.1365 +- ignore error if ranlib doesn't exist
  2.1366 +- call ranlib twice for NeXTSTEP
  2.1367 +- use exec_prefix instead of prefix for libz.a
  2.1368 +- renamed ct_* as _tr_* to avoid conflict with applications
  2.1369 +- clear z->msg in inflateInit2 before any error return
  2.1370 +- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
  2.1371 +- fixed typo in zconf.h (_GNUC__ => __GNUC__)
  2.1372 +- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
  2.1373 +- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
  2.1374 +- in fcalloc, normalize pointer if size > 65520 bytes
  2.1375 +- don't use special fcalloc for 32 bit Borland C++
  2.1376 +- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
  2.1377 +- use Z_BINARY instead of BINARY
  2.1378 +- document that gzclose after gzdopen will close the file
  2.1379 +- allow "a" as mode in gzopen.
  2.1380 +- fix error checking in gzread
  2.1381 +- allow skipping .gz extra-field on pipes
  2.1382 +- added reference to Perl interface in README
  2.1383 +- put the crc table in FAR data (I dislike more and more the medium model :)
  2.1384 +- added get_crc_table
  2.1385 +- added a dimension to all arrays (Borland C can't count).
  2.1386 +- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
  2.1387 +- guard against multiple inclusion of *.h (for precompiled header on Mac)
  2.1388 +- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
  2.1389 +- don't use unsized arrays to avoid silly warnings by Visual C++:
  2.1390 +     warning C4746: 'inflate_mask' : unsized array treated as  '__far'
  2.1391 +     (what's wrong with far data in far model?).
  2.1392 +- define enum out of inflate_blocks_state to allow compilation with C++
  2.1393 +
  2.1394 +Changes in 0.95 (16 Aug 95)
  2.1395 +- fix MSDOS small and medium model (now easier to adapt to any compiler)
  2.1396 +- inlined send_bits
  2.1397 +- fix the final (:-) bug for deflate with flush (output was correct but
  2.1398 +  not completely flushed in rare occasions).
  2.1399 +- default window size is same for compression and decompression
  2.1400 +  (it's now sufficient to set MAX_WBITS in zconf.h).
  2.1401 +- voidp -> voidpf and voidnp -> voidp (for consistency with other
  2.1402 +  typedefs and because voidnp was not near in large model).
  2.1403 +
  2.1404 +Changes in 0.94 (13 Aug 95)
  2.1405 +- support MSDOS medium model
  2.1406 +- fix deflate with flush (could sometimes generate bad output)
  2.1407 +- fix deflateReset (zlib header was incorrectly suppressed)
  2.1408 +- added support for VMS
  2.1409 +- allow a compression level in gzopen()
  2.1410 +- gzflush now calls fflush
  2.1411 +- For deflate with flush, flush even if no more input is provided.
  2.1412 +- rename libgz.a as libz.a
  2.1413 +- avoid complex expression in infcodes.c triggering Turbo C bug
  2.1414 +- work around a problem with gcc on Alpha (in INSERT_STRING)
  2.1415 +- don't use inline functions (problem with some gcc versions)
  2.1416 +- allow renaming of Byte, uInt, etc... with #define.
  2.1417 +- avoid warning about (unused) pointer before start of array in deflate.c
  2.1418 +- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
  2.1419 +- avoid reserved word 'new' in trees.c
  2.1420 +
  2.1421 +Changes in 0.93 (25 June 95)
  2.1422 +- temporarily disable inline functions
  2.1423 +- make deflate deterministic
  2.1424 +- give enough lookahead for PARTIAL_FLUSH
  2.1425 +- Set binary mode for stdin/stdout in minigzip.c for OS/2
  2.1426 +- don't even use signed char in inflate (not portable enough)
  2.1427 +- fix inflate memory leak for segmented architectures
  2.1428 +
  2.1429 +Changes in 0.92 (3 May 95)
  2.1430 +- don't assume that char is signed (problem on SGI)
  2.1431 +- Clear bit buffer when starting a stored block
  2.1432 +- no memcpy on Pyramid
  2.1433 +- suppressed inftest.c
  2.1434 +- optimized fill_window, put longest_match inline for gcc
  2.1435 +- optimized inflate on stored blocks.
  2.1436 +- untabify all sources to simplify patches
  2.1437 +
  2.1438 +Changes in 0.91 (2 May 95)
  2.1439 +- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
  2.1440 +- Document the memory requirements in zconf.h
  2.1441 +- added "make install"
  2.1442 +- fix sync search logic in inflateSync
  2.1443 +- deflate(Z_FULL_FLUSH) now works even if output buffer too short
  2.1444 +- after inflateSync, don't scare people with just "lo world"
  2.1445 +- added support for DJGPP
  2.1446 +
  2.1447 +Changes in 0.9 (1 May 95)
  2.1448 +- don't assume that zalloc clears the allocated memory (the TurboC bug
  2.1449 +  was Mark's bug after all :)
  2.1450 +- let again gzread copy uncompressed data unchanged (was working in 0.71)
  2.1451 +- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
  2.1452 +- added a test of inflateSync in example.c
  2.1453 +- moved MAX_WBITS to zconf.h because users might want to change that.
  2.1454 +- document explicitly that zalloc(64K) on MSDOS must return a normalized
  2.1455 +  pointer (zero offset)
  2.1456 +- added Makefiles for Microsoft C, Turbo C, Borland C++
  2.1457 +- faster crc32()
  2.1458 +
  2.1459 +Changes in 0.8 (29 April 95)
  2.1460 +- added fast inflate (inffast.c)
  2.1461 +- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
  2.1462 +  is incompatible with previous versions of zlib which returned Z_OK.
  2.1463 +- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
  2.1464 +  (actually that was not a compiler bug, see 0.81 above)
  2.1465 +- gzread no longer reads one extra byte in certain cases
  2.1466 +- In gzio destroy(), don't reference a freed structure
  2.1467 +- avoid many warnings for MSDOS
  2.1468 +- avoid the ERROR symbol which is used by MS Windows
  2.1469 +
  2.1470 +Changes in 0.71 (14 April 95)
  2.1471 +- Fixed more MSDOS compilation problems :( There is still a bug with
  2.1472 +  TurboC large model.
  2.1473 +
  2.1474 +Changes in 0.7 (14 April 95)
  2.1475 +- Added full inflate support.
  2.1476 +- Simplified the crc32() interface. The pre- and post-conditioning
  2.1477 +  (one's complement) is now done inside crc32(). WARNING: this is
  2.1478 +  incompatible with previous versions; see zlib.h for the new usage.
  2.1479 +
  2.1480 +Changes in 0.61 (12 April 95)
  2.1481 +- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
  2.1482 +
  2.1483 +Changes in 0.6 (11 April 95)
  2.1484 +- added minigzip.c
  2.1485 +- added gzdopen to reopen a file descriptor as gzFile
  2.1486 +- added transparent reading of non-gziped files in gzread.
  2.1487 +- fixed bug in gzread (don't read crc as data)
  2.1488 +- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
  2.1489 +- don't allocate big arrays in the stack (for MSDOS)
  2.1490 +- fix some MSDOS compilation problems
  2.1491 +
  2.1492 +Changes in 0.5:
  2.1493 +- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
  2.1494 +  not yet Z_FULL_FLUSH.
  2.1495 +- support decompression but only in a single step (forced Z_FINISH)
  2.1496 +- added opaque object for zalloc and zfree.
  2.1497 +- added deflateReset and inflateReset
  2.1498 +- added a variable zlib_version for consistency checking.
  2.1499 +- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
  2.1500 +  Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
  2.1501 +
  2.1502 +Changes in 0.4:
  2.1503 +- avoid "zip" everywhere, use zlib instead of ziplib.
  2.1504 +- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
  2.1505 +  if compression method == 8.
  2.1506 +- added adler32 and crc32
  2.1507 +- renamed deflateOptions as deflateInit2, call one or the other but not both
  2.1508 +- added the method parameter for deflateInit2.
  2.1509 +- added inflateInit2
  2.1510 +- simplied considerably deflateInit and inflateInit by not supporting
  2.1511 +  user-provided history buffer. This is supported only in deflateInit2
  2.1512 +  and inflateInit2.
  2.1513 +
  2.1514 +Changes in 0.3:
  2.1515 +- prefix all macro names with Z_
  2.1516 +- use Z_FINISH instead of deflateEnd to finish compression.
  2.1517 +- added Z_HUFFMAN_ONLY
  2.1518 +- added gzerror()
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/external/zlib-1.2.11/FAQ	Sat Oct 21 21:05:43 2017 -0700
     3.3 @@ -0,0 +1,368 @@
     3.4 +
     3.5 +                Frequently Asked Questions about zlib
     3.6 +
     3.7 +
     3.8 +If your question is not there, please check the zlib home page
     3.9 +http://zlib.net/ which may have more recent information.
    3.10 +The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
    3.11 +
    3.12 +
    3.13 + 1. Is zlib Y2K-compliant?
    3.14 +
    3.15 +    Yes. zlib doesn't handle dates.
    3.16 +
    3.17 + 2. Where can I get a Windows DLL version?
    3.18 +
    3.19 +    The zlib sources can be compiled without change to produce a DLL.  See the
    3.20 +    file win32/DLL_FAQ.txt in the zlib distribution.  Pointers to the
    3.21 +    precompiled DLL are found in the zlib web site at http://zlib.net/ .
    3.22 +
    3.23 + 3. Where can I get a Visual Basic interface to zlib?
    3.24 +
    3.25 +    See
    3.26 +        * http://marknelson.us/1997/01/01/zlib-engine/
    3.27 +        * win32/DLL_FAQ.txt in the zlib distribution
    3.28 +
    3.29 + 4. compress() returns Z_BUF_ERROR.
    3.30 +
    3.31 +    Make sure that before the call of compress(), the length of the compressed
    3.32 +    buffer is equal to the available size of the compressed buffer and not
    3.33 +    zero.  For Visual Basic, check that this parameter is passed by reference
    3.34 +    ("as any"), not by value ("as long").
    3.35 +
    3.36 + 5. deflate() or inflate() returns Z_BUF_ERROR.
    3.37 +
    3.38 +    Before making the call, make sure that avail_in and avail_out are not zero.
    3.39 +    When setting the parameter flush equal to Z_FINISH, also make sure that
    3.40 +    avail_out is big enough to allow processing all pending input.  Note that a
    3.41 +    Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
    3.42 +    made with more input or output space.  A Z_BUF_ERROR may in fact be
    3.43 +    unavoidable depending on how the functions are used, since it is not
    3.44 +    possible to tell whether or not there is more output pending when
    3.45 +    strm.avail_out returns with zero.  See http://zlib.net/zlib_how.html for a
    3.46 +    heavily annotated example.
    3.47 +
    3.48 + 6. Where's the zlib documentation (man pages, etc.)?
    3.49 +
    3.50 +    It's in zlib.h .  Examples of zlib usage are in the files test/example.c
    3.51 +    and test/minigzip.c, with more in examples/ .
    3.52 +
    3.53 + 7. Why don't you use GNU autoconf or libtool or ...?
    3.54 +
    3.55 +    Because we would like to keep zlib as a very small and simple package.
    3.56 +    zlib is rather portable and doesn't need much configuration.
    3.57 +
    3.58 + 8. I found a bug in zlib.
    3.59 +
    3.60 +    Most of the time, such problems are due to an incorrect usage of zlib.
    3.61 +    Please try to reproduce the problem with a small program and send the
    3.62 +    corresponding source to us at zlib@gzip.org .  Do not send multi-megabyte
    3.63 +    data files without prior agreement.
    3.64 +
    3.65 + 9. Why do I get "undefined reference to gzputc"?
    3.66 +
    3.67 +    If "make test" produces something like
    3.68 +
    3.69 +       example.o(.text+0x154): undefined reference to `gzputc'
    3.70 +
    3.71 +    check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
    3.72 +    /usr/X11R6/lib. Remove any old versions, then do "make install".
    3.73 +
    3.74 +10. I need a Delphi interface to zlib.
    3.75 +
    3.76 +    See the contrib/delphi directory in the zlib distribution.
    3.77 +
    3.78 +11. Can zlib handle .zip archives?
    3.79 +
    3.80 +    Not by itself, no.  See the directory contrib/minizip in the zlib
    3.81 +    distribution.
    3.82 +
    3.83 +12. Can zlib handle .Z files?
    3.84 +
    3.85 +    No, sorry.  You have to spawn an uncompress or gunzip subprocess, or adapt
    3.86 +    the code of uncompress on your own.
    3.87 +
    3.88 +13. How can I make a Unix shared library?
    3.89 +
    3.90 +    By default a shared (and a static) library is built for Unix.  So:
    3.91 +
    3.92 +    make distclean
    3.93 +    ./configure
    3.94 +    make
    3.95 +
    3.96 +14. How do I install a shared zlib library on Unix?
    3.97 +
    3.98 +    After the above, then:
    3.99 +
   3.100 +    make install
   3.101 +
   3.102 +    However, many flavors of Unix come with a shared zlib already installed.
   3.103 +    Before going to the trouble of compiling a shared version of zlib and
   3.104 +    trying to install it, you may want to check if it's already there!  If you
   3.105 +    can #include <zlib.h>, it's there.  The -lz option will probably link to
   3.106 +    it.  You can check the version at the top of zlib.h or with the
   3.107 +    ZLIB_VERSION symbol defined in zlib.h .
   3.108 +
   3.109 +15. I have a question about OttoPDF.
   3.110 +
   3.111 +    We are not the authors of OttoPDF. The real author is on the OttoPDF web
   3.112 +    site: Joel Hainley, jhainley@myndkryme.com.
   3.113 +
   3.114 +16. Can zlib decode Flate data in an Adobe PDF file?
   3.115 +
   3.116 +    Yes. See http://www.pdflib.com/ . To modify PDF forms, see
   3.117 +    http://sourceforge.net/projects/acroformtool/ .
   3.118 +
   3.119 +17. Why am I getting this "register_frame_info not found" error on Solaris?
   3.120 +
   3.121 +    After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib
   3.122 +    generates an error such as:
   3.123 +
   3.124 +        ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so:
   3.125 +        symbol __register_frame_info: referenced symbol not found
   3.126 +
   3.127 +    The symbol __register_frame_info is not part of zlib, it is generated by
   3.128 +    the C compiler (cc or gcc).  You must recompile applications using zlib
   3.129 +    which have this problem.  This problem is specific to Solaris.  See
   3.130 +    http://www.sunfreeware.com for Solaris versions of zlib and applications
   3.131 +    using zlib.
   3.132 +
   3.133 +18. Why does gzip give an error on a file I make with compress/deflate?
   3.134 +
   3.135 +    The compress and deflate functions produce data in the zlib format, which
   3.136 +    is different and incompatible with the gzip format.  The gz* functions in
   3.137 +    zlib on the other hand use the gzip format.  Both the zlib and gzip formats
   3.138 +    use the same compressed data format internally, but have different headers
   3.139 +    and trailers around the compressed data.
   3.140 +
   3.141 +19. Ok, so why are there two different formats?
   3.142 +
   3.143 +    The gzip format was designed to retain the directory information about a
   3.144 +    single file, such as the name and last modification date.  The zlib format
   3.145 +    on the other hand was designed for in-memory and communication channel
   3.146 +    applications, and has a much more compact header and trailer and uses a
   3.147 +    faster integrity check than gzip.
   3.148 +
   3.149 +20. Well that's nice, but how do I make a gzip file in memory?
   3.150 +
   3.151 +    You can request that deflate write the gzip format instead of the zlib
   3.152 +    format using deflateInit2().  You can also request that inflate decode the
   3.153 +    gzip format using inflateInit2().  Read zlib.h for more details.
   3.154 +
   3.155 +21. Is zlib thread-safe?
   3.156 +
   3.157 +    Yes.  However any library routines that zlib uses and any application-
   3.158 +    provided memory allocation routines must also be thread-safe.  zlib's gz*
   3.159 +    functions use stdio library routines, and most of zlib's functions use the
   3.160 +    library memory allocation routines by default.  zlib's *Init* functions
   3.161 +    allow for the application to provide custom memory allocation routines.
   3.162 +
   3.163 +    Of course, you should only operate on any given zlib or gzip stream from a
   3.164 +    single thread at a time.
   3.165 +
   3.166 +22. Can I use zlib in my commercial application?
   3.167 +
   3.168 +    Yes.  Please read the license in zlib.h.
   3.169 +
   3.170 +23. Is zlib under the GNU license?
   3.171 +
   3.172 +    No.  Please read the license in zlib.h.
   3.173 +
   3.174 +24. The license says that altered source versions must be "plainly marked". So
   3.175 +    what exactly do I need to do to meet that requirement?
   3.176 +
   3.177 +    You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h.  In
   3.178 +    particular, the final version number needs to be changed to "f", and an
   3.179 +    identification string should be appended to ZLIB_VERSION.  Version numbers
   3.180 +    x.x.x.f are reserved for modifications to zlib by others than the zlib
   3.181 +    maintainers.  For example, if the version of the base zlib you are altering
   3.182 +    is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
   3.183 +    ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3".  You can also
   3.184 +    update the version strings in deflate.c and inftrees.c.
   3.185 +
   3.186 +    For altered source distributions, you should also note the origin and
   3.187 +    nature of the changes in zlib.h, as well as in ChangeLog and README, along
   3.188 +    with the dates of the alterations.  The origin should include at least your
   3.189 +    name (or your company's name), and an email address to contact for help or
   3.190 +    issues with the library.
   3.191 +
   3.192 +    Note that distributing a compiled zlib library along with zlib.h and
   3.193 +    zconf.h is also a source distribution, and so you should change
   3.194 +    ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes
   3.195 +    in zlib.h as you would for a full source distribution.
   3.196 +
   3.197 +25. Will zlib work on a big-endian or little-endian architecture, and can I
   3.198 +    exchange compressed data between them?
   3.199 +
   3.200 +    Yes and yes.
   3.201 +
   3.202 +26. Will zlib work on a 64-bit machine?
   3.203 +
   3.204 +    Yes.  It has been tested on 64-bit machines, and has no dependence on any
   3.205 +    data types being limited to 32-bits in length.  If you have any
   3.206 +    difficulties, please provide a complete problem report to zlib@gzip.org
   3.207 +
   3.208 +27. Will zlib decompress data from the PKWare Data Compression Library?
   3.209 +
   3.210 +    No.  The PKWare DCL uses a completely different compressed data format than
   3.211 +    does PKZIP and zlib.  However, you can look in zlib's contrib/blast
   3.212 +    directory for a possible solution to your problem.
   3.213 +
   3.214 +28. Can I access data randomly in a compressed stream?
   3.215 +
   3.216 +    No, not without some preparation.  If when compressing you periodically use
   3.217 +    Z_FULL_FLUSH, carefully write all the pending data at those points, and
   3.218 +    keep an index of those locations, then you can start decompression at those
   3.219 +    points.  You have to be careful to not use Z_FULL_FLUSH too often, since it
   3.220 +    can significantly degrade compression.  Alternatively, you can scan a
   3.221 +    deflate stream once to generate an index, and then use that index for
   3.222 +    random access.  See examples/zran.c .
   3.223 +
   3.224 +29. Does zlib work on MVS, OS/390, CICS, etc.?
   3.225 +
   3.226 +    It has in the past, but we have not heard of any recent evidence.  There
   3.227 +    were working ports of zlib 1.1.4 to MVS, but those links no longer work.
   3.228 +    If you know of recent, successful applications of zlib on these operating
   3.229 +    systems, please let us know.  Thanks.
   3.230 +
   3.231 +30. Is there some simpler, easier to read version of inflate I can look at to
   3.232 +    understand the deflate format?
   3.233 +
   3.234 +    First off, you should read RFC 1951.  Second, yes.  Look in zlib's
   3.235 +    contrib/puff directory.
   3.236 +
   3.237 +31. Does zlib infringe on any patents?
   3.238 +
   3.239 +    As far as we know, no.  In fact, that was originally the whole point behind
   3.240 +    zlib.  Look here for some more information:
   3.241 +
   3.242 +    http://www.gzip.org/#faq11
   3.243 +
   3.244 +32. Can zlib work with greater than 4 GB of data?
   3.245 +
   3.246 +    Yes.  inflate() and deflate() will process any amount of data correctly.
   3.247 +    Each call of inflate() or deflate() is limited to input and output chunks
   3.248 +    of the maximum value that can be stored in the compiler's "unsigned int"
   3.249 +    type, but there is no limit to the number of chunks.  Note however that the
   3.250 +    strm.total_in and strm_total_out counters may be limited to 4 GB.  These
   3.251 +    counters are provided as a convenience and are not used internally by
   3.252 +    inflate() or deflate().  The application can easily set up its own counters
   3.253 +    updated after each call of inflate() or deflate() to count beyond 4 GB.
   3.254 +    compress() and uncompress() may be limited to 4 GB, since they operate in a
   3.255 +    single call.  gzseek() and gztell() may be limited to 4 GB depending on how
   3.256 +    zlib is compiled.  See the zlibCompileFlags() function in zlib.h.
   3.257 +
   3.258 +    The word "may" appears several times above since there is a 4 GB limit only
   3.259 +    if the compiler's "long" type is 32 bits.  If the compiler's "long" type is
   3.260 +    64 bits, then the limit is 16 exabytes.
   3.261 +
   3.262 +33. Does zlib have any security vulnerabilities?
   3.263 +
   3.264 +    The only one that we are aware of is potentially in gzprintf().  If zlib is
   3.265 +    compiled to use sprintf() or vsprintf(), then there is no protection
   3.266 +    against a buffer overflow of an 8K string space (or other value as set by
   3.267 +    gzbuffer()), other than the caller of gzprintf() assuring that the output
   3.268 +    will not exceed 8K.  On the other hand, if zlib is compiled to use
   3.269 +    snprintf() or vsnprintf(), which should normally be the case, then there is
   3.270 +    no vulnerability.  The ./configure script will display warnings if an
   3.271 +    insecure variation of sprintf() will be used by gzprintf().  Also the
   3.272 +    zlibCompileFlags() function will return information on what variant of
   3.273 +    sprintf() is used by gzprintf().
   3.274 +
   3.275 +    If you don't have snprintf() or vsnprintf() and would like one, you can
   3.276 +    find a portable implementation here:
   3.277 +
   3.278 +        http://www.ijs.si/software/snprintf/
   3.279 +
   3.280 +    Note that you should be using the most recent version of zlib.  Versions
   3.281 +    1.1.3 and before were subject to a double-free vulnerability, and versions
   3.282 +    1.2.1 and 1.2.2 were subject to an access exception when decompressing
   3.283 +    invalid compressed data.
   3.284 +
   3.285 +34. Is there a Java version of zlib?
   3.286 +
   3.287 +    Probably what you want is to use zlib in Java. zlib is already included
   3.288 +    as part of the Java SDK in the java.util.zip package. If you really want
   3.289 +    a version of zlib written in the Java language, look on the zlib home
   3.290 +    page for links: http://zlib.net/ .
   3.291 +
   3.292 +35. I get this or that compiler or source-code scanner warning when I crank it
   3.293 +    up to maximally-pedantic. Can't you guys write proper code?
   3.294 +
   3.295 +    Many years ago, we gave up attempting to avoid warnings on every compiler
   3.296 +    in the universe.  It just got to be a waste of time, and some compilers
   3.297 +    were downright silly as well as contradicted each other.  So now, we simply
   3.298 +    make sure that the code always works.
   3.299 +
   3.300 +36. Valgrind (or some similar memory access checker) says that deflate is
   3.301 +    performing a conditional jump that depends on an uninitialized value.
   3.302 +    Isn't that a bug?
   3.303 +
   3.304 +    No.  That is intentional for performance reasons, and the output of deflate
   3.305 +    is not affected.  This only started showing up recently since zlib 1.2.x
   3.306 +    uses malloc() by default for allocations, whereas earlier versions used
   3.307 +    calloc(), which zeros out the allocated memory.  Even though the code was
   3.308 +    correct, versions 1.2.4 and later was changed to not stimulate these
   3.309 +    checkers.
   3.310 +
   3.311 +37. Will zlib read the (insert any ancient or arcane format here) compressed
   3.312 +    data format?
   3.313 +
   3.314 +    Probably not. Look in the comp.compression FAQ for pointers to various
   3.315 +    formats and associated software.
   3.316 +
   3.317 +38. How can I encrypt/decrypt zip files with zlib?
   3.318 +
   3.319 +    zlib doesn't support encryption.  The original PKZIP encryption is very
   3.320 +    weak and can be broken with freely available programs.  To get strong
   3.321 +    encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
   3.322 +    compression.  For PKZIP compatible "encryption", look at
   3.323 +    http://www.info-zip.org/
   3.324 +
   3.325 +39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
   3.326 +
   3.327 +    "gzip" is the gzip format, and "deflate" is the zlib format.  They should
   3.328 +    probably have called the second one "zlib" instead to avoid confusion with
   3.329 +    the raw deflate compressed data format.  While the HTTP 1.1 RFC 2616
   3.330 +    correctly points to the zlib specification in RFC 1950 for the "deflate"
   3.331 +    transfer encoding, there have been reports of servers and browsers that
   3.332 +    incorrectly produce or expect raw deflate data per the deflate
   3.333 +    specification in RFC 1951, most notably Microsoft.  So even though the
   3.334 +    "deflate" transfer encoding using the zlib format would be the more
   3.335 +    efficient approach (and in fact exactly what the zlib format was designed
   3.336 +    for), using the "gzip" transfer encoding is probably more reliable due to
   3.337 +    an unfortunate choice of name on the part of the HTTP 1.1 authors.
   3.338 +
   3.339 +    Bottom line: use the gzip format for HTTP 1.1 encoding.
   3.340 +
   3.341 +40. Does zlib support the new "Deflate64" format introduced by PKWare?
   3.342 +
   3.343 +    No.  PKWare has apparently decided to keep that format proprietary, since
   3.344 +    they have not documented it as they have previous compression formats.  In
   3.345 +    any case, the compression improvements are so modest compared to other more
   3.346 +    modern approaches, that it's not worth the effort to implement.
   3.347 +
   3.348 +41. I'm having a problem with the zip functions in zlib, can you help?
   3.349 +
   3.350 +    There are no zip functions in zlib.  You are probably using minizip by
   3.351 +    Giles Vollant, which is found in the contrib directory of zlib.  It is not
   3.352 +    part of zlib.  In fact none of the stuff in contrib is part of zlib.  The
   3.353 +    files in there are not supported by the zlib authors.  You need to contact
   3.354 +    the authors of the respective contribution for help.
   3.355 +
   3.356 +42. The match.asm code in contrib is under the GNU General Public License.
   3.357 +    Since it's part of zlib, doesn't that mean that all of zlib falls under the
   3.358 +    GNU GPL?
   3.359 +
   3.360 +    No.  The files in contrib are not part of zlib.  They were contributed by
   3.361 +    other authors and are provided as a convenience to the user within the zlib
   3.362 +    distribution.  Each item in contrib has its own license.
   3.363 +
   3.364 +43. Is zlib subject to export controls?  What is its ECCN?
   3.365 +
   3.366 +    zlib is not subject to export controls, and so is classified as EAR99.
   3.367 +
   3.368 +44. Can you please sign these lengthy legal documents and fax them back to us
   3.369 +    so that we can use your software in our product?
   3.370 +
   3.371 +    No. Go away. Shoo.
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/external/zlib-1.2.11/INDEX	Sat Oct 21 21:05:43 2017 -0700
     4.3 @@ -0,0 +1,68 @@
     4.4 +CMakeLists.txt  cmake build file
     4.5 +ChangeLog       history of changes
     4.6 +FAQ             Frequently Asked Questions about zlib
     4.7 +INDEX           this file
     4.8 +Makefile        dummy Makefile that tells you to ./configure
     4.9 +Makefile.in     template for Unix Makefile
    4.10 +README          guess what
    4.11 +configure       configure script for Unix
    4.12 +make_vms.com    makefile for VMS
    4.13 +test/example.c  zlib usages examples for build testing
    4.14 +test/minigzip.c minimal gzip-like functionality for build testing
    4.15 +test/infcover.c inf*.c code coverage for build coverage testing
    4.16 +treebuild.xml   XML description of source file dependencies
    4.17 +zconf.h.cmakein zconf.h template for cmake
    4.18 +zconf.h.in      zconf.h template for configure
    4.19 +zlib.3          Man page for zlib
    4.20 +zlib.3.pdf      Man page in PDF format
    4.21 +zlib.map        Linux symbol information
    4.22 +zlib.pc.in      Template for pkg-config descriptor
    4.23 +zlib.pc.cmakein zlib.pc template for cmake
    4.24 +zlib2ansi       perl script to convert source files for C++ compilation
    4.25 +
    4.26 +amiga/          makefiles for Amiga SAS C
    4.27 +as400/          makefiles for AS/400
    4.28 +doc/            documentation for formats and algorithms
    4.29 +msdos/          makefiles for MSDOS
    4.30 +nintendods/     makefile for Nintendo DS
    4.31 +old/            makefiles for various architectures and zlib documentation
    4.32 +                files that have not yet been updated for zlib 1.2.x
    4.33 +qnx/            makefiles for QNX
    4.34 +watcom/         makefiles for OpenWatcom
    4.35 +win32/          makefiles for Windows
    4.36 +
    4.37 +                zlib public header files (required for library use):
    4.38 +zconf.h
    4.39 +zlib.h
    4.40 +
    4.41 +                private source files used to build the zlib library:
    4.42 +adler32.c
    4.43 +compress.c
    4.44 +crc32.c
    4.45 +crc32.h
    4.46 +deflate.c
    4.47 +deflate.h
    4.48 +gzclose.c
    4.49 +gzguts.h
    4.50 +gzlib.c
    4.51 +gzread.c
    4.52 +gzwrite.c
    4.53 +infback.c
    4.54 +inffast.c
    4.55 +inffast.h
    4.56 +inffixed.h
    4.57 +inflate.c
    4.58 +inflate.h
    4.59 +inftrees.c
    4.60 +inftrees.h
    4.61 +trees.c
    4.62 +trees.h
    4.63 +uncompr.c
    4.64 +zutil.c
    4.65 +zutil.h
    4.66 +
    4.67 +                source files for sample programs
    4.68 +See examples/README.examples
    4.69 +
    4.70 +                unsupported contributions by third parties
    4.71 +See contrib/README.contrib
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/external/zlib-1.2.11/Makefile.in	Sat Oct 21 21:05:43 2017 -0700
     5.3 @@ -0,0 +1,410 @@
     5.4 +# Makefile for zlib
     5.5 +# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
     5.6 +# For conditions of distribution and use, see copyright notice in zlib.h
     5.7 +
     5.8 +# To compile and test, type:
     5.9 +#    ./configure; make test
    5.10 +# Normally configure builds both a static and a shared library.
    5.11 +# If you want to build just a static library, use: ./configure --static
    5.12 +
    5.13 +# To use the asm code, type:
    5.14 +#    cp contrib/asm?86/match.S ./match.S
    5.15 +#    make LOC=-DASMV OBJA=match.o
    5.16 +
    5.17 +# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
    5.18 +#    make install
    5.19 +# To install in $HOME instead of /usr/local, use:
    5.20 +#    make install prefix=$HOME
    5.21 +
    5.22 +CC=cc
    5.23 +
    5.24 +CFLAGS=-O
    5.25 +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
    5.26 +#CFLAGS=-g -DZLIB_DEBUG
    5.27 +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
    5.28 +#           -Wstrict-prototypes -Wmissing-prototypes
    5.29 +
    5.30 +SFLAGS=-O
    5.31 +LDFLAGS=
    5.32 +TEST_LDFLAGS=-L. libz.a
    5.33 +LDSHARED=$(CC)
    5.34 +CPP=$(CC) -E
    5.35 +
    5.36 +STATICLIB=libz.a
    5.37 +SHAREDLIB=libz.so
    5.38 +SHAREDLIBV=libz.so.1.2.11
    5.39 +SHAREDLIBM=libz.so.1
    5.40 +LIBS=$(STATICLIB) $(SHAREDLIBV)
    5.41 +
    5.42 +AR=ar
    5.43 +ARFLAGS=rc
    5.44 +RANLIB=ranlib
    5.45 +LDCONFIG=ldconfig
    5.46 +LDSHAREDLIBC=-lc
    5.47 +TAR=tar
    5.48 +SHELL=/bin/sh
    5.49 +EXE=
    5.50 +
    5.51 +prefix = /usr/local
    5.52 +exec_prefix = ${prefix}
    5.53 +libdir = ${exec_prefix}/lib
    5.54 +sharedlibdir = ${libdir}
    5.55 +includedir = ${prefix}/include
    5.56 +mandir = ${prefix}/share/man
    5.57 +man3dir = ${mandir}/man3
    5.58 +pkgconfigdir = ${libdir}/pkgconfig
    5.59 +SRCDIR=
    5.60 +ZINC=
    5.61 +ZINCOUT=-I.
    5.62 +
    5.63 +OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
    5.64 +OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
    5.65 +OBJC = $(OBJZ) $(OBJG)
    5.66 +
    5.67 +PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
    5.68 +PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
    5.69 +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
    5.70 +
    5.71 +# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
    5.72 +OBJA =
    5.73 +PIC_OBJA =
    5.74 +
    5.75 +OBJS = $(OBJC) $(OBJA)
    5.76 +
    5.77 +PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
    5.78 +
    5.79 +all: static shared
    5.80 +
    5.81 +static: example$(EXE) minigzip$(EXE)
    5.82 +
    5.83 +shared: examplesh$(EXE) minigzipsh$(EXE)
    5.84 +
    5.85 +all64: example64$(EXE) minigzip64$(EXE)
    5.86 +
    5.87 +check: test
    5.88 +
    5.89 +test: all teststatic testshared
    5.90 +
    5.91 +teststatic: static
    5.92 +	@TMPST=tmpst_$$; \
    5.93 +	if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
    5.94 +	  echo '		*** zlib test OK ***'; \
    5.95 +	else \
    5.96 +	  echo '		*** zlib test FAILED ***'; false; \
    5.97 +	fi; \
    5.98 +	rm -f $$TMPST
    5.99 +
   5.100 +testshared: shared
   5.101 +	@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
   5.102 +	LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
   5.103 +	DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
   5.104 +	SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
   5.105 +	TMPSH=tmpsh_$$; \
   5.106 +	if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
   5.107 +	  echo '		*** zlib shared test OK ***'; \
   5.108 +	else \
   5.109 +	  echo '		*** zlib shared test FAILED ***'; false; \
   5.110 +	fi; \
   5.111 +	rm -f $$TMPSH
   5.112 +
   5.113 +test64: all64
   5.114 +	@TMP64=tmp64_$$; \
   5.115 +	if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
   5.116 +	  echo '		*** zlib 64-bit test OK ***'; \
   5.117 +	else \
   5.118 +	  echo '		*** zlib 64-bit test FAILED ***'; false; \
   5.119 +	fi; \
   5.120 +	rm -f $$TMP64
   5.121 +
   5.122 +infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
   5.123 +	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
   5.124 +
   5.125 +infcover: infcover.o libz.a
   5.126 +	$(CC) $(CFLAGS) -o $@ infcover.o libz.a
   5.127 +
   5.128 +cover: infcover
   5.129 +	rm -f *.gcda
   5.130 +	./infcover
   5.131 +	gcov inf*.c
   5.132 +
   5.133 +libz.a: $(OBJS)
   5.134 +	$(AR) $(ARFLAGS) $@ $(OBJS)
   5.135 +	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
   5.136 +
   5.137 +match.o: match.S
   5.138 +	$(CPP) match.S > _match.s
   5.139 +	$(CC) -c _match.s
   5.140 +	mv _match.o match.o
   5.141 +	rm -f _match.s
   5.142 +
   5.143 +match.lo: match.S
   5.144 +	$(CPP) match.S > _match.s
   5.145 +	$(CC) -c -fPIC _match.s
   5.146 +	mv _match.o match.lo
   5.147 +	rm -f _match.s
   5.148 +
   5.149 +example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
   5.150 +	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
   5.151 +
   5.152 +minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
   5.153 +	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
   5.154 +
   5.155 +example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
   5.156 +	$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
   5.157 +
   5.158 +minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
   5.159 +	$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
   5.160 +
   5.161 +
   5.162 +adler32.o: $(SRCDIR)adler32.c
   5.163 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
   5.164 +
   5.165 +crc32.o: $(SRCDIR)crc32.c
   5.166 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
   5.167 +
   5.168 +deflate.o: $(SRCDIR)deflate.c
   5.169 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
   5.170 +
   5.171 +infback.o: $(SRCDIR)infback.c
   5.172 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
   5.173 +
   5.174 +inffast.o: $(SRCDIR)inffast.c
   5.175 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
   5.176 +
   5.177 +inflate.o: $(SRCDIR)inflate.c
   5.178 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
   5.179 +
   5.180 +inftrees.o: $(SRCDIR)inftrees.c
   5.181 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
   5.182 +
   5.183 +trees.o: $(SRCDIR)trees.c
   5.184 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
   5.185 +
   5.186 +zutil.o: $(SRCDIR)zutil.c
   5.187 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
   5.188 +
   5.189 +compress.o: $(SRCDIR)compress.c
   5.190 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
   5.191 +
   5.192 +uncompr.o: $(SRCDIR)uncompr.c
   5.193 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
   5.194 +
   5.195 +gzclose.o: $(SRCDIR)gzclose.c
   5.196 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
   5.197 +
   5.198 +gzlib.o: $(SRCDIR)gzlib.c
   5.199 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
   5.200 +
   5.201 +gzread.o: $(SRCDIR)gzread.c
   5.202 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
   5.203 +
   5.204 +gzwrite.o: $(SRCDIR)gzwrite.c
   5.205 +	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
   5.206 +
   5.207 +
   5.208 +adler32.lo: $(SRCDIR)adler32.c
   5.209 +	-@mkdir objs 2>/dev/null || test -d objs
   5.210 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
   5.211 +	-@mv objs/adler32.o $@
   5.212 +
   5.213 +crc32.lo: $(SRCDIR)crc32.c
   5.214 +	-@mkdir objs 2>/dev/null || test -d objs
   5.215 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
   5.216 +	-@mv objs/crc32.o $@
   5.217 +
   5.218 +deflate.lo: $(SRCDIR)deflate.c
   5.219 +	-@mkdir objs 2>/dev/null || test -d objs
   5.220 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
   5.221 +	-@mv objs/deflate.o $@
   5.222 +
   5.223 +infback.lo: $(SRCDIR)infback.c
   5.224 +	-@mkdir objs 2>/dev/null || test -d objs
   5.225 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
   5.226 +	-@mv objs/infback.o $@
   5.227 +
   5.228 +inffast.lo: $(SRCDIR)inffast.c
   5.229 +	-@mkdir objs 2>/dev/null || test -d objs
   5.230 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
   5.231 +	-@mv objs/inffast.o $@
   5.232 +
   5.233 +inflate.lo: $(SRCDIR)inflate.c
   5.234 +	-@mkdir objs 2>/dev/null || test -d objs
   5.235 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
   5.236 +	-@mv objs/inflate.o $@
   5.237 +
   5.238 +inftrees.lo: $(SRCDIR)inftrees.c
   5.239 +	-@mkdir objs 2>/dev/null || test -d objs
   5.240 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
   5.241 +	-@mv objs/inftrees.o $@
   5.242 +
   5.243 +trees.lo: $(SRCDIR)trees.c
   5.244 +	-@mkdir objs 2>/dev/null || test -d objs
   5.245 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
   5.246 +	-@mv objs/trees.o $@
   5.247 +
   5.248 +zutil.lo: $(SRCDIR)zutil.c
   5.249 +	-@mkdir objs 2>/dev/null || test -d objs
   5.250 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
   5.251 +	-@mv objs/zutil.o $@
   5.252 +
   5.253 +compress.lo: $(SRCDIR)compress.c
   5.254 +	-@mkdir objs 2>/dev/null || test -d objs
   5.255 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
   5.256 +	-@mv objs/compress.o $@
   5.257 +
   5.258 +uncompr.lo: $(SRCDIR)uncompr.c
   5.259 +	-@mkdir objs 2>/dev/null || test -d objs
   5.260 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
   5.261 +	-@mv objs/uncompr.o $@
   5.262 +
   5.263 +gzclose.lo: $(SRCDIR)gzclose.c
   5.264 +	-@mkdir objs 2>/dev/null || test -d objs
   5.265 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
   5.266 +	-@mv objs/gzclose.o $@
   5.267 +
   5.268 +gzlib.lo: $(SRCDIR)gzlib.c
   5.269 +	-@mkdir objs 2>/dev/null || test -d objs
   5.270 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
   5.271 +	-@mv objs/gzlib.o $@
   5.272 +
   5.273 +gzread.lo: $(SRCDIR)gzread.c
   5.274 +	-@mkdir objs 2>/dev/null || test -d objs
   5.275 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
   5.276 +	-@mv objs/gzread.o $@
   5.277 +
   5.278 +gzwrite.lo: $(SRCDIR)gzwrite.c
   5.279 +	-@mkdir objs 2>/dev/null || test -d objs
   5.280 +	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
   5.281 +	-@mv objs/gzwrite.o $@
   5.282 +
   5.283 +
   5.284 +placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
   5.285 +	$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
   5.286 +	rm -f $(SHAREDLIB) $(SHAREDLIBM)
   5.287 +	ln -s $@ $(SHAREDLIB)
   5.288 +	ln -s $@ $(SHAREDLIBM)
   5.289 +	-@rmdir objs
   5.290 +
   5.291 +example$(EXE): example.o $(STATICLIB)
   5.292 +	$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
   5.293 +
   5.294 +minigzip$(EXE): minigzip.o $(STATICLIB)
   5.295 +	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
   5.296 +
   5.297 +examplesh$(EXE): example.o $(SHAREDLIBV)
   5.298 +	$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
   5.299 +
   5.300 +minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
   5.301 +	$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
   5.302 +
   5.303 +example64$(EXE): example64.o $(STATICLIB)
   5.304 +	$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
   5.305 +
   5.306 +minigzip64$(EXE): minigzip64.o $(STATICLIB)
   5.307 +	$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
   5.308 +
   5.309 +install-libs: $(LIBS)
   5.310 +	-@if [ ! -d $(DESTDIR)$(exec_prefix)  ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
   5.311 +	-@if [ ! -d $(DESTDIR)$(libdir)       ]; then mkdir -p $(DESTDIR)$(libdir); fi
   5.312 +	-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
   5.313 +	-@if [ ! -d $(DESTDIR)$(man3dir)      ]; then mkdir -p $(DESTDIR)$(man3dir); fi
   5.314 +	-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
   5.315 +	rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
   5.316 +	cp $(STATICLIB) $(DESTDIR)$(libdir)
   5.317 +	chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
   5.318 +	-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
   5.319 +	-@if test -n "$(SHAREDLIBV)"; then \
   5.320 +	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
   5.321 +	  cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
   5.322 +	  echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
   5.323 +	  chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
   5.324 +	  echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
   5.325 +	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
   5.326 +	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
   5.327 +	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
   5.328 +	  ($(LDCONFIG) || true)  >/dev/null 2>&1; \
   5.329 +	fi
   5.330 +	rm -f $(DESTDIR)$(man3dir)/zlib.3
   5.331 +	cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
   5.332 +	chmod 644 $(DESTDIR)$(man3dir)/zlib.3
   5.333 +	rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
   5.334 +	cp zlib.pc $(DESTDIR)$(pkgconfigdir)
   5.335 +	chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
   5.336 +# The ranlib in install is needed on NeXTSTEP which checks file times
   5.337 +# ldconfig is for Linux
   5.338 +
   5.339 +install: install-libs
   5.340 +	-@if [ ! -d $(DESTDIR)$(includedir)   ]; then mkdir -p $(DESTDIR)$(includedir); fi
   5.341 +	rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
   5.342 +	cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
   5.343 +	chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
   5.344 +
   5.345 +uninstall:
   5.346 +	cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
   5.347 +	cd $(DESTDIR)$(libdir) && rm -f libz.a; \
   5.348 +	if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
   5.349 +	  rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
   5.350 +	fi
   5.351 +	cd $(DESTDIR)$(man3dir) && rm -f zlib.3
   5.352 +	cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
   5.353 +
   5.354 +docs: zlib.3.pdf
   5.355 +
   5.356 +zlib.3.pdf: $(SRCDIR)zlib.3
   5.357 +	groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
   5.358 +
   5.359 +zconf.h.cmakein: $(SRCDIR)zconf.h.in
   5.360 +	-@ TEMPFILE=zconfh_$$; \
   5.361 +	echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
   5.362 +	sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
   5.363 +	touch -r $(SRCDIR)zconf.h.in $@ &&\
   5.364 +	rm $$TEMPFILE
   5.365 +
   5.366 +zconf: $(SRCDIR)zconf.h.in
   5.367 +	cp -p $(SRCDIR)zconf.h.in zconf.h
   5.368 +
   5.369 +mostlyclean: clean
   5.370 +clean:
   5.371 +	rm -f *.o *.lo *~ \
   5.372 +	   example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
   5.373 +	   example64$(EXE) minigzip64$(EXE) \
   5.374 +	   infcover \
   5.375 +	   libz.* foo.gz so_locations \
   5.376 +	   _match.s maketree contrib/infback9/*.o
   5.377 +	rm -rf objs
   5.378 +	rm -f *.gcda *.gcno *.gcov
   5.379 +	rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
   5.380 +
   5.381 +maintainer-clean: distclean
   5.382 +distclean: clean zconf zconf.h.cmakein docs
   5.383 +	rm -f Makefile zlib.pc configure.log
   5.384 +	-@rm -f .DS_Store
   5.385 +	@if [ -f Makefile.in ]; then \
   5.386 +	printf 'all:\n\t-@echo "Please use ./configure first.  Thank you."\n' > Makefile ; \
   5.387 +	printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
   5.388 +	touch -r $(SRCDIR)Makefile.in Makefile ; fi
   5.389 +	@if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
   5.390 +	@if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
   5.391 +
   5.392 +tags:
   5.393 +	etags $(SRCDIR)*.[ch]
   5.394 +
   5.395 +adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
   5.396 +gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
   5.397 +compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
   5.398 +crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
   5.399 +deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
   5.400 +infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
   5.401 +inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
   5.402 +inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
   5.403 +trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
   5.404 +
   5.405 +adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
   5.406 +gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
   5.407 +compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
   5.408 +crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
   5.409 +deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
   5.410 +infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
   5.411 +inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
   5.412 +inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
   5.413 +trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/external/zlib-1.2.11/README	Sat Oct 21 21:05:43 2017 -0700
     6.3 @@ -0,0 +1,115 @@
     6.4 +ZLIB DATA COMPRESSION LIBRARY
     6.5 +
     6.6 +zlib 1.2.11 is a general purpose data compression library.  All the code is
     6.7 +thread safe.  The data format used by the zlib library is described by RFCs
     6.8 +(Request for Comments) 1950 to 1952 in the files
     6.9 +http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
    6.10 +rfc1952 (gzip format).
    6.11 +
    6.12 +All functions of the compression library are documented in the file zlib.h
    6.13 +(volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
    6.14 +of the library is given in the file test/example.c which also tests that
    6.15 +the library is working correctly.  Another example is given in the file
    6.16 +test/minigzip.c.  The compression library itself is composed of all source
    6.17 +files in the root directory.
    6.18 +
    6.19 +To compile all files and run the test program, follow the instructions given at
    6.20 +the top of Makefile.in.  In short "./configure; make test", and if that goes
    6.21 +well, "make install" should work for most flavors of Unix.  For Windows, use
    6.22 +one of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
    6.23 +make_vms.com.
    6.24 +
    6.25 +Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
    6.26 +<info@winimage.com> for the Windows DLL version.  The zlib home page is
    6.27 +http://zlib.net/ .  Before reporting a problem, please check this site to
    6.28 +verify that you have the latest version of zlib; otherwise get the latest
    6.29 +version and check whether the problem still exists or not.
    6.30 +
    6.31 +PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
    6.32 +
    6.33 +Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan.  1997
    6.34 +issue of Dr.  Dobb's Journal; a copy of the article is available at
    6.35 +http://marknelson.us/1997/01/01/zlib-engine/ .
    6.36 +
    6.37 +The changes made in version 1.2.11 are documented in the file ChangeLog.
    6.38 +
    6.39 +Unsupported third party contributions are provided in directory contrib/ .
    6.40 +
    6.41 +zlib is available in Java using the java.util.zip package, documented at
    6.42 +http://java.sun.com/developer/technicalArticles/Programming/compression/ .
    6.43 +
    6.44 +A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
    6.45 +at CPAN (Comprehensive Perl Archive Network) sites, including
    6.46 +http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
    6.47 +
    6.48 +A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
    6.49 +available in Python 1.5 and later versions, see
    6.50 +http://docs.python.org/library/zlib.html .
    6.51 +
    6.52 +zlib is built into tcl: http://wiki.tcl.tk/4610 .
    6.53 +
    6.54 +An experimental package to read and write files in .zip format, written on top
    6.55 +of zlib by Gilles Vollant <info@winimage.com>, is available in the
    6.56 +contrib/minizip directory of zlib.
    6.57 +
    6.58 +
    6.59 +Notes for some targets:
    6.60 +
    6.61 +- For Windows DLL versions, please see win32/DLL_FAQ.txt
    6.62 +
    6.63 +- For 64-bit Irix, deflate.c must be compiled without any optimization. With
    6.64 +  -O, one libpng test fails. The test works in 32 bit mode (with the -n32
    6.65 +  compiler flag). The compiler bug has been reported to SGI.
    6.66 +
    6.67 +- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
    6.68 +  when compiled with cc.
    6.69 +
    6.70 +- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
    6.71 +  necessary to get gzprintf working correctly. This is done by configure.
    6.72 +
    6.73 +- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
    6.74 +  other compilers. Use "make test" to check your compiler.
    6.75 +
    6.76 +- gzdopen is not supported on RISCOS or BEOS.
    6.77 +
    6.78 +- For PalmOs, see http://palmzlib.sourceforge.net/
    6.79 +
    6.80 +
    6.81 +Acknowledgments:
    6.82 +
    6.83 +  The deflate format used by zlib was defined by Phil Katz.  The deflate and
    6.84 +  zlib specifications were written by L.  Peter Deutsch.  Thanks to all the
    6.85 +  people who reported problems and suggested various improvements in zlib; they
    6.86 +  are too numerous to cite here.
    6.87 +
    6.88 +Copyright notice:
    6.89 +
    6.90 + (C) 1995-2017 Jean-loup Gailly and Mark Adler
    6.91 +
    6.92 +  This software is provided 'as-is', without any express or implied
    6.93 +  warranty.  In no event will the authors be held liable for any damages
    6.94 +  arising from the use of this software.
    6.95 +
    6.96 +  Permission is granted to anyone to use this software for any purpose,
    6.97 +  including commercial applications, and to alter it and redistribute it
    6.98 +  freely, subject to the following restrictions:
    6.99 +
   6.100 +  1. The origin of this software must not be misrepresented; you must not
   6.101 +     claim that you wrote the original software. If you use this software
   6.102 +     in a product, an acknowledgment in the product documentation would be
   6.103 +     appreciated but is not required.
   6.104 +  2. Altered source versions must be plainly marked as such, and must not be
   6.105 +     misrepresented as being the original software.
   6.106 +  3. This notice may not be removed or altered from any source distribution.
   6.107 +
   6.108 +  Jean-loup Gailly        Mark Adler
   6.109 +  jloup@gzip.org          madler@alumni.caltech.edu
   6.110 +
   6.111 +If you use the zlib library in a product, we would appreciate *not* receiving
   6.112 +lengthy legal documents to sign.  The sources are provided for free but without
   6.113 +warranty of any kind.  The library has been entirely written by Jean-loup
   6.114 +Gailly and Mark Adler; it does not include third-party code.
   6.115 +
   6.116 +If you redistribute modified sources, we would appreciate that you include in
   6.117 +the file ChangeLog history information documenting your changes.  Please read
   6.118 +the FAQ for more information on the distribution of modified source versions.
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/external/zlib-1.2.11/adler32.c	Sat Oct 21 21:05:43 2017 -0700
     7.3 @@ -0,0 +1,186 @@
     7.4 +/* adler32.c -- compute the Adler-32 checksum of a data stream
     7.5 + * Copyright (C) 1995-2011, 2016 Mark Adler
     7.6 + * For conditions of distribution and use, see copyright notice in zlib.h
     7.7 + */
     7.8 +
     7.9 +/* @(#) $Id$ */
    7.10 +
    7.11 +#include "zutil.h"
    7.12 +
    7.13 +local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
    7.14 +
    7.15 +#define BASE 65521U     /* largest prime smaller than 65536 */
    7.16 +#define NMAX 5552
    7.17 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
    7.18 +
    7.19 +#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
    7.20 +#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
    7.21 +#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
    7.22 +#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
    7.23 +#define DO16(buf)   DO8(buf,0); DO8(buf,8);
    7.24 +
    7.25 +/* use NO_DIVIDE if your processor does not do division in hardware --
    7.26 +   try it both ways to see which is faster */
    7.27 +#ifdef NO_DIVIDE
    7.28 +/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
    7.29 +   (thank you to John Reiser for pointing this out) */
    7.30 +#  define CHOP(a) \
    7.31 +    do { \
    7.32 +        unsigned long tmp = a >> 16; \
    7.33 +        a &= 0xffffUL; \
    7.34 +        a += (tmp << 4) - tmp; \
    7.35 +    } while (0)
    7.36 +#  define MOD28(a) \
    7.37 +    do { \
    7.38 +        CHOP(a); \
    7.39 +        if (a >= BASE) a -= BASE; \
    7.40 +    } while (0)
    7.41 +#  define MOD(a) \
    7.42 +    do { \
    7.43 +        CHOP(a); \
    7.44 +        MOD28(a); \
    7.45 +    } while (0)
    7.46 +#  define MOD63(a) \
    7.47 +    do { /* this assumes a is not negative */ \
    7.48 +        z_off64_t tmp = a >> 32; \
    7.49 +        a &= 0xffffffffL; \
    7.50 +        a += (tmp << 8) - (tmp << 5) + tmp; \
    7.51 +        tmp = a >> 16; \
    7.52 +        a &= 0xffffL; \
    7.53 +        a += (tmp << 4) - tmp; \
    7.54 +        tmp = a >> 16; \
    7.55 +        a &= 0xffffL; \
    7.56 +        a += (tmp << 4) - tmp; \
    7.57 +        if (a >= BASE) a -= BASE; \
    7.58 +    } while (0)
    7.59 +#else
    7.60 +#  define MOD(a) a %= BASE
    7.61 +#  define MOD28(a) a %= BASE
    7.62 +#  define MOD63(a) a %= BASE
    7.63 +#endif
    7.64 +
    7.65 +/* ========================================================================= */
    7.66 +uLong ZEXPORT adler32_z(adler, buf, len)
    7.67 +    uLong adler;
    7.68 +    const Bytef *buf;
    7.69 +    z_size_t len;
    7.70 +{
    7.71 +    unsigned long sum2;
    7.72 +    unsigned n;
    7.73 +
    7.74 +    /* split Adler-32 into component sums */
    7.75 +    sum2 = (adler >> 16) & 0xffff;
    7.76 +    adler &= 0xffff;
    7.77 +
    7.78 +    /* in case user likes doing a byte at a time, keep it fast */
    7.79 +    if (len == 1) {
    7.80 +        adler += buf[0];
    7.81 +        if (adler >= BASE)
    7.82 +            adler -= BASE;
    7.83 +        sum2 += adler;
    7.84 +        if (sum2 >= BASE)
    7.85 +            sum2 -= BASE;
    7.86 +        return adler | (sum2 << 16);
    7.87 +    }
    7.88 +
    7.89 +    /* initial Adler-32 value (deferred check for len == 1 speed) */
    7.90 +    if (buf == Z_NULL)
    7.91 +        return 1L;
    7.92 +
    7.93 +    /* in case short lengths are provided, keep it somewhat fast */
    7.94 +    if (len < 16) {
    7.95 +        while (len--) {
    7.96 +            adler += *buf++;
    7.97 +            sum2 += adler;
    7.98 +        }
    7.99 +        if (adler >= BASE)
   7.100 +            adler -= BASE;
   7.101 +        MOD28(sum2);            /* only added so many BASE's */
   7.102 +        return adler | (sum2 << 16);
   7.103 +    }
   7.104 +
   7.105 +    /* do length NMAX blocks -- requires just one modulo operation */
   7.106 +    while (len >= NMAX) {
   7.107 +        len -= NMAX;
   7.108 +        n = NMAX / 16;          /* NMAX is divisible by 16 */
   7.109 +        do {
   7.110 +            DO16(buf);          /* 16 sums unrolled */
   7.111 +            buf += 16;
   7.112 +        } while (--n);
   7.113 +        MOD(adler);
   7.114 +        MOD(sum2);
   7.115 +    }
   7.116 +
   7.117 +    /* do remaining bytes (less than NMAX, still just one modulo) */
   7.118 +    if (len) {                  /* avoid modulos if none remaining */
   7.119 +        while (len >= 16) {
   7.120 +            len -= 16;
   7.121 +            DO16(buf);
   7.122 +            buf += 16;
   7.123 +        }
   7.124 +        while (len--) {
   7.125 +            adler += *buf++;
   7.126 +            sum2 += adler;
   7.127 +        }
   7.128 +        MOD(adler);
   7.129 +        MOD(sum2);
   7.130 +    }
   7.131 +
   7.132 +    /* return recombined sums */
   7.133 +    return adler | (sum2 << 16);
   7.134 +}
   7.135 +
   7.136 +/* ========================================================================= */
   7.137 +uLong ZEXPORT adler32(adler, buf, len)
   7.138 +    uLong adler;
   7.139 +    const Bytef *buf;
   7.140 +    uInt len;
   7.141 +{
   7.142 +    return adler32_z(adler, buf, len);
   7.143 +}
   7.144 +
   7.145 +/* ========================================================================= */
   7.146 +local uLong adler32_combine_(adler1, adler2, len2)
   7.147 +    uLong adler1;
   7.148 +    uLong adler2;
   7.149 +    z_off64_t len2;
   7.150 +{
   7.151 +    unsigned long sum1;
   7.152 +    unsigned long sum2;
   7.153 +    unsigned rem;
   7.154 +
   7.155 +    /* for negative len, return invalid adler32 as a clue for debugging */
   7.156 +    if (len2 < 0)
   7.157 +        return 0xffffffffUL;
   7.158 +
   7.159 +    /* the derivation of this formula is left as an exercise for the reader */
   7.160 +    MOD63(len2);                /* assumes len2 >= 0 */
   7.161 +    rem = (unsigned)len2;
   7.162 +    sum1 = adler1 & 0xffff;
   7.163 +    sum2 = rem * sum1;
   7.164 +    MOD(sum2);
   7.165 +    sum1 += (adler2 & 0xffff) + BASE - 1;
   7.166 +    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
   7.167 +    if (sum1 >= BASE) sum1 -= BASE;
   7.168 +    if (sum1 >= BASE) sum1 -= BASE;
   7.169 +    if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
   7.170 +    if (sum2 >= BASE) sum2 -= BASE;
   7.171 +    return sum1 | (sum2 << 16);
   7.172 +}
   7.173 +
   7.174 +/* ========================================================================= */
   7.175 +uLong ZEXPORT adler32_combine(adler1, adler2, len2)
   7.176 +    uLong adler1;
   7.177 +    uLong adler2;
   7.178 +    z_off_t len2;
   7.179 +{
   7.180 +    return adler32_combine_(adler1, adler2, len2);
   7.181 +}
   7.182 +
   7.183 +uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
   7.184 +    uLong adler1;
   7.185 +    uLong adler2;
   7.186 +    z_off64_t len2;
   7.187 +{
   7.188 +    return adler32_combine_(adler1, adler2, len2);
   7.189 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/external/zlib-1.2.11/amiga/Makefile.pup	Sat Oct 21 21:05:43 2017 -0700
     8.3 @@ -0,0 +1,69 @@
     8.4 +# Amiga powerUP (TM) Makefile
     8.5 +# makefile for libpng and SAS C V6.58/7.00 PPC compiler
     8.6 +# Copyright (C) 1998 by Andreas R. Kleinert
     8.7 +
     8.8 +LIBNAME	= libzip.a
     8.9 +
    8.10 +CC	= scppc
    8.11 +CFLAGS	= NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
    8.12 +	  OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER
    8.13 +AR	= ppc-amigaos-ar cr
    8.14 +RANLIB	= ppc-amigaos-ranlib
    8.15 +LD	= ppc-amigaos-ld -r
    8.16 +LDFLAGS	= -o
    8.17 +LDLIBS	= LIB:scppc.a LIB:end.o
    8.18 +RM	= delete quiet
    8.19 +
    8.20 +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
    8.21 +       uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
    8.22 +
    8.23 +TEST_OBJS = example.o minigzip.o
    8.24 +
    8.25 +all: example minigzip
    8.26 +
    8.27 +check: test
    8.28 +test: all
    8.29 +	example
    8.30 +	echo hello world | minigzip | minigzip -d
    8.31 +
    8.32 +$(LIBNAME): $(OBJS)
    8.33 +	$(AR) $@ $(OBJS)
    8.34 +	-$(RANLIB) $@
    8.35 +
    8.36 +example: example.o $(LIBNAME)
    8.37 +	$(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
    8.38 +
    8.39 +minigzip: minigzip.o $(LIBNAME)
    8.40 +	$(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
    8.41 +
    8.42 +mostlyclean: clean
    8.43 +clean:
    8.44 +	$(RM) *.o example minigzip $(LIBNAME) foo.gz
    8.45 +
    8.46 +zip:
    8.47 +	zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
    8.48 +	  descrip.mms *.[ch]
    8.49 +
    8.50 +tgz:
    8.51 +	cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
    8.52 +	  zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
    8.53 +
    8.54 +# DO NOT DELETE THIS LINE -- make depend depends on it.
    8.55 +
    8.56 +adler32.o: zlib.h zconf.h
    8.57 +compress.o: zlib.h zconf.h
    8.58 +crc32.o: crc32.h zlib.h zconf.h
    8.59 +deflate.o: deflate.h zutil.h zlib.h zconf.h
    8.60 +example.o: zlib.h zconf.h
    8.61 +gzclose.o: zlib.h zconf.h gzguts.h
    8.62 +gzlib.o: zlib.h zconf.h gzguts.h
    8.63 +gzread.o: zlib.h zconf.h gzguts.h
    8.64 +gzwrite.o: zlib.h zconf.h gzguts.h
    8.65 +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    8.66 +inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    8.67 +infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    8.68 +inftrees.o: zutil.h zlib.h zconf.h inftrees.h
    8.69 +minigzip.o: zlib.h zconf.h
    8.70 +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
    8.71 +uncompr.o: zlib.h zconf.h
    8.72 +zutil.o: zutil.h zlib.h zconf.h
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/external/zlib-1.2.11/amiga/Makefile.sas	Sat Oct 21 21:05:43 2017 -0700
     9.3 @@ -0,0 +1,68 @@
     9.4 +# SMakefile for zlib
     9.5 +# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
     9.6 +# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
     9.7 +# Amiga, SAS/C 6.56 & Smake
     9.8 +
     9.9 +CC=sc
    9.10 +CFLAGS=OPT
    9.11 +#CFLAGS=OPT CPU=68030
    9.12 +#CFLAGS=DEBUG=LINE
    9.13 +LDFLAGS=LIB z.lib
    9.14 +
    9.15 +SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
    9.16 +       NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \
    9.17 +       DEF=POSTINC
    9.18 +
    9.19 +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
    9.20 +       uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
    9.21 +
    9.22 +TEST_OBJS = example.o minigzip.o
    9.23 +
    9.24 +all: SCOPTIONS example minigzip
    9.25 +
    9.26 +check: test
    9.27 +test: all
    9.28 +	example
    9.29 +	echo hello world | minigzip | minigzip -d
    9.30 +
    9.31 +install: z.lib
    9.32 +	copy clone zlib.h zconf.h INCLUDE:
    9.33 +	copy clone z.lib LIB:
    9.34 +
    9.35 +z.lib: $(OBJS)
    9.36 +	oml z.lib r $(OBJS)
    9.37 +
    9.38 +example: example.o z.lib
    9.39 +	$(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
    9.40 +
    9.41 +minigzip: minigzip.o z.lib
    9.42 +	$(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
    9.43 +
    9.44 +mostlyclean: clean
    9.45 +clean:
    9.46 +	-delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS
    9.47 +
    9.48 +SCOPTIONS: Makefile.sas
    9.49 +	copy to $@ <from <
    9.50 +$(SCOPTIONS)
    9.51 +<
    9.52 +
    9.53 +# DO NOT DELETE THIS LINE -- make depend depends on it.
    9.54 +
    9.55 +adler32.o: zlib.h zconf.h
    9.56 +compress.o: zlib.h zconf.h
    9.57 +crc32.o: crc32.h zlib.h zconf.h
    9.58 +deflate.o: deflate.h zutil.h zlib.h zconf.h
    9.59 +example.o: zlib.h zconf.h
    9.60 +gzclose.o: zlib.h zconf.h gzguts.h
    9.61 +gzlib.o: zlib.h zconf.h gzguts.h
    9.62 +gzread.o: zlib.h zconf.h gzguts.h
    9.63 +gzwrite.o: zlib.h zconf.h gzguts.h
    9.64 +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    9.65 +inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    9.66 +infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
    9.67 +inftrees.o: zutil.h zlib.h zconf.h inftrees.h
    9.68 +minigzip.o: zlib.h zconf.h
    9.69 +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
    9.70 +uncompr.o: zlib.h zconf.h
    9.71 +zutil.o: zutil.h zlib.h zconf.h
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/external/zlib-1.2.11/compress.c	Sat Oct 21 21:05:43 2017 -0700
    10.3 @@ -0,0 +1,86 @@
    10.4 +/* compress.c -- compress a memory buffer
    10.5 + * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
    10.6 + * For conditions of distribution and use, see copyright notice in zlib.h
    10.7 + */
    10.8 +
    10.9 +/* @(#) $Id$ */
   10.10 +
   10.11 +#define ZLIB_INTERNAL
   10.12 +#include "zlib.h"
   10.13 +
   10.14 +/* ===========================================================================
   10.15 +     Compresses the source buffer into the destination buffer. The level
   10.16 +   parameter has the same meaning as in deflateInit.  sourceLen is the byte
   10.17 +   length of the source buffer. Upon entry, destLen is the total size of the
   10.18 +   destination buffer, which must be at least 0.1% larger than sourceLen plus
   10.19 +   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
   10.20 +
   10.21 +     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
   10.22 +   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
   10.23 +   Z_STREAM_ERROR if the level parameter is invalid.
   10.24 +*/
   10.25 +int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
   10.26 +    Bytef *dest;
   10.27 +    uLongf *destLen;
   10.28 +    const Bytef *source;
   10.29 +    uLong sourceLen;
   10.30 +    int level;
   10.31 +{
   10.32 +    z_stream stream;
   10.33 +    int err;
   10.34 +    const uInt max = (uInt)-1;
   10.35 +    uLong left;
   10.36 +
   10.37 +    left = *destLen;
   10.38 +    *destLen = 0;
   10.39 +
   10.40 +    stream.zalloc = (alloc_func)0;
   10.41 +    stream.zfree = (free_func)0;
   10.42 +    stream.opaque = (voidpf)0;
   10.43 +
   10.44 +    err = deflateInit(&stream, level);
   10.45 +    if (err != Z_OK) return err;
   10.46 +
   10.47 +    stream.next_out = dest;
   10.48 +    stream.avail_out = 0;
   10.49 +    stream.next_in = (z_const Bytef *)source;
   10.50 +    stream.avail_in = 0;
   10.51 +
   10.52 +    do {
   10.53 +        if (stream.avail_out == 0) {
   10.54 +            stream.avail_out = left > (uLong)max ? max : (uInt)left;
   10.55 +            left -= stream.avail_out;
   10.56 +        }
   10.57 +        if (stream.avail_in == 0) {
   10.58 +            stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
   10.59 +            sourceLen -= stream.avail_in;
   10.60 +        }
   10.61 +        err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
   10.62 +    } while (err == Z_OK);
   10.63 +
   10.64 +    *destLen = stream.total_out;
   10.65 +    deflateEnd(&stream);
   10.66 +    return err == Z_STREAM_END ? Z_OK : err;
   10.67 +}
   10.68 +
   10.69 +/* ===========================================================================
   10.70 + */
   10.71 +int ZEXPORT compress (dest, destLen, source, sourceLen)
   10.72 +    Bytef *dest;
   10.73 +    uLongf *destLen;
   10.74 +    const Bytef *source;
   10.75 +    uLong sourceLen;
   10.76 +{
   10.77 +    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
   10.78 +}
   10.79 +
   10.80 +/* ===========================================================================
   10.81 +     If the default memLevel or windowBits for deflateInit() is changed, then
   10.82 +   this function needs to be updated.
   10.83 + */
   10.84 +uLong ZEXPORT compressBound (sourceLen)
   10.85 +    uLong sourceLen;
   10.86 +{
   10.87 +    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
   10.88 +           (sourceLen >> 25) + 13;
   10.89 +}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/external/zlib-1.2.11/configure	Sat Oct 21 21:05:43 2017 -0700
    11.3 @@ -0,0 +1,921 @@
    11.4 +#!/bin/sh
    11.5 +# configure script for zlib.
    11.6 +#
    11.7 +# Normally configure builds both a static and a shared library.
    11.8 +# If you want to build just a static library, use: ./configure --static
    11.9 +#
   11.10 +# To impose specific compiler or flags or install directory, use for example:
   11.11 +#    prefix=$HOME CC=cc CFLAGS="-O4" ./configure
   11.12 +# or for csh/tcsh users:
   11.13 +#    (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
   11.14 +
   11.15 +# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
   11.16 +# If you have problems, try without defining CC and CFLAGS before reporting
   11.17 +# an error.
   11.18 +
   11.19 +# start off configure.log
   11.20 +echo -------------------- >> configure.log
   11.21 +echo $0 $* >> configure.log
   11.22 +date >> configure.log
   11.23 +
   11.24 +# get source directory
   11.25 +SRCDIR=`dirname $0`
   11.26 +if test $SRCDIR = "."; then
   11.27 +    ZINC=""
   11.28 +    ZINCOUT="-I."
   11.29 +    SRCDIR=""
   11.30 +else
   11.31 +    ZINC='-include zconf.h'
   11.32 +    ZINCOUT='-I. -I$(SRCDIR)'
   11.33 +    SRCDIR="$SRCDIR/"
   11.34 +fi
   11.35 +
   11.36 +# set command prefix for cross-compilation
   11.37 +if [ -n "${CHOST}" ]; then
   11.38 +    uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
   11.39 +    CROSS_PREFIX="${CHOST}-"
   11.40 +fi
   11.41 +
   11.42 +# destination name for static library
   11.43 +STATICLIB=libz.a
   11.44 +
   11.45 +# extract zlib version numbers from zlib.h
   11.46 +VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
   11.47 +VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < ${SRCDIR}zlib.h`
   11.48 +VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
   11.49 +VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
   11.50 +
   11.51 +# establish commands for library building
   11.52 +if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
   11.53 +    AR=${AR-"${CROSS_PREFIX}ar"}
   11.54 +    test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
   11.55 +else
   11.56 +    AR=${AR-"ar"}
   11.57 +    test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
   11.58 +fi
   11.59 +ARFLAGS=${ARFLAGS-"rc"}
   11.60 +if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
   11.61 +    RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
   11.62 +    test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
   11.63 +else
   11.64 +    RANLIB=${RANLIB-"ranlib"}
   11.65 +fi
   11.66 +if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
   11.67 +    NM=${NM-"${CROSS_PREFIX}nm"}
   11.68 +    test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
   11.69 +else
   11.70 +    NM=${NM-"nm"}
   11.71 +fi
   11.72 +
   11.73 +# set defaults before processing command line options
   11.74 +LDCONFIG=${LDCONFIG-"ldconfig"}
   11.75 +LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
   11.76 +ARCHS=
   11.77 +prefix=${prefix-/usr/local}
   11.78 +exec_prefix=${exec_prefix-'${prefix}'}
   11.79 +libdir=${libdir-'${exec_prefix}/lib'}
   11.80 +sharedlibdir=${sharedlibdir-'${libdir}'}
   11.81 +includedir=${includedir-'${prefix}/include'}
   11.82 +mandir=${mandir-'${prefix}/share/man'}
   11.83 +shared_ext='.so'
   11.84 +shared=1
   11.85 +solo=0
   11.86 +cover=0
   11.87 +zprefix=0
   11.88 +zconst=0
   11.89 +build64=0
   11.90 +gcc=0
   11.91 +warn=0
   11.92 +debug=0
   11.93 +old_cc="$CC"
   11.94 +old_cflags="$CFLAGS"
   11.95 +OBJC='$(OBJZ) $(OBJG)'
   11.96 +PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
   11.97 +
   11.98 +# leave this script, optionally in a bad way
   11.99 +leave()
  11.100 +{
  11.101 +  if test "$*" != "0"; then
  11.102 +    echo "** $0 aborting." | tee -a configure.log
  11.103 +  fi
  11.104 +  rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
  11.105 +  echo -------------------- >> configure.log
  11.106 +  echo >> configure.log
  11.107 +  echo >> configure.log
  11.108 +  exit $1
  11.109 +}
  11.110 +
  11.111 +# process command line options
  11.112 +while test $# -ge 1
  11.113 +do
  11.114 +case "$1" in
  11.115 +    -h* | --help)
  11.116 +      echo 'usage:' | tee -a configure.log
  11.117 +      echo '  configure [--const] [--zprefix] [--prefix=PREFIX]  [--eprefix=EXPREFIX]' | tee -a configure.log
  11.118 +      echo '    [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
  11.119 +      echo '    [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
  11.120 +        exit 0 ;;
  11.121 +    -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
  11.122 +    -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
  11.123 +    -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
  11.124 +    --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
  11.125 +    -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
  11.126 +    -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
  11.127 +    -p* | --prefix) prefix="$2"; shift; shift ;;
  11.128 +    -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
  11.129 +    -l* | --libdir) libdir="$2"; shift; shift ;;
  11.130 +    -i* | --includedir) includedir="$2"; shift; shift ;;
  11.131 +    -s* | --shared | --enable-shared) shared=1; shift ;;
  11.132 +    -t | --static) shared=0; shift ;;
  11.133 +    --solo) solo=1; shift ;;
  11.134 +    --cover) cover=1; shift ;;
  11.135 +    -z* | --zprefix) zprefix=1; shift ;;
  11.136 +    -6* | --64) build64=1; shift ;;
  11.137 +    -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
  11.138 +    --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
  11.139 +    --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
  11.140 +    -c* | --const) zconst=1; shift ;;
  11.141 +    -w* | --warn) warn=1; shift ;;
  11.142 +    -d* | --debug) debug=1; shift ;;
  11.143 +    *)
  11.144 +      echo "unknown option: $1" | tee -a configure.log
  11.145 +      echo "$0 --help for help" | tee -a configure.log
  11.146 +      leave 1;;
  11.147 +    esac
  11.148 +done
  11.149 +
  11.150 +# temporary file name
  11.151 +test=ztest$$
  11.152 +
  11.153 +# put arguments in log, also put test file in log if used in arguments
  11.154 +show()
  11.155 +{
  11.156 +  case "$*" in
  11.157 +    *$test.c*)
  11.158 +      echo === $test.c === >> configure.log
  11.159 +      cat $test.c >> configure.log
  11.160 +      echo === >> configure.log;;
  11.161 +  esac
  11.162 +  echo $* >> configure.log
  11.163 +}
  11.164 +
  11.165 +# check for gcc vs. cc and set compile and link flags based on the system identified by uname
  11.166 +cat > $test.c <<EOF
  11.167 +extern int getchar();
  11.168 +int hello() {return getchar();}
  11.169 +EOF
  11.170 +
  11.171 +test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
  11.172 +cc=${CC-${CROSS_PREFIX}gcc}
  11.173 +cflags=${CFLAGS-"-O3"}
  11.174 +# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
  11.175 +case "$cc" in
  11.176 +  *gcc*) gcc=1 ;;
  11.177 +  *clang*) gcc=1 ;;
  11.178 +esac
  11.179 +case `$cc -v 2>&1` in
  11.180 +  *gcc*) gcc=1 ;;
  11.181 +  *clang*) gcc=1 ;;
  11.182 +esac
  11.183 +
  11.184 +show $cc -c $test.c
  11.185 +if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
  11.186 +  echo ... using gcc >> configure.log
  11.187 +  CC="$cc"
  11.188 +  CFLAGS="${CFLAGS--O3}"
  11.189 +  SFLAGS="${CFLAGS--O3} -fPIC"
  11.190 +  if test "$ARCHS"; then
  11.191 +    CFLAGS="${CFLAGS} ${ARCHS}"
  11.192 +    LDFLAGS="${LDFLAGS} ${ARCHS}"
  11.193 +  fi
  11.194 +  if test $build64 -eq 1; then
  11.195 +    CFLAGS="${CFLAGS} -m64"
  11.196 +    SFLAGS="${SFLAGS} -m64"
  11.197 +  fi
  11.198 +  if test "$warn" -eq 1; then
  11.199 +    if test "$zconst" -eq 1; then
  11.200 +      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
  11.201 +    else
  11.202 +      CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
  11.203 +    fi
  11.204 +  fi
  11.205 +  if test $debug -eq 1; then
  11.206 +    CFLAGS="${CFLAGS} -DZLIB_DEBUG"
  11.207 +    SFLAGS="${SFLAGS} -DZLIB_DEBUG"
  11.208 +  fi
  11.209 +  if test -z "$uname"; then
  11.210 +    uname=`(uname -s || echo unknown) 2>/dev/null`
  11.211 +  fi
  11.212 +  case "$uname" in
  11.213 +  Linux* | linux* | GNU | GNU/* | solaris*)
  11.214 +        LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
  11.215 +  *BSD | *bsd* | DragonFly)
  11.216 +        LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
  11.217 +        LDCONFIG="ldconfig -m" ;;
  11.218 +  CYGWIN* | Cygwin* | cygwin* | OS/2*)
  11.219 +        EXE='.exe' ;;
  11.220 +  MINGW* | mingw*)
  11.221 +# temporary bypass
  11.222 +        rm -f $test.[co] $test $test$shared_ext
  11.223 +        echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
  11.224 +        leave 1
  11.225 +        LDSHARED=${LDSHARED-"$cc -shared"}
  11.226 +        LDSHAREDLIBC=""
  11.227 +        EXE='.exe' ;;
  11.228 +  QNX*)  # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
  11.229 +         # (alain.bonnefoy@icbt.com)
  11.230 +                 LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
  11.231 +  HP-UX*)
  11.232 +         LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
  11.233 +         case `(uname -m || echo unknown) 2>/dev/null` in
  11.234 +         ia64)
  11.235 +                 shared_ext='.so'
  11.236 +                 SHAREDLIB='libz.so' ;;
  11.237 +         *)
  11.238 +                 shared_ext='.sl'
  11.239 +                 SHAREDLIB='libz.sl' ;;
  11.240 +         esac ;;
  11.241 +  Darwin* | darwin*)
  11.242 +             shared_ext='.dylib'
  11.243 +             SHAREDLIB=libz$shared_ext
  11.244 +             SHAREDLIBV=libz.$VER$shared_ext
  11.245 +             SHAREDLIBM=libz.$VER1$shared_ext
  11.246 +             LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
  11.247 +             if libtool -V 2>&1 | grep Apple > /dev/null; then
  11.248 +                 AR="libtool"
  11.249 +             else
  11.250 +                 AR="/usr/bin/libtool"
  11.251 +             fi
  11.252 +             ARFLAGS="-o" ;;
  11.253 +  *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
  11.254 +  esac
  11.255 +else
  11.256 +  # find system name and corresponding cc options
  11.257 +  CC=${CC-cc}
  11.258 +  gcc=0
  11.259 +  echo ... using $CC >> configure.log
  11.260 +  if test -z "$uname"; then
  11.261 +    uname=`(uname -sr || echo unknown) 2>/dev/null`
  11.262 +  fi
  11.263 +  case "$uname" in
  11.264 +  HP-UX*)    SFLAGS=${CFLAGS-"-O +z"}
  11.265 +             CFLAGS=${CFLAGS-"-O"}
  11.266 +#            LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
  11.267 +             LDSHARED=${LDSHARED-"ld -b"}
  11.268 +         case `(uname -m || echo unknown) 2>/dev/null` in
  11.269 +         ia64)
  11.270 +             shared_ext='.so'
  11.271 +             SHAREDLIB='libz.so' ;;
  11.272 +         *)
  11.273 +             shared_ext='.sl'
  11.274 +             SHAREDLIB='libz.sl' ;;
  11.275 +         esac ;;
  11.276 +  IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
  11.277 +             CFLAGS=${CFLAGS-"-ansi -O2"}
  11.278 +             LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
  11.279 +  OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
  11.280 +             CFLAGS=${CFLAGS-"-O -std1"}
  11.281 +             LDFLAGS="${LDFLAGS} -Wl,-rpath,."
  11.282 +             LDSHARED=${LDSHARED-"cc -shared  -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
  11.283 +  OSF1*)     SFLAGS=${CFLAGS-"-O -std1"}
  11.284 +             CFLAGS=${CFLAGS-"-O -std1"}
  11.285 +             LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
  11.286 +  QNX*)      SFLAGS=${CFLAGS-"-4 -O"}
  11.287 +             CFLAGS=${CFLAGS-"-4 -O"}
  11.288 +             LDSHARED=${LDSHARED-"cc"}
  11.289 +             RANLIB=${RANLIB-"true"}
  11.290 +             AR="cc"
  11.291 +             ARFLAGS="-A" ;;
  11.292 +  SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
  11.293 +             CFLAGS=${CFLAGS-"-O3"}
  11.294 +             LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
  11.295 +  SunOS\ 5* | solaris*)
  11.296 +         LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
  11.297 +         SFLAGS=${CFLAGS-"-fast -KPIC"}
  11.298 +         CFLAGS=${CFLAGS-"-fast"}
  11.299 +         if test $build64 -eq 1; then
  11.300 +             # old versions of SunPRO/Workshop/Studio don't support -m64,
  11.301 +             # but newer ones do.  Check for it.
  11.302 +             flag64=`$CC -flags | egrep -- '^-m64'`
  11.303 +             if test x"$flag64" != x"" ; then
  11.304 +                 CFLAGS="${CFLAGS} -m64"
  11.305 +                 SFLAGS="${SFLAGS} -m64"
  11.306 +             else
  11.307 +                 case `(uname -m || echo unknown) 2>/dev/null` in
  11.308 +                   i86*)
  11.309 +                     SFLAGS="$SFLAGS -xarch=amd64"
  11.310 +                     CFLAGS="$CFLAGS -xarch=amd64" ;;
  11.311 +                   *)
  11.312 +                     SFLAGS="$SFLAGS -xarch=v9"
  11.313 +                     CFLAGS="$CFLAGS -xarch=v9" ;;
  11.314 +                 esac
  11.315 +             fi
  11.316 +         fi
  11.317 +         if test -n "$ZINC"; then
  11.318 +             ZINC='-I- -I. -I$(SRCDIR)'
  11.319 +         fi
  11.320 +         ;;
  11.321 +  SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
  11.322 +             CFLAGS=${CFLAGS-"-O2"}
  11.323 +             LDSHARED=${LDSHARED-"ld"} ;;
  11.324 +  SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
  11.325 +             CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
  11.326 +             LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
  11.327 +  UNIX_System_V\ 4.2.0)
  11.328 +             SFLAGS=${CFLAGS-"-KPIC -O"}
  11.329 +             CFLAGS=${CFLAGS-"-O"}
  11.330 +             LDSHARED=${LDSHARED-"cc -G"} ;;
  11.331 +  UNIX_SV\ 4.2MP)
  11.332 +             SFLAGS=${CFLAGS-"-Kconform_pic -O"}
  11.333 +             CFLAGS=${CFLAGS-"-O"}
  11.334 +             LDSHARED=${LDSHARED-"cc -G"} ;;
  11.335 +  OpenUNIX\ 5)
  11.336 +             SFLAGS=${CFLAGS-"-KPIC -O"}
  11.337 +             CFLAGS=${CFLAGS-"-O"}
  11.338 +             LDSHARED=${LDSHARED-"cc -G"} ;;
  11.339 +  AIX*)  # Courtesy of dbakker@arrayasolutions.com
  11.340 +             SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
  11.341 +             CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
  11.342 +             LDSHARED=${LDSHARED-"xlc -G"} ;;
  11.343 +  # send working options for other systems to zlib@gzip.org
  11.344 +  *)         SFLAGS=${CFLAGS-"-O"}
  11.345 +             CFLAGS=${CFLAGS-"-O"}
  11.346 +             LDSHARED=${LDSHARED-"cc -shared"} ;;
  11.347 +  esac
  11.348 +fi
  11.349 +
  11.350 +# destination names for shared library if not defined above
  11.351 +SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
  11.352 +SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
  11.353 +SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
  11.354 +
  11.355 +echo >> configure.log
  11.356 +
  11.357 +# define functions for testing compiler and library characteristics and logging the results
  11.358 +
  11.359 +cat > $test.c <<EOF
  11.360 +#error error
  11.361 +EOF
  11.362 +if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
  11.363 +  try()
  11.364 +  {
  11.365 +    show $*
  11.366 +    test "`( $* ) 2>&1 | tee -a configure.log`" = ""
  11.367 +  }
  11.368 +  echo - using any output from compiler to indicate an error >> configure.log
  11.369 +else
  11.370 +  try()
  11.371 +  {
  11.372 +    show $*
  11.373 +    ( $* ) >> configure.log 2>&1
  11.374 +    ret=$?
  11.375 +    if test $ret -ne 0; then
  11.376 +      echo "(exit code "$ret")" >> configure.log
  11.377 +    fi
  11.378 +    return $ret
  11.379 +  }
  11.380 +fi
  11.381 +
  11.382 +tryboth()
  11.383 +{
  11.384 +  show $*
  11.385 +  got=`( $* ) 2>&1`
  11.386 +  ret=$?
  11.387 +  printf %s "$got" >> configure.log
  11.388 +  if test $ret -ne 0; then
  11.389 +    return $ret
  11.390 +  fi
  11.391 +  test "$got" = ""
  11.392 +}
  11.393 +
  11.394 +cat > $test.c << EOF
  11.395 +int foo() { return 0; }
  11.396 +EOF
  11.397 +echo "Checking for obsessive-compulsive compiler options..." >> configure.log
  11.398 +if try $CC -c $CFLAGS $test.c; then
  11.399 +  :
  11.400 +else
  11.401 +  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  11.402 +  leave 1
  11.403 +fi
  11.404 +
  11.405 +echo >> configure.log
  11.406 +
  11.407 +# see if shared library build supported
  11.408 +cat > $test.c <<EOF
  11.409 +extern int getchar();
  11.410 +int hello() {return getchar();}
  11.411 +EOF
  11.412 +if test $shared -eq 1; then
  11.413 +  echo Checking for shared library support... | tee -a configure.log
  11.414 +  # we must test in two steps (cc then ld), required at least on SunOS 4.x
  11.415 +  if try $CC -w -c $SFLAGS $test.c &&
  11.416 +     try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
  11.417 +    echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
  11.418 +  elif test -z "$old_cc" -a -z "$old_cflags"; then
  11.419 +    echo No shared library support. | tee -a configure.log
  11.420 +    shared=0;
  11.421 +  else
  11.422 +    echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
  11.423 +    shared=0;
  11.424 +  fi
  11.425 +fi
  11.426 +if test $shared -eq 0; then
  11.427 +  LDSHARED="$CC"
  11.428 +  ALL="static"
  11.429 +  TEST="all teststatic"
  11.430 +  SHAREDLIB=""
  11.431 +  SHAREDLIBV=""
  11.432 +  SHAREDLIBM=""
  11.433 +  echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
  11.434 +else
  11.435 +  ALL="static shared"
  11.436 +  TEST="all teststatic testshared"
  11.437 +fi
  11.438 +
  11.439 +# check for underscores in external names for use by assembler code
  11.440 +CPP=${CPP-"$CC -E"}
  11.441 +case $CFLAGS in
  11.442 +  *ASMV*)
  11.443 +    echo >> configure.log
  11.444 +    show "$NM $test.o | grep _hello"
  11.445 +    if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
  11.446 +      CPP="$CPP -DNO_UNDERLINE"
  11.447 +      echo Checking for underline in external names... No. | tee -a configure.log
  11.448 +    else
  11.449 +      echo Checking for underline in external names... Yes. | tee -a configure.log
  11.450 +    fi ;;
  11.451 +esac
  11.452 +
  11.453 +echo >> configure.log
  11.454 +
  11.455 +# check for size_t
  11.456 +cat > $test.c <<EOF
  11.457 +#include <stdio.h>
  11.458 +#include <stdlib.h>
  11.459 +size_t dummy = 0;
  11.460 +EOF
  11.461 +if try $CC -c $CFLAGS $test.c; then
  11.462 +  echo "Checking for size_t... Yes." | tee -a configure.log
  11.463 +  need_sizet=0
  11.464 +else
  11.465 +  echo "Checking for size_t... No." | tee -a configure.log
  11.466 +  need_sizet=1
  11.467 +fi
  11.468 +
  11.469 +echo >> configure.log
  11.470 +
  11.471 +# find the size_t integer type, if needed
  11.472 +if test $need_sizet -eq 1; then
  11.473 +  cat > $test.c <<EOF
  11.474 +long long dummy = 0;
  11.475 +EOF
  11.476 +  if try $CC -c $CFLAGS $test.c; then
  11.477 +    echo "Checking for long long... Yes." | tee -a configure.log
  11.478 +    cat > $test.c <<EOF
  11.479 +#include <stdio.h>
  11.480 +int main(void) {
  11.481 +    if (sizeof(void *) <= sizeof(int)) puts("int");
  11.482 +    else if (sizeof(void *) <= sizeof(long)) puts("long");
  11.483 +    else puts("z_longlong");
  11.484 +    return 0;
  11.485 +}
  11.486 +EOF
  11.487 +  else
  11.488 +    echo "Checking for long long... No." | tee -a configure.log
  11.489 +    cat > $test.c <<EOF
  11.490 +#include <stdio.h>
  11.491 +int main(void) {
  11.492 +    if (sizeof(void *) <= sizeof(int)) puts("int");
  11.493 +    else puts("long");
  11.494 +    return 0;
  11.495 +}
  11.496 +EOF
  11.497 +  fi
  11.498 +  if try $CC $CFLAGS -o $test $test.c; then
  11.499 +    sizet=`./$test`
  11.500 +    echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
  11.501 +  else
  11.502 +    echo "Failed to find a pointer-size integer type." | tee -a configure.log
  11.503 +    leave 1
  11.504 +  fi
  11.505 +fi
  11.506 +
  11.507 +if test $need_sizet -eq 1; then
  11.508 +  CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
  11.509 +  SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
  11.510 +fi
  11.511 +
  11.512 +echo >> configure.log
  11.513 +
  11.514 +# check for large file support, and if none, check for fseeko()
  11.515 +cat > $test.c <<EOF
  11.516 +#include <sys/types.h>
  11.517 +off64_t dummy = 0;
  11.518 +EOF
  11.519 +if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
  11.520 +  CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
  11.521 +  SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
  11.522 +  ALL="${ALL} all64"
  11.523 +  TEST="${TEST} test64"
  11.524 +  echo "Checking for off64_t... Yes." | tee -a configure.log
  11.525 +  echo "Checking for fseeko... Yes." | tee -a configure.log
  11.526 +else
  11.527 +  echo "Checking for off64_t... No." | tee -a configure.log
  11.528 +  echo >> configure.log
  11.529 +  cat > $test.c <<EOF
  11.530 +#include <stdio.h>
  11.531 +int main(void) {
  11.532 +  fseeko(NULL, 0, 0);
  11.533 +  return 0;
  11.534 +}
  11.535 +EOF
  11.536 +  if try $CC $CFLAGS -o $test $test.c; then
  11.537 +    echo "Checking for fseeko... Yes." | tee -a configure.log
  11.538 +  else
  11.539 +    CFLAGS="${CFLAGS} -DNO_FSEEKO"
  11.540 +    SFLAGS="${SFLAGS} -DNO_FSEEKO"
  11.541 +    echo "Checking for fseeko... No." | tee -a configure.log
  11.542 +  fi
  11.543 +fi
  11.544 +
  11.545 +echo >> configure.log
  11.546 +
  11.547 +# check for strerror() for use by gz* functions
  11.548 +cat > $test.c <<EOF
  11.549 +#include <string.h>
  11.550 +#include <errno.h>
  11.551 +int main() { return strlen(strerror(errno)); }
  11.552 +EOF
  11.553 +if try $CC $CFLAGS -o $test $test.c; then
  11.554 +  echo "Checking for strerror... Yes." | tee -a configure.log
  11.555 +else
  11.556 +  CFLAGS="${CFLAGS} -DNO_STRERROR"
  11.557 +  SFLAGS="${SFLAGS} -DNO_STRERROR"
  11.558 +  echo "Checking for strerror... No." | tee -a configure.log
  11.559 +fi
  11.560 +
  11.561 +# copy clean zconf.h for subsequent edits
  11.562 +cp -p ${SRCDIR}zconf.h.in zconf.h
  11.563 +
  11.564 +echo >> configure.log
  11.565 +
  11.566 +# check for unistd.h and save result in zconf.h
  11.567 +cat > $test.c <<EOF
  11.568 +#include <unistd.h>
  11.569 +int main() { return 0; }
  11.570 +EOF
  11.571 +if try $CC -c $CFLAGS $test.c; then
  11.572 +  sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
  11.573 +  mv zconf.temp.h zconf.h
  11.574 +  echo "Checking for unistd.h... Yes." | tee -a configure.log
  11.575 +else
  11.576 +  echo "Checking for unistd.h... No." | tee -a configure.log
  11.577 +fi
  11.578 +
  11.579 +echo >> configure.log
  11.580 +
  11.581 +# check for stdarg.h and save result in zconf.h
  11.582 +cat > $test.c <<EOF
  11.583 +#include <stdarg.h>
  11.584 +int main() { return 0; }
  11.585 +EOF
  11.586 +if try $CC -c $CFLAGS $test.c; then
  11.587 +  sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
  11.588 +  mv zconf.temp.h zconf.h
  11.589 +  echo "Checking for stdarg.h... Yes." | tee -a configure.log
  11.590 +else
  11.591 +  echo "Checking for stdarg.h... No." | tee -a configure.log
  11.592 +fi
  11.593 +
  11.594 +# if the z_ prefix was requested, save that in zconf.h
  11.595 +if test $zprefix -eq 1; then
  11.596 +  sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
  11.597 +  mv zconf.temp.h zconf.h
  11.598 +  echo >> configure.log
  11.599 +  echo "Using z_ prefix on all symbols." | tee -a configure.log
  11.600 +fi
  11.601 +
  11.602 +# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
  11.603 +if test $solo -eq 1; then
  11.604 +  sed '/#define ZCONF_H/a\
  11.605 +#define Z_SOLO
  11.606 +
  11.607 +' < zconf.h > zconf.temp.h
  11.608 +  mv zconf.temp.h zconf.h
  11.609 +OBJC='$(OBJZ)'
  11.610 +PIC_OBJC='$(PIC_OBJZ)'
  11.611 +fi
  11.612 +
  11.613 +# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
  11.614 +if test $cover -eq 1; then
  11.615 +  CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
  11.616 +  if test -n "$GCC_CLASSIC"; then
  11.617 +    CC=$GCC_CLASSIC
  11.618 +  fi
  11.619 +fi
  11.620 +
  11.621 +echo >> configure.log
  11.622 +
  11.623 +# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
  11.624 +# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
  11.625 +# return value.  The most secure result is vsnprintf() with a return value.  snprintf() with a
  11.626 +# return value is secure as well, but then gzprintf() will be limited to 20 arguments.
  11.627 +cat > $test.c <<EOF
  11.628 +#include <stdio.h>
  11.629 +#include <stdarg.h>
  11.630 +#include "zconf.h"
  11.631 +int main()
  11.632 +{
  11.633 +#ifndef STDC
  11.634 +  choke me
  11.635 +#endif
  11.636 +  return 0;
  11.637 +}
  11.638 +EOF
  11.639 +if try $CC -c $CFLAGS $test.c; then
  11.640 +  echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
  11.641 +
  11.642 +  echo >> configure.log
  11.643 +  cat > $test.c <<EOF
  11.644 +#include <stdio.h>
  11.645 +#include <stdarg.h>
  11.646 +int mytest(const char *fmt, ...)
  11.647 +{
  11.648 +  char buf[20];
  11.649 +  va_list ap;
  11.650 +  va_start(ap, fmt);
  11.651 +  vsnprintf(buf, sizeof(buf), fmt, ap);
  11.652 +  va_end(ap);
  11.653 +  return 0;
  11.654 +}
  11.655 +int main()
  11.656 +{
  11.657 +  return (mytest("Hello%d\n", 1));
  11.658 +}
  11.659 +EOF
  11.660 +  if try $CC $CFLAGS -o $test $test.c; then
  11.661 +    echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
  11.662 +
  11.663 +    echo >> configure.log
  11.664 +    cat >$test.c <<EOF
  11.665 +#include <stdio.h>
  11.666 +#include <stdarg.h>
  11.667 +int mytest(const char *fmt, ...)
  11.668 +{
  11.669 +  int n;
  11.670 +  char buf[20];
  11.671 +  va_list ap;
  11.672 +  va_start(ap, fmt);
  11.673 +  n = vsnprintf(buf, sizeof(buf), fmt, ap);
  11.674 +  va_end(ap);
  11.675 +  return n;
  11.676 +}
  11.677 +int main()
  11.678 +{
  11.679 +  return (mytest("Hello%d\n", 1));
  11.680 +}
  11.681 +EOF
  11.682 +
  11.683 +    if try $CC -c $CFLAGS $test.c; then
  11.684 +      echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
  11.685 +    else
  11.686 +      CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
  11.687 +      SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
  11.688 +      echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
  11.689 +      echo "  WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
  11.690 +      echo "  can build but will be open to possible string-format security" | tee -a configure.log
  11.691 +      echo "  vulnerabilities." | tee -a configure.log
  11.692 +    fi
  11.693 +  else
  11.694 +    CFLAGS="$CFLAGS -DNO_vsnprintf"
  11.695 +    SFLAGS="$SFLAGS -DNO_vsnprintf"
  11.696 +    echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
  11.697 +    echo "  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
  11.698 +    echo "  can build but will be open to possible buffer-overflow security" | tee -a configure.log
  11.699 +    echo "  vulnerabilities." | tee -a configure.log
  11.700 +
  11.701 +    echo >> configure.log
  11.702 +    cat >$test.c <<EOF
  11.703 +#include <stdio.h>
  11.704 +#include <stdarg.h>
  11.705 +int mytest(const char *fmt, ...)
  11.706 +{
  11.707 +  int n;
  11.708 +  char buf[20];
  11.709 +  va_list ap;
  11.710 +  va_start(ap, fmt);
  11.711 +  n = vsprintf(buf, fmt, ap);
  11.712 +  va_end(ap);
  11.713 +  return n;
  11.714 +}
  11.715 +int main()
  11.716 +{
  11.717 +  return (mytest("Hello%d\n", 1));
  11.718 +}
  11.719 +EOF
  11.720 +
  11.721 +    if try $CC -c $CFLAGS $test.c; then
  11.722 +      echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
  11.723 +    else
  11.724 +      CFLAGS="$CFLAGS -DHAS_vsprintf_void"
  11.725 +      SFLAGS="$SFLAGS -DHAS_vsprintf_void"
  11.726 +      echo "Checking for return value of vsprintf()... No." | tee -a configure.log
  11.727 +      echo "  WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
  11.728 +      echo "  can build but will be open to possible string-format security" | tee -a configure.log
  11.729 +      echo "  vulnerabilities." | tee -a configure.log
  11.730 +    fi
  11.731 +  fi
  11.732 +else
  11.733 +  echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
  11.734 +
  11.735 +  echo >> configure.log
  11.736 +  cat >$test.c <<EOF
  11.737 +#include <stdio.h>
  11.738 +int mytest()
  11.739 +{
  11.740 +  char buf[20];
  11.741 +  snprintf(buf, sizeof(buf), "%s", "foo");
  11.742 +  return 0;
  11.743 +}
  11.744 +int main()
  11.745 +{
  11.746 +  return (mytest());
  11.747 +}
  11.748 +EOF
  11.749 +
  11.750 +  if try $CC $CFLAGS -o $test $test.c; then
  11.751 +    echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
  11.752 +
  11.753 +    echo >> configure.log
  11.754 +    cat >$test.c <<EOF
  11.755 +#include <stdio.h>
  11.756 +int mytest()
  11.757 +{
  11.758 +  char buf[20];
  11.759 +  return snprintf(buf, sizeof(buf), "%s", "foo");
  11.760 +}
  11.761 +int main()
  11.762 +{
  11.763 +  return (mytest());
  11.764 +}
  11.765 +EOF
  11.766 +
  11.767 +    if try $CC -c $CFLAGS $test.c; then
  11.768 +      echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
  11.769 +    else
  11.770 +      CFLAGS="$CFLAGS -DHAS_snprintf_void"
  11.771 +      SFLAGS="$SFLAGS -DHAS_snprintf_void"
  11.772 +      echo "Checking for return value of snprintf()... No." | tee -a configure.log
  11.773 +      echo "  WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
  11.774 +      echo "  can build but will be open to possible string-format security" | tee -a configure.log
  11.775 +      echo "  vulnerabilities." | tee -a configure.log
  11.776 +    fi
  11.777 +  else
  11.778 +    CFLAGS="$CFLAGS -DNO_snprintf"
  11.779 +    SFLAGS="$SFLAGS -DNO_snprintf"
  11.780 +    echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
  11.781 +    echo "  WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
  11.782 +    echo "  can build but will be open to possible buffer-overflow security" | tee -a configure.log
  11.783 +    echo "  vulnerabilities." | tee -a configure.log
  11.784 +
  11.785 +    echo >> configure.log
  11.786 +    cat >$test.c <<EOF
  11.787 +#include <stdio.h>
  11.788 +int mytest()
  11.789 +{
  11.790 +  char buf[20];
  11.791 +  return sprintf(buf, "%s", "foo");
  11.792 +}
  11.793 +int main()
  11.794 +{
  11.795 +  return (mytest());
  11.796 +}
  11.797 +EOF
  11.798 +
  11.799 +    if try $CC -c $CFLAGS $test.c; then
  11.800 +      echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
  11.801 +    else
  11.802 +      CFLAGS="$CFLAGS -DHAS_sprintf_void"
  11.803 +      SFLAGS="$SFLAGS -DHAS_sprintf_void"
  11.804 +      echo "Checking for return value of sprintf()... No." | tee -a configure.log
  11.805 +      echo "  WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
  11.806 +      echo "  can build but will be open to possible string-format security" | tee -a configure.log
  11.807 +      echo "  vulnerabilities." | tee -a configure.log
  11.808 +    fi
  11.809 +  fi
  11.810 +fi
  11.811 +
  11.812 +# see if we can hide zlib internal symbols that are linked between separate source files
  11.813 +if test "$gcc" -eq 1; then
  11.814 +  echo >> configure.log
  11.815 +  cat > $test.c <<EOF
  11.816 +#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
  11.817 +int ZLIB_INTERNAL foo;
  11.818 +int main()
  11.819 +{
  11.820 +  return 0;
  11.821 +}
  11.822 +EOF
  11.823 +  if tryboth $CC -c $CFLAGS $test.c; then
  11.824 +    CFLAGS="$CFLAGS -DHAVE_HIDDEN"
  11.825 +    SFLAGS="$SFLAGS -DHAVE_HIDDEN"
  11.826 +    echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
  11.827 +  else
  11.828 +    echo "Checking for attribute(visibility) support... No." | tee -a configure.log
  11.829 +  fi
  11.830 +fi
  11.831 +
  11.832 +# show the results in the log
  11.833 +echo >> configure.log
  11.834 +echo ALL = $ALL >> configure.log
  11.835 +echo AR = $AR >> configure.log
  11.836 +echo ARFLAGS = $ARFLAGS >> configure.log
  11.837 +echo CC = $CC >> configure.log
  11.838 +echo CFLAGS = $CFLAGS >> configure.log
  11.839 +echo CPP = $CPP >> configure.log
  11.840 +echo EXE = $EXE >> configure.log
  11.841 +echo LDCONFIG = $LDCONFIG >> configure.log
  11.842 +echo LDFLAGS = $LDFLAGS >> configure.log
  11.843 +echo LDSHARED = $LDSHARED >> configure.log
  11.844 +echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
  11.845 +echo OBJC = $OBJC >> configure.log
  11.846 +echo PIC_OBJC = $PIC_OBJC >> configure.log
  11.847 +echo RANLIB = $RANLIB >> configure.log
  11.848 +echo SFLAGS = $SFLAGS >> configure.log
  11.849 +echo SHAREDLIB = $SHAREDLIB >> configure.log
  11.850 +echo SHAREDLIBM = $SHAREDLIBM >> configure.log
  11.851 +echo SHAREDLIBV = $SHAREDLIBV >> configure.log
  11.852 +echo STATICLIB = $STATICLIB >> configure.log
  11.853 +echo TEST = $TEST >> configure.log
  11.854 +echo VER = $VER >> configure.log
  11.855 +echo Z_U4 = $Z_U4 >> configure.log
  11.856 +echo SRCDIR = $SRCDIR >> configure.log
  11.857 +echo exec_prefix = $exec_prefix >> configure.log
  11.858 +echo includedir = $includedir >> configure.log
  11.859 +echo libdir = $libdir >> configure.log
  11.860 +echo mandir = $mandir >> configure.log
  11.861 +echo prefix = $prefix >> configure.log
  11.862 +echo sharedlibdir = $sharedlibdir >> configure.log
  11.863 +echo uname = $uname >> configure.log
  11.864 +
  11.865 +# udpate Makefile with the configure results
  11.866 +sed < ${SRCDIR}Makefile.in "
  11.867 +/^CC *=/s#=.*#=$CC#
  11.868 +/^CFLAGS *=/s#=.*#=$CFLAGS#
  11.869 +/^SFLAGS *=/s#=.*#=$SFLAGS#
  11.870 +/^LDFLAGS *=/s#=.*#=$LDFLAGS#
  11.871 +/^LDSHARED *=/s#=.*#=$LDSHARED#
  11.872 +/^CPP *=/s#=.*#=$CPP#
  11.873 +/^STATICLIB *=/s#=.*#=$STATICLIB#
  11.874 +/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
  11.875 +/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
  11.876 +/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
  11.877 +/^AR *=/s#=.*#=$AR#
  11.878 +/^ARFLAGS *=/s#=.*#=$ARFLAGS#
  11.879 +/^RANLIB *=/s#=.*#=$RANLIB#
  11.880 +/^LDCONFIG *=/s#=.*#=$LDCONFIG#
  11.881 +/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
  11.882 +/^EXE *=/s#=.*#=$EXE#
  11.883 +/^SRCDIR *=/s#=.*#=$SRCDIR#
  11.884 +/^ZINC *=/s#=.*#=$ZINC#
  11.885 +/^ZINCOUT *=/s#=.*#=$ZINCOUT#
  11.886 +/^prefix *=/s#=.*#=$prefix#
  11.887 +/^exec_prefix *=/s#=.*#=$exec_prefix#
  11.888 +/^libdir *=/s#=.*#=$libdir#
  11.889 +/^sharedlibdir *=/s#=.*#=$sharedlibdir#
  11.890 +/^includedir *=/s#=.*#=$includedir#
  11.891 +/^mandir *=/s#=.*#=$mandir#
  11.892 +/^OBJC *=/s#=.*#= $OBJC#
  11.893 +/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
  11.894 +/^all: */s#:.*#: $ALL#
  11.895 +/^test: */s#:.*#: $TEST#
  11.896 +" > Makefile
  11.897 +
  11.898 +# create zlib.pc with the configure results
  11.899 +sed < ${SRCDIR}zlib.pc.in "
  11.900 +/^CC *=/s#=.*#=$CC#
  11.901 +/^CFLAGS *=/s#=.*#=$CFLAGS#
  11.902 +/^CPP *=/s#=.*#=$CPP#
  11.903 +/^LDSHARED *=/s#=.*#=$LDSHARED#
  11.904 +/^STATICLIB *=/s#=.*#=$STATICLIB#
  11.905 +/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
  11.906 +/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
  11.907 +/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
  11.908 +/^AR *=/s#=.*#=$AR#
  11.909 +/^ARFLAGS *=/s#=.*#=$ARFLAGS#
  11.910 +/^RANLIB *=/s#=.*#=$RANLIB#
  11.911 +/^EXE *=/s#=.*#=$EXE#
  11.912 +/^prefix *=/s#=.*#=$prefix#
  11.913 +/^exec_prefix *=/s#=.*#=$exec_prefix#
  11.914 +/^libdir *=/s#=.*#=$libdir#
  11.915 +/^sharedlibdir *=/s#=.*#=$sharedlibdir#
  11.916 +/^includedir *=/s#=.*#=$includedir#
  11.917 +/^mandir *=/s#=.*#=$mandir#
  11.918 +/^LDFLAGS *=/s#=.*#=$LDFLAGS#
  11.919 +" | sed -e "
  11.920 +s/\@VERSION\@/$VER/g;
  11.921 +" > zlib.pc
  11.922 +
  11.923 +# done
  11.924 +leave 0
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/external/zlib-1.2.11/contrib/README.contrib	Sat Oct 21 21:05:43 2017 -0700
    12.3 @@ -0,0 +1,78 @@
    12.4 +All files under this contrib directory are UNSUPPORTED. There were
    12.5 +provided by users of zlib and were not tested by the authors of zlib.
    12.6 +Use at your own risk. Please contact the authors of the contributions
    12.7 +for help about these, not the zlib authors. Thanks.
    12.8 +
    12.9 +
   12.10 +ada/        by Dmitriy Anisimkov <anisimkov@yahoo.com>
   12.11 +        Support for Ada
   12.12 +        See http://zlib-ada.sourceforge.net/
   12.13 +
   12.14 +amd64/      by Mikhail Teterin <mi@ALDAN.algebra.com>
   12.15 +        asm code for AMD64
   12.16 +        See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
   12.17 +
   12.18 +asm686/     by Brian Raiter <breadbox@muppetlabs.com>
   12.19 +        asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
   12.20 +        See http://www.muppetlabs.com/~breadbox/software/assembly.html
   12.21 +
   12.22 +blast/      by Mark Adler <madler@alumni.caltech.edu>
   12.23 +        Decompressor for output of PKWare Data Compression Library (DCL)
   12.24 +
   12.25 +delphi/     by Cosmin Truta <cosmint@cs.ubbcluj.ro>
   12.26 +        Support for Delphi and C++ Builder
   12.27 +
   12.28 +dotzlib/    by Henrik Ravn <henrik@ravn.com>
   12.29 +        Support for Microsoft .Net and Visual C++ .Net
   12.30 +
   12.31 +gcc_gvmat64/by Gilles Vollant <info@winimage.com>
   12.32 +        GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64
   12.33 +        assembler to replace longest_match() and inflate_fast()
   12.34 +
   12.35 +infback9/   by Mark Adler <madler@alumni.caltech.edu>
   12.36 +        Unsupported diffs to infback to decode the deflate64 format
   12.37 +
   12.38 +inflate86/  by Chris Anderson <christop@charm.net>
   12.39 +        Tuned x86 gcc asm code to replace inflate_fast()
   12.40 +
   12.41 +iostream/   by Kevin Ruland <kevin@rodin.wustl.edu>
   12.42 +        A C++ I/O streams interface to the zlib gz* functions
   12.43 +
   12.44 +iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
   12.45 +        Another C++ I/O streams interface
   12.46 +
   12.47 +iostream3/  by Ludwig Schwardt <schwardt@sun.ac.za>
   12.48 +            and Kevin Ruland <kevin@rodin.wustl.edu>
   12.49 +        Yet another C++ I/O streams interface
   12.50 +
   12.51 +masmx64/    by Gilles Vollant <info@winimage.com>
   12.52 +        x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
   12.53 +        replace longest_match() and inflate_fast(),  also masm x86
   12.54 +        64-bits translation of Chris Anderson inflate_fast()
   12.55 +
   12.56 +masmx86/    by Gilles Vollant <info@winimage.com>
   12.57 +        x86 asm code to replace longest_match() and inflate_fast(),
   12.58 +        for Visual C++ and MASM (32 bits).
   12.59 +        Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
   12.60 +
   12.61 +minizip/    by Gilles Vollant <info@winimage.com>
   12.62 +        Mini zip and unzip based on zlib
   12.63 +        Includes Zip64 support by Mathias Svensson <mathias@result42.com>
   12.64 +        See http://www.winimage.com/zLibDll/minizip.html
   12.65 +
   12.66 +pascal/     by Bob Dellaca <bobdl@xtra.co.nz> et al.
   12.67 +        Support for Pascal
   12.68 +
   12.69 +puff/       by Mark Adler <madler@alumni.caltech.edu>
   12.70 +        Small, low memory usage inflate.  Also serves to provide an
   12.71 +        unambiguous description of the deflate format.
   12.72 +
   12.73 +testzlib/   by Gilles Vollant <info@winimage.com>
   12.74 +        Example of the use of zlib
   12.75 +
   12.76 +untgz/      by Pedro A. Aranda Gutierrez <paag@tid.es>
   12.77 +        A very simple tar.gz file extractor using zlib
   12.78 +
   12.79 +vstudio/    by Gilles Vollant <info@winimage.com>
   12.80 +        Building a minizip-enhanced zlib with Microsoft Visual Studio
   12.81 +        Includes vc11 from kreuzerkrieg and vc12 from davispuh
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/external/zlib-1.2.11/contrib/ada/buffer_demo.adb	Sat Oct 21 21:05:43 2017 -0700
    13.3 @@ -0,0 +1,106 @@
    13.4 +----------------------------------------------------------------
    13.5 +--  ZLib for Ada thick binding.                               --
    13.6 +--                                                            --
    13.7 +--  Copyright (C) 2002-2004 Dmitriy Anisimkov                 --
    13.8 +--                                                            --
    13.9 +--  Open source license information is in the zlib.ads file.  --
   13.10 +----------------------------------------------------------------
   13.11 +--
   13.12 +--  $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $
   13.13 +
   13.14 +--  This demo program provided by Dr Steve Sangwine <sjs@essex.ac.uk>
   13.15 +--
   13.16 +--  Demonstration of a problem with Zlib-Ada (already fixed) when a buffer
   13.17 +--  of exactly the correct size is used for decompressed data, and the last
   13.18 +--  few bytes passed in to Zlib are checksum bytes.
   13.19 +
   13.20 +--  This program compresses a string of text, and then decompresses the
   13.21 +--  compressed text into a buffer of the same size as the original text.
   13.22 +
   13.23 +with Ada.Streams; use Ada.Streams;
   13.24 +with Ada.Text_IO;
   13.25 +
   13.26 +with ZLib; use ZLib;
   13.27 +
   13.28 +procedure Buffer_Demo is
   13.29 +   EOL  : Character renames ASCII.LF;
   13.30 +   Text : constant String
   13.31 +     := "Four score and seven years ago our fathers brought forth," & EOL &
   13.32 +        "upon this continent, a new nation, conceived in liberty," & EOL &
   13.33 +        "and dedicated to the proposition that `all men are created equal'.";
   13.34 +
   13.35 +   Source : Stream_Element_Array (1 .. Text'Length);
   13.36 +   for Source'Address use Text'Address;
   13.37 +
   13.38 +begin
   13.39 +   Ada.Text_IO.Put (Text);
   13.40 +   Ada.Text_IO.New_Line;
   13.41 +   Ada.Text_IO.Put_Line
   13.42 +     ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes");
   13.43 +
   13.44 +   declare
   13.45 +      Compressed_Data : Stream_Element_Array (1 .. Text'Length);
   13.46 +      L               : Stream_Element_Offset;
   13.47 +   begin
   13.48 +      Compress : declare
   13.49 +         Compressor : Filter_Type;
   13.50 +         I : Stream_Element_Offset;
   13.51 +      begin
   13.52 +         Deflate_Init (Compressor);
   13.53 +
   13.54 +         --  Compress the whole of T at once.
   13.55 +
   13.56 +         Translate (Compressor, Source, I, Compressed_Data, L, Finish);
   13.57 +         pragma Assert (I = Source'Last);
   13.58 +
   13.59 +         Close (Compressor);
   13.60 +
   13.61 +         Ada.Text_IO.Put_Line
   13.62 +           ("Compressed size :   "
   13.63 +            & Stream_Element_Offset'Image (L) & " bytes");
   13.64 +      end Compress;
   13.65 +
   13.66 +      --  Now we decompress the data, passing short blocks of data to Zlib
   13.67 +      --  (because this demonstrates the problem - the last block passed will
   13.68 +      --  contain checksum information and there will be no output, only a
   13.69 +      --  check inside Zlib that the checksum is correct).
   13.70 +
   13.71 +      Decompress : declare
   13.72 +         Decompressor : Filter_Type;
   13.73 +
   13.74 +         Uncompressed_Data : Stream_Element_Array (1 .. Text'Length);
   13.75 +
   13.76 +         Block_Size : constant := 4;
   13.77 +         --  This makes sure that the last block contains
   13.78 +         --  only Adler checksum data.
   13.79 +
   13.80 +         P : Stream_Element_Offset := Compressed_Data'First - 1;
   13.81 +         O : Stream_Element_Offset;
   13.82 +      begin
   13.83 +         Inflate_Init (Decompressor);
   13.84 +
   13.85 +         loop
   13.86 +            Translate
   13.87 +              (Decompressor,
   13.88 +               Compressed_Data
   13.89 +                 (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)),
   13.90 +               P,
   13.91 +               Uncompressed_Data
   13.92 +                 (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last),
   13.93 +               O,
   13.94 +               No_Flush);
   13.95 +
   13.96 +               Ada.Text_IO.Put_Line
   13.97 +                 ("Total in : " & Count'Image (Total_In (Decompressor)) &
   13.98 +                  ", out : " & Count'Image (Total_Out (Decompressor)));
   13.99 +
  13.100 +               exit when P = L;
  13.101 +         end loop;
  13.102 +
  13.103 +         Ada.Text_IO.New_Line;
  13.104 +         Ada.Text_IO.Put_Line
  13.105 +           ("Decompressed text matches original text : "
  13.106 +             & Boolean'Image (Uncompressed_Data = Source));
  13.107 +      end Decompress;
  13.108 +   end;
  13.109 +end Buffer_Demo;
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/external/zlib-1.2.11/contrib/ada/mtest.adb	Sat Oct 21 21:05:43 2017 -0700
    14.3 @@ -0,0 +1,156 @@
    14.4 +----------------------------------------------------------------
    14.5 +--  ZLib for Ada thick binding.                               --
    14.6 +--                                                            --
    14.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    14.8 +--                                                            --
    14.9 +--  Open source license information is in the zlib.ads file.  --
   14.10 +----------------------------------------------------------------
   14.11 +--  Continuous test for ZLib multithreading. If the test would fail
   14.12 +--  we should provide thread safe allocation routines for the Z_Stream.
   14.13 +--
   14.14 +--  $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $
   14.15 +
   14.16 +with ZLib;
   14.17 +with Ada.Streams;
   14.18 +with Ada.Numerics.Discrete_Random;
   14.19 +with Ada.Text_IO;
   14.20 +with Ada.Exceptions;
   14.21 +with Ada.Task_Identification;
   14.22 +
   14.23 +procedure MTest is
   14.24 +   use Ada.Streams;
   14.25 +   use ZLib;
   14.26 +
   14.27 +   Stop : Boolean := False;
   14.28 +
   14.29 +   pragma Atomic (Stop);
   14.30 +
   14.31 +   subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
   14.32 +
   14.33 +   package Random_Elements is
   14.34 +      new Ada.Numerics.Discrete_Random (Visible_Symbols);
   14.35 +
   14.36 +   task type Test_Task;
   14.37 +
   14.38 +   task body Test_Task is
   14.39 +      Buffer : Stream_Element_Array (1 .. 100_000);
   14.40 +      Gen : Random_Elements.Generator;
   14.41 +
   14.42 +      Buffer_First  : Stream_Element_Offset;
   14.43 +      Compare_First : Stream_Element_Offset;
   14.44 +
   14.45 +      Deflate : Filter_Type;
   14.46 +      Inflate : Filter_Type;
   14.47 +
   14.48 +      procedure Further (Item : in Stream_Element_Array);
   14.49 +
   14.50 +      procedure Read_Buffer
   14.51 +        (Item : out Ada.Streams.Stream_Element_Array;
   14.52 +         Last : out Ada.Streams.Stream_Element_Offset);
   14.53 +
   14.54 +      -------------
   14.55 +      -- Further --
   14.56 +      -------------
   14.57 +
   14.58 +      procedure Further (Item : in Stream_Element_Array) is
   14.59 +
   14.60 +         procedure Compare (Item : in Stream_Element_Array);
   14.61 +
   14.62 +         -------------
   14.63 +         -- Compare --
   14.64 +         -------------
   14.65 +
   14.66 +         procedure Compare (Item : in Stream_Element_Array) is
   14.67 +            Next_First : Stream_Element_Offset := Compare_First + Item'Length;
   14.68 +         begin
   14.69 +            if Buffer (Compare_First .. Next_First - 1) /= Item then
   14.70 +               raise Program_Error;
   14.71 +            end if;
   14.72 +
   14.73 +            Compare_First := Next_First;
   14.74 +         end Compare;
   14.75 +
   14.76 +         procedure Compare_Write is new ZLib.Write (Write => Compare);
   14.77 +      begin
   14.78 +         Compare_Write (Inflate, Item, No_Flush);
   14.79 +      end Further;
   14.80 +
   14.81 +      -----------------
   14.82 +      -- Read_Buffer --
   14.83 +      -----------------
   14.84 +
   14.85 +      procedure Read_Buffer
   14.86 +        (Item : out Ada.Streams.Stream_Element_Array;
   14.87 +         Last : out Ada.Streams.Stream_Element_Offset)
   14.88 +      is
   14.89 +         Buff_Diff   : Stream_Element_Offset := Buffer'Last - Buffer_First;
   14.90 +         Next_First : Stream_Element_Offset;
   14.91 +      begin
   14.92 +         if Item'Length <= Buff_Diff then
   14.93 +            Last := Item'Last;
   14.94 +
   14.95 +            Next_First := Buffer_First + Item'Length;
   14.96 +
   14.97 +            Item := Buffer (Buffer_First .. Next_First - 1);
   14.98 +
   14.99 +            Buffer_First := Next_First;
  14.100 +         else
  14.101 +            Last := Item'First + Buff_Diff;
  14.102 +            Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last);
  14.103 +            Buffer_First := Buffer'Last + 1;
  14.104 +         end if;
  14.105 +      end Read_Buffer;
  14.106 +
  14.107 +      procedure Translate is new Generic_Translate
  14.108 +                                   (Data_In  => Read_Buffer,
  14.109 +                                    Data_Out => Further);
  14.110 +
  14.111 +   begin
  14.112 +      Random_Elements.Reset (Gen);
  14.113 +
  14.114 +      Buffer := (others => 20);
  14.115 +
  14.116 +      Main : loop
  14.117 +         for J in Buffer'Range loop
  14.118 +            Buffer (J) := Random_Elements.Random (Gen);
  14.119 +
  14.120 +            Deflate_Init (Deflate);
  14.121 +            Inflate_Init (Inflate);
  14.122 +
  14.123 +            Buffer_First  := Buffer'First;
  14.124 +            Compare_First := Buffer'First;
  14.125 +
  14.126 +            Translate (Deflate);
  14.127 +
  14.128 +            if Compare_First /= Buffer'Last + 1 then
  14.129 +               raise Program_Error;
  14.130 +            end if;
  14.131 +
  14.132 +            Ada.Text_IO.Put_Line
  14.133 +              (Ada.Task_Identification.Image
  14.134 +                 (Ada.Task_Identification.Current_Task)
  14.135 +               & Stream_Element_Offset'Image (J)
  14.136 +               & ZLib.Count'Image (Total_Out (Deflate)));
  14.137 +
  14.138 +            Close (Deflate);
  14.139 +            Close (Inflate);
  14.140 +
  14.141 +            exit Main when Stop;
  14.142 +         end loop;
  14.143 +      end loop Main;
  14.144 +   exception
  14.145 +      when E : others =>
  14.146 +         Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
  14.147 +         Stop := True;
  14.148 +   end Test_Task;
  14.149 +
  14.150 +   Test : array (1 .. 4) of Test_Task;
  14.151 +
  14.152 +   pragma Unreferenced (Test);
  14.153 +
  14.154 +   Dummy : Character;
  14.155 +
  14.156 +begin
  14.157 +   Ada.Text_IO.Get_Immediate (Dummy);
  14.158 +   Stop := True;
  14.159 +end MTest;
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/external/zlib-1.2.11/contrib/ada/read.adb	Sat Oct 21 21:05:43 2017 -0700
    15.3 @@ -0,0 +1,156 @@
    15.4 +----------------------------------------------------------------
    15.5 +--  ZLib for Ada thick binding.                               --
    15.6 +--                                                            --
    15.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    15.8 +--                                                            --
    15.9 +--  Open source license information is in the zlib.ads file.  --
   15.10 +----------------------------------------------------------------
   15.11 +
   15.12 +--  $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $
   15.13 +
   15.14 +--  Test/demo program for the generic read interface.
   15.15 +
   15.16 +with Ada.Numerics.Discrete_Random;
   15.17 +with Ada.Streams;
   15.18 +with Ada.Text_IO;
   15.19 +
   15.20 +with ZLib;
   15.21 +
   15.22 +procedure Read is
   15.23 +
   15.24 +   use Ada.Streams;
   15.25 +
   15.26 +   ------------------------------------
   15.27 +   --  Test configuration parameters --
   15.28 +   ------------------------------------
   15.29 +
   15.30 +   File_Size   : Stream_Element_Offset := 100_000;
   15.31 +
   15.32 +   Continuous  : constant Boolean          := False;
   15.33 +   --  If this constant is True, the test would be repeated again and again,
   15.34 +   --  with increment File_Size for every iteration.
   15.35 +
   15.36 +   Header      : constant ZLib.Header_Type := ZLib.Default;
   15.37 +   --  Do not use Header other than Default in ZLib versions 1.1.4 and older.
   15.38 +
   15.39 +   Init_Random : constant := 8;
   15.40 +   --  We are using the same random sequence, in case of we catch bug,
   15.41 +   --  so we would be able to reproduce it.
   15.42 +
   15.43 +   -- End --
   15.44 +
   15.45 +   Pack_Size : Stream_Element_Offset;
   15.46 +   Offset    : Stream_Element_Offset;
   15.47 +
   15.48 +   Filter     : ZLib.Filter_Type;
   15.49 +
   15.50 +   subtype Visible_Symbols
   15.51 +      is Stream_Element range 16#20# .. 16#7E#;
   15.52 +
   15.53 +   package Random_Elements is new
   15.54 +      Ada.Numerics.Discrete_Random (Visible_Symbols);
   15.55 +
   15.56 +   Gen : Random_Elements.Generator;
   15.57 +   Period  : constant Stream_Element_Offset := 200;
   15.58 +   --  Period constant variable for random generator not to be very random.
   15.59 +   --  Bigger period, harder random.
   15.60 +
   15.61 +   Read_Buffer : Stream_Element_Array (1 .. 2048);
   15.62 +   Read_First  : Stream_Element_Offset;
   15.63 +   Read_Last   : Stream_Element_Offset;
   15.64 +
   15.65 +   procedure Reset;
   15.66 +
   15.67 +   procedure Read
   15.68 +     (Item : out Stream_Element_Array;
   15.69 +      Last : out Stream_Element_Offset);
   15.70 +   --  this procedure is for generic instantiation of
   15.71 +   --  ZLib.Read
   15.72 +   --  reading data from the File_In.
   15.73 +
   15.74 +   procedure Read is new ZLib.Read
   15.75 +                           (Read,
   15.76 +                            Read_Buffer,
   15.77 +                            Rest_First => Read_First,
   15.78 +                            Rest_Last  => Read_Last);
   15.79 +
   15.80 +   ----------
   15.81 +   -- Read --
   15.82 +   ----------
   15.83 +
   15.84 +   procedure Read
   15.85 +     (Item : out Stream_Element_Array;
   15.86 +      Last : out Stream_Element_Offset) is
   15.87 +   begin
   15.88 +      Last := Stream_Element_Offset'Min
   15.89 +               (Item'Last,
   15.90 +                Item'First + File_Size - Offset);
   15.91 +
   15.92 +      for J in Item'First .. Last loop
   15.93 +         if J < Item'First + Period then
   15.94 +            Item (J) := Random_Elements.Random (Gen);
   15.95 +         else
   15.96 +            Item (J) := Item (J - Period);
   15.97 +         end if;
   15.98 +
   15.99 +         Offset   := Offset + 1;
  15.100 +      end loop;
  15.101 +   end Read;
  15.102 +
  15.103 +   -----------
  15.104 +   -- Reset --
  15.105 +   -----------
  15.106 +
  15.107 +   procedure Reset is
  15.108 +   begin
  15.109 +      Random_Elements.Reset (Gen, Init_Random);
  15.110 +      Pack_Size := 0;
  15.111 +      Offset := 1;
  15.112 +      Read_First := Read_Buffer'Last + 1;
  15.113 +      Read_Last  := Read_Buffer'Last;
  15.114 +   end Reset;
  15.115 +
  15.116 +begin
  15.117 +   Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
  15.118 +
  15.119 +   loop
  15.120 +      for Level in ZLib.Compression_Level'Range loop
  15.121 +
  15.122 +         Ada.Text_IO.Put ("Level ="
  15.123 +            & ZLib.Compression_Level'Image (Level));
  15.124 +
  15.125 +         --  Deflate using generic instantiation.
  15.126 +
  15.127 +         ZLib.Deflate_Init
  15.128 +               (Filter,
  15.129 +                Level,
  15.130 +                Header => Header);
  15.131 +
  15.132 +         Reset;
  15.133 +
  15.134 +         Ada.Text_IO.Put
  15.135 +           (Stream_Element_Offset'Image (File_Size) & " ->");
  15.136 +
  15.137 +         loop
  15.138 +            declare
  15.139 +               Buffer : Stream_Element_Array (1 .. 1024);
  15.140 +               Last   : Stream_Element_Offset;
  15.141 +            begin
  15.142 +               Read (Filter, Buffer, Last);
  15.143 +
  15.144 +               Pack_Size := Pack_Size + Last - Buffer'First + 1;
  15.145 +
  15.146 +               exit when Last < Buffer'Last;
  15.147 +            end;
  15.148 +         end loop;
  15.149 +
  15.150 +         Ada.Text_IO.Put_Line (Stream_Element_Offset'Image (Pack_Size));
  15.151 +
  15.152 +         ZLib.Close (Filter);
  15.153 +      end loop;
  15.154 +
  15.155 +      exit when not Continuous;
  15.156 +
  15.157 +      File_Size := File_Size + 1;
  15.158 +   end loop;
  15.159 +end Read;
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/external/zlib-1.2.11/contrib/ada/readme.txt	Sat Oct 21 21:05:43 2017 -0700
    16.3 @@ -0,0 +1,65 @@
    16.4 +                        ZLib for Ada thick binding (ZLib.Ada)
    16.5 +                        Release 1.3
    16.6 +
    16.7 +ZLib.Ada is a thick binding interface to the popular ZLib data
    16.8 +compression library, available at http://www.gzip.org/zlib/.
    16.9 +It provides Ada-style access to the ZLib C library.
   16.10 +
   16.11 +
   16.12 +        Here are the main changes since ZLib.Ada 1.2:
   16.13 +
   16.14 +- Attension: ZLib.Read generic routine have a initialization requirement
   16.15 +  for Read_Last parameter now. It is a bit incompartible with previous version,
   16.16 +  but extends functionality, we could use new parameters Allow_Read_Some and
   16.17 +  Flush now.
   16.18 +
   16.19 +- Added Is_Open routines to ZLib and ZLib.Streams packages.
   16.20 +
   16.21 +- Add pragma Assert to check Stream_Element is 8 bit.
   16.22 +
   16.23 +- Fix extraction to buffer with exact known decompressed size. Error reported by
   16.24 +  Steve Sangwine.
   16.25 +
   16.26 +- Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits
   16.27 +  computers. Patch provided by Pascal Obry.
   16.28 +
   16.29 +- Add Status_Error exception definition.
   16.30 +
   16.31 +- Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit.
   16.32 +
   16.33 +
   16.34 +        How to build ZLib.Ada under GNAT
   16.35 +
   16.36 +You should have the ZLib library already build on your computer, before
   16.37 +building ZLib.Ada. Make the directory of ZLib.Ada sources current and
   16.38 +issue the command:
   16.39 +
   16.40 +  gnatmake test -largs -L<directory where libz.a is> -lz
   16.41 +
   16.42 +Or use the GNAT project file build for GNAT 3.15 or later:
   16.43 +
   16.44 +  gnatmake -Pzlib.gpr -L<directory where libz.a is>
   16.45 +
   16.46 +
   16.47 +        How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2
   16.48 +
   16.49 +1. Make a project with all *.ads and *.adb files from the distribution.
   16.50 +2. Build the libz.a library from the ZLib C sources.
   16.51 +3. Rename libz.a to z.lib.
   16.52 +4. Add the library z.lib to the project.
   16.53 +5. Add the libc.lib library from the ObjectAda distribution to the project.
   16.54 +6. Build the executable using test.adb as a main procedure.
   16.55 +
   16.56 +
   16.57 +        How to use ZLib.Ada
   16.58 +
   16.59 +The source files test.adb and read.adb are small demo programs that show
   16.60 +the main functionality of ZLib.Ada.
   16.61 +
   16.62 +The routines from the package specifications are commented.
   16.63 +
   16.64 +
   16.65 +Homepage: http://zlib-ada.sourceforge.net/
   16.66 +Author: Dmitriy Anisimkov <anisimkov@yahoo.com>
   16.67 +
   16.68 +Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/external/zlib-1.2.11/contrib/ada/test.adb	Sat Oct 21 21:05:43 2017 -0700
    17.3 @@ -0,0 +1,463 @@
    17.4 +----------------------------------------------------------------
    17.5 +--  ZLib for Ada thick binding.                               --
    17.6 +--                                                            --
    17.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    17.8 +--                                                            --
    17.9 +--  Open source license information is in the zlib.ads file.  --
   17.10 +----------------------------------------------------------------
   17.11 +
   17.12 +--  $Id: test.adb,v 1.17 2003/08/12 12:13:30 vagul Exp $
   17.13 +
   17.14 +--  The program has a few aims.
   17.15 +--  1. Test ZLib.Ada95 thick binding functionality.
   17.16 +--  2. Show the example of use main functionality of the ZLib.Ada95 binding.
   17.17 +--  3. Build this program automatically compile all ZLib.Ada95 packages under
   17.18 +--     GNAT Ada95 compiler.
   17.19 +
   17.20 +with ZLib.Streams;
   17.21 +with Ada.Streams.Stream_IO;
   17.22 +with Ada.Numerics.Discrete_Random;
   17.23 +
   17.24 +with Ada.Text_IO;
   17.25 +
   17.26 +with Ada.Calendar;
   17.27 +
   17.28 +procedure Test is
   17.29 +
   17.30 +   use Ada.Streams;
   17.31 +   use Stream_IO;
   17.32 +
   17.33 +   ------------------------------------
   17.34 +   --  Test configuration parameters --
   17.35 +   ------------------------------------
   17.36 +
   17.37 +   File_Size   : Count   := 100_000;
   17.38 +   Continuous  : constant Boolean := False;
   17.39 +
   17.40 +   Header      : constant ZLib.Header_Type := ZLib.Default;
   17.41 +                                              --  ZLib.None;
   17.42 +                                              --  ZLib.Auto;
   17.43 +                                              --  ZLib.GZip;
   17.44 +   --  Do not use Header other then Default in ZLib versions 1.1.4
   17.45 +   --  and older.
   17.46 +
   17.47 +   Strategy    : constant ZLib.Strategy_Type := ZLib.Default_Strategy;
   17.48 +   Init_Random : constant := 10;
   17.49 +
   17.50 +   -- End --
   17.51 +
   17.52 +   In_File_Name  : constant String := "testzlib.in";
   17.53 +   --  Name of the input file
   17.54 +
   17.55 +   Z_File_Name   : constant String := "testzlib.zlb";
   17.56 +   --  Name of the compressed file.
   17.57 +
   17.58 +   Out_File_Name : constant String := "testzlib.out";
   17.59 +   --  Name of the decompressed file.
   17.60 +
   17.61 +   File_In   : File_Type;
   17.62 +   File_Out  : File_Type;
   17.63 +   File_Back : File_Type;
   17.64 +   File_Z    : ZLib.Streams.Stream_Type;
   17.65 +
   17.66 +   Filter : ZLib.Filter_Type;
   17.67 +
   17.68 +   Time_Stamp : Ada.Calendar.Time;
   17.69 +
   17.70 +   procedure Generate_File;
   17.71 +   --  Generate file of spetsified size with some random data.
   17.72 +   --  The random data is repeatable, for the good compression.
   17.73 +
   17.74 +   procedure Compare_Streams
   17.75 +     (Left, Right : in out Root_Stream_Type'Class);
   17.76 +   --  The procedure compearing data in 2 streams.
   17.77 +   --  It is for compare data before and after compression/decompression.
   17.78 +
   17.79 +   procedure Compare_Files (Left, Right : String);
   17.80 +   --  Compare files. Based on the Compare_Streams.
   17.81 +
   17.82 +   procedure Copy_Streams
   17.83 +     (Source, Target : in out Root_Stream_Type'Class;
   17.84 +      Buffer_Size    : in     Stream_Element_Offset := 1024);
   17.85 +   --  Copying data from one stream to another. It is for test stream
   17.86 +   --  interface of the library.
   17.87 +
   17.88 +   procedure Data_In
   17.89 +     (Item : out Stream_Element_Array;
   17.90 +      Last : out Stream_Element_Offset);
   17.91 +   --  this procedure is for generic instantiation of
   17.92 +   --  ZLib.Generic_Translate.
   17.93 +   --  reading data from the File_In.
   17.94 +
   17.95 +   procedure Data_Out (Item : in Stream_Element_Array);
   17.96 +   --  this procedure is for generic instantiation of
   17.97 +   --  ZLib.Generic_Translate.
   17.98 +   --  writing data to the File_Out.
   17.99 +
  17.100 +   procedure Stamp;
  17.101 +   --  Store the timestamp to the local variable.
  17.102 +
  17.103 +   procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count);
  17.104 +   --  Print the time statistic with the message.
  17.105 +
  17.106 +   procedure Translate is new ZLib.Generic_Translate
  17.107 +                                (Data_In  => Data_In,
  17.108 +                                 Data_Out => Data_Out);
  17.109 +   --  This procedure is moving data from File_In to File_Out
  17.110 +   --  with compression or decompression, depend on initialization of
  17.111 +   --  Filter parameter.
  17.112 +
  17.113 +   -------------------
  17.114 +   -- Compare_Files --
  17.115 +   -------------------
  17.116 +
  17.117 +   procedure Compare_Files (Left, Right : String) is
  17.118 +      Left_File, Right_File : File_Type;
  17.119 +   begin
  17.120 +      Open (Left_File, In_File, Left);
  17.121 +      Open (Right_File, In_File, Right);
  17.122 +      Compare_Streams (Stream (Left_File).all, Stream (Right_File).all);
  17.123 +      Close (Left_File);
  17.124 +      Close (Right_File);
  17.125 +   end Compare_Files;
  17.126 +
  17.127 +   ---------------------
  17.128 +   -- Compare_Streams --
  17.129 +   ---------------------
  17.130 +
  17.131 +   procedure Compare_Streams
  17.132 +     (Left, Right : in out Ada.Streams.Root_Stream_Type'Class)
  17.133 +   is
  17.134 +      Left_Buffer, Right_Buffer : Stream_Element_Array (0 .. 16#FFF#);
  17.135 +      Left_Last, Right_Last : Stream_Element_Offset;
  17.136 +   begin
  17.137 +      loop
  17.138 +         Read (Left, Left_Buffer, Left_Last);
  17.139 +         Read (Right, Right_Buffer, Right_Last);
  17.140 +
  17.141 +         if Left_Last /= Right_Last then
  17.142 +            Ada.Text_IO.Put_Line ("Compare error :"
  17.143 +              & Stream_Element_Offset'Image (Left_Last)
  17.144 +              & " /= "
  17.145 +              & Stream_Element_Offset'Image (Right_Last));
  17.146 +
  17.147 +            raise Constraint_Error;
  17.148 +
  17.149 +         elsif Left_Buffer (0 .. Left_Last)
  17.150 +               /= Right_Buffer (0 .. Right_Last)
  17.151 +         then
  17.152 +            Ada.Text_IO.Put_Line ("ERROR: IN and OUT files is not equal.");
  17.153 +            raise Constraint_Error;
  17.154 +
  17.155 +         end if;
  17.156 +
  17.157 +         exit when Left_Last < Left_Buffer'Last;
  17.158 +      end loop;
  17.159 +   end Compare_Streams;
  17.160 +
  17.161 +   ------------------
  17.162 +   -- Copy_Streams --
  17.163 +   ------------------
  17.164 +
  17.165 +   procedure Copy_Streams
  17.166 +     (Source, Target : in out Ada.Streams.Root_Stream_Type'Class;
  17.167 +      Buffer_Size    : in     Stream_Element_Offset := 1024)
  17.168 +   is
  17.169 +      Buffer : Stream_Element_Array (1 .. Buffer_Size);
  17.170 +      Last   : Stream_Element_Offset;
  17.171 +   begin
  17.172 +      loop
  17.173 +         Read  (Source, Buffer, Last);
  17.174 +         Write (Target, Buffer (1 .. Last));
  17.175 +
  17.176 +         exit when Last < Buffer'Last;
  17.177 +      end loop;
  17.178 +   end Copy_Streams;
  17.179 +
  17.180 +   -------------
  17.181 +   -- Data_In --
  17.182 +   -------------
  17.183 +
  17.184 +   procedure Data_In
  17.185 +     (Item : out Stream_Element_Array;
  17.186 +      Last : out Stream_Element_Offset) is
  17.187 +   begin
  17.188 +      Read (File_In, Item, Last);
  17.189 +   end Data_In;
  17.190 +
  17.191 +   --------------
  17.192 +   -- Data_Out --
  17.193 +   --------------
  17.194 +
  17.195 +   procedure Data_Out (Item : in Stream_Element_Array) is
  17.196 +   begin
  17.197 +      Write (File_Out, Item);
  17.198 +   end Data_Out;
  17.199 +
  17.200 +   -------------------
  17.201 +   -- Generate_File --
  17.202 +   -------------------
  17.203 +
  17.204 +   procedure Generate_File is
  17.205 +      subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
  17.206 +
  17.207 +      package Random_Elements is
  17.208 +         new Ada.Numerics.Discrete_Random (Visible_Symbols);
  17.209 +
  17.210 +      Gen    : Random_Elements.Generator;
  17.211 +      Buffer : Stream_Element_Array := (1 .. 77 => 16#20#) & 10;
  17.212 +
  17.213 +      Buffer_Count : constant Count := File_Size / Buffer'Length;
  17.214 +      --  Number of same buffers in the packet.
  17.215 +
  17.216 +      Density : constant Count := 30; --  from 0 to Buffer'Length - 2;
  17.217 +
  17.218 +      procedure Fill_Buffer (J, D : in Count);
  17.219 +      --  Change the part of the buffer.
  17.220 +
  17.221 +      -----------------
  17.222 +      -- Fill_Buffer --
  17.223 +      -----------------
  17.224 +
  17.225 +      procedure Fill_Buffer (J, D : in Count) is
  17.226 +      begin
  17.227 +         for K in 0 .. D loop
  17.228 +            Buffer
  17.229 +              (Stream_Element_Offset ((J + K) mod (Buffer'Length - 1) + 1))
  17.230 +             := Random_Elements.Random (Gen);
  17.231 +
  17.232 +         end loop;
  17.233 +      end Fill_Buffer;
  17.234 +
  17.235 +   begin
  17.236 +      Random_Elements.Reset (Gen, Init_Random);
  17.237 +
  17.238 +      Create (File_In, Out_File, In_File_Name);
  17.239 +
  17.240 +      Fill_Buffer (1, Buffer'Length - 2);
  17.241 +
  17.242 +      for J in 1 .. Buffer_Count loop
  17.243 +         Write (File_In, Buffer);
  17.244 +
  17.245 +         Fill_Buffer (J, Density);
  17.246 +      end loop;
  17.247 +
  17.248 +      --  fill remain size.
  17.249 +
  17.250 +      Write
  17.251 +        (File_In,
  17.252 +         Buffer
  17.253 +           (1 .. Stream_Element_Offset
  17.254 +                   (File_Size - Buffer'Length * Buffer_Count)));
  17.255 +
  17.256 +      Flush (File_In);
  17.257 +      Close (File_In);
  17.258 +   end Generate_File;
  17.259 +
  17.260 +   ---------------------
  17.261 +   -- Print_Statistic --
  17.262 +   ---------------------
  17.263 +
  17.264 +   procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count) is
  17.265 +      use Ada.Calendar;
  17.266 +      use Ada.Text_IO;
  17.267 +
  17.268 +      package Count_IO is new Integer_IO (ZLib.Count);
  17.269 +
  17.270 +      Curr_Dur : Duration := Clock - Time_Stamp;
  17.271 +   begin
  17.272 +      Put (Msg);
  17.273 +
  17.274 +      Set_Col (20);
  17.275 +      Ada.Text_IO.Put ("size =");
  17.276 +
  17.277 +      Count_IO.Put
  17.278 +        (Data_Size,
  17.279 +         Width => Stream_IO.Count'Image (File_Size)'Length);
  17.280 +
  17.281 +      Put_Line (" duration =" & Duration'Image (Curr_Dur));
  17.282 +   end Print_Statistic;
  17.283 +
  17.284 +   -----------
  17.285 +   -- Stamp --
  17.286 +   -----------
  17.287 +
  17.288 +   procedure Stamp is
  17.289 +   begin
  17.290 +      Time_Stamp := Ada.Calendar.Clock;
  17.291 +   end Stamp;
  17.292 +
  17.293 +begin
  17.294 +   Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
  17.295 +
  17.296 +   loop
  17.297 +      Generate_File;
  17.298 +
  17.299 +      for Level in ZLib.Compression_Level'Range loop
  17.300 +
  17.301 +         Ada.Text_IO.Put_Line ("Level ="
  17.302 +            & ZLib.Compression_Level'Image (Level));
  17.303 +
  17.304 +         --  Test generic interface.
  17.305 +         Open   (File_In, In_File, In_File_Name);
  17.306 +         Create (File_Out, Out_File, Z_File_Name);
  17.307 +
  17.308 +         Stamp;
  17.309 +
  17.310 +         --  Deflate using generic instantiation.
  17.311 +
  17.312 +         ZLib.Deflate_Init
  17.313 +               (Filter   => Filter,
  17.314 +                Level    => Level,
  17.315 +                Strategy => Strategy,
  17.316 +                Header   => Header);
  17.317 +
  17.318 +         Translate (Filter);
  17.319 +         Print_Statistic ("Generic compress", ZLib.Total_Out (Filter));
  17.320 +         ZLib.Close (Filter);
  17.321 +
  17.322 +         Close (File_In);
  17.323 +         Close (File_Out);
  17.324 +
  17.325 +         Open   (File_In, In_File, Z_File_Name);
  17.326 +         Create (File_Out, Out_File, Out_File_Name);
  17.327 +
  17.328 +         Stamp;
  17.329 +
  17.330 +         --  Inflate using generic instantiation.
  17.331 +
  17.332 +         ZLib.Inflate_Init (Filter, Header => Header);
  17.333 +
  17.334 +         Translate (Filter);
  17.335 +         Print_Statistic ("Generic decompress", ZLib.Total_Out (Filter));
  17.336 +
  17.337 +         ZLib.Close (Filter);
  17.338 +
  17.339 +         Close (File_In);
  17.340 +         Close (File_Out);
  17.341 +
  17.342 +         Compare_Files (In_File_Name, Out_File_Name);
  17.343 +
  17.344 +         --  Test stream interface.
  17.345 +
  17.346 +         --  Compress to the back stream.
  17.347 +
  17.348 +         Open   (File_In, In_File, In_File_Name);
  17.349 +         Create (File_Back, Out_File, Z_File_Name);
  17.350 +
  17.351 +         Stamp;
  17.352 +
  17.353 +         ZLib.Streams.Create
  17.354 +           (Stream          => File_Z,
  17.355 +            Mode            => ZLib.Streams.Out_Stream,
  17.356 +            Back            => ZLib.Streams.Stream_Access
  17.357 +                                 (Stream (File_Back)),
  17.358 +            Back_Compressed => True,
  17.359 +            Level           => Level,
  17.360 +            Strategy        => Strategy,
  17.361 +            Header          => Header);
  17.362 +
  17.363 +         Copy_Streams
  17.364 +           (Source => Stream (File_In).all,
  17.365 +            Target => File_Z);
  17.366 +
  17.367 +         --  Flushing internal buffers to the back stream.
  17.368 +
  17.369 +         ZLib.Streams.Flush (File_Z, ZLib.Finish);
  17.370 +
  17.371 +         Print_Statistic ("Write compress",
  17.372 +                          ZLib.Streams.Write_Total_Out (File_Z));
  17.373 +
  17.374 +         ZLib.Streams.Close (File_Z);
  17.375 +
  17.376 +         Close (File_In);
  17.377 +         Close (File_Back);
  17.378 +
  17.379 +         --  Compare reading from original file and from
  17.380 +         --  decompression stream.
  17.381 +
  17.382 +         Open (File_In,   In_File, In_File_Name);
  17.383 +         Open (File_Back, In_File, Z_File_Name);
  17.384 +
  17.385 +         ZLib.Streams.Create
  17.386 +           (Stream          => File_Z,
  17.387 +            Mode            => ZLib.Streams.In_Stream,
  17.388 +            Back            => ZLib.Streams.Stream_Access
  17.389 +                                 (Stream (File_Back)),
  17.390 +            Back_Compressed => True,
  17.391 +            Header          => Header);
  17.392 +
  17.393 +         Stamp;
  17.394 +         Compare_Streams (Stream (File_In).all, File_Z);
  17.395 +
  17.396 +         Print_Statistic ("Read decompress",
  17.397 +                          ZLib.Streams.Read_Total_Out (File_Z));
  17.398 +
  17.399 +         ZLib.Streams.Close (File_Z);
  17.400 +         Close (File_In);
  17.401 +         Close (File_Back);
  17.402 +
  17.403 +         --  Compress by reading from compression stream.
  17.404 +
  17.405 +         Open (File_Back, In_File, In_File_Name);
  17.406 +         Create (File_Out, Out_File, Z_File_Name);
  17.407 +
  17.408 +         ZLib.Streams.Create
  17.409 +           (Stream          => File_Z,
  17.410 +            Mode            => ZLib.Streams.In_Stream,
  17.411 +            Back            => ZLib.Streams.Stream_Access
  17.412 +                                 (Stream (File_Back)),
  17.413 +            Back_Compressed => False,
  17.414 +            Level           => Level,
  17.415 +            Strategy        => Strategy,
  17.416 +            Header          => Header);
  17.417 +
  17.418 +         Stamp;
  17.419 +         Copy_Streams
  17.420 +           (Source => File_Z,
  17.421 +            Target => Stream (File_Out).all);
  17.422 +
  17.423 +         Print_Statistic ("Read compress",
  17.424 +                          ZLib.Streams.Read_Total_Out (File_Z));
  17.425 +
  17.426 +         ZLib.Streams.Close (File_Z);
  17.427 +
  17.428 +         Close (File_Out);
  17.429 +         Close (File_Back);
  17.430 +
  17.431 +         --  Decompress to decompression stream.
  17.432 +
  17.433 +         Open   (File_In,   In_File, Z_File_Name);
  17.434 +         Create (File_Back, Out_File, Out_File_Name);
  17.435 +
  17.436 +         ZLib.Streams.Create
  17.437 +           (Stream          => File_Z,
  17.438 +            Mode            => ZLib.Streams.Out_Stream,
  17.439 +            Back            => ZLib.Streams.Stream_Access
  17.440 +                                 (Stream (File_Back)),
  17.441 +            Back_Compressed => False,
  17.442 +            Header          => Header);
  17.443 +
  17.444 +         Stamp;
  17.445 +
  17.446 +         Copy_Streams
  17.447 +           (Source => Stream (File_In).all,
  17.448 +            Target => File_Z);
  17.449 +
  17.450 +         Print_Statistic ("Write decompress",
  17.451 +                          ZLib.Streams.Write_Total_Out (File_Z));
  17.452 +
  17.453 +         ZLib.Streams.Close (File_Z);
  17.454 +         Close (File_In);
  17.455 +         Close (File_Back);
  17.456 +
  17.457 +         Compare_Files (In_File_Name, Out_File_Name);
  17.458 +      end loop;
  17.459 +
  17.460 +      Ada.Text_IO.Put_Line (Count'Image (File_Size) & " Ok.");
  17.461 +
  17.462 +      exit when not Continuous;
  17.463 +
  17.464 +      File_Size := File_Size + 1;
  17.465 +   end loop;
  17.466 +end Test;
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/external/zlib-1.2.11/contrib/ada/zlib-streams.adb	Sat Oct 21 21:05:43 2017 -0700
    18.3 @@ -0,0 +1,225 @@
    18.4 +----------------------------------------------------------------
    18.5 +--  ZLib for Ada thick binding.                               --
    18.6 +--                                                            --
    18.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    18.8 +--                                                            --
    18.9 +--  Open source license information is in the zlib.ads file.  --
   18.10 +----------------------------------------------------------------
   18.11 +
   18.12 +--  $Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp $
   18.13 +
   18.14 +with Ada.Unchecked_Deallocation;
   18.15 +
   18.16 +package body ZLib.Streams is
   18.17 +
   18.18 +   -----------
   18.19 +   -- Close --
   18.20 +   -----------
   18.21 +
   18.22 +   procedure Close (Stream : in out Stream_Type) is
   18.23 +      procedure Free is new Ada.Unchecked_Deallocation
   18.24 +         (Stream_Element_Array, Buffer_Access);
   18.25 +   begin
   18.26 +      if Stream.Mode = Out_Stream or Stream.Mode = Duplex then
   18.27 +         --  We should flush the data written by the writer.
   18.28 +
   18.29 +         Flush (Stream, Finish);
   18.30 +
   18.31 +         Close (Stream.Writer);
   18.32 +      end if;
   18.33 +
   18.34 +      if Stream.Mode = In_Stream or Stream.Mode = Duplex then
   18.35 +         Close (Stream.Reader);
   18.36 +         Free (Stream.Buffer);
   18.37 +      end if;
   18.38 +   end Close;
   18.39 +
   18.40 +   ------------
   18.41 +   -- Create --
   18.42 +   ------------
   18.43 +
   18.44 +   procedure Create
   18.45 +     (Stream            :    out Stream_Type;
   18.46 +      Mode              : in     Stream_Mode;
   18.47 +      Back              : in     Stream_Access;
   18.48 +      Back_Compressed   : in     Boolean;
   18.49 +      Level             : in     Compression_Level := Default_Compression;
   18.50 +      Strategy          : in     Strategy_Type     := Default_Strategy;
   18.51 +      Header            : in     Header_Type       := Default;
   18.52 +      Read_Buffer_Size  : in     Ada.Streams.Stream_Element_Offset
   18.53 +                                    := Default_Buffer_Size;
   18.54 +      Write_Buffer_Size : in     Ada.Streams.Stream_Element_Offset
   18.55 +                                    := Default_Buffer_Size)
   18.56 +   is
   18.57 +
   18.58 +      subtype Buffer_Subtype is Stream_Element_Array (1 .. Read_Buffer_Size);
   18.59 +
   18.60 +      procedure Init_Filter
   18.61 +         (Filter   : in out Filter_Type;
   18.62 +          Compress : in     Boolean);
   18.63 +
   18.64 +      -----------------
   18.65 +      -- Init_Filter --
   18.66 +      -----------------
   18.67 +
   18.68 +      procedure Init_Filter
   18.69 +         (Filter   : in out Filter_Type;
   18.70 +          Compress : in     Boolean) is
   18.71 +      begin
   18.72 +         if Compress then
   18.73 +            Deflate_Init
   18.74 +              (Filter, Level, Strategy, Header => Header);
   18.75 +         else
   18.76 +            Inflate_Init (Filter, Header => Header);
   18.77 +         end if;
   18.78 +      end Init_Filter;
   18.79 +
   18.80 +   begin
   18.81 +      Stream.Back := Back;
   18.82 +      Stream.Mode := Mode;
   18.83 +
   18.84 +      if Mode = Out_Stream or Mode = Duplex then
   18.85 +         Init_Filter (Stream.Writer, Back_Compressed);
   18.86 +         Stream.Buffer_Size := Write_Buffer_Size;
   18.87 +      else
   18.88 +         Stream.Buffer_Size := 0;
   18.89 +      end if;
   18.90 +
   18.91 +      if Mode = In_Stream or Mode = Duplex then
   18.92 +         Init_Filter (Stream.Reader, not Back_Compressed);
   18.93 +
   18.94 +         Stream.Buffer     := new Buffer_Subtype;
   18.95 +         Stream.Rest_First := Stream.Buffer'Last + 1;
   18.96 +         Stream.Rest_Last  := Stream.Buffer'Last;
   18.97 +      end if;
   18.98 +   end Create;
   18.99 +
  18.100 +   -----------
  18.101 +   -- Flush --
  18.102 +   -----------
  18.103 +
  18.104 +   procedure Flush
  18.105 +     (Stream : in out Stream_Type;
  18.106 +      Mode   : in     Flush_Mode := Sync_Flush)
  18.107 +   is
  18.108 +      Buffer : Stream_Element_Array (1 .. Stream.Buffer_Size);
  18.109 +      Last   : Stream_Element_Offset;
  18.110 +   begin
  18.111 +      loop
  18.112 +         Flush (Stream.Writer, Buffer, Last, Mode);
  18.113 +
  18.114 +         Ada.Streams.Write (Stream.Back.all, Buffer (1 .. Last));
  18.115 +
  18.116 +         exit when Last < Buffer'Last;
  18.117 +      end loop;
  18.118 +   end Flush;
  18.119 +
  18.120 +   -------------
  18.121 +   -- Is_Open --
  18.122 +   -------------
  18.123 +
  18.124 +   function Is_Open (Stream : Stream_Type) return Boolean is
  18.125 +   begin
  18.126 +      return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer);
  18.127 +   end Is_Open;
  18.128 +
  18.129 +   ----------
  18.130 +   -- Read --
  18.131 +   ----------
  18.132 +
  18.133 +   procedure Read
  18.134 +     (Stream : in out Stream_Type;
  18.135 +      Item   :    out Stream_Element_Array;
  18.136 +      Last   :    out Stream_Element_Offset)
  18.137 +   is
  18.138 +
  18.139 +      procedure Read
  18.140 +        (Item : out Stream_Element_Array;
  18.141 +         Last : out Stream_Element_Offset);
  18.142 +
  18.143 +      ----------
  18.144 +      -- Read --
  18.145 +      ----------
  18.146 +
  18.147 +      procedure Read
  18.148 +        (Item : out Stream_Element_Array;
  18.149 +         Last : out Stream_Element_Offset) is
  18.150 +      begin
  18.151 +         Ada.Streams.Read (Stream.Back.all, Item, Last);
  18.152 +      end Read;
  18.153 +
  18.154 +      procedure Read is new ZLib.Read
  18.155 +         (Read       => Read,
  18.156 +          Buffer     => Stream.Buffer.all,
  18.157 +          Rest_First => Stream.Rest_First,
  18.158 +          Rest_Last  => Stream.Rest_Last);
  18.159 +
  18.160 +   begin
  18.161 +      Read (Stream.Reader, Item, Last);
  18.162 +   end Read;
  18.163 +
  18.164 +   -------------------
  18.165 +   -- Read_Total_In --
  18.166 +   -------------------
  18.167 +
  18.168 +   function Read_Total_In (Stream : in Stream_Type) return Count is
  18.169 +   begin
  18.170 +      return Total_In (Stream.Reader);
  18.171 +   end Read_Total_In;
  18.172 +
  18.173 +   --------------------
  18.174 +   -- Read_Total_Out --
  18.175 +   --------------------
  18.176 +
  18.177 +   function Read_Total_Out (Stream : in Stream_Type) return Count is
  18.178 +   begin
  18.179 +      return Total_Out (Stream.Reader);
  18.180 +   end Read_Total_Out;
  18.181 +
  18.182 +   -----------
  18.183 +   -- Write --
  18.184 +   -----------
  18.185 +
  18.186 +   procedure Write
  18.187 +     (Stream : in out Stream_Type;
  18.188 +      Item   : in     Stream_Element_Array)
  18.189 +   is
  18.190 +
  18.191 +      procedure Write (Item : in Stream_Element_Array);
  18.192 +
  18.193 +      -----------
  18.194 +      -- Write --
  18.195 +      -----------
  18.196 +
  18.197 +      procedure Write (Item : in Stream_Element_Array) is
  18.198 +      begin
  18.199 +         Ada.Streams.Write (Stream.Back.all, Item);
  18.200 +      end Write;
  18.201 +
  18.202 +      procedure Write is new ZLib.Write
  18.203 +         (Write       => Write,
  18.204 +          Buffer_Size => Stream.Buffer_Size);
  18.205 +
  18.206 +   begin
  18.207 +      Write (Stream.Writer, Item, No_Flush);
  18.208 +   end Write;
  18.209 +
  18.210 +   --------------------
  18.211 +   -- Write_Total_In --
  18.212 +   --------------------
  18.213 +
  18.214 +   function Write_Total_In (Stream : in Stream_Type) return Count is
  18.215 +   begin
  18.216 +      return Total_In (Stream.Writer);
  18.217 +   end Write_Total_In;
  18.218 +
  18.219 +   ---------------------
  18.220 +   -- Write_Total_Out --
  18.221 +   ---------------------
  18.222 +
  18.223 +   function Write_Total_Out (Stream : in Stream_Type) return Count is
  18.224 +   begin
  18.225 +      return Total_Out (Stream.Writer);
  18.226 +   end Write_Total_Out;
  18.227 +
  18.228 +end ZLib.Streams;
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/external/zlib-1.2.11/contrib/ada/zlib-streams.ads	Sat Oct 21 21:05:43 2017 -0700
    19.3 @@ -0,0 +1,114 @@
    19.4 +----------------------------------------------------------------
    19.5 +--  ZLib for Ada thick binding.                               --
    19.6 +--                                                            --
    19.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    19.8 +--                                                            --
    19.9 +--  Open source license information is in the zlib.ads file.  --
   19.10 +----------------------------------------------------------------
   19.11 +
   19.12 +--  $Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp $
   19.13 +
   19.14 +package ZLib.Streams is
   19.15 +
   19.16 +   type Stream_Mode is (In_Stream, Out_Stream, Duplex);
   19.17 +
   19.18 +   type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;
   19.19 +
   19.20 +   type Stream_Type is
   19.21 +      new Ada.Streams.Root_Stream_Type with private;
   19.22 +
   19.23 +   procedure Read
   19.24 +     (Stream : in out Stream_Type;
   19.25 +      Item   :    out Ada.Streams.Stream_Element_Array;
   19.26 +      Last   :    out Ada.Streams.Stream_Element_Offset);
   19.27 +
   19.28 +   procedure Write
   19.29 +     (Stream : in out Stream_Type;
   19.30 +      Item   : in     Ada.Streams.Stream_Element_Array);
   19.31 +
   19.32 +   procedure Flush
   19.33 +     (Stream : in out Stream_Type;
   19.34 +      Mode   : in     Flush_Mode := Sync_Flush);
   19.35 +   --  Flush the written data to the back stream,
   19.36 +   --  all data placed to the compressor is flushing to the Back stream.
   19.37 +   --  Should not be used until necessary, because it is decreasing
   19.38 +   --  compression.
   19.39 +
   19.40 +   function Read_Total_In (Stream : in Stream_Type) return Count;
   19.41 +   pragma Inline (Read_Total_In);
   19.42 +   --  Return total number of bytes read from back stream so far.
   19.43 +
   19.44 +   function Read_Total_Out (Stream : in Stream_Type) return Count;
   19.45 +   pragma Inline (Read_Total_Out);
   19.46 +   --  Return total number of bytes read so far.
   19.47 +
   19.48 +   function Write_Total_In (Stream : in Stream_Type) return Count;
   19.49 +   pragma Inline (Write_Total_In);
   19.50 +   --  Return total number of bytes written so far.
   19.51 +
   19.52 +   function Write_Total_Out (Stream : in Stream_Type) return Count;
   19.53 +   pragma Inline (Write_Total_Out);
   19.54 +   --  Return total number of bytes written to the back stream.
   19.55 +
   19.56 +   procedure Create
   19.57 +     (Stream            :    out Stream_Type;
   19.58 +      Mode              : in     Stream_Mode;
   19.59 +      Back              : in     Stream_Access;
   19.60 +      Back_Compressed   : in     Boolean;
   19.61 +      Level             : in     Compression_Level := Default_Compression;
   19.62 +      Strategy          : in     Strategy_Type     := Default_Strategy;
   19.63 +      Header            : in     Header_Type       := Default;
   19.64 +      Read_Buffer_Size  : in     Ada.Streams.Stream_Element_Offset
   19.65 +                                    := Default_Buffer_Size;
   19.66 +      Write_Buffer_Size : in     Ada.Streams.Stream_Element_Offset
   19.67 +                                    := Default_Buffer_Size);
   19.68 +   --  Create the Comression/Decompression stream.
   19.69 +   --  If mode is In_Stream then Write operation is disabled.
   19.70 +   --  If mode is Out_Stream then Read operation is disabled.
   19.71 +
   19.72 +   --  If Back_Compressed is true then
   19.73 +   --  Data written to the Stream is compressing to the Back stream
   19.74 +   --  and data read from the Stream is decompressed data from the Back stream.
   19.75 +
   19.76 +   --  If Back_Compressed is false then
   19.77 +   --  Data written to the Stream is decompressing to the Back stream
   19.78 +   --  and data read from the Stream is compressed data from the Back stream.
   19.79 +
   19.80 +   --  !!! When the Need_Header is False ZLib-Ada is using undocumented
   19.81 +   --  ZLib 1.1.4 functionality to do not create/wait for ZLib headers.
   19.82 +
   19.83 +   function Is_Open (Stream : Stream_Type) return Boolean;
   19.84 +
   19.85 +   procedure Close (Stream : in out Stream_Type);
   19.86 +
   19.87 +private
   19.88 +
   19.89 +   use Ada.Streams;
   19.90 +
   19.91 +   type Buffer_Access is access all Stream_Element_Array;
   19.92 +
   19.93 +   type Stream_Type
   19.94 +     is new Root_Stream_Type with
   19.95 +   record
   19.96 +      Mode       : Stream_Mode;
   19.97 +
   19.98 +      Buffer     : Buffer_Access;
   19.99 +      Rest_First : Stream_Element_Offset;
  19.100 +      Rest_Last  : Stream_Element_Offset;
  19.101 +      --  Buffer for Read operation.
  19.102 +      --  We need to have this buffer in the record
  19.103 +      --  because not all read data from back stream
  19.104 +      --  could be processed during the read operation.
  19.105 +
  19.106 +      Buffer_Size : Stream_Element_Offset;
  19.107 +      --  Buffer size for write operation.
  19.108 +      --  We do not need to have this buffer
  19.109 +      --  in the record because all data could be
  19.110 +      --  processed in the write operation.
  19.111 +
  19.112 +      Back       : Stream_Access;
  19.113 +      Reader     : Filter_Type;
  19.114 +      Writer     : Filter_Type;
  19.115 +   end record;
  19.116 +
  19.117 +end ZLib.Streams;
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/external/zlib-1.2.11/contrib/ada/zlib-thin.adb	Sat Oct 21 21:05:43 2017 -0700
    20.3 @@ -0,0 +1,141 @@
    20.4 +----------------------------------------------------------------
    20.5 +--  ZLib for Ada thick binding.                               --
    20.6 +--                                                            --
    20.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    20.8 +--                                                            --
    20.9 +--  Open source license information is in the zlib.ads file.  --
   20.10 +----------------------------------------------------------------
   20.11 +
   20.12 +--  $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $
   20.13 +
   20.14 +package body ZLib.Thin is
   20.15 +
   20.16 +   ZLIB_VERSION  : constant Chars_Ptr := zlibVersion;
   20.17 +
   20.18 +   Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
   20.19 +
   20.20 +   --------------
   20.21 +   -- Avail_In --
   20.22 +   --------------
   20.23 +
   20.24 +   function Avail_In (Strm : in Z_Stream) return UInt is
   20.25 +   begin
   20.26 +      return Strm.Avail_In;
   20.27 +   end Avail_In;
   20.28 +
   20.29 +   ---------------
   20.30 +   -- Avail_Out --
   20.31 +   ---------------
   20.32 +
   20.33 +   function Avail_Out (Strm : in Z_Stream) return UInt is
   20.34 +   begin
   20.35 +      return Strm.Avail_Out;
   20.36 +   end Avail_Out;
   20.37 +
   20.38 +   ------------------
   20.39 +   -- Deflate_Init --
   20.40 +   ------------------
   20.41 +
   20.42 +   function Deflate_Init
   20.43 +     (strm       : Z_Streamp;
   20.44 +      level      : Int;
   20.45 +      method     : Int;
   20.46 +      windowBits : Int;
   20.47 +      memLevel   : Int;
   20.48 +      strategy   : Int)
   20.49 +      return       Int is
   20.50 +   begin
   20.51 +      return deflateInit2
   20.52 +               (strm,
   20.53 +                level,
   20.54 +                method,
   20.55 +                windowBits,
   20.56 +                memLevel,
   20.57 +                strategy,
   20.58 +                ZLIB_VERSION,
   20.59 +                Z_Stream_Size);
   20.60 +   end Deflate_Init;
   20.61 +
   20.62 +   ------------------
   20.63 +   -- Inflate_Init --
   20.64 +   ------------------
   20.65 +
   20.66 +   function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
   20.67 +   begin
   20.68 +      return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
   20.69 +   end Inflate_Init;
   20.70 +
   20.71 +   ------------------------
   20.72 +   -- Last_Error_Message --
   20.73 +   ------------------------
   20.74 +
   20.75 +   function Last_Error_Message (Strm : in Z_Stream) return String is
   20.76 +      use Interfaces.C.Strings;
   20.77 +   begin
   20.78 +      if Strm.msg = Null_Ptr then
   20.79 +         return "";
   20.80 +      else
   20.81 +         return Value (Strm.msg);
   20.82 +      end if;
   20.83 +   end Last_Error_Message;
   20.84 +
   20.85 +   ------------
   20.86 +   -- Set_In --
   20.87 +   ------------
   20.88 +
   20.89 +   procedure Set_In
   20.90 +     (Strm   : in out Z_Stream;
   20.91 +      Buffer : in     Voidp;
   20.92 +      Size   : in     UInt) is
   20.93 +   begin
   20.94 +      Strm.Next_In  := Buffer;
   20.95 +      Strm.Avail_In := Size;
   20.96 +   end Set_In;
   20.97 +
   20.98 +   ------------------
   20.99 +   -- Set_Mem_Func --
  20.100 +   ------------------
  20.101 +
  20.102 +   procedure Set_Mem_Func
  20.103 +     (Strm   : in out Z_Stream;
  20.104 +      Opaque : in     Voidp;
  20.105 +      Alloc  : in     alloc_func;
  20.106 +      Free   : in     free_func) is
  20.107 +   begin
  20.108 +      Strm.opaque := Opaque;
  20.109 +      Strm.zalloc := Alloc;
  20.110 +      Strm.zfree  := Free;
  20.111 +   end Set_Mem_Func;
  20.112 +
  20.113 +   -------------
  20.114 +   -- Set_Out --
  20.115 +   -------------
  20.116 +
  20.117 +   procedure Set_Out
  20.118 +     (Strm   : in out Z_Stream;
  20.119 +      Buffer : in     Voidp;
  20.120 +      Size   : in     UInt) is
  20.121 +   begin
  20.122 +      Strm.Next_Out  := Buffer;
  20.123 +      Strm.Avail_Out := Size;
  20.124 +   end Set_Out;
  20.125 +
  20.126 +   --------------
  20.127 +   -- Total_In --
  20.128 +   --------------
  20.129 +
  20.130 +   function Total_In (Strm : in Z_Stream) return ULong is
  20.131 +   begin
  20.132 +      return Strm.Total_In;
  20.133 +   end Total_In;
  20.134 +
  20.135 +   ---------------
  20.136 +   -- Total_Out --
  20.137 +   ---------------
  20.138 +
  20.139 +   function Total_Out (Strm : in Z_Stream) return ULong is
  20.140 +   begin
  20.141 +      return Strm.Total_Out;
  20.142 +   end Total_Out;
  20.143 +
  20.144 +end ZLib.Thin;
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/external/zlib-1.2.11/contrib/ada/zlib-thin.ads	Sat Oct 21 21:05:43 2017 -0700
    21.3 @@ -0,0 +1,450 @@
    21.4 +----------------------------------------------------------------
    21.5 +--  ZLib for Ada thick binding.                               --
    21.6 +--                                                            --
    21.7 +--  Copyright (C) 2002-2003 Dmitriy Anisimkov                 --
    21.8 +--                                                            --
    21.9 +--  Open source license information is in the zlib.ads file.  --
   21.10 +----------------------------------------------------------------
   21.11 +
   21.12 +--  $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $
   21.13 +
   21.14 +with Interfaces.C.Strings;
   21.15 +
   21.16 +with System;
   21.17 +
   21.18 +private package ZLib.Thin is
   21.19 +
   21.20 +   --  From zconf.h
   21.21 +
   21.22 +   MAX_MEM_LEVEL : constant := 9;         --  zconf.h:105
   21.23 +                                          --  zconf.h:105
   21.24 +   MAX_WBITS : constant := 15;      --  zconf.h:115
   21.25 +                                    --  32K LZ77 window
   21.26 +                                    --  zconf.h:115
   21.27 +   SEEK_SET : constant := 8#0000#;  --  zconf.h:244
   21.28 +                                    --  Seek from beginning of file.
   21.29 +                                    --  zconf.h:244
   21.30 +   SEEK_CUR : constant := 1;        --  zconf.h:245
   21.31 +                                    --  Seek from current position.
   21.32 +                                    --  zconf.h:245
   21.33 +   SEEK_END : constant := 2;        --  zconf.h:246
   21.34 +                                    --  Set file pointer to EOF plus "offset"
   21.35 +                                    --  zconf.h:246
   21.36 +
   21.37 +   type Byte is new Interfaces.C.unsigned_char; --  8 bits
   21.38 +                                                --  zconf.h:214
   21.39 +   type UInt is new Interfaces.C.unsigned;      --  16 bits or more
   21.40 +                                                --  zconf.h:216
   21.41 +   type Int is new Interfaces.C.int;
   21.42 +
   21.43 +   type ULong is new Interfaces.C.unsigned_long;     --  32 bits or more
   21.44 +                                                     --  zconf.h:217
   21.45 +   subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;
   21.46 +
   21.47 +   type ULong_Access is access ULong;
   21.48 +   type Int_Access is access Int;
   21.49 +
   21.50 +   subtype Voidp is System.Address;            --  zconf.h:232
   21.51 +
   21.52 +   subtype Byte_Access is Voidp;
   21.53 +
   21.54 +   Nul : constant Voidp := System.Null_Address;
   21.55 +   --  end from zconf
   21.56 +
   21.57 +   Z_NO_FLUSH : constant := 8#0000#;   --  zlib.h:125
   21.58 +                                       --  zlib.h:125
   21.59 +   Z_PARTIAL_FLUSH : constant := 1;       --  zlib.h:126
   21.60 +                                          --  will be removed, use
   21.61 +                                          --  Z_SYNC_FLUSH instead
   21.62 +                                          --  zlib.h:126
   21.63 +   Z_SYNC_FLUSH : constant := 2;       --  zlib.h:127
   21.64 +                                       --  zlib.h:127
   21.65 +   Z_FULL_FLUSH : constant := 3;       --  zlib.h:128
   21.66 +                                       --  zlib.h:128
   21.67 +   Z_FINISH : constant := 4;        --  zlib.h:129
   21.68 +                                    --  zlib.h:129
   21.69 +   Z_OK : constant := 8#0000#;   --  zlib.h:132
   21.70 +                                 --  zlib.h:132
   21.71 +   Z_STREAM_END : constant := 1;       --  zlib.h:133
   21.72 +                                       --  zlib.h:133
   21.73 +   Z_NEED_DICT : constant := 2;        --  zlib.h:134
   21.74 +                                       --  zlib.h:134
   21.75 +   Z_ERRNO : constant := -1;        --  zlib.h:135
   21.76 +                                    --  zlib.h:135
   21.77 +   Z_STREAM_ERROR : constant := -2;       --  zlib.h:136
   21.78 +                                          --  zlib.h:136
   21.79 +   Z_DATA_ERROR : constant := -3;      --  zlib.h:137
   21.80 +                                       --  zlib.h:137
   21.81 +   Z_MEM_ERROR : constant := -4;       --  zlib.h:138
   21.82 +                                       --  zlib.h:138
   21.83 +   Z_BUF_ERROR : constant := -5;       --  zlib.h:139
   21.84 +                                       --  zlib.h:139
   21.85 +   Z_VERSION_ERROR : constant := -6;      --  zlib.h:140
   21.86 +                                          --  zlib.h:140
   21.87 +   Z_NO_COMPRESSION : constant := 8#0000#;   --  zlib.h:145
   21.88 +                                             --  zlib.h:145
   21.89 +   Z_BEST_SPEED : constant := 1;       --  zlib.h:146
   21.90 +                                       --  zlib.h:146
   21.91 +   Z_BEST_COMPRESSION : constant := 9;       --  zlib.h:147
   21.92 +                                             --  zlib.h:147
   21.93 +   Z_DEFAULT_COMPRESSION : constant := -1;      --  zlib.h:148
   21.94 +                                                --  zlib.h:148
   21.95 +   Z_FILTERED : constant := 1;      --  zlib.h:151
   21.96 +                                    --  zlib.h:151
   21.97 +   Z_HUFFMAN_ONLY : constant := 2;        --  zlib.h:152
   21.98 +                                          --  zlib.h:152
   21.99 +   Z_DEFAULT_STRATEGY : constant := 8#0000#; --  zlib.h:153
  21.100 +                                             --  zlib.h:153
  21.101 +   Z_BINARY : constant := 8#0000#;  --  zlib.h:156
  21.102 +                                    --  zlib.h:156
  21.103 +   Z_ASCII : constant := 1;      --  zlib.h:157
  21.104 +                                 --  zlib.h:157
  21.105 +   Z_UNKNOWN : constant := 2;       --  zlib.h:158
  21.106 +                                    --  zlib.h:158
  21.107 +   Z_DEFLATED : constant := 8;      --  zlib.h:161
  21.108 +                                    --  zlib.h:161
  21.109 +   Z_NULL : constant := 8#0000#; --  zlib.h:164
  21.110 +                                 --  for initializing zalloc, zfree, opaque
  21.111 +                                 --  zlib.h:164
  21.112 +   type gzFile is new Voidp;                  --  zlib.h:646
  21.113 +
  21.114 +   type Z_Stream is private;
  21.115 +
  21.116 +   type Z_Streamp is access all Z_Stream;     --  zlib.h:89
  21.117 +
  21.118 +   type alloc_func is access function
  21.119 +     (Opaque : Voidp;
  21.120 +      Items  : UInt;
  21.121 +      Size   : UInt)
  21.122 +      return Voidp; --  zlib.h:63
  21.123 +
  21.124 +   type free_func is access procedure (opaque : Voidp; address : Voidp);
  21.125 +
  21.126 +   function zlibVersion return Chars_Ptr;
  21.127 +
  21.128 +   function Deflate (strm : Z_Streamp; flush : Int) return Int;
  21.129 +
  21.130 +   function DeflateEnd (strm : Z_Streamp) return Int;
  21.131 +
  21.132 +   function Inflate (strm : Z_Streamp; flush : Int) return Int;
  21.133 +
  21.134 +   function InflateEnd (strm : Z_Streamp) return Int;
  21.135 +
  21.136 +   function deflateSetDictionary
  21.137 +     (strm       : Z_Streamp;
  21.138 +      dictionary : Byte_Access;
  21.139 +      dictLength : UInt)
  21.140 +      return       Int;
  21.141 +
  21.142 +   function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int;
  21.143 +   --  zlib.h:478
  21.144 +
  21.145 +   function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495
  21.146 +
  21.147 +   function deflateParams
  21.148 +     (strm     : Z_Streamp;
  21.149 +      level    : Int;
  21.150 +      strategy : Int)
  21.151 +      return     Int;       -- zlib.h:506
  21.152 +
  21.153 +   function inflateSetDictionary
  21.154 +     (strm       : Z_Streamp;
  21.155 +      dictionary : Byte_Access;
  21.156 +      dictLength : UInt)
  21.157 +      return       Int; --  zlib.h:548
  21.158 +
  21.159 +   function inflateSync (strm : Z_Streamp) return Int;  --  zlib.h:565
  21.160 +
  21.161 +   function inflateReset (strm : Z_Streamp) return Int; --  zlib.h:580
  21.162 +
  21.163 +   function compress
  21.164 +     (dest      : Byte_Access;
  21.165 +      destLen   : ULong_Access;
  21.166 +      source    : Byte_Access;
  21.167 +      sourceLen : ULong)
  21.168 +      return      Int;           -- zlib.h:601
  21.169 +
  21.170 +   function compress2
  21.171 +     (dest      : Byte_Access;
  21.172 +      destLen   : ULong_Access;
  21.173 +      source    : Byte_Access;
  21.174 +      sourceLen : ULong;
  21.175 +      level     : Int)
  21.176 +      return      Int;          -- zlib.h:615
  21.177 +
  21.178 +   function uncompress
  21.179 +     (dest      : Byte_Access;
  21.180 +      destLen   : ULong_Access;
  21.181 +      source    : Byte_Access;
  21.182 +      sourceLen : ULong)
  21.183 +      return      Int;
  21.184 +
  21.185 +   function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile;
  21.186 +
  21.187 +   function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile;
  21.188 +
  21.189 +   function gzsetparams
  21.190 +     (file     : gzFile;
  21.191 +      level    : Int;
  21.192 +      strategy : Int)
  21.193 +      return     Int;
  21.194 +
  21.195 +   function gzread
  21.196 +     (file : gzFile;
  21.197 +      buf  : Voidp;
  21.198 +      len  : UInt)
  21.199 +      return Int;
  21.200 +
  21.201 +   function gzwrite
  21.202 +     (file : in gzFile;
  21.203 +      buf  : in Voidp;
  21.204 +      len  : in UInt)
  21.205 +      return Int;
  21.206 +
  21.207 +   function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int;
  21.208 +
  21.209 +   function gzputs (file : in gzFile; s : in Chars_Ptr) return Int;
  21.210 +
  21.211 +   function gzgets
  21.212 +     (file : gzFile;
  21.213 +      buf  : Chars_Ptr;
  21.214 +      len  : Int)
  21.215 +      return Chars_Ptr;
  21.216 +
  21.217 +   function gzputc (file : gzFile; char : Int) return Int;
  21.218 +
  21.219 +   function gzgetc (file : gzFile) return Int;
  21.220 +
  21.221 +   function gzflush (file : gzFile; flush : Int) return Int;
  21.222 +
  21.223 +   function gzseek
  21.224 +     (file   : gzFile;
  21.225 +      offset : Int;
  21.226 +      whence : Int)
  21.227 +      return   Int;
  21.228 +
  21.229 +   function gzrewind (file : gzFile) return Int;
  21.230 +
  21.231 +   function gztell (file : gzFile) return Int;
  21.232 +
  21.233 +   function gzeof (file : gzFile) return Int;
  21.234 +
  21.235 +   function gzclose (file : gzFile) return Int;
  21.236 +
  21.237 +   function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr;
  21.238 +
  21.239 +   function adler32
  21.240 +     (adler : ULong;
  21.241 +      buf   : Byte_Access;
  21.242 +      len   : UInt)
  21.243 +      return  ULong;
  21.244 +
  21.245 +   function crc32
  21.246 +     (crc  : ULong;
  21.247 +      buf  : Byte_Access;
  21.248 +      len  : UInt)
  21.249 +      return ULong;
  21.250 +
  21.251 +   function deflateInit
  21.252 +     (strm        : Z_Streamp;
  21.253 +      level       : Int;
  21.254 +      version     : Chars_Ptr;
  21.255 +      stream_size : Int)
  21.256 +      return        Int;
  21.257 +
  21.258 +   function deflateInit2
  21.259 +     (strm        : Z_Streamp;
  21.260 +      level       : Int;
  21.261 +      method      : Int;
  21.262 +      windowBits  : Int;
  21.263 +      memLevel    : Int;
  21.264 +      strategy    : Int;
  21.265 +      version     : Chars_Ptr;
  21.266 +      stream_size : Int)
  21.267 +      return        Int;
  21.268 +
  21.269 +   function Deflate_Init
  21.270 +     (strm       : Z_Streamp;
  21.271 +      level      : Int;
  21.272 +      method     : Int;
  21.273 +      windowBits : Int;
  21.274 +      memLevel   : Int;
  21.275 +      strategy   : Int)
  21.276 +      return       Int;
  21.277 +   pragma Inline (Deflate_Init);
  21.278 +
  21.279 +   function inflateInit
  21.280 +     (strm        : Z_Streamp;
  21.281 +      version     : Chars_Ptr;
  21.282 +      stream_size : Int)
  21.283 +      return        Int;
  21.284 +
  21.285 +   function inflateInit2
  21.286 +     (strm        : in Z_Streamp;
  21.287 +      windowBits  : in Int;
  21.288 +      version     : in Chars_Ptr;
  21.289 +      stream_size : in Int)
  21.290 +      return      Int;
  21.291 +
  21.292 +   function inflateBackInit
  21.293 +     (strm        : in Z_Streamp;
  21.294 +      windowBits  : in Int;
  21.295 +      window      : in Byte_Access;
  21.296 +      version     : in Chars_Ptr;
  21.297 +      stream_size : in Int)
  21.298 +      return      Int;
  21.299 +   --  Size of window have to be 2**windowBits.
  21.300 +
  21.301 +   function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int;
  21.302 +   pragma Inline (Inflate_Init);
  21.303 +
  21.304 +   function zError (err : Int) return Chars_Ptr;
  21.305 +
  21.306 +   function inflateSyncPoint (z : Z_Streamp) return Int;
  21.307 +
  21.308 +   function get_crc_table return ULong_Access;
  21.309 +
  21.310 +   --  Interface to the available fields of the z_stream structure.
  21.311 +   --  The application must update next_in and avail_in when avail_in has
  21.312 +   --  dropped to zero. It must update next_out and avail_out when avail_out
  21.313 +   --  has dropped to zero. The application must initialize zalloc, zfree and
  21.314 +   --  opaque before calling the init function.
  21.315 +
  21.316 +   procedure Set_In
  21.317 +     (Strm   : in out Z_Stream;
  21.318 +      Buffer : in Voidp;
  21.319 +      Size   : in UInt);
  21.320 +   pragma Inline (Set_In);
  21.321 +
  21.322 +   procedure Set_Out
  21.323 +     (Strm   : in out Z_Stream;
  21.324 +      Buffer : in Voidp;
  21.325 +      Size   : in UInt);
  21.326 +   pragma Inline (Set_Out);
  21.327 +
  21.328 +   procedure Set_Mem_Func
  21.329 +     (Strm   : in out Z_Stream;
  21.330 +      Opaque : in Voidp;
  21.331 +      Alloc  : in alloc_func;
  21.332 +      Free   : in free_func);
  21.333 +   pragma Inline (Set_Mem_Func);
  21.334 +
  21.335 +   function Last_Error_Message (Strm : in Z_Stream) return String;
  21.336 +   pragma Inline (Last_Error_Message);
  21.337 +
  21.338 +   function Avail_Out (Strm : in Z_Stream) return UInt;
  21.339 +   pragma Inline (Avail_Out);
  21.340 +
  21.341 +   function Avail_In (Strm : in Z_Stream) return UInt;
  21.342 +   pragma Inline (Avail_In);
  21.343 +
  21.344 +   function Total_In (Strm : in Z_Stream) return ULong;
  21.345 +   pragma Inline (Total_In);
  21.346 +
  21.347 +   function Total_Out (Strm : in Z_Stream) return ULong;
  21.348 +   pragma Inline (Total_Out);
  21.349 +
  21.350 +   function inflateCopy
  21.351 +     (dest   : in Z_Streamp;
  21.352 +      Source : in Z_Streamp)
  21.353 +      return Int;
  21.354 +
  21.355 +   function compressBound (Source_Len : in ULong) return ULong;
  21.356 +
  21.357 +   function deflateBound
  21.358 +     (Strm       : in Z_Streamp;
  21.359 +      Source_Len : in ULong)
  21.360 +      return     ULong;
  21.361 +
  21.362 +   function gzungetc (C : in Int; File : in  gzFile) return Int;
  21.363 +
  21.364 +   function zlibCompileFlags return ULong;
  21.365 +
  21.366 +private
  21.367 +
  21.368 +   type Z_Stream is record            -- zlib.h:68
  21.369 +      Next_In   : Voidp      := Nul;  -- next input byte
  21.370 +      Avail_In  : UInt       := 0;    -- number of bytes available at next_in
  21.371 +      Total_In  : ULong      := 0;    -- total nb of input bytes read so far
  21.372 +      Next_Out  : Voidp      := Nul;  -- next output byte should be put there
  21.373 +      Avail_Out : UInt       := 0;    -- remaining free space at next_out
  21.374 +      Total_Out : ULong      := 0;    -- total nb of bytes output so far
  21.375 +      msg       : Chars_Ptr;          -- last error message, NULL if no error
  21.376 +      state     : Voidp;              -- not visible by applications
  21.377 +      zalloc    : alloc_func := null; -- used to allocate the internal state
  21.378 +      zfree     : free_func  := null; -- used to free the internal state
  21.379 +      opaque    : Voidp;              -- private data object passed to
  21.380 +                                      --  zalloc and zfree
  21.381 +      data_type : Int;                -- best guess about the data type:
  21.382 +                                      --  ascii or binary
  21.383 +      adler     : ULong;              -- adler32 value of the uncompressed
  21.384 +                                      --  data
  21.385 +      reserved  : ULong;              -- reserved for future use
  21.386 +   end record;
  21.387 +
  21.388 +   pragma Convention (C, Z_Stream);
  21.389 +
  21.390 +   pragma Import (C, zlibVersion, "zlibVersion");
  21.391 +   pragma Import (C, Deflate, "deflate");
  21.392 +   pragma Import (C, DeflateEnd, "deflateEnd");
  21.393 +   pragma Import (C, Inflate, "inflate");
  21.394 +   pragma Import (C, InflateEnd, "inflateEnd");
  21.395 +   pragma Import (C, deflateSetDictionary, "deflateSetDictionary");
  21.396 +   pragma Import (C, deflateCopy, "deflateCopy");
  21.397 +   pragma Import (C, deflateReset, "deflateReset");
  21.398 +   pragma Import (C, deflateParams, "deflateParams");
  21.399 +   pragma Import (C, inflateSetDictionary, "inflateSetDictionary");
  21.400 +   pragma Import (C, inflateSync, "inflateSync");
  21.401 +   pragma Import (C, inflateReset, "inflateReset");
  21.402 +   pragma Import (C, compress, "compress");
  21.403 +   pragma Import (C, compress2, "compress2");
  21.404 +   pragma Import (C, uncompress, "uncompress");
  21.405 +   pragma Import (C, gzopen, "gzopen");
  21.406 +   pragma Import (C, gzdopen, "gzdopen");
  21.407 +   pragma Import (C, gzsetparams, "gzsetparams");
  21.408 +   pragma Import (C, gzread, "gzread");
  21.409 +   pragma Import (C, gzwrite, "gzwrite");
  21.410 +   pragma Import (C, gzprintf, "gzprintf");
  21.411 +   pragma Import (C, gzputs, "gzputs");
  21.412 +   pragma Import (C, gzgets, "gzgets");
  21.413 +   pragma Import (C, gzputc, "gzputc");
  21.414 +   pragma Import (C, gzgetc, "gzgetc");
  21.415 +   pragma Import (C, gzflush, "gzflush");
  21.416 +   pragma Import (C, gzseek, "gzseek");
  21.417 +   pragma Import (C, gzrewind, "gzrewind");
  21.418 +   pragma Import (C, gztell, "gztell");
  21.419 +   pragma Import (C, gzeof, "gzeof");
  21.420 +   pragma Import (C, gzclose, "gzclose");
  21.421 +   pragma Import (C, gzerror, "gzerror");
  21.422 +   pragma Import (C, adler32, "adler32");
  21.423 +   pragma Import (C, crc32, "crc32");
  21.424 +   pragma Import (C, deflateInit, "deflateInit_");
  21.425 +   pragma Import (C, inflateInit, "inflateInit_");
  21.426 +   pragma Import (C, deflateInit2, "deflateInit2_");
  21.427 +   pragma Import (C, inflateInit2, "inflateInit2_");
  21.428 +   pragma Import (C, zError, "zError");
  21.429 +   pragma Import (C, inflateSyncPoint, "inflateSyncPoint");
  21.430 +   pragma Import (C, get_crc_table, "get_crc_table");
  21.431 +
  21.432 +   --  since zlib 1.2.0:
  21.433 +
  21.434 +   pragma Import (C, inflateCopy, "inflateCopy");
  21.435 +   pragma Import (C, compressBound, "compressBound");
  21.436 +   pragma Import (C, deflateBound, "deflateBound");
  21.437 +   pragma Import (C, gzungetc, "gzungetc");
  21.438 +   pragma Import (C, zlibCompileFlags, "zlibCompileFlags");
  21.439 +
  21.440 +   pragma Import (C, inflateBackInit, "inflateBackInit_");
  21.441 +
  21.442 +   --  I stopped binding the inflateBack routines, because realize that
  21.443 +   --  it does not support zlib and gzip headers for now, and have no
  21.444 +   --  symmetric deflateBack routines.
  21.445 +   --  ZLib-Ada is symmetric regarding deflate/inflate data transformation
  21.446 +   --  and has a similar generic callback interface for the
  21.447 +   --  deflate/inflate transformation based on the regular Deflate/Inflate
  21.448 +   --  routines.
  21.449 +
  21.450 +   --  pragma Import (C, inflateBack, "inflateBack");
  21.451 +   --  pragma Import (C, inflateBackEnd, "inflateBackEnd");
  21.452 +
  21.453 +end ZLib.Thin;
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/external/zlib-1.2.11/contrib/ada/zlib.adb	Sat Oct 21 21:05:43 2017 -0700
    22.3 @@ -0,0 +1,701 @@
    22.4 +----------------------------------------------------------------
    22.5 +--  ZLib for Ada thick binding.                               --
    22.6 +--                                                            --
    22.7 +--  Copyright (C) 2002-2004 Dmitriy Anisimkov                 --
    22.8 +--                                                            --
    22.9 +--  Open source license information is in the zlib.ads file.  --
   22.10 +----------------------------------------------------------------
   22.11 +
   22.12 +--  $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $
   22.13 +
   22.14 +with Ada.Exceptions;
   22.15 +with Ada.Unchecked_Conversion;
   22.16 +with Ada.Unchecked_Deallocation;
   22.17 +
   22.18 +with Interfaces.C.Strings;
   22.19 +
   22.20 +with ZLib.Thin;
   22.21 +
   22.22 +package body ZLib is
   22.23 +
   22.24 +   use type Thin.Int;
   22.25 +
   22.26 +   type Z_Stream is new Thin.Z_Stream;
   22.27 +
   22.28 +   type Return_Code_Enum is
   22.29 +      (OK,
   22.30 +       STREAM_END,
   22.31 +       NEED_DICT,
   22.32 +       ERRNO,
   22.33 +       STREAM_ERROR,
   22.34 +       DATA_ERROR,
   22.35 +       MEM_ERROR,
   22.36 +       BUF_ERROR,
   22.37 +       VERSION_ERROR);
   22.38 +
   22.39 +   type Flate_Step_Function is access
   22.40 +     function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int;
   22.41 +   pragma Convention (C, Flate_Step_Function);
   22.42 +
   22.43 +   type Flate_End_Function is access
   22.44 +      function (Ctrm : in Thin.Z_Streamp) return Thin.Int;
   22.45 +   pragma Convention (C, Flate_End_Function);
   22.46 +
   22.47 +   type Flate_Type is record
   22.48 +      Step : Flate_Step_Function;
   22.49 +      Done : Flate_End_Function;
   22.50 +   end record;
   22.51 +
   22.52 +   subtype Footer_Array is Stream_Element_Array (1 .. 8);
   22.53 +
   22.54 +   Simple_GZip_Header : constant Stream_Element_Array (1 .. 10)
   22.55 +     := (16#1f#, 16#8b#,                 --  Magic header
   22.56 +         16#08#,                         --  Z_DEFLATED
   22.57 +         16#00#,                         --  Flags
   22.58 +         16#00#, 16#00#, 16#00#, 16#00#, --  Time
   22.59 +         16#00#,                         --  XFlags
   22.60 +         16#03#                          --  OS code
   22.61 +        );
   22.62 +   --  The simplest gzip header is not for informational, but just for
   22.63 +   --  gzip format compatibility.
   22.64 +   --  Note that some code below is using assumption
   22.65 +   --  Simple_GZip_Header'Last > Footer_Array'Last, so do not make
   22.66 +   --  Simple_GZip_Header'Last <= Footer_Array'Last.
   22.67 +
   22.68 +   Return_Code : constant array (Thin.Int range <>) of Return_Code_Enum
   22.69 +     := (0 => OK,
   22.70 +         1 => STREAM_END,
   22.71 +         2 => NEED_DICT,
   22.72 +        -1 => ERRNO,
   22.73 +        -2 => STREAM_ERROR,
   22.74 +        -3 => DATA_ERROR,
   22.75 +        -4 => MEM_ERROR,
   22.76 +        -5 => BUF_ERROR,
   22.77 +        -6 => VERSION_ERROR);
   22.78 +
   22.79 +   Flate : constant array (Boolean) of Flate_Type
   22.80 +     := (True  => (Step => Thin.Deflate'Access,
   22.81 +                   Done => Thin.DeflateEnd'Access),
   22.82 +         False => (Step => Thin.Inflate'Access,
   22.83 +                   Done => Thin.InflateEnd'Access));
   22.84 +
   22.85 +   Flush_Finish : constant array (Boolean) of Flush_Mode
   22.86 +     := (True => Finish, False => No_Flush);
   22.87 +
   22.88 +   procedure Raise_Error (Stream : in Z_Stream);
   22.89 +   pragma Inline (Raise_Error);
   22.90 +
   22.91 +   procedure Raise_Error (Message : in String);
   22.92 +   pragma Inline (Raise_Error);
   22.93 +
   22.94 +   procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int);
   22.95 +
   22.96 +   procedure Free is new Ada.Unchecked_Deallocation
   22.97 +      (Z_Stream, Z_Stream_Access);
   22.98 +
   22.99 +   function To_Thin_Access is new Ada.Unchecked_Conversion
  22.100 +     (Z_Stream_Access, Thin.Z_Streamp);
  22.101 +
  22.102 +   procedure Translate_GZip
  22.103 +     (Filter    : in out Filter_Type;
  22.104 +      In_Data   : in     Ada.Streams.Stream_Element_Array;
  22.105 +      In_Last   :    out Ada.Streams.Stream_Element_Offset;
  22.106 +      Out_Data  :    out Ada.Streams.Stream_Element_Array;
  22.107 +      Out_Last  :    out Ada.Streams.Stream_Element_Offset;
  22.108 +      Flush     : in     Flush_Mode);
  22.109 +   --  Separate translate routine for make gzip header.
  22.110 +
  22.111 +   procedure Translate_Auto
  22.112 +     (Filter    : in out Filter_Type;
  22.113 +      In_Data   : in     Ada.Streams.Stream_Element_Array;
  22.114 +      In_Last   :    out Ada.Streams.Stream_Element_Offset;
  22.115 +      Out_Data  :    out Ada.Streams.Stream_Element_Array;
  22.116 +      Out_Last  :    out Ada.Streams.Stream_Element_Offset;
  22.117 +      Flush     : in     Flush_Mode);
  22.118 +   --  translate routine without additional headers.
  22.119 +
  22.120 +   -----------------
  22.121 +   -- Check_Error --
  22.122 +   -----------------
  22.123 +
  22.124 +   procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is
  22.125 +      use type Thin.Int;
  22.126 +   begin
  22.127 +      if Code /= Thin.Z_OK then
  22.128 +         Raise_Error
  22.129 +            (Return_Code_Enum'Image (Return_Code (Code))
  22.130 +              & ": " & Last_Error_Message (Stream));
  22.131 +      end if;
  22.132 +   end Check_Error;
  22.133 +
  22.134 +   -----------
  22.135 +   -- Close --
  22.136 +   -----------
  22.137 +
  22.138 +   procedure Close
  22.139 +     (Filter       : in out Filter_Type;
  22.140 +      Ignore_Error : in     Boolean := False)
  22.141 +   is
  22.142 +      Code : Thin.Int;
  22.143 +   begin
  22.144 +      if not Ignore_Error and then not Is_Open (Filter) then
  22.145 +         raise Status_Error;
  22.146 +      end if;
  22.147 +
  22.148 +      Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm));
  22.149 +
  22.150 +      if Ignore_Error or else Code = Thin.Z_OK then
  22.151 +         Free (Filter.Strm);
  22.152 +      else
  22.153 +         declare
  22.154 +            Error_Message : constant String
  22.155 +              := Last_Error_Message (Filter.Strm.all);
  22.156 +         begin
  22.157 +            Free (Filter.Strm);
  22.158 +            Ada.Exceptions.Raise_Exception
  22.159 +               (ZLib_Error'Identity,
  22.160 +                Return_Code_Enum'Image (Return_Code (Code))
  22.161 +                  & ": " & Error_Message);
  22.162 +         end;
  22.163 +      end if;
  22.164 +   end Close;
  22.165 +
  22.166 +   -----------
  22.167 +   -- CRC32 --
  22.168 +   -----------
  22.169 +
  22.170 +   function CRC32
  22.171 +     (CRC  : in Unsigned_32;
  22.172 +      Data : in Ada.Streams.Stream_Element_Array)
  22.173 +      return Unsigned_32
  22.174 +   is
  22.175 +      use Thin;
  22.176 +   begin
  22.177 +      return Unsigned_32 (crc32 (ULong (CRC),
  22.178 +                                 Data'Address,
  22.179 +                                 Data'Length));
  22.180 +   end CRC32;
  22.181 +
  22.182 +   procedure CRC32
  22.183 +     (CRC  : in out Unsigned_32;
  22.184 +      Data : in     Ada.Streams.Stream_Element_Array) is
  22.185 +   begin
  22.186 +      CRC := CRC32 (CRC, Data);
  22.187 +   end CRC32;
  22.188 +
  22.189 +   ------------------
  22.190 +   -- Deflate_Init --
  22.191 +   ------------------
  22.192 +
  22.193 +   procedure Deflate_Init
  22.194 +     (Filter       : in out Filter_Type;
  22.195 +      Level        : in     Compression_Level  := Default_Compression;
  22.196 +      Strategy     : in     Strategy_Type      := Default_Strategy;
  22.197 +      Method       : in     Compression_Method := Deflated;
  22.198 +      Window_Bits  : in     Window_Bits_Type   := Default_Window_Bits;
  22.199 +      Memory_Level : in     Memory_Level_Type  := Default_Memory_Level;
  22.200 +      Header       : in     Header_Type        := Default)
  22.201 +   is
  22.202 +      use type Thin.Int;
  22.203 +      Win_Bits : Thin.Int := Thin.Int (Window_Bits);
  22.204 +   begin
  22.205 +      if Is_Open (Filter) then
  22.206 +         raise Status_Error;
  22.207 +      end if;
  22.208 +
  22.209 +      --  We allow ZLib to make header only in case of default header type.
  22.210 +      --  Otherwise we would either do header by ourselfs, or do not do
  22.211 +      --  header at all.
  22.212 +
  22.213 +      if Header = None or else Header = GZip then
  22.214 +         Win_Bits := -Win_Bits;
  22.215 +      end if;
  22.216 +
  22.217 +      --  For the GZip CRC calculation and make headers.
  22.218 +
  22.219 +      if Header = GZip then
  22.220 +         Filter.CRC    := 0;
  22.221 +         Filter.Offset := Simple_GZip_Header'First;
  22.222 +      else
  22.223 +         Filter.Offset := Simple_GZip_Header'Last + 1;
  22.224 +      end if;
  22.225 +
  22.226 +      Filter.Strm        := new Z_Stream;
  22.227 +      Filter.Compression := True;
  22.228 +      Filter.Stream_End  := False;
  22.229 +      Filter.Header      := Header;
  22.230 +
  22.231 +      if Thin.Deflate_Init
  22.232 +           (To_Thin_Access (Filter.Strm),
  22.233 +            Level      => Thin.Int (Level),
  22.234 +            method     => Thin.Int (Method),
  22.235 +            windowBits => Win_Bits,
  22.236 +            memLevel   => Thin.Int (Memory_Level),
  22.237 +            strategy   => Thin.Int (Strategy)) /= Thin.Z_OK
  22.238 +      then
  22.239 +         Raise_Error (Filter.Strm.all);
  22.240 +      end if;
  22.241 +   end Deflate_Init;
  22.242 +
  22.243 +   -----------
  22.244 +   -- Flush --
  22.245 +   -----------
  22.246 +
  22.247 +   procedure Flush
  22.248 +     (Filter    : in out Filter_Type;
  22.249 +      Out_Data  :    out Ada.Streams.Stream_Element_Array;
  22.250 +      Out_Last  :    out Ada.Streams.Stream_Element_Offset;
  22.251 +      Flush     : in     Flush_Mode)
  22.252 +   is
  22.253 +      No_Data : Stream_Element_Array := (1 .. 0 => 0);
  22.254 +      Last    : Stream_Element_Offset;
  22.255 +   begin
  22.256 +      Translate (Filter, No_Data, Last, Out_Data, Out_Last, Flush);
  22.257 +   end Flush;
  22.258 +
  22.259 +   -----------------------
  22.260 +   -- Generic_Translate --
  22.261 +   -----------------------
  22.262 +
  22.263 +   procedure Generic_Translate
  22.264 +     (Filter          : in out ZLib.Filter_Type;
  22.265 +      In_Buffer_Size  : in     Integer := Default_Buffer_Size;
  22.266 +      Out_Buffer_Size : in     Integer := Default_Buffer_Size)
  22.267 +   is
  22.268 +      In_Buffer  : Stream_Element_Array
  22.269 +                     (1 .. Stream_Element_Offset (In_Buffer_Size));
  22.270 +      Out_Buffer : Stream_Element_Array
  22.271 +                     (1 .. Stream_Element_Offset (Out_Buffer_Size));
  22.272 +      Last       : Stream_Element_Offset;
  22.273 +      In_Last    : Stream_Element_Offset;
  22.274 +      In_First   : Stream_Element_Offset;
  22.275 +      Out_Last   : Stream_Element_Offset;
  22.276 +   begin
  22.277 +      Main : loop
  22.278 +         Data_In (In_Buffer, Last);
  22.279 +
  22.280 +         In_First := In_Buffer'First;
  22.281 +
  22.282 +         loop
  22.283 +            Translate
  22.284 +              (Filter   => Filter,
  22.285 +               In_Data  => In_Buffer (In_First .. Last),
  22.286 +               In_Last  => In_Last,
  22.287 +               Out_Data => Out_Buffer,
  22.288 +               Out_Last => Out_Last,
  22.289 +               Flush    => Flush_Finish (Last < In_Buffer'First));
  22.290 +
  22.291 +            if Out_Buffer'First <= Out_Last then
  22.292 +               Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last));
  22.293 +            end if;
  22.294 +
  22.295 +            exit Main when Stream_End (Filter);
  22.296 +
  22.297 +            --  The end of in buffer.
  22.298 +
  22.299 +            exit when In_Last = Last;
  22.300 +
  22.301 +            In_First := In_Last + 1;
  22.302 +         end loop;
  22.303 +      end loop Main;
  22.304 +
  22.305 +   end Generic_Translate;
  22.306 +
  22.307 +   ------------------
  22.308 +   -- Inflate_Init --
  22.309 +   ------------------
  22.310 +
  22.311 +   procedure Inflate_Init
  22.312 +     (Filter      : in out Filter_Type;
  22.313 +      Window_Bits : in     Window_Bits_Type := Default_Window_Bits;
  22.314 +      Header      : in     Header_Type      := Default)
  22.315 +   is
  22.316 +      use type Thin.Int;
  22.317 +      Win_Bits : Thin.Int := Thin.Int (Window_Bits);
  22.318 +
  22.319 +      procedure Check_Version;
  22.320 +      --  Check the latest header types compatibility.
  22.321 +
  22.322 +      procedure Check_Version is
  22.323 +      begin
  22.324 +         if Version <= "1.1.4" then
  22.325 +            Raise_Error
  22.326 +              ("Inflate header type " & Header_Type'Image (Header)
  22.327 +               & " incompatible with ZLib version " & Version);
  22.328 +         end if;
  22.329 +      end Check_Version;
  22.330 +
  22.331 +   begin
  22.332 +      if Is_Open (Filter) then
  22.333 +         raise Status_Error;
  22.334 +      end if;
  22.335 +
  22.336 +      case Header is
  22.337 +         when None =>
  22.338 +            Check_Version;
  22.339 +
  22.340 +            --  Inflate data without headers determined
  22.341 +            --  by negative Win_Bits.
  22.342 +
  22.343 +            Win_Bits := -Win_Bits;
  22.344 +         when GZip =>
  22.345 +            Check_Version;
  22.346 +
  22.347 +            --  Inflate gzip data defined by flag 16.
  22.348 +
  22.349 +            Win_Bits := Win_Bits + 16;
  22.350 +         when Auto =>
  22.351 +            Check_Version;
  22.352 +
  22.353 +            --  Inflate with automatic detection
  22.354 +            --  of gzip or native header defined by flag 32.
  22.355 +
  22.356 +            Win_Bits := Win_Bits + 32;
  22.357 +         when Default => null;
  22.358 +      end case;
  22.359 +
  22.360 +      Filter.Strm        := new Z_Stream;
  22.361 +      Filter.Compression := False;
  22.362 +      Filter.Stream_End  := False;
  22.363 +      Filter.Header      := Header;
  22.364 +
  22.365 +      if Thin.Inflate_Init
  22.366 +         (To_Thin_Access (Filter.Strm), Win_Bits) /= Thin.Z_OK
  22.367 +      then
  22.368 +         Raise_Error (Filter.Strm.all);
  22.369 +      end if;
  22.370 +   end Inflate_Init;
  22.371 +
  22.372 +   -------------
  22.373 +   -- Is_Open --
  22.374 +   -------------
  22.375 +
  22.376 +   function Is_Open (Filter : in Filter_Type) return Boolean is
  22.377 +   begin
  22.378 +      return Filter.Strm /= null;
  22.379 +   end Is_Open;
  22.380 +
  22.381 +   -----------------
  22.382 +   -- Raise_Error --
  22.383 +   -----------------
  22.384 +
  22.385 +   procedure Raise_Error (Message : in String) is
  22.386 +   begin
  22.387 +      Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message);
  22.388 +   end Raise_Error;
  22.389 +
  22.390 +   procedure Raise_Error (Stream : in Z_Stream) is
  22.391 +   begin
  22.392 +      Raise_Error (Last_Error_Message (Stream));
  22.393 +   end Raise_Error;
  22.394 +
  22.395 +   ----------
  22.396 +   -- Read --
  22.397 +   ----------
  22.398 +
  22.399 +   procedure Read
  22.400 +     (Filter : in out Filter_Type;
  22.401 +      Item   :    out Ada.Streams.Stream_Element_Array;
  22.402 +      Last   :    out Ada.Streams.Stream_Element_Offset;
  22.403 +      Flush  : in     Flush_Mode := No_Flush)
  22.404 +   is
  22.405 +      In_Last    : Stream_Element_Offset;
  22.406 +      Item_First : Ada.Streams.Stream_Element_Offset := Item'First;
  22.407 +      V_Flush    : Flush_Mode := Flush;
  22.408 +
  22.409 +   begin
  22.410 +      pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1);
  22.411 +      pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last);
  22.412 +
  22.413 +      loop
  22.414 +         if Rest_Last = Buffer'First - 1 then
  22.415 +            V_Flush := Finish;
  22.416 +
  22.417 +         elsif Rest_First > Rest_Last then
  22.418 +            Read (Buffer, Rest_Last);
  22.419 +            Rest_First := Buffer'First;
  22.420 +
  22.421 +            if Rest_Last < Buffer'First then
  22.422 +               V_Flush := Finish;
  22.423 +            end if;
  22.424 +         end if;
  22.425 +
  22.426 +         Translate
  22.427 +           (Filter   => Filter,
  22.428 +            In_Data  => Buffer (Rest_First .. Rest_Last),
  22.429 +            In_Last  => In_Last,
  22.430 +            Out_Data => Item (Item_First .. Item'Last),
  22.431 +            Out_Last => Last,
  22.432 +            Flush    => V_Flush);
  22.433 +
  22.434 +