"Fossies" - the Fresh Open Source Software Archive

Member "sfk-1.9.6/sfkpack.cpp" (22 Feb 2020, 686257 Bytes) of package /linux/misc/sfk-1.9.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "sfkpack.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.9.5_vs_1.9.6.

    1 /*
    2    SFKPack V1.0.3, a frozen monolithic code containing
    3 
    4       zlib     1.2.11
    5 
    6    for easiest possible compilation. Created by
    7    joinsfkpack.bat using the Swiss File Knife tool.
    8 
    9    All source files were heavily modified to allow freezing
   10    them into a single source code, compilable in C++ mode.
   11    For input source files see sfklib.zip within sfk.zip.
   12 
   13    This library can be used free of charge in any project,
   14    based on the original library licenses, which are all
   15    BSD compatible. This means you may use them also in
   16    closed source commercial applications, but without
   17    any warranty.
   18 
   19    If errors occur on file compression, do not ask the original
   20    authors of zlib as they have nothing to do with SFKPack.
   21    Instead, download the original source codes
   22    of those libraries, then compile your project with these,
   23    and see if it works. If so, you may be better off with the
   24    original libraries. But if the error is produced just and
   25    only by SFKPack, and can be easily reproduced (by a sample
   26    data file) you may also submit a bug report to the
   27    Swiss File Knife project.
   28 */
   29 #ifdef _WIN32
   30  #include <windows.h>
   31  #include <direct.h>
   32 #else
   33  #include <sys/stat.h>
   34  #include <utime.h>
   35 #endif
   36 #include <stdlib.h>
   37 #include <stdio.h>
   38 #include <string.h>
   39 #include <setjmp.h>
   40 #include <math.h>
   41 #include <time.h>
   42 #include <errno.h>
   43 #define TBLS 8
   44 #define NO_DUMMY_DECL
   45 #ifdef _MSC_VER
   46  #ifndef _PTRDIFF_T_DEFINED
   47   #define _PTRDIFF_T_DEFINED
   48   typedef long ptrdiff_t;
   49  #endif
   50 #endif
   51 typedef unsigned int u4;
   52 #define DIST_CODE_LEN  512
   53 #define Z_BUFSIZE   (256*1024)
   54 #define UNZ_BUFSIZE (256*1024)
   55 #define NOCRYPT
   56 #define NOBYFOUR
   57 #ifdef _WIN32
   58 extern "C" {
   59    int _fseeki64(FILE *stream, __int64 offset, int origin);
   60    __int64 _ftelli64(FILE * _File);
   61 }
   62 #endif
   63 /*
   64 :file sfklib\zlib\zconf.h
   65 */
   66 /* zconf.h -- configuration of the zlib compression library
   67  * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
   68  * For conditions of distribution and use, see copyright notice in zlib.h
   69  */
   70 /* @(#) $Id$ */
   71 #ifndef ZCONF_H
   72 #define ZCONF_H
   73 /*
   74  * If you *really* need a unique prefix for all types and library functions,
   75  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
   76  * Even better than compiling with -DZ_PREFIX would be to use configure to set
   77  * that permanently in zconf.h using "./configure --zprefix".
   78  */
   79 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
   80 #  define Z_PREFIX_SET
   81 /* all linked symbols and init macros */
   82 #  define _dist_code            z__dist_code
   83 #  define _length_code          z__length_code
   84 #  define _tr_align             z__tr_align
   85 #  define _tr_flush_bits        z__tr_flush_bits
   86 #  define _tr_flush_block       z__tr_flush_block
   87 #  define _tr_init              z__tr_init
   88 #  define _tr_stored_block      z__tr_stored_block
   89 #  define _tr_tally             z__tr_tally
   90 #  define adler32               z_adler32
   91 #  define adler32_combine       z_adler32_combine
   92 #  define adler32_combine64     z_adler32_combine64
   93 #  define adler32_z             z_adler32_z
   94 #  ifndef Z_SOLO
   95 #    define compress              z_compress
   96 #    define compress2             z_compress2
   97 #    define compressBound         z_compressBound
   98 #  endif
   99 #  define crc32                 z_crc32
  100 #  define crc32_combine         z_crc32_combine
  101 #  define crc32_combine64       z_crc32_combine64
  102 #  define crc32_z               z_crc32_z
  103 #  define deflate               z_deflate
  104 #  define deflateBound          z_deflateBound
  105 #  define deflateCopy           z_deflateCopy
  106 #  define deflateEnd            z_deflateEnd
  107 #  define deflateGetDictionary  z_deflateGetDictionary
  108 #  define deflateInit           z_deflateInit
  109 #  define deflateInit2          z_deflateInit2
  110 #  define deflateInit2_         z_deflateInit2_
  111 #  define deflateInit_          z_deflateInit_
  112 #  define deflateParams         z_deflateParams
  113 #  define deflatePending        z_deflatePending
  114 #  define deflatePrime          z_deflatePrime
  115 #  define deflateReset          z_deflateReset
  116 #  define deflateResetKeep      z_deflateResetKeep
  117 #  define deflateSetDictionary  z_deflateSetDictionary
  118 #  define deflateSetHeader      z_deflateSetHeader
  119 #  define deflateTune           z_deflateTune
  120 #  define deflate_copyright     z_deflate_copyright
  121 #  define get_crc_table         z_get_crc_table
  122 #  ifndef Z_SOLO
  123 #    define gz_error              z_gz_error
  124 #    define gz_intmax             z_gz_intmax
  125 #    define gz_strwinerror        z_gz_strwinerror
  126 #    define gzbuffer              z_gzbuffer
  127 #    define gzclearerr            z_gzclearerr
  128 #    define gzclose               z_gzclose
  129 #    define gzclose_r             z_gzclose_r
  130 #    define gzclose_w             z_gzclose_w
  131 #    define gzdirect              z_gzdirect
  132 #    define gzdopen               z_gzdopen
  133 #    define gzeof                 z_gzeof
  134 #    define gzerror               z_gzerror
  135 #    define gzflush               z_gzflush
  136 #    define gzfread               z_gzfread
  137 #    define gzfwrite              z_gzfwrite
  138 #    define gzgetc                z_gzgetc
  139 #    define gzgetc_               z_gzgetc_
  140 #    define gzgets                z_gzgets
  141 #    define gzoffset              z_gzoffset
  142 #    define gzoffset64            z_gzoffset64
  143 #    define gzopen                z_gzopen
  144 #    define gzopen64              z_gzopen64
  145 #    ifdef _WIN32
  146 #      define gzopen_w              z_gzopen_w
  147 #    endif
  148 #    define gzprintf              z_gzprintf
  149 #    define gzputc                z_gzputc
  150 #    define gzputs                z_gzputs
  151 #    define gzread                z_gzread
  152 #    define gzrewind              z_gzrewind
  153 #    define gzseek                z_gzseek
  154 #    define gzseek64              z_gzseek64
  155 #    define gzsetparams           z_gzsetparams
  156 #    define gztell                z_gztell
  157 #    define gztell64              z_gztell64
  158 #    define gzungetc              z_gzungetc
  159 #    define gzvprintf             z_gzvprintf
  160 #    define gzwrite               z_gzwrite
  161 #  endif
  162 #  define inflate               z_inflate
  163 #  define inflateBack           z_inflateBack
  164 #  define inflateBackEnd        z_inflateBackEnd
  165 #  define inflateBackInit       z_inflateBackInit
  166 #  define inflateBackInit_      z_inflateBackInit_
  167 #  define inflateCodesUsed      z_inflateCodesUsed
  168 #  define inflateCopy           z_inflateCopy
  169 #  define inflateEnd            z_inflateEnd
  170 #  define inflateGetDictionary  z_inflateGetDictionary
  171 #  define inflateGetHeader      z_inflateGetHeader
  172 #  define inflateInit           z_inflateInit
  173 #  define inflateInit2          z_inflateInit2
  174 #  define inflateInit2_         z_inflateInit2_
  175 #  define inflateInit_          z_inflateInit_
  176 #  define inflateMark           z_inflateMark
  177 #  define inflatePrime          z_inflatePrime
  178 #  define inflateReset          z_inflateReset
  179 #  define inflateReset2         z_inflateReset2
  180 #  define inflateResetKeep      z_inflateResetKeep
  181 #  define inflateSetDictionary  z_inflateSetDictionary
  182 #  define inflateSync           z_inflateSync
  183 #  define inflateSyncPoint      z_inflateSyncPoint
  184 #  define inflateUndermine      z_inflateUndermine
  185 #  define inflateValidate       z_inflateValidate
  186 #  define inflate_copyright     z_inflate_copyright
  187 #  define inflate_fast          z_inflate_fast
  188 #  define inflate_table         z_inflate_table
  189 #  ifndef Z_SOLO
  190 #    define uncompress            z_uncompress
  191 #    define uncompress2           z_uncompress2
  192 #  endif
  193 #  define zError                z_zError
  194 #  ifndef Z_SOLO
  195 #    define zcalloc               z_zcalloc
  196 #    define zcfree                z_zcfree
  197 #  endif
  198 #  define zlibCompileFlags      z_zlibCompileFlags
  199 #  define zlibVersion           z_zlibVersion
  200 /* all zlib typedefs in zlib.h and zconf.h */
  201 #  define Byte                  z_Byte
  202 #  define Bytef                 z_Bytef
  203 #  define alloc_func            z_alloc_func
  204 #  define charf                 z_charf
  205 #  define free_func             z_free_func
  206 #  ifndef Z_SOLO
  207 #    define gzFile                z_gzFile
  208 #  endif
  209 #  define gz_header             z_gz_header
  210 #  define gz_headerp            z_gz_headerp
  211 #  define in_func               z_in_func
  212 #  define intf                  z_intf
  213 #  define out_func              z_out_func
  214 #  define uInt                  z_uInt
  215 #  define uIntf                 z_uIntf
  216 #  define uLong                 z_uLong
  217 #  define uLongf                z_uLongf
  218 #  define voidp                 z_voidp
  219 #  define voidpc                z_voidpc
  220 #  define voidpf                z_voidpf
  221 /* all zlib structs in zlib.h and zconf.h */
  222 #  define gz_header_s           z_gz_header_s
  223 #  define internal_state        z_internal_state
  224 #endif
  225 #if defined(__MSDOS__) && !defined(MSDOS)
  226 #  define MSDOS
  227 #endif
  228 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  229 #  define OS2
  230 #endif
  231 #if defined(_WINDOWS) && !defined(WINDOWS)
  232 #  define WINDOWS
  233 #endif
  234 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  235 #  ifndef WIN32
  236 #    define WIN32
  237 #  endif
  238 #endif
  239 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  240 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  241 #    ifndef SYS16BIT
  242 #      define SYS16BIT
  243 #    endif
  244 #  endif
  245 #endif
  246 /*
  247  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  248  * than 64k bytes at a time (needed on systems with 16-bit int).
  249  */
  250 #ifdef SYS16BIT
  251 #  define MAXSEG_64K
  252 #endif
  253 #ifdef MSDOS
  254 #  define UNALIGNED_OK
  255 #endif
  256 #ifdef __STDC_VERSION__
  257 #  ifndef STDC
  258 #    define STDC
  259 #  endif
  260 #  if __STDC_VERSION__ >= 199901L
  261 #    ifndef STDC99
  262 #      define STDC99
  263 #    endif
  264 #  endif
  265 #endif
  266 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  267 #  define STDC
  268 #endif
  269 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  270 #  define STDC
  271 #endif
  272 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  273 #  define STDC
  274 #endif
  275 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  276 #  define STDC
  277 #endif
  278 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
  279 #  define STDC
  280 #endif
  281 #ifndef STDC
  282 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  283 #    define const       /* note: need a more gentle solution here */
  284 #  endif
  285 #endif
  286 #if defined(ZLIB_CONST) && !defined(z_const)
  287 #  define z_const const
  288 #else
  289 #  define z_const
  290 #endif
  291 #ifdef Z_SOLO
  292    typedef unsigned long z_size_t;
  293 #else
  294 #  define z_longlong long long
  295 #  if defined(NO_SIZE_T)
  296      typedef unsigned NO_SIZE_T z_size_t;
  297 #  elif defined(STDC)
  298      typedef size_t z_size_t;
  299 #  else
  300      typedef unsigned long z_size_t;
  301 #  endif
  302 #  undef z_longlong
  303 #endif
  304 /* Maximum value for memLevel in deflateInit2 */
  305 #ifndef MAX_MEM_LEVEL
  306 #  ifdef MAXSEG_64K
  307 #    define MAX_MEM_LEVEL 8
  308 #  else
  309 #    define MAX_MEM_LEVEL 9
  310 #  endif
  311 #endif
  312 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  313  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  314  * created by gzip. (Files created by minigzip can still be extracted by
  315  * gzip.)
  316  */
  317 #ifndef MAX_WBITS
  318 #  define MAX_WBITS   15 /* 32K LZ77 window */
  319 #endif
  320 /* The memory requirements for deflate are (in bytes):
  321             (1 << (windowBits+2)) +  (1 << (memLevel+9))
  322  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
  323  plus a few kilobytes for small objects. For example, if you want to reduce
  324  the default memory requirements from 256K to 128K, compile with
  325      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  326  Of course that will generally degrade compression (there's no free lunch).
  327    The memory requirements for inflate are (in bytes) 1 << windowBits
  328  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
  329  for small objects.
  330 */
  331                         /* Type declarations */
  332 #ifndef OF /* function prototypes */
  333 #  ifdef STDC
  334 #    define OF(args)  args
  335 #  else
  336 #    define OF(args)  ()
  337 #  endif
  338 #endif
  339 #ifndef Z_ARG /* function prototypes for stdarg */
  340 #  if defined(STDC) || defined(Z_HAVE_STDARG_H)
  341 #    define Z_ARG(args)  args
  342 #  else
  343 #    define Z_ARG(args)  ()
  344 #  endif
  345 #endif
  346 /* The following definitions for FAR are needed only for MSDOS mixed
  347  * model programming (small or medium model with some far allocations).
  348  * This was tested only with MSC; for other MSDOS compilers you may have
  349  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
  350  * just define FAR to be empty.
  351  */
  352 #ifdef SYS16BIT
  353 #  if defined(M_I86SM) || defined(M_I86MM)
  354      /* MSC small or medium model */
  355 #    define SMALL_MEDIUM
  356 #    ifdef _MSC_VER
  357 #      define FAR _far
  358 #    else
  359 #      define FAR far
  360 #    endif
  361 #  endif
  362 #  if (defined(__SMALL__) || defined(__MEDIUM__))
  363      /* Turbo C small or medium model */
  364 #    define SMALL_MEDIUM
  365 #    ifdef __BORLANDC__
  366 #      define FAR _far
  367 #    else
  368 #      define FAR far
  369 #    endif
  370 #  endif
  371 #endif
  372 #if defined(WINDOWS) || defined(WIN32)
  373    /* If building or using zlib as a DLL, define ZLIB_DLL.
  374     * This is not mandatory, but it offers a little performance increase.
  375     */
  376 #  ifdef ZLIB_DLL
  377 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  378 #      ifdef ZLIB_INTERNAL
  379 #        define ZEXTERN extern __declspec(dllexport)
  380 #      else
  381 #        define ZEXTERN extern __declspec(dllimport)
  382 #      endif
  383 #    endif
  384 #  endif  /* ZLIB_DLL */
  385    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  386     * define ZLIB_WINAPI.
  387     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  388     */
  389 #  ifdef ZLIB_WINAPI
  390 #    ifdef FAR
  391 #      undef FAR
  392 #    endif
  393      /* No need for _export, use ZLIB.DEF instead. */
  394      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  395 #    define ZEXPORT WINAPI
  396 #    ifdef WIN32
  397 #      define ZEXPORTVA WINAPIV
  398 #    else
  399 #      define ZEXPORTVA FAR CDECL
  400 #    endif
  401 #  endif
  402 #endif
  403 #if defined (__BEOS__)
  404 #  ifdef ZLIB_DLL
  405 #    ifdef ZLIB_INTERNAL
  406 #      define ZEXPORT   __declspec(dllexport)
  407 #      define ZEXPORTVA __declspec(dllexport)
  408 #    else
  409 #      define ZEXPORT   __declspec(dllimport)
  410 #      define ZEXPORTVA __declspec(dllimport)
  411 #    endif
  412 #  endif
  413 #endif
  414 #ifndef ZEXTERN
  415 #  define ZEXTERN extern
  416 #endif
  417 #ifndef ZEXPORT
  418 #  define ZEXPORT
  419 #endif
  420 #ifndef ZEXPORTVA
  421 #  define ZEXPORTVA
  422 #endif
  423 #ifndef FAR
  424 #  define FAR
  425 #endif
  426 #if !defined(__MACTYPES__)
  427 typedef unsigned char  Byte;  /* 8 bits */
  428 #endif
  429 typedef unsigned int   uInt;  /* 16 bits or more */
  430 typedef unsigned long  uLong; /* 32 bits or more */
  431 #ifdef SMALL_MEDIUM
  432    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  433 #  define Bytef Byte FAR
  434 #else
  435    typedef Byte  FAR Bytef;
  436 #endif
  437 typedef char  FAR charf;
  438 typedef int   FAR intf;
  439 typedef uInt  FAR uIntf;
  440 typedef uLong FAR uLongf;
  441 #ifdef STDC
  442    typedef void const *voidpc;
  443    typedef void FAR   *voidpf;
  444    typedef void       *voidp;
  445 #else
  446    typedef Byte const *voidpc;
  447    typedef Byte FAR   *voidpf;
  448    typedef Byte       *voidp;
  449 #endif
  450 #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
  451 #  if (UINT_MAX == 0xffffffffUL)
  452 #    define Z_U4 unsigned
  453 #  elif (ULONG_MAX == 0xffffffffUL)
  454 #    define Z_U4 unsigned long
  455 #  elif (USHRT_MAX == 0xffffffffUL)
  456 #    define Z_U4 unsigned short
  457 #  endif
  458 #endif
  459 #ifdef Z_U4
  460    typedef Z_U4 z_crc_t;
  461 #else
  462    typedef unsigned long z_crc_t;
  463 #endif
  464 #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
  465 #  define Z_HAVE_UNISTD_H
  466 #endif
  467 #ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
  468 #  define Z_HAVE_STDARG_H
  469 #endif
  470 #ifdef STDC
  471 #  ifndef Z_SOLO
  472 #  endif
  473 #endif
  474 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
  475 #  ifndef Z_SOLO
  476 #  endif
  477 #endif
  478 #ifdef _WIN32
  479 #  ifndef Z_SOLO
  480 #  endif
  481 #endif
  482 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
  483  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
  484  * though the former does not conform to the LFS document), but considering
  485  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  486  * equivalently requesting no 64-bit operations
  487  */
  488 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
  489 #  undef _LARGEFILE64_SOURCE
  490 #endif
  491 #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
  492 #  define Z_HAVE_UNISTD_H
  493 #endif
  494 #ifndef Z_SOLO
  495 #  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
  496 #    ifdef VMS
  497 #    endif
  498 #    ifndef z_off_t
  499 #      define z_off_t off_t
  500 #    endif
  501 #  endif
  502 #endif
  503 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
  504 #  define Z_LFS64
  505 #endif
  506 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
  507 #  define Z_LARGE64
  508 #endif
  509 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
  510 #  define Z_WANT64
  511 #endif
  512 #if !defined(SEEK_SET) && !defined(Z_SOLO)
  513 #  define SEEK_SET        0       /* Seek from beginning of file.  */
  514 #  define SEEK_CUR        1       /* Seek from current position.  */
  515 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
  516 #endif
  517 #ifndef z_off_t
  518 #  define z_off_t long
  519 #endif
  520 #if !defined(_WIN32) && defined(Z_LARGE64)
  521 #  define z_off64_t off64_t
  522 #else
  523 #  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
  524 #    define z_off64_t __int64
  525 #  else
  526 #    define z_off64_t z_off_t
  527 #  endif
  528 #endif
  529 /* MVS linker does not support external names larger than 8 bytes */
  530 #if defined(__MVS__)
  531   #pragma map(deflateInit_,"DEIN")
  532   #pragma map(deflateInit2_,"DEIN2")
  533   #pragma map(deflateEnd,"DEEND")
  534   #pragma map(deflateBound,"DEBND")
  535   #pragma map(inflateInit_,"ININ")
  536   #pragma map(inflateInit2_,"ININ2")
  537   #pragma map(inflateEnd,"INEND")
  538   #pragma map(inflateSync,"INSY")
  539   #pragma map(inflateSetDictionary,"INSEDI")
  540   #pragma map(compressBound,"CMBND")
  541   #pragma map(inflate_table,"INTABL")
  542   #pragma map(inflate_fast,"INFA")
  543   #pragma map(inflate_copyright,"INCOPY")
  544 #endif
  545 #endif /* ZCONF_H */
  546 /*
  547 :file sfklib\zlib\zlib.h
  548 */
  549 /* zlib.h -- interface of the 'zlib' general purpose compression library
  550   version 1.2.11, January 15th, 2017
  551   Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
  552   This software is provided 'as-is', without any express or implied
  553   warranty.  In no event will the authors be held liable for any damages
  554   arising from the use of that software.
  555   Permission is granted to anyone to use that software for any purpose,
  556   including commercial applications, and to alter it and redistribute it
  557   freely, subject to the following restrictions:
  558   1. The origin of that software must not be misrepresented; you must not
  559      claim that you wrote the original software. If you use that software
  560      in a product, an acknowledgment in the product documentation would be
  561      appreciated but is not required.
  562   2. Altered source versions must be plainly marked as such, and must not be
  563      misrepresented as being the original software.
  564   3. This notice may not be removed or altered from any source distribution.
  565   Jean-loup Gailly        Mark Adler
  566   jloup@gzip.org          madler@alumni.caltech.edu
  567   The data format used by the zlib library is described by RFCs (Request for
  568   Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
  569   (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
  570 */
  571 #ifndef ZLIB_H
  572 #define ZLIB_H
  573 #ifdef __cplusplus
  574 extern "C" {
  575 #endif
  576 #define ZLIB_VERSION "1.2.11"
  577 #define ZLIB_VERNUM 0x12b0
  578 #define ZLIB_VER_MAJOR 1
  579 #define ZLIB_VER_MINOR 2
  580 #define ZLIB_VER_REVISION 11
  581 #define ZLIB_VER_SUBREVISION 0
  582 /*
  583     The 'zlib' compression library provides in-memory compression and
  584   decompression functions, including integrity checks of the uncompressed data.
  585   This version of the library supports only one compression method (deflation)
  586   but other algorithms will be added later and will have the same stream
  587   interface.
  588     Compression can be done in a single step if the buffers are large enough,
  589   or can be done by repeated calls of the compression function.  In the latter
  590   case, the application must provide more input and/or consume the output
  591   (providing more output space) before each call.
  592     The compressed data format used by default by the in-memory functions is
  593   the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
  594   around a deflate stream, which is itself documented in RFC 1951.
  595     The library also supports reading and writing files in gzip (.gz) format
  596   with an interface similar to that of stdio using the functions that start
  597   with "gz".  The gzip format is different from the zlib format.  gzip is a
  598   gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
  599     This library can optionally read and write gzip and raw deflate streams in
  600   memory as well.
  601     The zlib format was designed to be compact and fast for use in memory
  602   and on communications channels.  The gzip format was designed for single-
  603   file compression on file systems, has a larger header than zlib to maintain
  604   directory information, and uses a different, slower check method than zlib.
  605     The library does not install any signal handler.  The decoder checks
  606   the consistency of the compressed data, so the library should never crash
  607   even in the case of corrupted input.
  608 */
  609 typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
  610 typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
  611 struct internal_state;
  612 typedef struct z_stream_s {
  613     z_const Bytef *next_in;     /* next input byte */
  614     uInt     avail_in;  /* number of bytes available at next_in */
  615     uLong    total_in;  /* total number of input bytes read so far */
  616     Bytef    *next_out; /* next output byte will go here */
  617     uInt     avail_out; /* remaining free space at next_out */
  618     uLong    total_out; /* total number of bytes output so far */
  619     z_const char *msg;  /* last error message, NULL if no error */
  620     struct internal_state FAR *state; /* not visible by applications */
  621     alloc_func zalloc;  /* used to allocate the internal state */
  622     free_func  zfree;   /* used to free the internal state */
  623     voidpf     opaque;  /* private data object passed to zalloc and zfree */
  624     int     data_type;  /* best guess about the data type: binary or text
  625                            for deflate, or the decoding state for inflate */
  626     uLong   adler;      /* Adler-32 or CRC-32 value of the uncompressed data */
  627     uLong   reserved;   /* reserved for future use */
  628 } z_stream;
  629 typedef z_stream FAR *z_streamp;
  630 /*
  631      gzip header information passed to and from zlib routines.  See RFC 1952
  632   for more details on the meanings of these fields.
  633 */
  634 typedef struct gz_header_s {
  635     int     text;       /* true if compressed data believed to be text */
  636     uLong   time;       /* modification time */
  637     int     xflags;     /* extra flags (not used when writing a gzip file) */
  638     int     os;         /* operating system */
  639     Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
  640     uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
  641     uInt    extra_max;  /* space at extra (only when reading header) */
  642     Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
  643     uInt    name_max;   /* space at name (only when reading header) */
  644     Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
  645     uInt    comm_max;   /* space at comment (only when reading header) */
  646     int     hcrc;       /* true if there was or will be a header crc */
  647     int     done;       /* true when done reading gzip header (not used
  648                            when writing a gzip file) */
  649 } gz_header;
  650 typedef gz_header FAR *gz_headerp;
  651 /*
  652      The application must update next_in and avail_in when avail_in has dropped
  653    to zero.  It must update next_out and avail_out when avail_out has dropped
  654    to zero.  The application must initialize zalloc, zfree and opaque before
  655    calling the init function.  All other fields are set by the compression
  656    library and must not be updated by the application.
  657      The opaque value provided by the application will be passed as the first
  658    parameter for calls of zalloc and zfree.  This can be useful for custom
  659    memory management.  The compression library attaches no meaning to the
  660    opaque value.
  661      zalloc must return Z_NULL if there is not enough memory for the object.
  662    If zlib is used in a multi-threaded application, zalloc and zfree must be
  663    thread safe.  In that case, zlib is thread-safe.  When zalloc and zfree are
  664    Z_NULL on entry to the initialization function, they are set to internal
  665    routines that use the standard library functions malloc() and free().
  666      On 16-bit systems, the functions zalloc and zfree must be able to allocate
  667    exactly 65536 bytes, but will not be required to allocate more than that if
  668    the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
  669    returned by zalloc for objects of exactly 65536 bytes *must* have their
  670    offset normalized to zero.  The default allocation function provided by that
  671    library ensures that (see zutil.c).  To reduce memory requirements and avoid
  672    any allocation of 64K objects, at the expense of compression ratio, compile
  673    the library with -DMAX_WBITS=14 (see zconf.h).
  674      The fields total_in and total_out can be used for statistics or progress
  675    reports.  After compression, total_in holds the total size of the
  676    uncompressed data and may be saved for use by the decompressor (particularly
  677    if the decompressor wants to decompress everything in a single step).
  678 */
  679                         /* constants */
  680 #define Z_NO_FLUSH      0
  681 #define Z_PARTIAL_FLUSH 1
  682 #define Z_SYNC_FLUSH    2
  683 #define Z_FULL_FLUSH    3
  684 #define Z_FINISH        4
  685 #define Z_BLOCK         5
  686 #define Z_TREES         6
  687 /* Allowed flush values; see deflate() and inflate() below for details */
  688 #define Z_OK            0
  689 #define Z_STREAM_END    1
  690 #define Z_NEED_DICT     2
  691 #define Z_ERRNO        (-1)
  692 #define Z_STREAM_ERROR (-2)
  693 #define Z_DATA_ERROR   (-3)
  694 #define Z_MEM_ERROR    (-4)
  695 #define Z_BUF_ERROR    (-5)
  696 #define Z_VERSION_ERROR (-6)
  697 /* Return codes for the compression/decompression functions. Negative values
  698  * are errors, positive values are used for special but normal events.
  699  */
  700 #define Z_NO_COMPRESSION         0
  701 #define Z_BEST_SPEED             1
  702 #define Z_BEST_COMPRESSION       9
  703 #define Z_DEFAULT_COMPRESSION  (-1)
  704 /* compression levels */
  705 #define Z_FILTERED            1
  706 #define Z_HUFFMAN_ONLY        2
  707 #define Z_RLE                 3
  708 #define Z_FIXED               4
  709 #define Z_DEFAULT_STRATEGY    0
  710 /* compression strategy; see deflateInit2() below for details */
  711 #define Z_BINARY   0
  712 #define Z_TEXT     1
  713 #define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
  714 #define Z_UNKNOWN  2
  715 /* Possible values of the data_type field for deflate() */
  716 #define Z_DEFLATED   8
  717 /* The deflate compression method (the only one supported in that version) */
  718 #define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  719 #define zlib_version zlibVersion()
  720 /* for compatibility with versions < 1.0.2 */
  721                         /* basic functions */
  722 ZEXTERN const char * ZEXPORT zlibVersion OF((void));
  723 /* The application can compare zlibVersion and ZLIB_VERSION for consistency.
  724    If the first character differs, the library code actually used is not
  725    compatible with the zlib.h header file used by the application.  This check
  726    is automatically made by deflateInit and inflateInit.
  727  */
  728 /*
  729 ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
  730      Initializes the internal stream state for compression.  The fields
  731    zalloc, zfree and opaque must be initialized before by the caller.  If
  732    zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
  733    allocation functions.
  734      The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
  735    1 gives best speed, 9 gives best compression, 0 gives no compression at all
  736    (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
  737    requests a default compromise between speed and compression (currently
  738    equivalent to level 6).
  739      deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
  740    memory, Z_STREAM_ERROR if level is not a valid compression level, or
  741    Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
  742    with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
  743    if there is no error message.  deflateInit does not perform any compression:
  744    that will be done by deflate().
  745 */
  746 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
  747 /*
  748     deflate compresses as much data as possible, and stops when the input
  749   buffer becomes empty or the output buffer becomes full.  It may introduce
  750   some output latency (reading input without producing any output) except when
  751   forced to flush.
  752     The detailed semantics are as follows.  deflate performs one or both of the
  753   following actions:
  754   - Compress more input starting at next_in and update next_in and avail_in
  755     accordingly.  If not all input can be processed (because there is not
  756     enough room in the output buffer), next_in and avail_in are updated and
  757     processing will resume at that point for the next call of deflate().
  758   - Generate more output starting at next_out and update next_out and avail_out
  759     accordingly.  This action is forced if the parameter flush is non zero.
  760     Forcing flush frequently degrades the compression ratio, so that parameter
  761     should be set only when necessary.  Some output may be provided even if
  762     flush is zero.
  763     Before the call of deflate(), the application should ensure that at least
  764   one of the actions is possible, by providing more input and/or consuming more
  765   output, and updating avail_in or avail_out accordingly; avail_out should
  766   never be zero before the call.  The application can consume the compressed
  767   output when it wants, for example when the output buffer is full (avail_out
  768   == 0), or after each call of deflate().  If deflate returns Z_OK and with
  769   zero avail_out, it must be called again after making room in the output
  770   buffer because there might be more output pending. See deflatePending(),
  771   which can be used if desired to determine whether or not there is more ouput
  772   in that case.
  773     Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
  774   decide how much data to accumulate before producing output, in order to
  775   maximize compression.
  776     If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
  777   flushed to the output buffer and the output is aligned on a byte boundary, so
  778   that the decompressor can get all input data available so far.  (In
  779   particular avail_in is zero after the call if enough output space has been
  780   provided before the call.) Flushing may degrade compression for some
  781   compression algorithms and so it should be used only when necessary.  This
  782   completes the current deflate block and follows it with an empty stored block
  783   that is three bits plus filler bits to the next byte, followed by four bytes
  784   (00 00 ff ff).
  785     If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
  786   output buffer, but the output is not aligned to a byte boundary.  All of the
  787   input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
  788   This completes the current deflate block and follows it with an empty fixed
  789   codes block that is 10 bits long.  This assures that enough bytes are output
  790   in order for the decompressor to finish the block before the empty fixed
  791   codes block.
  792     If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
  793   for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
  794   seven bits of the current block are held to be written as the next byte after
  795   the next deflate block is completed.  In that case, the decompressor may not
  796   be provided enough bits at that point in order to complete decompression of
  797   the data provided so far to the compressor.  It may need to wait for the next
  798   block to be emitted.  This is for advanced applications that need to control
  799   the emission of deflate blocks.
  800     If flush is set to Z_FULL_FLUSH, all output is flushed as with
  801   Z_SYNC_FLUSH, and the compression state is reset so that decompression can
  802   restart from that point if previous compressed data has been damaged or if
  803   random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
  804   compression.
  805     If deflate returns with avail_out == 0, that function must be called again
  806   with the same value of the flush parameter and more output space (updated
  807   avail_out), until the flush is complete (deflate returns with non-zero
  808   avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
  809   avail_out is greater than six to avoid repeated flush markers due to
  810   avail_out == 0 on return.
  811     If the parameter flush is set to Z_FINISH, pending input is processed,
  812   pending output is flushed and deflate returns with Z_STREAM_END if there was
  813   enough output space.  If deflate returns with Z_OK or Z_BUF_ERROR, that
  814   function must be called again with Z_FINISH and more output space (updated
  815   avail_out) but no more input data, until it returns with Z_STREAM_END or an
  816   error.  After deflate has returned Z_STREAM_END, the only possible operations
  817   on the stream are deflateReset or deflateEnd.
  818     Z_FINISH can be used in the first deflate call after deflateInit if all the
  819   compression is to be done in a single step.  In order to complete in one
  820   call, avail_out must be at least the value returned by deflateBound (see
  821   below).  Then deflate is guaranteed to return Z_STREAM_END.  If not enough
  822   output space is provided, deflate will not return Z_STREAM_END, and it must
  823   be called again as described above.
  824     deflate() sets strm->adler to the Adler-32 checksum of all input read
  825   so far (that is, total_in bytes).  If a gzip stream is being generated, then
  826   strm->adler will be the CRC-32 checksum of the input read so far.  (See
  827   deflateInit2 below.)
  828     deflate() may update strm->data_type if it can make a good guess about
  829   the input data type (Z_BINARY or Z_TEXT).  If in doubt, the data is
  830   considered binary.  This field is only for information purposes and does not
  831   affect the compression algorithm in any manner.
  832     deflate() returns Z_OK if some progress has been made (more input
  833   processed or more output produced), Z_STREAM_END if all input has been
  834   consumed and all output has been produced (only when flush is set to
  835   Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
  836   if next_in or next_out was Z_NULL or the state was inadvertently written over
  837   by the application), or Z_BUF_ERROR if no progress is possible (for example
  838   avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not fatal, and
  839   deflate() can be called again with more input and more output space to
  840   continue compressing.
  841 */
  842 ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
  843 /*
  844      All dynamically allocated data structures for that stream are freed.
  845    This function discards any unprocessed input and does not flush any pending
  846    output.
  847      deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
  848    stream state was inconsistent, Z_DATA_ERROR if the stream was freed
  849    prematurely (some input or output was discarded).  In the error case, msg
  850    may be set but then points to a static string (which must not be
  851    deallocated).
  852 */
  853 /*
  854 ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
  855      Initializes the internal stream state for decompression.  The fields
  856    next_in, avail_in, zalloc, zfree and opaque must be initialized before by
  857    the caller.  In the current version of inflate, the provided input is not
  858    read or consumed.  The allocation of a sliding window will be deferred to
  859    the first call of inflate (if the decompression does not complete on the
  860    first call).  If zalloc and zfree are set to Z_NULL, inflateInit updates
  861    them to use default allocation functions.
  862      inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
  863    memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
  864    version assumed by the caller, or Z_STREAM_ERROR if the parameters are
  865    invalid, such as a null pointer to the structure.  msg is set to null if
  866    there is no error message.  inflateInit does not perform any decompression.
  867    Actual decompression will be done by inflate().  So next_in, and avail_in,
  868    next_out, and avail_out are unused and unchanged.  The current
  869    implementation of inflateInit() does not process any header information --
  870    that is deferred until inflate() is called.
  871 */
  872 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
  873 /*
  874     inflate decompresses as much data as possible, and stops when the input
  875   buffer becomes empty or the output buffer becomes full.  It may introduce
  876   some output latency (reading input without producing any output) except when
  877   forced to flush.
  878   The detailed semantics are as follows.  inflate performs one or both of the
  879   following actions:
  880   - Decompress more input starting at next_in and update next_in and avail_in
  881     accordingly.  If not all input can be processed (because there is not
  882     enough room in the output buffer), then next_in and avail_in are updated
  883     accordingly, and processing will resume at that point for the next call of
  884     inflate().
  885   - Generate more output starting at next_out and update next_out and avail_out
  886     accordingly.  inflate() provides as much output as possible, until there is
  887     no more input data or no more space in the output buffer (see below about
  888     the flush parameter).
  889     Before the call of inflate(), the application should ensure that at least
  890   one of the actions is possible, by providing more input and/or consuming more
  891   output, and updating the next_* and avail_* values accordingly.  If the
  892   caller of inflate() does not provide both available input and available
  893   output space, it is possible that there will be no progress made.  The
  894   application can consume the uncompressed output when it wants, for example
  895   when the output buffer is full (avail_out == 0), or after each call of
  896   inflate().  If inflate returns Z_OK and with zero avail_out, it must be
  897   called again after making room in the output buffer because there might be
  898   more output pending.
  899     The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
  900   Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
  901   output as possible to the output buffer.  Z_BLOCK requests that inflate()
  902   stop if and when it gets to the next deflate block boundary.  When decoding
  903   the zlib or gzip format, that will cause inflate() to return immediately
  904   after the header and before the first block.  When doing a raw inflate,
  905   inflate() will go ahead and process the first block, and will return when it
  906   gets to the end of that block, or when it runs out of data.
  907     The Z_BLOCK option assists in appending to or combining deflate streams.
  908   To assist in that, on return inflate() always sets strm->data_type to the
  909   number of unused bits in the last byte taken from strm->next_in, plus 64 if
  910   inflate() is currently decoding the last block in the deflate stream, plus
  911   128 if inflate() returned immediately after decoding an end-of-block code or
  912   decoding the complete header up to just before the first byte of the deflate
  913   stream.  The end-of-block will not be indicated until all of the uncompressed
  914   data from that block has been written to strm->next_out.  The number of
  915   unused bits may in general be greater than seven, except when bit 7 of
  916   data_type is set, in which case the number of unused bits will be less than
  917   eight.  data_type is set as noted here every time inflate() returns for all
  918   flush options, and so can be used to determine the amount of currently
  919   consumed input in bits.
  920     The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
  921   end of each deflate block header is reached, before any actual data in that
  922   block is decoded.  This allows the caller to determine the length of the
  923   deflate block header for later use in random access within a deflate block.
  924   256 is added to the value of strm->data_type when inflate() returns
  925   immediately after reaching the end of the deflate block header.
  926     inflate() should normally be called until it returns Z_STREAM_END or an
  927   error.  However if all decompression is to be performed in a single step (a
  928   single call of inflate), the parameter flush should be set to Z_FINISH.  In
  929   that case all pending input is processed and all pending output is flushed;
  930   avail_out must be large enough to hold all of the uncompressed data for the
  931   operation to complete.  (The size of the uncompressed data may have been
  932   saved by the compressor for that purpose.)  The use of Z_FINISH is not
  933   required to perform an inflation in one step.  However it may be used to
  934   inform inflate that a faster approach can be used for the single inflate()
  935   call.  Z_FINISH also informs inflate to not maintain a sliding window if the
  936   stream completes, which reduces inflate's memory footprint.  If the stream
  937   does not complete, either because not all of the stream is provided or not
  938   enough output space is provided, then a sliding window will be allocated and
  939   inflate() can be called again to continue the operation as if Z_NO_FLUSH had
  940   been used.
  941      In that implementation, inflate() always flushes as much output as
  942   possible to the output buffer, and always uses the faster approach on the
  943   first call.  So the effects of the flush parameter in that implementation are
  944   on the return value of inflate() as noted below, when inflate() returns early
  945   when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
  946   memory for a sliding window when Z_FINISH is used.
  947      If a preset dictionary is needed after that call (see inflateSetDictionary
  948   below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
  949   chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
  950   strm->adler to the Adler-32 checksum of all output produced so far (that is,
  951   total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
  952   below.  At the end of the stream, inflate() checks that its computed Adler-32
  953   checksum is equal to that saved by the compressor and returns Z_STREAM_END
  954   only if the checksum is correct.
  955     inflate() can decompress and check either zlib-wrapped or gzip-wrapped
  956   deflate data.  The header type is detected automatically, if requested when
  957   initializing with inflateInit2().  Any information contained in the gzip
  958   header is not retained unless inflateGetHeader() is used.  When processing
  959   gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
  960   produced so far.  The CRC-32 is checked against the gzip trailer, as is the
  961   uncompressed length, modulo 2^32.
  962     inflate() returns Z_OK if some progress has been made (more input processed
  963   or more output produced), Z_STREAM_END if the end of the compressed data has
  964   been reached and all uncompressed output has been produced, Z_NEED_DICT if a
  965   preset dictionary is needed at that point, Z_DATA_ERROR if the input data was
  966   corrupted (input stream not conforming to the zlib format or incorrect check
  967   value, in which case strm->msg points to a string with a more specific
  968   error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
  969   next_in or next_out was Z_NULL, or the state was inadvertently written over
  970   by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
  971   if no progress was possible or if there was not enough room in the output
  972   buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
  973   inflate() can be called again with more input and more output space to
  974   continue decompressing.  If Z_DATA_ERROR is returned, the application may
  975   then call inflateSync() to look for a good compression block if a partial
  976   recovery of the data is to be attempted.
  977 */
  978 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
  979 /*
  980      All dynamically allocated data structures for that stream are freed.
  981    This function discards any unprocessed input and does not flush any pending
  982    output.
  983      inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
  984    was inconsistent.
  985 */
  986                         /* Advanced functions */
  987 /*
  988     The following functions are needed only in some special applications.
  989 */
  990 /*
  991 ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
  992                                      int  level,
  993                                      int  method,
  994                                      int  windowBits,
  995                                      int  memLevel,
  996                                      int  strategy));
  997      This is another version of deflateInit with more compression options.  The
  998    fields next_in, zalloc, zfree and opaque must be initialized before by the
  999    caller.
 1000      The method parameter is the compression method.  It must be Z_DEFLATED in
 1001    that version of the library.
 1002      The windowBits parameter is the base two logarithm of the window size
 1003    (the size of the history buffer).  It should be in the range 8..15 for that
 1004    version of the library.  Larger values of that parameter result in better
 1005    compression at the expense of memory usage.  The default value is 15 if
 1006    deflateInit is used instead.
 1007      For the current implementation of deflate(), a windowBits value of 8 (a
 1008    window size of 256 bytes) is not supported.  As a result, a request for 8
 1009    will result in 9 (a 512-byte window).  In that case, providing 8 to
 1010    inflateInit2() will result in an error when the zlib header with 9 is
 1011    checked against the initialization of inflate().  The remedy is to not use 8
 1012    with deflateInit2() with that initialization, or at least in that case use 9
 1013    with inflateInit2().
 1014      windowBits can also be -8..-15 for raw deflate.  In that case, -windowBits
 1015    determines the window size.  deflate() will then generate raw deflate data
 1016    with no zlib header or trailer, and will not compute a check value.
 1017      windowBits can also be greater than 15 for optional gzip encoding.  Add
 1018    16 to windowBits to write a simple gzip header and trailer around the
 1019    compressed data instead of a zlib wrapper.  The gzip header will have no
 1020    file name, no extra data, no comment, no modification time (set to zero), no
 1021    header crc, and the operating system will be set to the appropriate value,
 1022    if the operating system was determined at compile time.  If a gzip stream is
 1023    being written, strm->adler is a CRC-32 instead of an Adler-32.
 1024      For raw deflate or gzip encoding, a request for a 256-byte window is
 1025    rejected as invalid, since only the zlib header provides a means of
 1026    transmitting the window size to the decompressor.
 1027      The memLevel parameter specifies how much memory should be allocated
 1028    for the internal compression state.  memLevel=1 uses minimum memory but is
 1029    slow and reduces compression ratio; memLevel=9 uses maximum memory for
 1030    optimal speed.  The default value is 8.  See zconf.h for total memory usage
 1031    as a function of windowBits and memLevel.
 1032      The strategy parameter is used to tune the compression algorithm.  Use the
 1033    value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
 1034    filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
 1035    string match), or Z_RLE to limit match distances to one (run-length
 1036    encoding).  Filtered data consists mostly of small values with a somewhat
 1037    random distribution.  In that case, the compression algorithm is tuned to
 1038    compress them better.  The effect of Z_FILTERED is to force more Huffman
 1039    coding and less string matching; it is somewhat intermediate between
 1040    Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
 1041    fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
 1042    strategy parameter only affects the compression ratio but not the
 1043    correctness of the compressed output even if it is not set appropriately.
 1044    Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
 1045    decoder for special applications.
 1046      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
 1047    memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
 1048    method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
 1049    incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
 1050    set to null if there is no error message.  deflateInit2 does not perform any
 1051    compression: that will be done by deflate().
 1052 */
 1053 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
 1054                                              const Bytef *dictionary,
 1055                                              uInt  dictLength));
 1056 /*
 1057      Initializes the compression dictionary from the given byte sequence
 1058    without producing any compressed output.  When using the zlib format, that
 1059    function must be called immediately after deflateInit, deflateInit2 or
 1060    deflateReset, and before any call of deflate.  When doing raw deflate, that
 1061    function must be called either before any call of deflate, or immediately
 1062    after the completion of a deflate block, i.e. after all input has been
 1063    consumed and all output has been delivered when using any of the flush
 1064    options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
 1065    compressor and decompressor must use exactly the same dictionary (see
 1066    inflateSetDictionary).
 1067      The dictionary should consist of strings (byte sequences) that are likely
 1068    to be encountered later in the data to be compressed, with the most commonly
 1069    used strings preferably put towards the end of the dictionary.  Using a
 1070    dictionary is most useful when the data to be compressed is short and can be
 1071    predicted with good accuracy; the data can then be compressed better than
 1072    with the default empty dictionary.
 1073      Depending on the size of the compression data structures selected by
 1074    deflateInit or deflateInit2, a part of the dictionary may in effect be
 1075    discarded, for example if the dictionary is larger than the window size
 1076    provided in deflateInit or deflateInit2.  Thus the strings most likely to be
 1077    useful should be put at the end of the dictionary, not at the front.  In
 1078    addition, the current implementation of deflate will use at most the window
 1079    size minus 262 bytes of the provided dictionary.
 1080      Upon return of that function, strm->adler is set to the Adler-32 value
 1081    of the dictionary; the decompressor may later use that value to determine
 1082    which dictionary has been used by the compressor.  (The Adler-32 value
 1083    applies to the whole dictionary even if only a subset of the dictionary is
 1084    actually used by the compressor.) If a raw deflate was requested, then the
 1085    Adler-32 value is not computed and strm->adler is not set.
 1086      deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
 1087    parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
 1088    inconsistent (for example if deflate has already been called for that stream
 1089    or if not at a block boundary for raw deflate).  deflateSetDictionary does
 1090    not perform any compression: that will be done by deflate().
 1091 */
 1092 ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
 1093                                              Bytef *dictionary,
 1094                                              uInt  *dictLength));
 1095 /*
 1096      Returns the sliding dictionary being maintained by deflate.  dictLength is
 1097    set to the number of bytes in the dictionary, and that many bytes are copied
 1098    to dictionary.  dictionary must have enough space, where 32768 bytes is
 1099    always enough.  If deflateGetDictionary() is called with dictionary equal to
 1100    Z_NULL, then only the dictionary length is returned, and nothing is copied.
 1101    Similary, if dictLength is Z_NULL, then it is not set.
 1102      deflateGetDictionary() may return a length less than the window size, even
 1103    when more than the window size in input has been provided. It may return up
 1104    to 258 bytes less in that case, due to how zlib's implementation of deflate
 1105    manages the sliding window and lookahead for matches, where matches can be
 1106    up to 258 bytes long. If the application needs the last window-size bytes of
 1107    input, then that would need to be saved by the application outside of zlib.
 1108      deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
 1109    stream state is inconsistent.
 1110 */
 1111 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
 1112                                     z_streamp source));
 1113 /*
 1114      Sets the destination stream as a complete copy of the source stream.
 1115      This function can be useful when several compression strategies will be
 1116    tried, for example when there are several ways of pre-processing the input
 1117    data with a filter.  The streams that will be discarded should then be freed
 1118    by calling deflateEnd.  Note that deflateCopy duplicates the internal
 1119    compression state which can be quite large, so that strategy is slow and can
 1120    consume lots of memory.
 1121      deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
 1122    enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
 1123    (such as zalloc being Z_NULL).  msg is left unchanged in both source and
 1124    destination.
 1125 */
 1126 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
 1127 /*
 1128      This function is equivalent to deflateEnd followed by deflateInit, but
 1129    does not free and reallocate the internal compression state.  The stream
 1130    will leave the compression level and any other attributes that may have been
 1131    set unchanged.
 1132      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
 1133    stream state was inconsistent (such as zalloc or state being Z_NULL).
 1134 */
 1135 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
 1136                                       int level,
 1137                                       int strategy));
 1138 /*
 1139      Dynamically update the compression level and compression strategy.  The
 1140    interpretation of level and strategy is as in deflateInit2().  This can be
 1141    used to switch between compression and straight copy of the input data, or
 1142    to switch to a different kind of input data requiring a different strategy.
 1143    If the compression approach (which is a function of the level) or the
 1144    strategy is changed, and if any input has been consumed in a previous
 1145    deflate() call, then the input available so far is compressed with the old
 1146    level and strategy using deflate(strm, Z_BLOCK).  There are three approaches
 1147    for the compression levels 0, 1..3, and 4..9 respectively.  The new level
 1148    and strategy will take effect at the next call of deflate().
 1149      If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
 1150    not have enough output space to complete, then the parameter change will not
 1151    take effect.  In that case, deflateParams() can be called again with the
 1152    same parameters and more output space to try again.
 1153      In order to assure a change in the parameters on the first try, the
 1154    deflate stream should be flushed using deflate() with Z_BLOCK or other flush
 1155    request until strm.avail_out is not zero, before calling deflateParams().
 1156    Then no more input data should be provided before the deflateParams() call.
 1157    If that is done, the old level and strategy will be applied to the data
 1158    compressed before deflateParams(), and the new level and strategy will be
 1159    applied to the the data compressed after deflateParams().
 1160      deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
 1161    state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
 1162    there was not enough output space to complete the compression of the
 1163    available input data before a change in the strategy or approach.  Note that
 1164    in the case of a Z_BUF_ERROR, the parameters are not changed.  A return
 1165    value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
 1166    retried with more output space.
 1167 */
 1168 ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
 1169                                     int good_length,
 1170                                     int max_lazy,
 1171                                     int nice_length,
 1172                                     int max_chain));
 1173 /*
 1174      Fine tune deflate's internal compression parameters.  This should only be
 1175    used by someone who understands the algorithm used by zlib's deflate for
 1176    searching for the best matching string, and even then only by the most
 1177    fanatic optimizer trying to squeeze out the last compressed bit for their
 1178    specific input data.  Read the deflate.c source code for the meaning of the
 1179    max_lazy, good_length, nice_length, and max_chain parameters.
 1180      deflateTune() can be called after deflateInit() or deflateInit2(), and
 1181    returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
 1182  */
 1183 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
 1184                                        uLong sourceLen));
 1185 /*
 1186      deflateBound() returns an upper bound on the compressed size after
 1187    deflation of sourceLen bytes.  It must be called after deflateInit() or
 1188    deflateInit2(), and after deflateSetHeader(), if used.  This would be used
 1189    to allocate an output buffer for deflation in a single pass, and so would be
 1190    called before deflate().  If that first deflate() call is provided the
 1191    sourceLen input bytes, an output buffer allocated to the size returned by
 1192    deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
 1193    to return Z_STREAM_END.  Note that it is possible for the compressed size to
 1194    be larger than the value returned by deflateBound() if flush options other
 1195    than Z_FINISH or Z_NO_FLUSH are used.
 1196 */
 1197 ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
 1198                                        unsigned *pending,
 1199                                        int *bits));
 1200 /*
 1201      deflatePending() returns the number of bytes and bits of output that have
 1202    been generated, but not yet provided in the available output.  The bytes not
 1203    provided would be due to the available output space having being consumed.
 1204    The number of bits of output not provided are between 0 and 7, where they
 1205    await more bits to join them in order to fill out a full byte.  If pending
 1206    or bits are Z_NULL, then those values are not set.
 1207      deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
 1208    stream state was inconsistent.
 1209  */
 1210 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
 1211                                      int bits,
 1212                                      int value));
 1213 /*
 1214      deflatePrime() inserts bits in the deflate output stream.  The intent
 1215    is that that function is used to start off the deflate output with the bits
 1216    leftover from a previous deflate stream when appending to it.  As such, that
 1217    function can only be used for raw deflate, and must be used before the first
 1218    deflate() call after a deflateInit2() or deflateReset().  bits must be less
 1219    than or equal to 16, and that many of the least significant bits of value
 1220    will be inserted in the output.
 1221      deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
 1222    room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
 1223    source stream state was inconsistent.
 1224 */
 1225 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
 1226                                          gz_headerp head));
 1227 /*
 1228      deflateSetHeader() provides gzip header information for when a gzip
 1229    stream is requested by deflateInit2().  deflateSetHeader() may be called
 1230    after deflateInit2() or deflateReset() and before the first call of
 1231    deflate().  The text, time, os, extra field, name, and comment information
 1232    in the provided gz_header structure are written to the gzip header (xflag is
 1233    ignored -- the extra flags are set according to the compression level).  The
 1234    caller must assure that, if not Z_NULL, name and comment are terminated with
 1235    a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
 1236    available there.  If hcrc is true, a gzip header crc is included.  Note that
 1237    the current versions of the command-line version of gzip (up through version
 1238    1.3.x) do not support header crc's, and will report that it is a "multi-part
 1239    gzip file" and give up.
 1240      If deflateSetHeader is not used, the default gzip header has text false,
 1241    the time set to zero, and os set to 255, with no extra, name, or comment
 1242    fields.  The gzip header is returned to the default state by deflateReset().
 1243      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
 1244    stream state was inconsistent.
 1245 */
 1246 /*
 1247 ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
 1248                                      int  windowBits));
 1249      This is another version of inflateInit with an extra parameter.  The
 1250    fields next_in, avail_in, zalloc, zfree and opaque must be initialized
 1251    before by the caller.
 1252      The windowBits parameter is the base two logarithm of the maximum window
 1253    size (the size of the history buffer).  It should be in the range 8..15 for
 1254    that version of the library.  The default value is 15 if inflateInit is used
 1255    instead.  windowBits must be greater than or equal to the windowBits value
 1256    provided to deflateInit2() while compressing, or it must be equal to 15 if
 1257    deflateInit2() was not used.  If a compressed stream with a larger window
 1258    size is given as input, inflate() will return with the error code
 1259    Z_DATA_ERROR instead of trying to allocate a larger window.
 1260      windowBits can also be zero to request that inflate use the window size in
 1261    the zlib header of the compressed stream.
 1262      windowBits can also be -8..-15 for raw inflate.  In that case, -windowBits
 1263    determines the window size.  inflate() will then process raw deflate data,
 1264    not looking for a zlib or gzip header, not generating a check value, and not
 1265    looking for any check values for comparison at the end of the stream.  This
 1266    is for use with other formats that use the deflate compressed data format
 1267    such as zip.  Those formats provide their own check values.  If a custom
 1268    format is developed using the raw deflate format for compressed data, it is
 1269    recommended that a check value such as an Adler-32 or a CRC-32 be applied to
 1270    the uncompressed data as is done in the zlib, gzip, and zip formats.  For
 1271    most applications, the zlib format should be used as is.  Note that comments
 1272    above on the use in deflateInit2() applies to the magnitude of windowBits.
 1273      windowBits can also be greater than 15 for optional gzip decoding.  Add
 1274    32 to windowBits to enable zlib and gzip decoding with automatic header
 1275    detection, or add 16 to decode only the gzip format (the zlib format will
 1276    return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
 1277    CRC-32 instead of an Adler-32.  Unlike the gunzip utility and gzread() (see
 1278    below), inflate() will not automatically decode concatenated gzip streams.
 1279    inflate() will return Z_STREAM_END at the end of the gzip stream.  The state
 1280    would need to be reset to continue decoding a subsequent gzip stream.
 1281      inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
 1282    memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
 1283    version assumed by the caller, or Z_STREAM_ERROR if the parameters are
 1284    invalid, such as a null pointer to the structure.  msg is set to null if
 1285    there is no error message.  inflateInit2 does not perform any decompression
 1286    apart from possibly reading the zlib header if present: actual decompression
 1287    will be done by inflate().  (So next_in and avail_in may be modified, but
 1288    next_out and avail_out are unused and unchanged.) The current implementation
 1289    of inflateInit2() does not process any header information -- that is
 1290    deferred until inflate() is called.
 1291 */
 1292 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
 1293                                              const Bytef *dictionary,
 1294                                              uInt  dictLength));
 1295 /*
 1296      Initializes the decompression dictionary from the given uncompressed byte
 1297    sequence.  This function must be called immediately after a call of inflate,
 1298    if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
 1299    can be determined from the Adler-32 value returned by that call of inflate.
 1300    The compressor and decompressor must use exactly the same dictionary (see
 1301    deflateSetDictionary).  For raw inflate, that function can be called at any
 1302    time to set the dictionary.  If the provided dictionary is smaller than the
 1303    window and there is already data in the window, then the provided dictionary
 1304    will amend what's there.  The application must insure that the dictionary
 1305    that was used for compression is provided.
 1306      inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
 1307    parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
 1308    inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
 1309    expected one (incorrect Adler-32 value).  inflateSetDictionary does not
 1310    perform any decompression: that will be done by subsequent calls of
 1311    inflate().
 1312 */
 1313 ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
 1314                                              Bytef *dictionary,
 1315                                              uInt  *dictLength));
 1316 /*
 1317      Returns the sliding dictionary being maintained by inflate.  dictLength is
 1318    set to the number of bytes in the dictionary, and that many bytes are copied
 1319    to dictionary.  dictionary must have enough space, where 32768 bytes is
 1320    always enough.  If inflateGetDictionary() is called with dictionary equal to
 1321    Z_NULL, then only the dictionary length is returned, and nothing is copied.
 1322    Similary, if dictLength is Z_NULL, then it is not set.
 1323      inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
 1324    stream state is inconsistent.
 1325 */
 1326 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
 1327 /*
 1328      Skips invalid compressed data until a possible full flush point (see above
 1329    for the description of deflate with Z_FULL_FLUSH) can be found, or until all
 1330    available input is skipped.  No output is provided.
 1331      inflateSync searches for a 00 00 FF FF pattern in the compressed data.
 1332    All full flush points have that pattern, but not all occurrences of that
 1333    pattern are full flush points.
 1334      inflateSync returns Z_OK if a possible full flush point has been found,
 1335    Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
 1336    has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
 1337    In the success case, the application may save the current current value of
 1338    total_in which indicates where valid compressed data was found.  In the
 1339    error case, the application may repeatedly call inflateSync, providing more
 1340    input each time, until success or end of the input data.
 1341 */
 1342 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
 1343                                     z_streamp source));
 1344 /*
 1345      Sets the destination stream as a complete copy of the source stream.
 1346      This function can be useful when randomly accessing a large stream.  The
 1347    first pass through the stream can periodically record the inflate state,
 1348    allowing restarting inflate at those points when randomly accessing the
 1349    stream.
 1350      inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
 1351    enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
 1352    (such as zalloc being Z_NULL).  msg is left unchanged in both source and
 1353    destination.
 1354 */
 1355 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
 1356 /*
 1357      This function is equivalent to inflateEnd followed by inflateInit,
 1358    but does not free and reallocate the internal decompression state.  The
 1359    stream will keep attributes that may have been set by inflateInit2.
 1360      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
 1361    stream state was inconsistent (such as zalloc or state being Z_NULL).
 1362 */
 1363 ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
 1364                                       int windowBits));
 1365 /*
 1366      This function is the same as inflateReset, but it also permits changing
 1367    the wrap and window size requests.  The windowBits parameter is interpreted
 1368    the same as it is for inflateInit2.  If the window size is changed, then the
 1369    memory allocated for the window is freed, and the window will be reallocated
 1370    by inflate() if needed.
 1371      inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
 1372    stream state was inconsistent (such as zalloc or state being Z_NULL), or if
 1373    the windowBits parameter is invalid.
 1374 */
 1375 ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
 1376                                      int bits,
 1377                                      int value));
 1378 /*
 1379      This function inserts bits in the inflate input stream.  The intent is
 1380    that that function is used to start inflating at a bit position in the
 1381    middle of a byte.  The provided bits will be used before any bytes are used
 1382    from next_in.  This function should only be used with raw inflate, and
 1383    should be used before the first inflate() call after inflateInit2() or
 1384    inflateReset().  bits must be less than or equal to 16, and that many of the
 1385    least significant bits of value will be inserted in the input.
 1386      If bits is negative, then the input stream bit buffer is emptied.  Then
 1387    inflatePrime() can be called again to put bits in the buffer.  This is used
 1388    to clear out bits leftover after feeding inflate a block description prior
 1389    to feeding inflate codes.
 1390      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
 1391    stream state was inconsistent.
 1392 */
 1393 ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
 1394 /*
 1395      This function returns two values, one in the lower 16 bits of the return
 1396    value, and the other in the remaining upper bits, obtained by shifting the
 1397    return value down 16 bits.  If the upper value is -1 and the lower value is
 1398    zero, then inflate() is currently decoding information outside of a block.
 1399    If the upper value is -1 and the lower value is non-zero, then inflate is in
 1400    the middle of a stored block, with the lower value equaling the number of
 1401    bytes from the input remaining to copy.  If the upper value is not -1, then
 1402    it is the number of bits back from the current bit position in the input of
 1403    the code (literal or length/distance pair) currently being processed.  In
 1404    that case the lower value is the number of bytes already emitted for that
 1405    code.
 1406      A code is being processed if inflate is waiting for more input to complete
 1407    decoding of the code, or if it has completed decoding but is waiting for
 1408    more output space to write the literal or match data.
 1409      inflateMark() is used to mark locations in the input data for random
 1410    access, which may be at bit positions, and to note those cases where the
 1411    output of a code may span boundaries of random access blocks.  The current
 1412    location in the input stream can be determined from avail_in and data_type
 1413    as noted in the description for the Z_BLOCK flush parameter for inflate.
 1414      inflateMark returns the value noted above, or -65536 if the provided
 1415    source stream state was inconsistent.
 1416 */
 1417 ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
 1418                                          gz_headerp head));
 1419 /*
 1420      inflateGetHeader() requests that gzip header information be stored in the
 1421    provided gz_header structure.  inflateGetHeader() may be called after
 1422    inflateInit2() or inflateReset(), and before the first call of inflate().
 1423    As inflate() processes the gzip stream, head->done is zero until the header
 1424    is completed, at which time head->done is set to one.  If a zlib stream is
 1425    being decoded, then head->done is set to -1 to indicate that there will be
 1426    no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
 1427    used to force inflate() to return immediately after header processing is
 1428    complete and before any actual data is decompressed.
 1429      The text, time, xflags, and os fields are filled in with the gzip header
 1430    contents.  hcrc is set to true if there is a header CRC.  (The header CRC
 1431    was valid if done is set to one.) If extra is not Z_NULL, then extra_max
 1432    contains the maximum number of bytes to write to extra.  Once done is true,
 1433    extra_len contains the actual extra field length, and extra contains the
 1434    extra field, or that field truncated if extra_max is less than extra_len.
 1435    If name is not Z_NULL, then up to name_max characters are written there,
 1436    terminated with a zero unless the length is greater than name_max.  If
 1437    comment is not Z_NULL, then up to comm_max characters are written there,
 1438    terminated with a zero unless the length is greater than comm_max.  When any
 1439    of extra, name, or comment are not Z_NULL and the respective field is not
 1440    present in the header, then that field is set to Z_NULL to signal its
 1441    absence.  This allows the use of deflateSetHeader() with the returned
 1442    structure to duplicate the header.  However if those fields are set to
 1443    allocated memory, then the application will need to save those pointers
 1444    elsewhere so that they can be eventually freed.
 1445      If inflateGetHeader is not used, then the header information is simply
 1446    discarded.  The header is always checked for validity, including the header
 1447    CRC if present.  inflateReset() will reset the process to discard the header
 1448    information.  The application would need to call inflateGetHeader() again to
 1449    retrieve the header from the next gzip stream.
 1450      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
 1451    stream state was inconsistent.
 1452 */
 1453 /*
 1454 ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
 1455                                         unsigned char FAR *window));
 1456      Initialize the internal stream state for decompression using inflateBack()
 1457    calls.  The fields zalloc, zfree and opaque in strm must be initialized
 1458    before the call.  If zalloc and zfree are Z_NULL, then the default library-
 1459    derived memory allocation routines are used.  windowBits is the base two
 1460    logarithm of the window size, in the range 8..15.  window is a caller
 1461    supplied buffer of that size.  Except for special applications where it is
 1462    assured that deflate was used with small window sizes, windowBits must be 15
 1463    and a 32K byte window must be supplied to be able to decompress general
 1464    deflate streams.
 1465      See inflateBack() for the usage of these routines.
 1466      inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
 1467    the parameters are invalid, Z_MEM_ERROR if the internal state could not be
 1468    allocated, or Z_VERSION_ERROR if the version of the library does not match
 1469    the version of the header file.
 1470 */
 1471 typedef unsigned (*in_func) OF((void FAR *,
 1472                                 z_const unsigned char FAR * FAR *));
 1473 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
 1474 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
 1475                                     in_func in, void FAR *in_desc,
 1476                                     out_func out, void FAR *out_desc));
 1477 /*
 1478      inflateBack() does a raw inflate with a single call using a call-back
 1479    interface for input and output.  This is potentially more efficient than
 1480    inflate() for file i/o applications, in that it avoids copying between the
 1481    output and the sliding window by simply making the window itself the output
 1482    buffer.  inflate() can be faster on modern CPUs when used with large
 1483    buffers.  inflateBack() trusts the application to not change the output
 1484    buffer passed by the output function, at least until inflateBack() returns.
 1485      inflateBackInit() must be called first to allocate the internal state
 1486    and to initialize the state with the user-provided window buffer.
 1487    inflateBack() may then be used multiple times to inflate a complete, raw
 1488    deflate stream with each call.  inflateBackEnd() is then called to free the
 1489    allocated state.
 1490      A raw deflate stream is one with no zlib or gzip header or trailer.
 1491    This routine would normally be used in a utility that reads zip or gzip
 1492    files and writes out uncompressed files.  The utility would decode the
 1493    header and process the trailer on its own, hence that routine expects only
 1494    the raw deflate stream to decompress.  This is different from the default
 1495    behavior of inflate(), which expects a zlib header and trailer around the
 1496    deflate stream.
 1497      inflateBack() uses two subroutines supplied by the caller that are then
 1498    called by inflateBack() for input and output.  inflateBack() calls those
 1499    routines until it reads a complete deflate stream and writes out all of the
 1500    uncompressed data, or until it encounters an error.  The function's
 1501    parameters and return types are defined above in the in_func and out_func
 1502    typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
 1503    number of bytes of provided input, and a pointer to that input in buf.  If
 1504    there is no input available, in() must return zero -- buf is ignored in that
 1505    case -- and inflateBack() will return a buffer error.  inflateBack() will
 1506    call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
 1507    out() should return zero on success, or non-zero on failure.  If out()
 1508    returns non-zero, inflateBack() will return with an error.  Neither in() nor
 1509    out() are permitted to change the contents of the window provided to
 1510    inflateBackInit(), which is also the buffer that out() uses to write from.
 1511    The length written by out() will be at most the window size.  Any non-zero
 1512    amount of input may be provided by in().
 1513      For convenience, inflateBack() can be provided input on the first call by
 1514    setting strm->next_in and strm->avail_in.  If that input is exhausted, then
 1515    in() will be called.  Therefore strm->next_in must be initialized before
 1516    calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
 1517    immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
 1518    must also be initialized, and then if strm->avail_in is not zero, input will
 1519    initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
 1520      The in_desc and out_desc parameters of inflateBack() is passed as the
 1521    first parameter of in() and out() respectively when they are called.  These
 1522    descriptors can be optionally used to pass any information that the caller-
 1523    supplied in() and out() functions need to do their job.
 1524      On return, inflateBack() will set strm->next_in and strm->avail_in to
 1525    pass back any unused input that was provided by the last in() call.  The
 1526    return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
 1527    if in() or out() returned an error, Z_DATA_ERROR if there was a format error
 1528    in the deflate stream (in which case strm->msg is set to indicate the nature
 1529    of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
 1530    In the case of Z_BUF_ERROR, an input or output error can be distinguished
 1531    using strm->next_in which will be Z_NULL only if in() returned an error.  If
 1532    strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
 1533    non-zero.  (in() will always be called before out(), so strm->next_in is
 1534    assured to be defined if out() returns non-zero.)  Note that inflateBack()
 1535    cannot return Z_OK.
 1536 */
 1537 ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
 1538 /*
 1539      All memory allocated by inflateBackInit() is freed.
 1540      inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
 1541    state was inconsistent.
 1542 */
 1543 ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
 1544 /* Return flags indicating compile-time options.
 1545     Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
 1546      1.0: size of uInt
 1547      3.2: size of uLong
 1548      5.4: size of voidpf (pointer)
 1549      7.6: size of z_off_t
 1550     Compiler, assembler, and debug options:
 1551      8: ZLIB_DEBUG
 1552      9: ASMV or ASMINF -- use ASM code
 1553      10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
 1554      11: 0 (reserved)
 1555     One-time table building (smaller code, but not thread-safe if true):
 1556      12: BUILDFIXED -- build static block decoding tables when needed
 1557      13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
 1558      14,15: 0 (reserved)
 1559     Library content (indicates missing functionality):
 1560      16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
 1561                           deflate code when not needed)
 1562      17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
 1563                     and decode gzip streams (to avoid linking crc code)
 1564      18-19: 0 (reserved)
 1565     Operation variations (changes in library functionality):
 1566      20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
 1567      21: FASTEST -- deflate algorithm with only one, lowest compression level
 1568      22,23: 0 (reserved)
 1569     The sprintf variant used by gzprintf (zero is best):
 1570      24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
 1571      25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
 1572      26: 0 = returns value, 1 = void -- 1 means inferred string length returned
 1573     Remainder:
 1574      27-31: 0 (reserved)
 1575  */
 1576 #ifndef Z_SOLO
 1577                         /* utility functions */
 1578 /*
 1579      The following utility functions are implemented on top of the basic
 1580    stream-oriented functions.  To simplify the interface, some default options
 1581    are assumed (compression level and memory usage, standard memory allocation
 1582    functions).  The source code of these utility functions can be modified if
 1583    you need special options.
 1584 */
 1585 ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
 1586                                  const Bytef *source, uLong sourceLen));
 1587 /*
 1588      Compresses the source buffer into the destination buffer.  sourceLen is
 1589    the byte length of the source buffer.  Upon entry, destLen is the total size
 1590    of the destination buffer, which must be at least the value returned by
 1591    compressBound(sourceLen).  Upon exit, destLen is the actual size of the
 1592    compressed data.  compress() is equivalent to compress2() with a level
 1593    parameter of Z_DEFAULT_COMPRESSION.
 1594      compress returns Z_OK if success, Z_MEM_ERROR if there was not
 1595    enough memory, Z_BUF_ERROR if there was not enough room in the output
 1596    buffer.
 1597 */
 1598 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
 1599                                   const Bytef *source, uLong sourceLen,
 1600                                   int level));
 1601 /*
 1602      Compresses the source buffer into the destination buffer.  The level
 1603    parameter has the same meaning as in deflateInit.  sourceLen is the byte
 1604    length of the source buffer.  Upon entry, destLen is the total size of the
 1605    destination buffer, which must be at least the value returned by
 1606    compressBound(sourceLen).  Upon exit, destLen is the actual size of the
 1607    compressed data.
 1608      compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
 1609    memory, Z_BUF_ERROR if there was not enough room in the output buffer,
 1610    Z_STREAM_ERROR if the level parameter is invalid.
 1611 */
 1612 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
 1613 /*
 1614      compressBound() returns an upper bound on the compressed size after
 1615    compress() or compress2() on sourceLen bytes.  It would be used before a
 1616    compress() or compress2() call to allocate the destination buffer.
 1617 */
 1618 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
 1619                                    const Bytef *source, uLong sourceLen));
 1620 /*
 1621      Decompresses the source buffer into the destination buffer.  sourceLen is
 1622    the byte length of the source buffer.  Upon entry, destLen is the total size
 1623    of the destination buffer, which must be large enough to hold the entire
 1624    uncompressed data.  (The size of the uncompressed data must have been saved
 1625    previously by the compressor and transmitted to the decompressor by some
 1626    mechanism outside the scope of that compression library.) Upon exit, destLen
 1627    is the actual size of the uncompressed data.
 1628      uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
 1629    enough memory, Z_BUF_ERROR if there was not enough room in the output
 1630    buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
 1631    the case where there is not enough room, uncompress() will fill the output
 1632    buffer with the uncompressed data up to that point.
 1633 */
 1634 ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest,   uLongf *destLen,
 1635                                     const Bytef *source, uLong *sourceLen));
 1636 /*
 1637      Same as uncompress, except that sourceLen is a pointer, where the
 1638    length of the source is *sourceLen.  On return, *sourceLen is the number of
 1639    source bytes consumed.
 1640 */
 1641                         /* gzip file access functions */
 1642 /*
 1643      This library supports reading and writing files in gzip (.gz) format with
 1644    an interface similar to that of stdio, using the functions that start with
 1645    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
 1646    wrapper, documented in RFC 1952, wrapped around a deflate stream.
 1647 */
 1648 typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
 1649 /*
 1650 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
 1651      Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
 1652    in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
 1653    a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
 1654    compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
 1655    for fixed code compression as in "wb9F".  (See the description of
 1656    deflateInit2 for more information about the strategy parameter.)  'T' will
 1657    request transparent writing or appending with no compression and not using
 1658    the gzip format.
 1659      "a" can be used instead of "w" to request that the gzip stream that will
 1660    be written be appended to the file.  "+" will result in an error, since
 1661    reading and writing to the same gzip file is not supported.  The addition of
 1662    "x" when writing will create the file exclusively, which fails if the file
 1663    already exists.  On systems that support it, the addition of "e" when
 1664    reading or writing will set the flag to close the file on an execve() call.
 1665      These functions, as well as gzip, will read and decode a sequence of gzip
 1666    streams in a file.  The append function of gzopen() can be used to create
 1667    such a file.  (Also see gzflush() for another way to do that.)  When
 1668    appending, gzopen does not test whether the file begins with a gzip stream,
 1669    nor does it look for the end of the gzip streams to begin appending.  gzopen
 1670    will simply append a gzip stream to the existing file.
 1671      gzopen can be used to read a file which is not in gzip format; in that
 1672    case gzread will directly read from the file without decompression.  When
 1673    reading, that will be detected automatically by looking for the magic two-
 1674    byte gzip header.
 1675      gzopen returns NULL if the file could not be opened, if there was
 1676    insufficient memory to allocate the gzFile state, or if an invalid mode was
 1677    specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
 1678    errno can be checked to determine if the reason gzopen failed was that the
 1679    file could not be opened.
 1680 */
 1681 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
 1682 /*
 1683      gzdopen associates a gzFile with the file descriptor fd.  File descriptors
 1684    are obtained from calls like open, dup, creat, pipe or fileno (if the file
 1685    has been previously opened with fopen).  The mode parameter is as in gzopen.
 1686      The next call of gzclose on the returned gzFile will also close the file
 1687    descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
 1688    fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
 1689    mode);.  The duplicated descriptor should be saved to avoid a leak, since
 1690    gzdopen does not close fd if it fails.  If you are using fileno() to get the
 1691    file descriptor from a FILE *, then you will have to use dup() to avoid
 1692    double-close()ing the file descriptor.  Both gzclose() and fclose() will
 1693    close the associated file descriptor, so they need to have different file
 1694    descriptors.
 1695      gzdopen returns NULL if there was insufficient memory to allocate the
 1696    gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
 1697    provided, or '+' was provided), or if fd is -1.  The file descriptor is not
 1698    used until the next gz* read, write, seek, or close operation, so gzdopen
 1699    will not detect if fd is invalid (unless fd is -1).
 1700 */
 1701 ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
 1702 /*
 1703      Set the internal buffer size used by that library's functions.  The
 1704    default buffer size is 8192 bytes.  This function must be called after
 1705    gzopen() or gzdopen(), and before any other calls that read or write the
 1706    file.  The buffer memory allocation is always deferred to the first read or
 1707    write.  Three times that size in buffer space is allocated.  A larger buffer
 1708    size of, for example, 64K or 128K bytes will noticeably increase the speed
 1709    of decompression (reading).
 1710      The new buffer size also affects the maximum length for gzprintf().
 1711      gzbuffer() returns 0 on success, or -1 on failure, such as being called
 1712    too late.
 1713 */
 1714 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
 1715 /*
 1716      Dynamically update the compression level or strategy.  See the description
 1717    of deflateInit2 for the meaning of these parameters.  Previously provided
 1718    data is flushed before the parameter change.
 1719      gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
 1720    opened for writing, Z_ERRNO if there is an error writing the flushed data,
 1721    or Z_MEM_ERROR if there is a memory allocation error.
 1722 */
 1723 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
 1724 /*
 1725      Reads the given number of uncompressed bytes from the compressed file.  If
 1726    the input file is not in gzip format, gzread copies the given number of
 1727    bytes into the buffer directly from the file.
 1728      After reaching the end of a gzip stream in the input, gzread will continue
 1729    to read, looking for another gzip stream.  Any number of gzip streams may be
 1730    concatenated in the input file, and will all be decompressed by gzread().
 1731    If something other than a gzip stream is encountered after a gzip stream,
 1732    that remaining trailing garbage is ignored (and no error is returned).
 1733      gzread can be used to read a gzip file that is being concurrently written.
 1734    Upon reaching the end of the input, gzread will return with the available
 1735    data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
 1736    gzclearerr can be used to clear the end of file indicator in order to permit
 1737    gzread to be tried again.  Z_OK indicates that a gzip stream was completed
 1738    on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
 1739    middle of a gzip stream.  Note that gzread does not return -1 in the event
 1740    of an incomplete gzip stream.  This error is deferred until gzclose(), which
 1741    will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
 1742    stream.  Alternatively, gzerror can be used before gzclose to detect that
 1743    case.
 1744      gzread returns the number of uncompressed bytes actually read, less than
 1745    len for end of file, or -1 for error.  If len is too large to fit in an int,
 1746    then nothing is read, -1 is returned, and the error state is set to
 1747    Z_STREAM_ERROR.
 1748 */
 1749 ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
 1750                                      gzFile file));
 1751 /*
 1752      Read up to nitems items of size size from file to buf, otherwise operating
 1753    as gzread() does.  This duplicates the interface of stdio's fread(), with
 1754    size_t request and return types.  If the library defines size_t, then
 1755    z_size_t is identical to size_t.  If not, then z_size_t is an unsigned
 1756    integer type that can contain a pointer.
 1757      gzfread() returns the number of full items read of size size, or zero if
 1758    the end of the file was reached and a full item could not be read, or if
 1759    there was an error.  gzerror() must be consulted if zero is returned in
 1760    order to determine if there was an error.  If the multiplication of size and
 1761    nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
 1762    is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
 1763      In the event that the end of file is reached and only a partial item is
 1764    available at the end, i.e. the remaining uncompressed data length is not a
 1765    multiple of size, then the final partial item is nevetheless read into buf
 1766    and the end-of-file flag is set.  The length of the partial item read is not
 1767    provided, but could be inferred from the result of gztell().  This behavior
 1768    is the same as the behavior of fread() implementations in common libraries,
 1769    but it prevents the direct use of gzfread() to read a concurrently written
 1770    file, reseting and retrying on end-of-file, when size is not 1.
 1771 */
 1772 ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
 1773                                 voidpc buf, unsigned len));
 1774 /*
 1775      Writes the given number of uncompressed bytes into the compressed file.
 1776    gzwrite returns the number of uncompressed bytes written or 0 in case of
 1777    error.
 1778 */
 1779 ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
 1780                                       z_size_t nitems, gzFile file));
 1781 /*
 1782      gzfwrite() writes nitems items of size size from buf to file, duplicating
 1783    the interface of stdio's fwrite(), with size_t request and return types.  If
 1784    the library defines size_t, then z_size_t is identical to size_t.  If not,
 1785    then z_size_t is an unsigned integer type that can contain a pointer.
 1786      gzfwrite() returns the number of full items written of size size, or zero
 1787    if there was an error.  If the multiplication of size and nitems overflows,
 1788    i.e. the product does not fit in a z_size_t, then nothing is written, zero
 1789    is returned, and the error state is set to Z_STREAM_ERROR.
 1790 */
 1791 ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
 1792 /*
 1793      Converts, formats, and writes the arguments to the compressed file under
 1794    control of the format string, as in fprintf.  gzprintf returns the number of
 1795    uncompressed bytes actually written, or a negative zlib error code in case
 1796    of error.  The number of uncompressed bytes written is limited to 8191, or
 1797    one less than the buffer size given to gzbuffer().  The caller should assure
 1798    that that limit is not exceeded.  If it is exceeded, then gzprintf() will
 1799    return an error (0) with nothing written.  In that case, there may also be a
 1800    buffer overflow with unpredictable consequences, which is possible only if
 1801    zlib was compiled with the insecure functions sprintf() or vsprintf()
 1802    because the secure snprintf() or vsnprintf() functions were not available.
 1803    This can be determined using zlibCompileFlags().
 1804 */
 1805 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
 1806 /*
 1807      Writes the given null-terminated string to the compressed file, excluding
 1808    the terminating null character.
 1809      gzputs returns the number of characters written, or -1 in case of error.
 1810 */
 1811 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
 1812 /*
 1813      Reads bytes from the compressed file until len-1 characters are read, or a
 1814    newline character is read and transferred to buf, or an end-of-file
 1815    condition is encountered.  If any characters are read or if len == 1, the
 1816    string is terminated with a null character.  If no characters are read due
 1817    to an end-of-file or len < 1, then the buffer is left untouched.
 1818      gzgets returns buf which is a null-terminated string, or it returns NULL
 1819    for end-of-file or in case of error.  If there was an error, the contents at
 1820    buf are indeterminate.
 1821 */
 1822 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
 1823 /*
 1824      Writes c, converted to an unsigned char, into the compressed file.  gzputc
 1825    returns the value that was written, or -1 in case of error.
 1826 */
 1827 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
 1828 /*
 1829      Reads one byte from the compressed file.  gzgetc returns that byte or -1
 1830    in case of end of file or error.  This is implemented as a macro for speed.
 1831    As such, it does not do all of the checking the other functions do.  I.e.
 1832    it does not check to see if file is NULL, nor whether the structure file
 1833    points to has been clobbered or not.
 1834 */
 1835 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
 1836 /*
 1837      Push one character back onto the stream to be read as the first character
 1838    on the next read.  At least one character of push-back is allowed.
 1839    gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
 1840    fail if c is -1, and may fail if a character has been pushed but not read
 1841    yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
 1842    output buffer size of pushed characters is allowed.  (See gzbuffer above.)
 1843    The pushed character will be discarded if the stream is repositioned with
 1844    gzseek() or gzrewind().
 1845 */
 1846 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
 1847 /*
 1848      Flushes all pending output into the compressed file.  The parameter flush
 1849    is as in the deflate() function.  The return value is the zlib error number
 1850    (see function gzerror below).  gzflush is only permitted when writing.
 1851      If the flush parameter is Z_FINISH, the remaining data is written and the
 1852    gzip stream is completed in the output.  If gzwrite() is called again, a new
 1853    gzip stream will be started in the output.  gzread() is able to read such
 1854    concatenated gzip streams.
 1855      gzflush should be called only when strictly necessary because it will
 1856    degrade compression if called too often.
 1857 */
 1858 /*
 1859 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
 1860                                    z_off_t offset, int whence));
 1861      Sets the starting position for the next gzread or gzwrite on the given
 1862    compressed file.  The offset represents a number of bytes in the
 1863    uncompressed data stream.  The whence parameter is defined as in lseek(2);
 1864    the value SEEK_END is not supported.
 1865      If the file is opened for reading, that function is emulated but can be
 1866    extremely slow.  If the file is opened for writing, only forward seeks are
 1867    supported; gzseek then compresses a sequence of zeroes up to the new
 1868    starting position.
 1869      gzseek returns the resulting offset location as measured in bytes from
 1870    the beginning of the uncompressed stream, or -1 in case of error, in
 1871    particular if the file is opened for writing and the new starting position
 1872    would be before the current position.
 1873 */
 1874 ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
 1875 /*
 1876      Rewinds the given file. This function is supported only for reading.
 1877      gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
 1878 */
 1879 /*
 1880 ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
 1881      Returns the starting position for the next gzread or gzwrite on the given
 1882    compressed file.  This position represents a number of bytes in the
 1883    uncompressed data stream, and is zero when starting, even if appending or
 1884    reading a gzip stream from the middle of a file using gzdopen().
 1885      gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
 1886 */
 1887 /*
 1888 ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
 1889      Returns the current offset in the file being read or written.  This offset
 1890    includes the count of bytes that precede the gzip stream, for example when
 1891    appending or when using gzdopen() for reading.  When reading, the offset
 1892    does not include as yet unused buffered input.  This information can be used
 1893    for a progress indicator.  On error, gzoffset() returns -1.
 1894 */
 1895 ZEXTERN int ZEXPORT gzeof OF((gzFile file));
 1896 /*
 1897      Returns true (1) if the end-of-file indicator has been set while reading,
 1898    false (0) otherwise.  Note that the end-of-file indicator is set only if the
 1899    read tried to go past the end of the input, but came up short.  Therefore,
 1900    just like feof(), gzeof() may return false even if there is no more data to
 1901    read, in the event that the last read request was for the exact number of
 1902    bytes remaining in the input file.  This will happen if the input file size
 1903    is an exact multiple of the buffer size.
 1904      If gzeof() returns true, then the read functions will return no more data,
 1905    unless the end-of-file indicator is reset by gzclearerr() and the input file
 1906    has grown since the previous end of file was detected.
 1907 */
 1908 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
 1909 /*
 1910      Returns true (1) if file is being copied directly while reading, or false
 1911    (0) if file is a gzip stream being decompressed.
 1912      If the input file is empty, gzdirect() will return true, since the input
 1913    does not contain a gzip stream.
 1914      If gzdirect() is used immediately after gzopen() or gzdopen() it will
 1915    cause buffers to be allocated to allow reading the file to determine if it
 1916    is a gzip file.  Therefore if gzbuffer() is used, it should be called before
 1917    gzdirect().
 1918      When writing, gzdirect() returns true (1) if transparent writing was
 1919    requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
 1920    gzdirect() is not needed when writing.  Transparent writing must be
 1921    explicitly requested, so the application already knows the answer.  When
 1922    linking statically, using gzdirect() will include all of the zlib code for
 1923    gzip file reading and decompression, which may not be desired.)
 1924 */
 1925 ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
 1926 /*
 1927      Flushes all pending output if necessary, closes the compressed file and
 1928    deallocates the (de)compression state.  Note that once file is closed, you
 1929    cannot call gzerror with file, since its structures have been deallocated.
 1930    gzclose must not be called more than once on the same file, just as free
 1931    must not be called more than once on the same allocation.
 1932      gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
 1933    file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
 1934    last read ended in the middle of a gzip stream, or Z_OK on success.
 1935 */
 1936 ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
 1937 ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
 1938 /*
 1939      Same as gzclose(), but gzclose_r() is only for use when reading, and
 1940    gzclose_w() is only for use when writing or appending.  The advantage to
 1941    using these instead of gzclose() is that they avoid linking in zlib
 1942    compression or decompression code that is not used when only reading or only
 1943    writing respectively.  If gzclose() is used, then both compression and
 1944    decompression code will be included the application when linking to a static
 1945    zlib library.
 1946 */
 1947 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
 1948 /*
 1949      Returns the error message for the last error which occurred on the given
 1950    compressed file.  errnum is set to zlib error number.  If an error occurred
 1951    in the file system and not in the compression library, errnum is set to
 1952    Z_ERRNO and the application may consult errno to get the exact error code.
 1953      The application must not modify the returned string.  Future calls to
 1954    that function may invalidate the previously returned string.  If file is
 1955    closed, then the string previously returned by gzerror will no longer be
 1956    available.
 1957      gzerror() should be used to distinguish errors from end-of-file for those
 1958    functions above that do not distinguish those cases in their return values.
 1959 */
 1960 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
 1961 /*
 1962      Clears the error and end-of-file flags for file.  This is analogous to the
 1963    clearerr() function in stdio.  This is useful for continuing to read a gzip
 1964    file that is being written concurrently.
 1965 */
 1966 #endif /* !Z_SOLO */
 1967                         /* checksum functions */
 1968 /*
 1969      These functions are not related to compression but are exported
 1970    anyway because they might be useful in applications using the compression
 1971    library.
 1972 */
 1973 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
 1974 /*
 1975      Update a running Adler-32 checksum with the bytes buf[0..len-1] and
 1976    return the updated checksum.  If buf is Z_NULL, that function returns the
 1977    required initial value for the checksum.
 1978      An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
 1979    much faster.
 1980    Usage example:
 1981      uLong adler = adler32(0L, Z_NULL, 0);
 1982      while (read_buffer(buffer, length) != EOF) {
 1983        adler = adler32(adler, buffer, length);
 1984      }
 1985      if (adler != original_adler) error();
 1986 */
 1987 ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
 1988                                     z_size_t len));
 1989 /*
 1990      Same as adler32(), but with a size_t length.
 1991 */
 1992 /*
 1993 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
 1994                                           z_off_t len2));
 1995      Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
 1996    and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
 1997    each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
 1998    seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
 1999    that the z_off_t type (like off_t) is a signed integer.  If len2 is
 2000    negative, the result has no meaning or utility.
 2001 */
 2002 ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
 2003 /*
 2004      Update a running CRC-32 with the bytes buf[0..len-1] and return the
 2005    updated CRC-32.  If buf is Z_NULL, that function returns the required
 2006    initial value for the crc.  Pre- and post-conditioning (one's complement) is
 2007    performed within that function so it shouldn't be done by the application.
 2008    Usage example:
 2009      uLong crc = crc32(0L, Z_NULL, 0);
 2010      while (read_buffer(buffer, length) != EOF) {
 2011        crc = crc32(crc, buffer, length);
 2012      }
 2013      if (crc != original_crc) error();
 2014 */
 2015 ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
 2016                                   z_size_t len));
 2017 /*
 2018      Same as crc32(), but with a size_t length.
 2019 */
 2020 /*
 2021 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
 2022      Combine two CRC-32 check values into one.  For two sequences of bytes,
 2023    seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
 2024    calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
 2025    check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
 2026    len2.
 2027 */
 2028                         /* various hacks, don't look :) */
 2029 /* deflateInit and inflateInit are macros to allow checking the zlib version
 2030  * and the compiler's view of z_stream:
 2031  */
 2032 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
 2033                                      const char *version, int stream_size));
 2034 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
 2035                                      const char *version, int stream_size));
 2036 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
 2037                                       int windowBits, int memLevel,
 2038                                       int strategy, const char *version,
 2039                                       int stream_size));
 2040 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
 2041                                       const char *version, int stream_size));
 2042 ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
 2043                                          unsigned char FAR *window,
 2044                                          const char *version,
 2045                                          int stream_size));
 2046 #ifdef Z_PREFIX_SET
 2047 #  define z_deflateInit(strm, level) \
 2048           deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
 2049 #  define z_inflateInit(strm) \
 2050           inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
 2051 #  define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
 2052           deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
 2053                         (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
 2054 #  define z_inflateInit2(strm, windowBits) \
 2055           inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
 2056                         (int)sizeof(z_stream))
 2057 #  define z_inflateBackInit(strm, windowBits, window) \
 2058           inflateBackInit_((strm), (windowBits), (window), \
 2059                            ZLIB_VERSION, (int)sizeof(z_stream))
 2060 #else
 2061 #  define deflateInit(strm, level) \
 2062           deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
 2063 #  define inflateInit(strm) \
 2064           inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
 2065 #  define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
 2066           deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
 2067                         (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
 2068 #  define inflateInit2(strm, windowBits) \
 2069           inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
 2070                         (int)sizeof(z_stream))
 2071 #  define inflateBackInit(strm, windowBits, window) \
 2072           inflateBackInit_((strm), (windowBits), (window), \
 2073                            ZLIB_VERSION, (int)sizeof(z_stream))
 2074 #endif
 2075 #ifndef Z_SOLO
 2076 /* gzgetc() macro and its supporting function and exposed data structure.  Note
 2077  * that the real internal state is much larger than the exposed structure.
 2078  * This abbreviated structure exposes just enough for the gzgetc() macro.  The
 2079  * user should not mess with these exposed elements, since their names or
 2080  * behavior could change in the future, perhaps even capriciously.  They can
 2081  * only be used by the gzgetc() macro.  You have been warned.
 2082  */
 2083 struct gzFile_s {
 2084     unsigned have;
 2085     unsigned char *next;
 2086     z_off64_t pos;
 2087 };
 2088 ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
 2089 #ifdef Z_PREFIX_SET
 2090 #  undef z_gzgetc
 2091 #  define z_gzgetc(g) \
 2092           ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
 2093 #else
 2094 #  define gzgetc(g) \
 2095           ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
 2096 #endif
 2097 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
 2098  * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
 2099  * both are true, the application gets the *64 functions, and the regular
 2100  * functions are changed to 64 bits) -- in case these are set on systems
 2101  * without large file support, _LFS64_LARGEFILE must also be true
 2102  */
 2103 #ifdef Z_LARGE64
 2104    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
 2105    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
 2106    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
 2107    ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
 2108    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
 2109    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
 2110 #endif
 2111 #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
 2112 #  ifdef Z_PREFIX_SET
 2113 #    define z_gzopen z_gzopen64
 2114 #    define z_gzseek z_gzseek64
 2115 #    define z_gztell z_gztell64
 2116 #    define z_gzoffset z_gzoffset64
 2117 #    define z_adler32_combine z_adler32_combine64
 2118 #    define z_crc32_combine z_crc32_combine64
 2119 #  else
 2120 #    define gzopen gzopen64
 2121 #    define gzseek gzseek64
 2122 #    define gztell gztell64
 2123 #    define gzoffset gzoffset64
 2124 #    define adler32_combine adler32_combine64
 2125 #    define crc32_combine crc32_combine64
 2126 #  endif
 2127 #  ifndef Z_LARGE64
 2128      ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
 2129      ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
 2130      ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
 2131      ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
 2132      ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
 2133      ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
 2134 #  endif
 2135 #else
 2136    ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
 2137    ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
 2138    ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
 2139    ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
 2140    ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
 2141    ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
 2142 #endif
 2143 #else /* Z_SOLO */
 2144    ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
 2145    ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
 2146 #endif /* !Z_SOLO */
 2147 /* undocumented functions */
 2148 ZEXTERN const char   * ZEXPORT zError           OF((int));
 2149 ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
 2150 ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
 2151 ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
 2152 ZEXTERN int            ZEXPORT inflateValidate OF((z_streamp, int));
 2153 ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF ((z_streamp));
 2154 ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
 2155 ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
 2156 #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
 2157 ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
 2158                                             const char *mode));
 2159 #endif
 2160 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
 2161 #  ifndef Z_SOLO
 2162 ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
 2163                                                   const char *format,
 2164                                                   va_list va));
 2165 #  endif
 2166 #endif
 2167 #ifdef __cplusplus
 2168 }
 2169 #endif
 2170 #endif /* ZLIB_H */
 2171 /*
 2172 :file sfklib\zlib\zutil.h
 2173 */
 2174 /* zutil.h -- internal interface and configuration of the compression library
 2175  * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
 2176  * For conditions of distribution and use, see copyright notice in zlib.h
 2177  */
 2178 /* WARNING: that file should *not* be used by applications. It is
 2179    part of the implementation of the compression library and is
 2180    subject to change. Applications should only use zlib.h.
 2181  */
 2182 /* @(#) $Id$ */
 2183 #ifndef ZUTIL_H
 2184 #define ZUTIL_H
 2185 #ifdef HAVE_HIDDEN
 2186 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 2187 #else
 2188 #  define ZLIB_INTERNAL
 2189 #endif
 2190 #if defined(STDC) && !defined(Z_SOLO)
 2191 #  if !(defined(_WIN32_WCE) && defined(_MSC_VER))
 2192 #  endif
 2193 #endif
 2194 #ifdef Z_SOLO
 2195    typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
 2196 #endif
 2197 #ifndef local
 2198 #  define local static
 2199 #endif
 2200 /* since "static" is used to mean two completely different things in C, we
 2201    define "local" for the non-static meaning of "static", for readability
 2202    (compile with -Dlocal if your debugger can't find static symbols) */
 2203 typedef unsigned char  uch;
 2204 typedef uch FAR uchf;
 2205 typedef unsigned short ush;
 2206 typedef ush FAR ushf;
 2207 typedef unsigned long  ulg;
 2208 extern z_const char * const z2_errmsg[10]; /* indexed by 2-zlib_error */
 2209 /* (size given to avoid silly warnings with Visual C++) */
 2210 #define ERR_MSG(err) z2_errmsg[Z_NEED_DICT-(err)]
 2211 #define ERR_RETURN(strm,err) \
 2212   return (strm->msg = ERR_MSG(err), (err))
 2213 /* To be used only when the state is known to be valid */
 2214         /* common constants */
 2215 #ifndef DEF_WBITS
 2216 #  define DEF_WBITS MAX_WBITS
 2217 #endif
 2218 /* default windowBits for decompression. MAX_WBITS is for compression only */
 2219 #if MAX_MEM_LEVEL >= 8
 2220 #  define DEF_MEM_LEVEL 8
 2221 #else
 2222 #  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
 2223 #endif
 2224 /* default memLevel */
 2225 #define STORED_BLOCK 0
 2226 #define STATIC_TREES 1
 2227 #define DYN_TREES    2
 2228 /* The three kinds of block type */
 2229 #define MIN_MATCH  3
 2230 #define MAX_MATCH  258
 2231 /* The minimum and maximum match lengths */
 2232 #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
 2233         /* target dependencies */
 2234 #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
 2235 #  define OS_CODE  0x00
 2236 #  ifndef Z_SOLO
 2237 #    if defined(__TURBOC__) || defined(__BORLANDC__)
 2238 #      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
 2239          /* Allow compilation with ANSI keywords only enabled */
 2240          void _Cdecl farfree( void *block );
 2241          void *_Cdecl farmalloc( unsigned long nbytes );
 2242 #      else
 2243 #      endif
 2244 #    else /* MSC or DJGPP */
 2245 #    endif
 2246 #  endif
 2247 #endif
 2248 #ifdef AMIGA
 2249 #  define OS_CODE  1
 2250 #endif
 2251 #if defined(VAXC) || defined(VMS)
 2252 #  define OS_CODE  2
 2253 #  define F_OPEN(name, mode) \
 2254      fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
 2255 #endif
 2256 #ifdef __370__
 2257 #  if __TARGET_LIB__ < 0x20000000
 2258 #    define OS_CODE 4
 2259 #  elif __TARGET_LIB__ < 0x40000000
 2260 #    define OS_CODE 11
 2261 #  else
 2262 #    define OS_CODE 8
 2263 #  endif
 2264 #endif
 2265 #if defined(ATARI) || defined(atarist)
 2266 #  define OS_CODE  5
 2267 #endif
 2268 #ifdef OS2
 2269 #  define OS_CODE  6
 2270 #  if defined(M_I86) && !defined(Z_SOLO)
 2271 #  endif
 2272 #endif
 2273 #if defined(MACOS) || defined(TARGET_OS_MAC)
 2274 #  define OS_CODE  7
 2275 #  ifndef Z_SOLO
 2276 #    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
 2277 #    else
 2278 #      ifndef fdopen
 2279 #        define fdopen(fd,mode) NULL /* No fdopen() */
 2280 #      endif
 2281 #    endif
 2282 #  endif
 2283 #endif
 2284 #ifdef __acorn
 2285 #  define OS_CODE 13
 2286 #endif
 2287 #if defined(WIN32) && !defined(__CYGWIN__)
 2288 #  define OS_CODE  10
 2289 #endif
 2290 #ifdef _BEOS_
 2291 #  define OS_CODE  16
 2292 #endif
 2293 #ifdef __TOS_OS400__
 2294 #  define OS_CODE 18
 2295 #endif
 2296 #ifdef __APPLE__
 2297 #  define OS_CODE 19
 2298 #endif
 2299 #if defined(_BEOS_) || defined(RISCOS)
 2300 #  define fdopen(fd,mode) NULL /* No fdopen() */
 2301 #endif
 2302 #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
 2303 #  if defined(_WIN32_WCE)
 2304 #    define fdopen(fd,mode) NULL /* No fdopen() */
 2305 #    ifndef _PTRDIFF_T_DEFINED
 2306        typedef int ptrdiff_t;
 2307 #      define _PTRDIFF_T_DEFINED
 2308 #    endif
 2309 #  else
 2310 #    define fdopen(fd,type)  _fdopen(fd,type)
 2311 #  endif
 2312 #endif
 2313 #if defined(__BORLANDC__) && !defined(MSDOS)
 2314   #pragma warn -8004
 2315   #pragma warn -8008
 2316   #pragma warn -8066
 2317 #endif
 2318 /* provide prototypes for these when building zlib without LFS */
 2319 #if !defined(_WIN32) && \
 2320     (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
 2321     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
 2322     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
 2323 #endif
 2324         /* common defaults */
 2325 #ifndef OS_CODE
 2326 #  define OS_CODE  3     /* assume Unix */
 2327 #endif
 2328 #ifndef F_OPEN
 2329 #  define F_OPEN(name, mode) fopen((name), (mode))
 2330 #endif
 2331          /* functions */
 2332 #if defined(pyr) || defined(Z_SOLO)
 2333 #  define NO_MEMCPY
 2334 #endif
 2335 #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
 2336  /* Use our own functions for small and medium model with MSC <= 5.0.
 2337   * You may have to use the same strategy for Borland C (untested).
 2338   * The __SC__ check is for Symantec.
 2339   */
 2340 #  define NO_MEMCPY
 2341 #endif
 2342 #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
 2343 #  define HAVE_MEMCPY
 2344 #endif
 2345 #ifdef HAVE_MEMCPY
 2346 #  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
 2347 #    define zmemcpy _fmemcpy
 2348 #    define zmemcmp _fmemcmp
 2349 #    define zmemzero(dest, len) _fmemset(dest, 0, len)
 2350 #  else
 2351 #    define zmemcpy memcpy
 2352 #    define zmemcmp memcmp
 2353 #    define zmemzero(dest, len) memset(dest, 0, len)
 2354 #  endif
 2355 #else
 2356    void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
 2357    int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
 2358    void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
 2359 #endif
 2360 /* Diagnostic functions */
 2361 #ifdef ZLIB_DEBUG
 2362    extern int ZLIB_INTERNAL z_verbose;
 2363    extern void ZLIB_INTERNAL z_error OF((char *m));
 2364 #  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
 2365 #  define Trace(x) {if (z_verbose>=0) fprintf x ;}
 2366 #  define Tracev(x) {if (z_verbose>0) fprintf x ;}
 2367 #  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
 2368 #  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
 2369 #  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
 2370 #else
 2371 #  define Assert(cond,msg)
 2372 #  define Trace(x)
 2373 #  define Tracev(x)
 2374 #  define Tracevv(x)
 2375 #  define Tracec(c,x)
 2376 #  define Tracecv(c,x)
 2377 #endif
 2378 #ifndef Z_SOLO
 2379    voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
 2380                                     unsigned size));
 2381    void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
 2382 #endif
 2383 #define ZALLOC(strm, items, size) \
 2384            (*((strm)->zalloc))((strm)->opaque, (items), (size))
 2385 #define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
 2386 #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
 2387 /* Reverse the bytes in a 32-bit value */
 2388 #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
 2389                     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
 2390 #endif /* ZUTIL_H */
 2391 /*
 2392 :file sfklib\zlib\deflate.h
 2393 */
 2394 /* deflate.h -- internal compression state
 2395  * Copyright (C) 1995-2016 Jean-loup Gailly
 2396  * For conditions of distribution and use, see copyright notice in zlib.h
 2397  */
 2398 /* WARNING: that file should *not* be used by applications. It is
 2399    part of the implementation of the compression library and is
 2400    subject to change. Applications should only use zlib.h.
 2401  */
 2402 /* @(#) $Id$ */
 2403 #ifndef DEFLATE_H
 2404 #define DEFLATE_H
 2405 /* define NO_GZIP when compiling if you want to disable gzip header and
 2406    trailer creation by deflate().  NO_GZIP would be used to avoid linking in
 2407    the crc code when it is not needed.  For shared libraries, gzip encoding
 2408    should be left enabled. */
 2409 #ifndef NO_GZIP
 2410 #  define GZIP
 2411 #endif
 2412 /* ===========================================================================
 2413  * Internal compression state.
 2414  */
 2415 #define LENGTH_CODES 29
 2416 /* number of length codes, not counting the special END_BLOCK code */
 2417 #define LITERALS  256
 2418 /* number of literal bytes 0..255 */
 2419 #define L_CODES (LITERALS+1+LENGTH_CODES)
 2420 /* number of Literal or Length codes, including the END_BLOCK code */
 2421 #define D_CODES   30
 2422 /* number of distance codes */
 2423 #define BL_CODES  19
 2424 /* number of codes used to transfer the bit lengths */
 2425 #define HEAP_SIZE (2*L_CODES+1)
 2426 /* maximum heap size */
 2427 #define MAX_BITS 15
 2428 /* All codes must not exceed MAX_BITS bits */
 2429 #define Buf_size 16
 2430 /* size of bit buffer in bi_buf */
 2431 #define INIT_STATE    42    /* zlib header -> BUSY_STATE */
 2432 #ifdef GZIP
 2433 #  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
 2434 #endif
 2435 #define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
 2436 #define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
 2437 #define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
 2438 #define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
 2439 #define BUSY_STATE   113    /* deflate -> FINISH_STATE */
 2440 #define FINISH_STATE 666    /* stream complete */
 2441 /* Stream status */
 2442 /* Data structure describing a single value and its code string. */
 2443 typedef struct ct_data_s {
 2444     union {
 2445         ush  freq;       /* frequency count */
 2446         ush  code;       /* bit string */
 2447     } fc;
 2448     union {
 2449         ush  dad;        /* father node in Huffman tree */
 2450         ush  len;        /* length of bit string */
 2451     } dl;
 2452 } FAR ct_data;
 2453 #define Freq fc.freq
 2454 #define Code fc.code
 2455 #define Dad  dl.dad
 2456 #define Len  dl.len
 2457 typedef struct static_tree_desc_s  static_tree_desc;
 2458 typedef struct tree_desc_s {
 2459     ct_data *dyn_tree;           /* the dynamic tree */
 2460     int     max_code;            /* largest code with non zero frequency */
 2461     const static_tree_desc *stat_desc;  /* the corresponding static tree */
 2462 } FAR tree_desc;
 2463 typedef ush Pos;
 2464 typedef Pos FAR Posf;
 2465 typedef unsigned IPos;
 2466 /* A Pos is an index in the character window. We use short instead of int to
 2467  * save space in the various tables. IPos is used only for parameter passing.
 2468  */
 2469 typedef struct internal_state {
 2470     z_streamp strm;      /* pointer back to that zlib stream */
 2471     int   status;        /* as the name implies */
 2472     Bytef *pending_buf;  /* output still pending */
 2473     ulg   pending_buf_size; /* size of pending_buf */
 2474     Bytef *pending_out;  /* next pending byte to output to the stream */
 2475     ulg   pending;       /* nb of bytes in the pending buffer */
 2476     int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
 2477     gz_headerp  gzhead;  /* gzip header information to write */
 2478     ulg   gzindex;       /* where in extra, name, or comment */
 2479     Byte  method;        /* can only be DEFLATED */
 2480     int   last_flush;    /* value of flush param for previous deflate call */
 2481                 /* used by deflate.c: */
 2482     uInt  w_size;        /* LZ77 window size (32K by default) */
 2483     uInt  w_bits;        /* log2(w_size)  (8..16) */
 2484     uInt  w_mask;        /* w_size - 1 */
 2485     Bytef *window;
 2486     /* Sliding window. Input bytes are read into the second half of the window,
 2487      * and move to the first half later to keep a dictionary of at least wSize
 2488      * bytes. With that organization, matches are limited to a distance of
 2489      * wSize-MAX_MATCH bytes, but that ensures that IO is always
 2490      * performed with a length multiple of the block size. Also, it limits
 2491      * the window size to 64K, which is quite useful on MSDOS.
 2492      * To do: use the user input buffer as sliding window.
 2493      */
 2494     ulg window_size;
 2495     /* Actual size of window: 2*wSize, except when the user input buffer
 2496      * is directly used as sliding window.
 2497      */
 2498     Posf *prev;
 2499     /* Link to older string with same hash index. To limit the size of that
 2500      * array to 64K, that link is maintained only for the last 32K strings.
 2501      * An index in that array is thus a window index modulo 32K.
 2502      */
 2503     Posf *head; /* Heads of the hash chains or NIL. */
 2504     uInt  ins_h;          /* hash index of string to be inserted */
 2505     uInt  hash_size;      /* number of elements in hash table */
 2506     uInt  hash_bits;      /* log2(hash_size) */
 2507     uInt  hash_mask;      /* hash_size-1 */
 2508     uInt  hash_shift;
 2509     /* Number of bits by which ins_h must be shifted at each input
 2510      * step. It must be such that after MIN_MATCH steps, the oldest
 2511      * byte no longer takes part in the hash key, that is:
 2512      *   hash_shift * MIN_MATCH >= hash_bits
 2513      */
 2514     long block_start;
 2515     /* Window position at the beginning of the current output block. Gets
 2516      * negative when the window is moved backwards.
 2517      */
 2518     uInt match_length;           /* length of best match */
 2519     IPos prev_match;             /* previous match */
 2520     int match_available;         /* set if previous match exists */
 2521     uInt strstart;               /* start of string to insert */
 2522     uInt match_start;            /* start of matching string */
 2523     uInt lookahead;              /* number of valid bytes ahead in window */
 2524     uInt prev_length;
 2525     /* Length of the best match at previous step. Matches not greater than that
 2526      * are discarded. This is used in the lazy match evaluation.
 2527      */
 2528     uInt max_chain_length;
 2529     /* To speed up deflation, hash chains are never searched beyond that
 2530      * length.  A higher limit improves compression ratio but degrades the
 2531      * speed.
 2532      */
 2533     uInt max_lazy_match;
 2534     /* Attempt to find a better match only when the current match is strictly
 2535      * smaller than that value. This mechanism is used only for compression
 2536      * levels >= 4.
 2537      */
 2538 #   define max_insert_length  max_lazy_match
 2539     /* Insert new strings in the hash table only if the match length is not
 2540      * greater than that length. This saves time but degrades compression.
 2541      * max_insert_length is used only for compression levels <= 3.
 2542      */
 2543     int level;    /* compression level (1..9) */
 2544     int strategy; /* favor or force Huffman coding*/
 2545     uInt good_match;
 2546     /* Use a faster search when the previous match is longer than that */
 2547     int nice_match; /* Stop searching when current match exceeds that */
 2548                 /* used by trees.c: */
 2549     /* Didn't use ct_data typedef below to suppress compiler warning */
 2550     struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
 2551     struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
 2552     struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
 2553     struct tree_desc_s l_desc;               /* desc. for literal tree */
 2554     struct tree_desc_s d_desc;               /* desc. for distance tree */
 2555     struct tree_desc_s bl_desc;              /* desc. for bit length tree */
 2556     ush bl_count[MAX_BITS+1];
 2557     /* number of codes at each bit length for an optimal tree */
 2558     int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
 2559     int heap_len;               /* number of elements in the heap */
 2560     int heap_max;               /* element of largest frequency */
 2561     /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
 2562      * The same heap array is used to build all trees.
 2563      */
 2564     uch depth[2*L_CODES+1];
 2565     /* Depth of each subtree used as tie breaker for trees of equal frequency
 2566      */
 2567     uchf *l_buf;          /* buffer for literals or lengths */
 2568     uInt  lit_bufsize;
 2569     /* Size of match buffer for literals/lengths.  There are 4 reasons for
 2570      * limiting lit_bufsize to 64K:
 2571      *   - frequencies can be kept in 16 bit counters
 2572      *   - if compression is not successful for the first block, all input
 2573      *     data is still in the window so we can still emit a stored block even
 2574      *     when input comes from standard input.  (This can also be done for
 2575      *     all blocks if lit_bufsize is not greater than 32K.)
 2576      *   - if compression is not successful for a file smaller than 64K, we can
 2577      *     even emit a stored file instead of a stored block (saving 5 bytes).
 2578      *     This is applicable only for zip (not gzip or zlib).
 2579      *   - creating new Huffman trees less frequently may not provide fast
 2580      *     adaptation to changes in the input data statistics. (Take for
 2581      *     example a binary file with poorly compressible code followed by
 2582      *     a highly compressible string table.) Smaller buffer sizes give
 2583      *     fast adaptation but have of course the overhead of transmitting
 2584      *     trees more frequently.
 2585      *   - I can't count above 4
 2586      */
 2587     uInt last_lit;      /* running index in l_buf */
 2588     ushf *d_buf;
 2589     /* Buffer for distances. To simplify the code, d_buf and l_buf have
 2590      * the same number of elements. To use different lengths, an extra flag
 2591      * array would be necessary.
 2592      */
 2593     ulg opt_len;        /* bit length of current block with optimal trees */
 2594     ulg static_len;     /* bit length of current block with static trees */
 2595     uInt matches;       /* number of string matches in current block */
 2596     uInt insert;        /* bytes at end of window left to insert */
 2597 #ifdef ZLIB_DEBUG
 2598     ulg compressed_len; /* total bit length of compressed file mod 2^32 */
 2599     ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
 2600 #endif
 2601     ush bi_buf;
 2602     /* Output buffer. bits are inserted starting at the bottom (least
 2603      * significant bits).
 2604      */
 2605     int bi_valid;
 2606     /* Number of valid bits in bi_buf.  All bits above the last valid bit
 2607      * are always zero.
 2608      */
 2609     ulg high_water;
 2610     /* High water mark offset in window for initialized bytes -- bytes above
 2611      * that are set to zero in order to avoid memory check warnings when
 2612      * longest match routines access bytes past the input.  This is then
 2613      * updated to the new high water mark.
 2614      */
 2615 } FAR deflate_state;
 2616 /* Output a byte on the stream.
 2617  * IN assertion: there is enough room in pending_buf.
 2618  */
 2619 #define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
 2620 #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
 2621 /* Minimum amount of lookahead, except at the end of the input file.
 2622  * See deflate.c for comments about the MIN_MATCH+1.
 2623  */
 2624 #define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
 2625 /* In order to simplify the code, particularly on 16 bit machines, match
 2626  * distances are limited to MAX_DIST instead of WSIZE.
 2627  */
 2628 #define WIN_INIT MAX_MATCH
 2629 /* Number of bytes after end of data in window to initialize in order to avoid
 2630    memory checker errors from longest match routines */
 2631         /* in trees.c */
 2632 void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
 2633 int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
 2634 void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
 2635                         ulg stored_len, int last));
 2636 void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
 2637 void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
 2638 void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
 2639                         ulg stored_len, int last));
 2640 #define d_code(dist) \
 2641    ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
 2642 /* Mapping from a distance to a distance code. dist is the distance - 1 and
 2643  * must not have side effects. _dist_code[256] and _dist_code[257] are never
 2644  * used.
 2645  */
 2646 #ifndef ZLIB_DEBUG
 2647 /* Inline versions of _tr_tally for speed: */
 2648 #if defined(GEN_TREES_H) || !defined(STDC)
 2649   extern uch ZLIB_INTERNAL _length_code[];
 2650   extern uch ZLIB_INTERNAL _dist_code[];
 2651 #else
 2652   extern const uch ZLIB_INTERNAL _length_code[];
 2653   extern const uch ZLIB_INTERNAL _dist_code[];
 2654 #endif
 2655 # define _tr_tally_lit(s, c, flush) \
 2656   { uch cc = (c); \
 2657     s->d_buf[s->last_lit] = 0; \
 2658     s->l_buf[s->last_lit++] = cc; \
 2659     s->dyn_ltree[cc].Freq++; \
 2660     flush = (s->last_lit == s->lit_bufsize-1); \
 2661    }
 2662 # define _tr_tally_dist(s, distance, length, flush) \
 2663   { uch len = (uch)(length); \
 2664     ush dist = (ush)(distance); \
 2665     s->d_buf[s->last_lit] = dist; \
 2666     s->l_buf[s->last_lit++] = len; \
 2667     dist--; \
 2668     s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
 2669     s->dyn_dtree[d_code(dist)].Freq++; \
 2670     flush = (s->last_lit == s->lit_bufsize-1); \
 2671   }
 2672 #else
 2673 # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
 2674 # define _tr_tally_dist(s, distance, length, flush) \
 2675               flush = _tr_tally(s, distance, length)
 2676 #endif
 2677 #endif /* DEFLATE_H */
 2678 /*
 2679 :file sfklib\zlib\crc32.h
 2680 */
 2681 /* crc32.h -- tables for rapid CRC calculation
 2682  * Generated automatically by crc32.c
 2683  */
 2684 local const z_crc_t FAR crc_table[TBLS][256] =
 2685 {
 2686   {
 2687     0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
 2688     0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
 2689     0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
 2690     0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
 2691     0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
 2692     0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
 2693     0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
 2694     0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
 2695     0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
 2696     0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
 2697     0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
 2698     0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
 2699     0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
 2700     0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
 2701     0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
 2702     0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
 2703     0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
 2704     0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
 2705     0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
 2706     0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
 2707     0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
 2708     0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
 2709     0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
 2710     0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
 2711     0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
 2712     0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
 2713     0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
 2714     0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
 2715     0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
 2716     0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
 2717     0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
 2718     0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
 2719     0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
 2720     0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
 2721     0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
 2722     0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
 2723     0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
 2724     0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
 2725     0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
 2726     0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
 2727     0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
 2728     0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
 2729     0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
 2730     0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
 2731     0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
 2732     0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
 2733     0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
 2734     0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
 2735     0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
 2736     0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
 2737     0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
 2738     0x2d02ef8dUL
 2739 #ifdef BYFOUR
 2740   },
 2741   {
 2742     0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
 2743     0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
 2744     0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
 2745     0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
 2746     0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
 2747     0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
 2748     0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
 2749     0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
 2750     0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
 2751     0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
 2752     0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
 2753     0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
 2754     0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
 2755     0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
 2756     0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
 2757     0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
 2758     0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
 2759     0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
 2760     0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
 2761     0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
 2762     0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
 2763     0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
 2764     0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
 2765     0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
 2766     0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
 2767     0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
 2768     0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
 2769     0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
 2770     0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
 2771     0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
 2772     0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
 2773     0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
 2774     0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
 2775     0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
 2776     0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
 2777     0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
 2778     0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
 2779     0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
 2780     0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
 2781     0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
 2782     0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
 2783     0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
 2784     0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
 2785     0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
 2786     0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
 2787     0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
 2788     0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
 2789     0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
 2790     0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
 2791     0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
 2792     0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
 2793     0x9324fd72UL
 2794   },
 2795   {
 2796     0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
 2797     0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
 2798     0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
 2799     0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
 2800     0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
 2801     0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
 2802     0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
 2803     0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
 2804     0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
 2805     0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
 2806     0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
 2807     0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
 2808     0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
 2809     0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
 2810     0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
 2811     0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
 2812     0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
 2813     0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
 2814     0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
 2815     0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
 2816     0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
 2817     0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
 2818     0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
 2819     0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
 2820     0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
 2821     0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
 2822     0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
 2823     0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
 2824     0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
 2825     0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
 2826     0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
 2827     0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
 2828     0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
 2829     0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
 2830     0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
 2831     0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
 2832     0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
 2833     0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
 2834     0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
 2835     0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
 2836     0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
 2837     0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
 2838     0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
 2839     0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
 2840     0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
 2841     0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
 2842     0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
 2843     0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
 2844     0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
 2845     0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
 2846     0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
 2847     0xbe9834edUL
 2848   },
 2849   {
 2850     0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
 2851     0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
 2852     0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
 2853     0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
 2854     0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
 2855     0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
 2856     0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
 2857     0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
 2858     0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
 2859     0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
 2860     0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
 2861     0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
 2862     0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
 2863     0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
 2864     0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
 2865     0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
 2866     0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
 2867     0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
 2868     0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
 2869     0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
 2870     0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
 2871     0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
 2872     0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
 2873     0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
 2874     0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
 2875     0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
 2876     0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
 2877     0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
 2878     0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
 2879     0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
 2880     0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
 2881     0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
 2882     0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
 2883     0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
 2884     0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
 2885     0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
 2886     0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
 2887     0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
 2888     0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
 2889     0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
 2890     0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
 2891     0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
 2892     0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
 2893     0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
 2894     0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
 2895     0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
 2896     0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
 2897     0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
 2898     0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
 2899     0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
 2900     0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
 2901     0xde0506f1UL
 2902   },
 2903   {
 2904     0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
 2905     0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
 2906     0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
 2907     0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
 2908     0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
 2909     0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
 2910     0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
 2911     0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
 2912     0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
 2913     0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
 2914     0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
 2915     0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
 2916     0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
 2917     0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
 2918     0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
 2919     0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
 2920     0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
 2921     0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
 2922     0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
 2923     0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
 2924     0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
 2925     0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
 2926     0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
 2927     0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
 2928     0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
 2929     0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
 2930     0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
 2931     0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
 2932     0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
 2933     0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
 2934     0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
 2935     0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
 2936     0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
 2937     0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
 2938     0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
 2939     0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
 2940     0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
 2941     0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
 2942     0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
 2943     0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
 2944     0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
 2945     0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
 2946     0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
 2947     0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
 2948     0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
 2949     0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
 2950     0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
 2951     0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
 2952     0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
 2953     0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
 2954     0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
 2955     0x8def022dUL
 2956   },
 2957   {
 2958     0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
 2959     0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
 2960     0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
 2961     0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
 2962     0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
 2963     0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
 2964     0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
 2965     0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
 2966     0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
 2967     0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
 2968     0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
 2969     0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
 2970     0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
 2971     0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
 2972     0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
 2973     0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
 2974     0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
 2975     0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
 2976     0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
 2977     0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
 2978     0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
 2979     0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
 2980     0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
 2981     0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
 2982     0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
 2983     0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
 2984     0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
 2985     0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
 2986     0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
 2987     0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
 2988     0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
 2989     0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
 2990     0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
 2991     0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
 2992     0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
 2993     0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
 2994     0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
 2995     0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
 2996     0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
 2997     0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
 2998     0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
 2999     0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
 3000     0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
 3001     0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
 3002     0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
 3003     0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
 3004     0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
 3005     0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
 3006     0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
 3007     0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
 3008     0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
 3009     0x72fd2493UL
 3010   },
 3011   {
 3012     0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
 3013     0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
 3014     0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
 3015     0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
 3016     0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
 3017     0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
 3018     0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
 3019     0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
 3020     0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
 3021     0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
 3022     0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
 3023     0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
 3024     0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
 3025     0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
 3026     0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
 3027     0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
 3028     0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
 3029     0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
 3030     0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
 3031     0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
 3032     0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
 3033     0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
 3034     0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
 3035     0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
 3036     0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
 3037     0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
 3038     0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
 3039     0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
 3040     0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
 3041     0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
 3042     0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
 3043     0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
 3044     0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
 3045     0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
 3046     0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
 3047     0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
 3048     0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
 3049     0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
 3050     0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
 3051     0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
 3052     0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
 3053     0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
 3054     0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
 3055     0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
 3056     0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
 3057     0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
 3058     0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
 3059     0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
 3060     0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
 3061     0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
 3062     0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
 3063     0xed3498beUL
 3064   },
 3065   {
 3066     0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
 3067     0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
 3068     0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
 3069     0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
 3070     0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
 3071     0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
 3072     0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
 3073     0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
 3074     0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
 3075     0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
 3076     0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
 3077     0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
 3078     0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
 3079     0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
 3080     0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
 3081     0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
 3082     0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
 3083     0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
 3084     0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
 3085     0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
 3086     0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
 3087     0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
 3088     0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
 3089     0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
 3090     0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
 3091     0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
 3092     0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
 3093     0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
 3094     0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
 3095     0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
 3096     0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
 3097     0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
 3098     0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
 3099     0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
 3100     0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
 3101     0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
 3102     0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
 3103     0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
 3104     0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
 3105     0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
 3106     0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
 3107     0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
 3108     0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
 3109     0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
 3110     0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
 3111     0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
 3112     0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
 3113     0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
 3114     0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
 3115     0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
 3116     0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
 3117     0xf10605deUL
 3118 #endif
 3119   }
 3120 };
 3121 /*
 3122 :file sfklib\zlib\inftrees.h
 3123 */
 3124 /* inftrees.h -- header to use inftrees.c
 3125  * Copyright (C) 1995-2005, 2010 Mark Adler
 3126  * For conditions of distribution and use, see copyright notice in zlib.h
 3127  */
 3128 /* WARNING: that file should *not* be used by applications. It is
 3129    part of the implementation of the compression library and is
 3130    subject to change. Applications should only use zlib.h.
 3131  */
 3132 /* Structure for decoding tables.  Each entry provides either the
 3133    information needed to do the operation requested by the code that
 3134    indexed that table entry, or it provides a pointer to another
 3135    table that indexes more bits of the code.  op indicates whether
 3136    the entry is a pointer to another table, a literal, a length or
 3137    distance, an end-of-block, or an invalid code.  For a table
 3138    pointer, the low four bits of op is the number of index bits of
 3139    that table.  For a length or distance, the low four bits of op
 3140    is the number of extra bits to get after the code.  bits is
 3141    the number of bits in that code or part of the code to drop off
 3142    of the bit buffer.  val is the actual byte to output in the case
 3143    of a literal, the base length or distance, or the offset from
 3144    the current table to the next table.  Each entry is four bytes. */
 3145 typedef struct {
 3146     unsigned char op;           /* operation, extra bits, table bits */
 3147     unsigned char bits;         /* bits in that part of the code */
 3148     unsigned short val;         /* offset in table or code value */
 3149 } code;
 3150 /* op values as set by inflate_table():
 3151     00000000 - literal
 3152     0000tttt - table link, tttt != 0 is the number of table index bits
 3153     0001eeee - length or distance, eeee is the number of extra bits
 3154     01100000 - end of block
 3155     01000000 - invalid code
 3156  */
 3157 /* Maximum size of the dynamic table.  The maximum number of code structures is
 3158    1444, which is the sum of 852 for literal/length codes and 592 for distance
 3159    codes.  These values were found by exhaustive searches using the program
 3160    examples/enough.c found in the zlib distribtution.  The arguments to that
 3161    program are the number of symbols, the initial root table size, and the
 3162    maximum bit length of a code.  "enough 286 9 15" for literal/length codes
 3163    returns returns 852, and "enough 30 6 15" for distance codes returns 592.
 3164    The initial root table size (9 or 6) is found in the fifth argument of the
 3165    inflate_table() calls in inflate.c and infback.c.  If the root table size is
 3166    changed, then these maximum sizes would be need to be recalculated and
 3167    updated. */
 3168 #define ENOUGH_LENS 852
 3169 #define ENOUGH_DISTS 592
 3170 #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
 3171 /* Type of code to build for inflate_table() */
 3172 typedef enum {
 3173     CODES,
 3174     LENS,
 3175     DISTS
 3176 } codetype;
 3177 int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
 3178                              unsigned codes, code FAR * FAR *table,
 3179                              unsigned FAR *bits, unsigned short FAR *work));
 3180 /*
 3181 :file sfklib\zlib\inffixed.h
 3182 */
 3183     /* inffixed.h -- table for decoding fixed codes
 3184      * Generated automatically by makefixed().
 3185      */
 3186     /* WARNING: that file should *not* be used by applications.
 3187        It is part of the implementation of that library and is
 3188        subject to change. Applications should only use zlib.h.
 3189      */
 3190     static const code lenfix[512] = {
 3191         {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
 3192         {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
 3193         {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
 3194         {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
 3195         {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
 3196         {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
 3197         {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
 3198         {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
 3199         {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
 3200         {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
 3201         {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
 3202         {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
 3203         {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
 3204         {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
 3205         {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
 3206         {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
 3207         {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
 3208         {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
 3209         {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
 3210         {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
 3211         {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
 3212         {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
 3213         {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
 3214         {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
 3215         {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
 3216         {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
 3217         {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
 3218         {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
 3219         {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
 3220         {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
 3221         {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
 3222         {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
 3223         {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
 3224         {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
 3225         {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
 3226         {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
 3227         {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
 3228         {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
 3229         {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
 3230         {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
 3231         {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
 3232         {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
 3233         {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
 3234         {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
 3235         {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
 3236         {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
 3237         {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
 3238         {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
 3239         {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
 3240         {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
 3241         {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
 3242         {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
 3243         {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
 3244         {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
 3245         {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
 3246         {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
 3247         {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
 3248         {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
 3249         {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
 3250         {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
 3251         {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
 3252         {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
 3253         {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
 3254         {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
 3255         {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
 3256         {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
 3257         {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
 3258         {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
 3259         {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
 3260         {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
 3261         {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
 3262         {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
 3263         {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
 3264         {0,9,255}
 3265     };
 3266     static const code distfix[32] = {
 3267         {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
 3268         {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
 3269         {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
 3270         {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
 3271         {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
 3272         {22,5,193},{64,5,0}
 3273     };
 3274 /*
 3275 :file sfklib\zlib\inffast.h
 3276 */
 3277 /* inffast.h -- header to use inffast.c
 3278  * Copyright (C) 1995-2003, 2010 Mark Adler
 3279  * For conditions of distribution and use, see copyright notice in zlib.h
 3280  */
 3281 /* WARNING: that file should *not* be used by applications. It is
 3282    part of the implementation of the compression library and is
 3283    subject to change. Applications should only use zlib.h.
 3284  */
 3285 void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
 3286 /*
 3287 :file sfklib\zlib\inflate.h
 3288 */
 3289 /* inflate.h -- internal inflate state definition
 3290  * Copyright (C) 1995-2016 Mark Adler
 3291  * For conditions of distribution and use, see copyright notice in zlib.h
 3292  */
 3293 /* WARNING: that file should *not* be used by applications. It is
 3294    part of the implementation of the compression library and is
 3295    subject to change. Applications should only use zlib.h.
 3296  */
 3297 /* define NO_GZIP when compiling if you want to disable gzip header and
 3298    trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
 3299    the crc code when it is not needed.  For shared libraries, gzip decoding
 3300    should be left enabled. */
 3301 #ifndef NO_GZIP
 3302 #  define GUNZIP
 3303 #endif
 3304 /* Possible inflate modes between inflate() calls */
 3305 typedef enum {
 3306     HEAD = 16180,   /* i: waiting for magic header */
 3307     FLAGS,      /* i: waiting for method and flags (gzip) */
 3308     TIME,       /* i: waiting for modification time (gzip) */
 3309     OS,         /* i: waiting for extra flags and operating system (gzip) */
 3310     EXLEN,      /* i: waiting for extra length (gzip) */
 3311     EXTRA,      /* i: waiting for extra bytes (gzip) */
 3312     NAME,       /* i: waiting for end of file name (gzip) */
 3313     COMMENT,    /* i: waiting for end of comment (gzip) */
 3314     HCRC,       /* i: waiting for header crc (gzip) */
 3315     DICTID,     /* i: waiting for dictionary check value */
 3316     DICT,       /* waiting for inflateSetDictionary() call */
 3317         TYPE,       /* i: waiting for type bits, including last-flag bit */
 3318         TYPEDO,     /* i: same, but skip check to exit inflate on new block */
 3319         STORED,     /* i: waiting for stored size (length and complement) */
 3320         COPY_,      /* i/o: same as COPY below, but only first time in */
 3321         COPY,       /* i/o: waiting for input or output to copy stored block */
 3322         TABLE,      /* i: waiting for dynamic block table lengths */
 3323         LENLENS,    /* i: waiting for code length code lengths */
 3324         CODELENS,   /* i: waiting for length/lit and distance code lengths */
 3325             LEN_,       /* i: same as LEN below, but only first time in */
 3326             LEN,        /* i: waiting for length/lit/eob code */
 3327             LENEXT,     /* i: waiting for length extra bits */
 3328             DIST,       /* i: waiting for distance code */
 3329             DISTEXT,    /* i: waiting for distance extra bits */
 3330             MATCH,      /* o: waiting for output space to copy string */
 3331             LIT,        /* o: waiting for output space to write literal */
 3332     CHECK,      /* i: waiting for 32-bit check value */
 3333     LENGTH,     /* i: waiting for 32-bit length (gzip) */
 3334     DONE,       /* finished check, done -- remain here until reset */
 3335     BAD,        /* got a data error -- remain here until reset */
 3336     MEM,        /* got an inflate() memory error -- remain here until reset */
 3337     SYNC        /* looking for synchronization bytes to restart inflate() */
 3338 } inflate_mode;
 3339 /*
 3340     State transitions between above modes -
 3341     (most modes can go to BAD or MEM on error -- not shown for clarity)
 3342     Process header:
 3343         HEAD -> (gzip) or (zlib) or (raw)
 3344         (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
 3345                   HCRC -> TYPE
 3346         (zlib) -> DICTID or TYPE
 3347         DICTID -> DICT -> TYPE
 3348         (raw) -> TYPEDO
 3349     Read deflate blocks:
 3350             TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
 3351             STORED -> COPY_ -> COPY -> TYPE
 3352             TABLE -> LENLENS -> CODELENS -> LEN_
 3353             LEN_ -> LEN
 3354     Read deflate codes in fixed or dynamic block:
 3355                 LEN -> LENEXT or LIT or TYPE
 3356                 LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
 3357                 LIT -> LEN
 3358     Process trailer:
 3359         CHECK -> LENGTH -> DONE
 3360  */
 3361 /* State maintained between inflate() calls -- approximately 7K bytes, not
 3362    including the allocated sliding window, which is up to 32K bytes. */
 3363 struct inflate_state {
 3364     z_streamp strm;             /* pointer back to that zlib stream */
 3365     inflate_mode mode;          /* current inflate mode */
 3366     int last;                   /* true if processing last block */
 3367     int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip,
 3368                                    bit 2 true to validate check value */
 3369     int havedict;               /* true if dictionary provided */
 3370     int flags;                  /* gzip header method and flags (0 if zlib) */
 3371     unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
 3372     unsigned long check;        /* protected copy of check value */
 3373     unsigned long total;        /* protected copy of output count */
 3374     gz_headerp head;            /* where to save gzip header information */
 3375         /* sliding window */
 3376     unsigned wbits;             /* log base 2 of requested window size */
 3377     unsigned wsize;             /* window size or zero if not using window */
 3378     unsigned whave;             /* valid bytes in the window */
 3379     unsigned wnext;             /* window write index */
 3380     unsigned char FAR *window;  /* allocated sliding window, if needed */
 3381         /* bit accumulator */
 3382     unsigned long hold;         /* input bit accumulator */
 3383     unsigned bits;              /* number of bits in "in" */
 3384         /* for string and stored block copying */
 3385     unsigned length;            /* literal or length of data to copy */
 3386     unsigned offset;            /* distance back to copy string from */
 3387         /* for table and code decoding */
 3388     unsigned extra;             /* extra bits needed */
 3389         /* fixed and dynamic code tables */
 3390     code const FAR *lencode;    /* starting table for length/literal codes */
 3391     code const FAR *distcode;   /* starting table for distance codes */
 3392     unsigned lenbits;           /* index bits for lencode */
 3393     unsigned distbits;          /* index bits for distcode */
 3394         /* dynamic table building */
 3395     unsigned ncode;             /* number of code length code lengths */
 3396     unsigned nlen;              /* number of length code lengths */
 3397     unsigned ndist;             /* number of distance code lengths */
 3398     unsigned have;              /* number of code lengths in lens[] */
 3399     code FAR *next;             /* next available space in codes[] */
 3400     unsigned short lens[320];   /* temporary storage for code lengths */
 3401     unsigned short work[288];   /* work area for code table building */
 3402     code codes[ENOUGH];         /* space for code tables */
 3403     int sane;                   /* if false, allow invalid distance too far */
 3404     int back;                   /* bits back of last unprocessed length/lit */
 3405     unsigned was;               /* initial length of match */
 3406 };
 3407 /*
 3408 :file sfklib\zlib\trees.h
 3409 */
 3410 /* header created automatically with -DGEN_TREES_H */
 3411 local const ct_data static_ltree[L_CODES+2] = {
 3412 {{ 12},{  8}}, {{140},{  8}}, {{ 76},{  8}}, {{204},{  8}}, {{ 44},{  8}},
 3413 {{172},{  8}}, {{108},{  8}}, {{236},{  8}}, {{ 28},{  8}}, {{156},{  8}},
 3414 {{ 92},{  8}}, {{220},{  8}}, {{ 60},{  8}}, {{188},{  8}}, {{124},{  8}},
 3415 {{252},{  8}}, {{  2},{  8}}, {{130},{  8}}, {{ 66},{  8}}, {{194},{  8}},
 3416 {{ 34},{  8}}, {{162},{  8}}, {{ 98},{  8}}, {{226},{  8}}, {{ 18},{  8}},
 3417 {{146},{  8}}, {{ 82},{  8}}, {{210},{  8}}, {{ 50},{  8}}, {{178},{  8}},
 3418 {{114},{  8}}, {{242},{  8}}, {{ 10},{  8}}, {{138},{  8}}, {{ 74},{  8}},
 3419 {{202},{  8}}, {{ 42},{  8}}, {{170},{  8}}, {{106},{  8}}, {{234},{  8}},
 3420 {{ 26},{  8}}, {{154},{  8}}, {{ 90},{  8}}, {{218},{  8}}, {{ 58},{  8}},
 3421 {{186},{  8}}, {{122},{  8}}, {{250},{  8}}, {{  6},{  8}}, {{134},{  8}},
 3422 {{ 70},{  8}}, {{198},{  8}}, {{ 38},{  8}}, {{166},{  8}}, {{102},{  8}},
 3423 {{230},{  8}}, {{ 22},{  8}}, {{150},{  8}}, {{ 86},{  8}}, {{214},{  8}},
 3424 {{ 54},{  8}}, {{182},{  8}}, {{118},{  8}}, {{246},{  8}}, {{ 14},{  8}},
 3425 {{142},{  8}}, {{ 78},{  8}}, {{206},{  8}}, {{ 46},{  8}}, {{174},{  8}},
 3426 {{110},{  8}}, {{238},{  8}}, {{ 30},{  8}}, {{158},{  8}}, {{ 94},{  8}},
 3427 {{222},{  8}}, {{ 62},{  8}}, {{190},{  8}}, {{126},{  8}}, {{254},{  8}},
 3428 {{  1},{  8}}, {{129},{  8}}, {{ 65},{  8}}, {{193},{  8}}, {{ 33},{  8}},
 3429 {{161},{  8}}, {{ 97},{  8}}, {{225},{  8}}, {{ 17},{  8}}, {{145},{  8}},
 3430 {{ 81},{  8}}, {{209},{  8}}, {{ 49},{  8}}, {{177},{  8}}, {{113},{  8}},
 3431 {{241},{  8}}, {{  9},{  8}}, {{137},{  8}}, {{ 73},{  8}}, {{201},{  8}},
 3432 {{ 41},{  8}}, {{169},{  8}}, {{105},{  8}}, {{233},{  8}}, {{ 25},{  8}},
 3433 {{153},{  8}}, {{ 89},{  8}}, {{217},{  8}}, {{ 57},{  8}}, {{185},{  8}},
 3434 {{121},{  8}}, {{249},{  8}}, {{  5},{  8}}, {{133},{  8}}, {{ 69},{  8}},
 3435 {{197},{  8}}, {{ 37},{  8}}, {{165},{  8}}, {{101},{  8}}, {{229},{  8}},
 3436 {{ 21},{  8}}, {{149},{  8}}, {{ 85},{  8}}, {{213},{  8}}, {{ 53},{  8}},
 3437 {{181},{  8}}, {{117},{  8}}, {{245},{  8}}, {{ 13},{  8}}, {{141},{  8}},
 3438 {{ 77},{  8}}, {{205},{  8}}, {{ 45},{  8}}, {{173},{  8}}, {{109},{  8}},
 3439 {{237},{  8}}, {{ 29},{  8}}, {{157},{  8}}, {{ 93},{  8}}, {{221},{  8}},
 3440 {{ 61},{  8}}, {{189},{  8}}, {{125},{  8}}, {{253},{  8}}, {{ 19},{  9}},
 3441 {{275},{  9}}, {{147},{  9}}, {{403},{  9}}, {{ 83},{  9}}, {{339},{  9}},
 3442 {{211},{  9}}, {{467},{  9}}, {{ 51},{  9}}, {{307},{  9}}, {{179},{  9}},
 3443 {{435},{  9}}, {{115},{  9}}, {{371},{  9}}, {{243},{  9}}, {{499},{  9}},
 3444 {{ 11},{  9}}, {{267},{  9}}, {{139},{  9}}, {{395},{  9}}, {{ 75},{  9}},
 3445 {{331},{  9}}, {{203},{  9}}, {{459},{  9}}, {{ 43},{  9}}, {{299},{  9}},
 3446 {{171},{  9}}, {{427},{  9}}, {{107},{  9}}, {{363},{  9}}, {{235},{  9}},
 3447 {{491},{  9}}, {{ 27},{  9}}, {{283},{  9}}, {{155},{  9}}, {{411},{  9}},
 3448 {{ 91},{  9}}, {{347},{  9}}, {{219},{  9}}, {{475},{  9}}, {{ 59},{  9}},
 3449 {{315},{  9}}, {{187},{  9}}, {{443},{  9}}, {{123},{  9}}, {{379},{  9}},
 3450 {{251},{  9}}, {{507},{  9}}, {{  7},{  9}}, {{263},{  9}}, {{135},{  9}},
 3451 {{391},{  9}}, {{ 71},{  9}}, {{327},{  9}}, {{199},{  9}}, {{455},{  9}},
 3452 {{ 39},{  9}}, {{295},{  9}}, {{167},{  9}}, {{423},{  9}}, {{103},{  9}},
 3453 {{359},{  9}}, {{231},{  9}}, {{487},{  9}}, {{ 23},{  9}}, {{279},{  9}},
 3454 {{151},{  9}}, {{407},{  9}}, {{ 87},{  9}}, {{343},{  9}}, {{215},{  9}},
 3455 {{471},{  9}}, {{ 55},{  9}}, {{311},{  9}}, {{183},{  9}}, {{439},{  9}},
 3456 {{119},{  9}}, {{375},{  9}}, {{247},{  9}}, {{503},{  9}}, {{ 15},{  9}},
 3457 {{271},{  9}}, {{143},{  9}}, {{399},{  9}}, {{ 79},{  9}}, {{335},{  9}},
 3458 {{207},{  9}}, {{463},{  9}}, {{ 47},{  9}}, {{303},{  9}}, {{175},{  9}},
 3459 {{431},{  9}}, {{111},{  9}}, {{367},{  9}}, {{239},{  9}}, {{495},{  9}},
 3460 {{ 31},{  9}}, {{287},{  9}}, {{159},{  9}}, {{415},{  9}}, {{ 95},{  9}},
 3461 {{351},{  9}}, {{223},{  9}}, {{479},{  9}}, {{ 63},{  9}}, {{319},{  9}},
 3462 {{191},{  9}}, {{447},{  9}}, {{127},{  9}}, {{383},{  9}}, {{255},{  9}},
 3463 {{511},{  9}}, {{  0},{  7}}, {{ 64},{  7}}, {{ 32},{  7}}, {{ 96},{  7}},
 3464 {{ 16},{  7}}, {{ 80},{  7}}, {{ 48},{  7}}, {{112},{  7}}, {{  8},{  7}},
 3465 {{ 72},{  7}}, {{ 40},{  7}}, {{104},{  7}}, {{ 24},{  7}}, {{ 88},{  7}},
 3466 {{ 56},{  7}}, {{120},{  7}}, {{  4},{  7}}, {{ 68},{  7}}, {{ 36},{  7}},
 3467 {{100},{  7}}, {{ 20},{  7}}, {{ 84},{  7}}, {{ 52},{  7}}, {{116},{  7}},
 3468 {{  3},{  8}}, {{131},{  8}}, {{ 67},{  8}}, {{195},{  8}}, {{ 35},{  8}},
 3469 {{163},{  8}}, {{ 99},{  8}}, {{227},{  8}}
 3470 };
 3471 local const ct_data static_dtree[D_CODES] = {
 3472 {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
 3473 {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
 3474 {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
 3475 {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
 3476 {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
 3477 {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
 3478 };
 3479 const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
 3480  0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
 3481  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
 3482 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
 3483 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
 3484 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
 3485 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
 3486 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
 3487 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
 3488 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
 3489 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
 3490 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
 3491 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
 3492 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  0,  0, 16, 17,
 3493 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
 3494 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
 3495 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 3496 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
 3497 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
 3498 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
 3499 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 3500 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 3501 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
 3502 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 3503 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 3504 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
 3505 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
 3506 };
 3507 const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
 3508  0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
 3509 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
 3510 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
 3511 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 3512 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
 3513 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
 3514 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
 3515 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
 3516 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 3517 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
 3518 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
 3519 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
 3520 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
 3521 };
 3522 local const int base_length[LENGTH_CODES] = {
 3523 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
 3524 64, 80, 96, 112, 128, 160, 192, 224, 0
 3525 };
 3526 local const int base_dist[D_CODES] = {
 3527     0,     1,     2,     3,     4,     6,     8,    12,    16,    24,
 3528    32,    48,    64,    96,   128,   192,   256,   384,   512,   768,
 3529  1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576
 3530 };
 3531 /*
 3532 :file sfklib\zlib\deflate.c
 3533 */
 3534 /* deflate.c -- compress data using the deflation algorithm
 3535  * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
 3536  * For conditions of distribution and use, see copyright notice in zlib.h
 3537  */
 3538 /*
 3539  *  ALGORITHM
 3540  *
 3541  *      The "deflation" process depends on being able to identify portions
 3542  *      of the input text which are identical to earlier input (within a
 3543  *      sliding window trailing behind the input currently being processed).
 3544  *
 3545  *      The most straightforward technique turns out to be the fastest for
 3546  *      most input files: try all possible matches and select the longest.
 3547  *      The key feature of that algorithm is that insertions into the string
 3548  *      dictionary are very simple and thus fast, and deletions are avoided
 3549  *      completely. Insertions are performed at each input character, whereas
 3550  *      string matches are performed only when the previous match ends. So it
 3551  *      is preferable to spend more time in matches to allow very fast string
 3552  *      insertions and avoid deletions. The matching algorithm for small
 3553  *      strings is inspired from that of Rabin & Karp. A brute force approach
 3554  *      is used to find longer strings when a small match has been found.
 3555  *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
 3556  *      (by Leonid Broukhis).
 3557  *         A previous version of that file used a more sophisticated algorithm
 3558  *      (by Fiala and Greene) which is guaranteed to run in linear amortized
 3559  *      time, but has a larger average cost, uses more memory and is patented.
 3560  *      However the F&G algorithm may be faster for some highly redundant
 3561  *      files if the parameter max_chain_length (described below) is too large.
 3562  *
 3563  *  ACKNOWLEDGEMENTS
 3564  *
 3565  *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
 3566  *      I found it in 'freeze' written by Leonid Broukhis.
 3567  *      Thanks to many people for bug reports and testing.
 3568  *
 3569  *  REFERENCES
 3570  *
 3571  *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
 3572  *      Available in http://tools.ietf.org/html/rfc1951
 3573  *
 3574  *      A description of the Rabin and Karp algorithm is given in the book
 3575  *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
 3576  *
 3577  *      Fiala,E.R., and Greene,D.H.
 3578  *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
 3579  *
 3580  */
 3581 /* @(#) $Id$ */
 3582 const char zldef01_copyright[] =
 3583    " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler ";
 3584 /*
 3585   If you use the zlib library in a product, an acknowledgment is welcome
 3586   in the documentation of your product. If for some reason you cannot
 3587   include such an acknowledgment, I would appreciate that you keep that
 3588   copyright string in the executable of your product.
 3589  */
 3590 /* ===========================================================================
 3591  *  Function prototypes.
 3592  */
 3593 typedef enum {
 3594     need_more,      /* block not completed, need more input or more output */
 3595     block_done,     /* block flush performed */
 3596     finish_started, /* finish started, need only more output at next deflate */
 3597     finish_done     /* finish done, accept no more input or output */
 3598 } block_state;
 3599 typedef block_state (*compress_func) OF((deflate_state *s, int flush));
 3600 /* Compression function. Returns the block state after the call. */
 3601 local int deflateStateCheck      OF((z_streamp strm));
 3602 local void slide_hash     OF((deflate_state *s));
 3603 local void fill_window    OF((deflate_state *s));
 3604 local block_state deflate_stored OF((deflate_state *s, int flush));
 3605 local block_state deflate_fast   OF((deflate_state *s, int flush));
 3606 #ifndef FASTEST
 3607 local block_state deflate_slow   OF((deflate_state *s, int flush));
 3608 #endif
 3609 local block_state deflate_rle    OF((deflate_state *s, int flush));
 3610 local block_state deflate_huff   OF((deflate_state *s, int flush));
 3611 local void lm_init        OF((deflate_state *s));
 3612 local void putShortMSB    OF((deflate_state *s, uInt b));
 3613 local void flush_pending  OF((z_streamp strm));
 3614 local unsigned read_buf   OF((z_streamp strm, Bytef *buf, unsigned size));
 3615 #ifdef ASMV
 3616 #  pragma message("Assembler code may have bugs -- use at your own risk")
 3617       void match_init OF((void)); /* asm code initialization */
 3618       uInt longest_match  OF((deflate_state *s, IPos cur_match));
 3619 #else
 3620 local uInt longest_match  OF((deflate_state *s, IPos cur_match));
 3621 #endif
 3622 #ifdef ZLIB_DEBUG
 3623 local  void check_match OF((deflate_state *s, IPos start, IPos match,
 3624                             int length));
 3625 #endif
 3626 /* ===========================================================================
 3627  * Local data
 3628  */
 3629 #define NIL 0
 3630 /* Tail of hash chains */
 3631 #ifndef TOO_FAR
 3632 #  define TOO_FAR 4096
 3633 #endif
 3634 /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
 3635 /* Values for max_lazy_match, good_match and max_chain_length, depending on
 3636  * the desired pack level (0..9). The values given below have been tuned to
 3637  * exclude worst case performance for pathological files. Better values may be
 3638  * found for specific files.
 3639  */
 3640 typedef struct config_s {
 3641    ush good_length; /* reduce lazy search above that match length */
 3642    ush max_lazy;    /* do not perform lazy search above that match length */
 3643    ush nice_length; /* quit search above that match length */
 3644    ush max_chain;
 3645    compress_func func;
 3646 } config;
 3647 #ifdef FASTEST
 3648 local const config configuration_table[2] = {
 3649 /*      good lazy nice chain */
 3650 /* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
 3651 /* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */
 3652 #else
 3653 local const config configuration_table[10] = {
 3654 /*      good lazy nice chain */
 3655 /* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
 3656 /* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */
 3657 /* 2 */ {4,    5, 16,    8, deflate_fast},
 3658 /* 3 */ {4,    6, 32,   32, deflate_fast},
 3659 /* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
 3660 /* 5 */ {8,   16, 32,   32, deflate_slow},
 3661 /* 6 */ {8,   16, 128, 128, deflate_slow},
 3662 /* 7 */ {8,   32, 128, 256, deflate_slow},
 3663 /* 8 */ {32, 128, 258, 1024, deflate_slow},
 3664 /* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
 3665 #endif
 3666 /* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
 3667  * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
 3668  * meaning.
 3669  */
 3670 /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
 3671 #define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
 3672 /* ===========================================================================
 3673  * Update a hash value with the given input byte
 3674  * IN  assertion: all calls to UPDATE_HASH are made with consecutive input
 3675  *    characters, so that a running hash key can be computed from the previous
 3676  *    key instead of complete recalculation each time.
 3677  */
 3678 #define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
 3679 /* ===========================================================================
 3680  * Insert string str in the dictionary and set match_head to the previous head
 3681  * of the hash chain (the most recent string with same hash key). Return
 3682  * the previous length of the hash chain.
 3683  * If that file is compiled with -DFASTEST, the compression level is forced
 3684  * to 1, and no hash chains are maintained.
 3685  * IN  assertion: all calls to INSERT_STRING are made with consecutive input
 3686  *    characters and the first MIN_MATCH bytes of str are valid (except for
 3687  *    the last MIN_MATCH-1 bytes of the input file).
 3688  */
 3689 #ifdef FASTEST
 3690 #define INSERT_STRING(s, str, match_head) \
 3691    (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
 3692     match_head = s->head[s->ins_h], \
 3693     s->head[s->ins_h] = (Pos)(str))
 3694 #else
 3695 #define INSERT_STRING(s, str, match_head) \
 3696    (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
 3697     match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
 3698     s->head[s->ins_h] = (Pos)(str))
 3699 #endif
 3700 /* ===========================================================================
 3701  * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
 3702  * prev[] will be initialized on the fly.
 3703  */
 3704 #define CLEAR_HASH(s) \
 3705     s->head[s->hash_size-1] = NIL; \
 3706     zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
 3707 /* ===========================================================================
 3708  * Slide the hash table when sliding the window down (could be avoided with 32
 3709  * bit values at the expense of memory usage). We slide even when level == 0 to
 3710  * keep the hash table consistent if we switch back to level > 0 later.
 3711  */
 3712 local void slide_hash(deflate_state *s) {
 3713 
 3714     unsigned n, m;
 3715     Posf *p;
 3716     uInt wsize = s->w_size;
 3717     n = s->hash_size;
 3718     p = &s->head[n];
 3719     do {
 3720         m = *--p;
 3721         *p = (Pos)(m >= wsize ? m - wsize : NIL);
 3722     } while (--n);
 3723     n = wsize;
 3724 #ifndef FASTEST
 3725     p = &s->prev[n];
 3726     do {
 3727         m = *--p;
 3728         *p = (Pos)(m >= wsize ? m - wsize : NIL);
 3729         /* If n is not on any hash chain, prev[n] is garbage but
 3730          * its value will never be used.
 3731          */
 3732     } while (--n);
 3733 #endif
 3734 }
 3735 /* ========================================================================= */
 3736 int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, int stream_size) {
 3737 
 3738     return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
 3739                          Z_DEFAULT_STRATEGY, version, stream_size);
 3740     /* To do: ignore strm->next_in if we use it as window */
 3741 }
 3742 /* ========================================================================= */
 3743 int ZEXPORT deflateInit2_(z_streamp strm, int  level, int  method, int  windowBits, int  memLevel,int  strategy, const char *version, int stream_size) {
 3744 
 3745     deflate_state *s;
 3746     int wrap = 1;
 3747     static const char my_version[] = ZLIB_VERSION;
 3748     ushf *overlay;
 3749     /* We overlay pending_buf and d_buf+l_buf. This works since the average
 3750      * output size for (length,distance) codes is <= 24 bits.
 3751      */
 3752     if (version == Z_NULL || version[0] != my_version[0] ||
 3753         stream_size != sizeof(z_stream)) {
 3754         return Z_VERSION_ERROR;
 3755     }
 3756     if (strm == Z_NULL) return Z_STREAM_ERROR;
 3757     strm->msg = Z_NULL;
 3758     if (strm->zalloc == (alloc_func)0) {
 3759 #ifdef Z_SOLO
 3760         return Z_STREAM_ERROR;
 3761 #else
 3762         strm->zalloc = zcalloc;
 3763         strm->opaque = (voidpf)0;
 3764 #endif
 3765     }
 3766     if (strm->zfree == (free_func)0)
 3767 #ifdef Z_SOLO
 3768         return Z_STREAM_ERROR;
 3769 #else
 3770         strm->zfree = zcfree;
 3771 #endif
 3772 #ifdef FASTEST
 3773     if (level != 0) level = 1;
 3774 #else
 3775     if (level == Z_DEFAULT_COMPRESSION) level = 6;
 3776 #endif
 3777     if (windowBits < 0) { /* suppress zlib wrapper */
 3778         wrap = 0;
 3779         windowBits = -windowBits;
 3780     }
 3781 #ifdef GZIP
 3782     else if (windowBits > 15) {
 3783         wrap = 2;       /* write gzip wrapper instead */
 3784         windowBits -= 16;
 3785     }
 3786 #endif
 3787     if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
 3788         windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
 3789         strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
 3790         return Z_STREAM_ERROR;
 3791     }
 3792     if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
 3793     s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
 3794     if (s == Z_NULL) return Z_MEM_ERROR;
 3795     strm->state = (struct internal_state FAR *)s;
 3796     s->strm = strm;
 3797     s->status = INIT_STATE;     /* to pass state test in deflateReset() */
 3798     s->wrap = wrap;
 3799     s->gzhead = Z_NULL;
 3800     s->w_bits = (uInt)windowBits;
 3801     s->w_size = 1 << s->w_bits;
 3802     s->w_mask = s->w_size - 1;
 3803     s->hash_bits = (uInt)memLevel + 7;
 3804     s->hash_size = 1 << s->hash_bits;
 3805     s->hash_mask = s->hash_size - 1;
 3806     s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
 3807     s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
 3808     s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
 3809     s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
 3810     s->high_water = 0;      /* nothing written to s->window yet */
 3811     s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
 3812     overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
 3813     s->pending_buf = (uchf *) overlay;
 3814     s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
 3815     if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
 3816         s->pending_buf == Z_NULL) {
 3817         s->status = FINISH_STATE;
 3818         strm->msg = ERR_MSG(Z_MEM_ERROR);
 3819         deflateEnd (strm);
 3820         return Z_MEM_ERROR;
 3821     }
 3822     s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
 3823     s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
 3824     s->level = level;
 3825     s->strategy = strategy;
 3826     s->method = (Byte)method;
 3827     return deflateReset(strm);
 3828 }
 3829 /* =========================================================================
 3830  * Check for a valid deflate stream state. Return 0 if ok, 1 if not.
 3831  */
 3832 local int deflateStateCheck (z_streamp strm) {
 3833 
 3834     deflate_state *s;
 3835     if (strm == Z_NULL ||
 3836         strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
 3837         return 1;
 3838     s = strm->state;
 3839     if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
 3840 #ifdef GZIP
 3841                                            s->status != GZIP_STATE &&
 3842 #endif
 3843                                            s->status != EXTRA_STATE &&
 3844                                            s->status != NAME_STATE &&
 3845                                            s->status != COMMENT_STATE &&
 3846                                            s->status != HCRC_STATE &&
 3847                                            s->status != BUSY_STATE &&
 3848                                            s->status != FINISH_STATE))
 3849         return 1;
 3850     return 0;
 3851 }
 3852 /* ========================================================================= */
 3853 int ZEXPORT deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt  dictLength) {
 3854 
 3855     deflate_state *s;
 3856     uInt str, n;
 3857     int wrap;
 3858     unsigned avail;
 3859     z_const unsigned char *next;
 3860     if (deflateStateCheck(strm) || dictionary == Z_NULL)
 3861         return Z_STREAM_ERROR;
 3862     s = strm->state;
 3863     wrap = s->wrap;
 3864     if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
 3865         return Z_STREAM_ERROR;
 3866     /* when using zlib wrappers, compute Adler-32 for provided dictionary */
 3867     if (wrap == 1)
 3868         strm->adler = adler32(strm->adler, dictionary, dictLength);
 3869     s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
 3870     /* if dictionary would fill window, just replace the history */
 3871     if (dictLength >= s->w_size) {
 3872         if (wrap == 0) {            /* already empty otherwise */
 3873             CLEAR_HASH(s);
 3874             s->strstart = 0;
 3875             s->block_start = 0L;
 3876             s->insert = 0;
 3877         }
 3878         dictionary += dictLength - s->w_size;  /* use the tail */
 3879         dictLength = s->w_size;
 3880     }
 3881     /* insert dictionary into window and hash */
 3882     avail = strm->avail_in;
 3883     next = strm->next_in;
 3884     strm->avail_in = dictLength;
 3885     strm->next_in = (z_const Bytef *)dictionary;
 3886     fill_window(s);
 3887     while (s->lookahead >= MIN_MATCH) {
 3888         str = s->strstart;
 3889         n = s->lookahead - (MIN_MATCH-1);
 3890         do {
 3891             UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
 3892 #ifndef FASTEST
 3893             s->prev[str & s->w_mask] = s->head[s->ins_h];
 3894 #endif
 3895             s->head[s->ins_h] = (Pos)str;
 3896             str++;
 3897         } while (--n);
 3898         s->strstart = str;
 3899         s->lookahead = MIN_MATCH-1;
 3900         fill_window(s);
 3901     }
 3902     s->strstart += s->lookahead;
 3903     s->block_start = (long)s->strstart;
 3904     s->insert = s->lookahead;
 3905     s->lookahead = 0;
 3906     s->match_length = s->prev_length = MIN_MATCH-1;
 3907     s->match_available = 0;
 3908     strm->next_in = next;
 3909     strm->avail_in = avail;
 3910     s->wrap = wrap;
 3911     return Z_OK;
 3912 }
 3913 /* ========================================================================= */
 3914 int ZEXPORT deflateGetDictionary (z_streamp strm, Bytef *dictionary, uInt  *dictLength) {
 3915 
 3916     deflate_state *s;
 3917     uInt len;
 3918     if (deflateStateCheck(strm))
 3919         return Z_STREAM_ERROR;
 3920     s = strm->state;
 3921     len = s->strstart + s->lookahead;
 3922     if (len > s->w_size)
 3923         len = s->w_size;
 3924     if (dictionary != Z_NULL && len)
 3925         zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len);
 3926     if (dictLength != Z_NULL)
 3927         *dictLength = len;
 3928     return Z_OK;
 3929 }
 3930 /* =================================================