kusano fc6ab3
      *  ZLIB.INC - Interface to the general purpose compression library
kusano fc6ab3
      *
kusano fc6ab3
      *  ILE RPG400 version by Patrick Monnerat, DATASPHERE.
kusano fc6ab3
      *  Version 1.2.8
kusano fc6ab3
      *
kusano fc6ab3
      *
kusano fc6ab3
      *  WARNING:
kusano fc6ab3
      *     Procedures inflateInit(), inflateInit2(), deflateInit(),
kusano fc6ab3
      *         deflateInit2() and inflateBackInit() need to be called with
kusano fc6ab3
      *         two additional arguments:
kusano fc6ab3
      *         the package version string and the stream control structure.
kusano fc6ab3
      *         size. This is needed because RPG lacks some macro feature.
kusano fc6ab3
      *         Call these procedures as:
kusano fc6ab3
      *             inflateInit(...: ZLIB_VERSION: %size(z_stream))
kusano fc6ab3
      *
kusano fc6ab3
      /if not defined(ZLIB_H_)
kusano fc6ab3
      /define ZLIB_H_
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                               Constants
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
      *  Versioning information.
kusano fc6ab3
      *
kusano fc6ab3
     D ZLIB_VERSION    C                   '1.2.8'
kusano fc6ab3
     D ZLIB_VERNUM     C                   X'1280'
kusano fc6ab3
     D ZLIB_VER_MAJOR  C                   1
kusano fc6ab3
     D ZLIB_VER_MINOR  C                   2
kusano fc6ab3
     D ZLIB_VER_REVISION...
kusano fc6ab3
     D                 C                   8
kusano fc6ab3
     D ZLIB_VER_SUBREVISION...
kusano fc6ab3
     D                 C                   0
kusano fc6ab3
      *
kusano fc6ab3
      *  Other equates.
kusano fc6ab3
      *
kusano fc6ab3
     D Z_NO_FLUSH      C                   0
kusano fc6ab3
     D Z_PARTIAL_FLUSH...
kusano fc6ab3
     D                 C                   1
kusano fc6ab3
     D Z_SYNC_FLUSH    C                   2
kusano fc6ab3
     D Z_FULL_FLUSH    C                   3
kusano fc6ab3
     D Z_FINISH        C                   4
kusano fc6ab3
     D Z_BLOCK         C                   5
kusano fc6ab3
     D Z_TREES         C                   6
kusano fc6ab3
      *
kusano fc6ab3
     D Z_OK            C                   0
kusano fc6ab3
     D Z_STREAM_END    C                   1
kusano fc6ab3
     D Z_NEED_DICT     C                   2
kusano fc6ab3
     D Z_ERRNO         C                   -1
kusano fc6ab3
     D Z_STREAM_ERROR  C                   -2
kusano fc6ab3
     D Z_DATA_ERROR    C                   -3
kusano fc6ab3
     D Z_MEM_ERROR     C                   -4
kusano fc6ab3
     D Z_BUF_ERROR     C                   -5
kusano fc6ab3
     DZ_VERSION_ERROR  C                   -6
kusano fc6ab3
      *
kusano fc6ab3
     D Z_NO_COMPRESSION...
kusano fc6ab3
     D                 C                   0
kusano fc6ab3
     D Z_BEST_SPEED    C                   1
kusano fc6ab3
     D Z_BEST_COMPRESSION...
kusano fc6ab3
     D                 C                   9
kusano fc6ab3
     D Z_DEFAULT_COMPRESSION...
kusano fc6ab3
     D                 C                   -1
kusano fc6ab3
      *
kusano fc6ab3
     D Z_FILTERED      C                   1
kusano fc6ab3
     D Z_HUFFMAN_ONLY  C                   2
kusano fc6ab3
     D Z_RLE           C                   3
kusano fc6ab3
     D Z_DEFAULT_STRATEGY...
kusano fc6ab3
     D                 C                   0
kusano fc6ab3
      *
kusano fc6ab3
     D Z_BINARY        C                   0
kusano fc6ab3
     D Z_ASCII         C                   1
kusano fc6ab3
     D Z_UNKNOWN       C                   2
kusano fc6ab3
      *
kusano fc6ab3
     D Z_DEFLATED      C                   8
kusano fc6ab3
      *
kusano fc6ab3
     D Z_NULL          C                   0
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                                 Types
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D z_streamp       S               *                                        Stream struct ptr
kusano fc6ab3
     D gzFile          S               *                                        File pointer
kusano fc6ab3
     D z_off_t         S             10i 0                                      Stream offsets
kusano fc6ab3
     D z_off64_t       S             20i 0                                      Stream offsets
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                               Structures
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
      *  The GZIP encode/decode stream support structure.
kusano fc6ab3
      *
kusano fc6ab3
     D z_stream        DS                  align based(z_streamp)
kusano fc6ab3
     D  zs_next_in                     *                                        Next input byte
kusano fc6ab3
     D  zs_avail_in                  10U 0                                      Byte cnt at next_in
kusano fc6ab3
     D  zs_total_in                  10U 0                                      Total bytes read
kusano fc6ab3
     D  zs_next_out                    *                                        Output buffer ptr
kusano fc6ab3
     D  zs_avail_out                 10U 0                                      Room left @ next_out
kusano fc6ab3
     D  zs_total_out                 10U 0                                      Total bytes written
kusano fc6ab3
     D  zs_msg                         *                                        Last errmsg or null
kusano fc6ab3
     D  zs_state                       *                                        Internal state
kusano fc6ab3
     D  zs_zalloc                      *   procptr                              Int. state allocator
kusano fc6ab3
     D  zs_free                        *   procptr                              Int. state dealloc.
kusano fc6ab3
     D  zs_opaque                      *                                        Private alloc. data
kusano fc6ab3
     D  zs_data_type                 10i 0                                      ASC/BIN best guess
kusano fc6ab3
     D  zs_adler                     10u 0                                      Uncompr. adler32 val
kusano fc6ab3
     D                               10U 0                                      Reserved
kusano fc6ab3
     D                               10U 0                                      Ptr. alignment
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                     Utility function prototypes
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D compress        PR            10I 0 extproc('compress')
kusano fc6ab3
     D  dest                      65535    options(*varsize)                    Destination buffer
kusano fc6ab3
     D  destLen                      10U 0                                      Destination length
kusano fc6ab3
     D  source                    65535    const options(*varsize)              Source buffer
kusano fc6ab3
     D  sourceLen                    10u 0 value                                Source length
kusano fc6ab3
      *
kusano fc6ab3
     D compress2       PR            10I 0 extproc('compress2')
kusano fc6ab3
     D  dest                      65535    options(*varsize)                    Destination buffer
kusano fc6ab3
     D  destLen                      10U 0                                      Destination length
kusano fc6ab3
     D  source                    65535    const options(*varsize)              Source buffer
kusano fc6ab3
     D  sourceLen                    10U 0 value                                Source length
kusano fc6ab3
     D  level                        10I 0 value                                Compression level
kusano fc6ab3
      *
kusano fc6ab3
     D compressBound   PR            10U 0 extproc('compressBound')
kusano fc6ab3
     D  sourceLen                    10U 0 value
kusano fc6ab3
      *
kusano fc6ab3
     D uncompress      PR            10I 0 extproc('uncompress')
kusano fc6ab3
     D  dest                      65535    options(*varsize)                    Destination buffer
kusano fc6ab3
     D  destLen                      10U 0                                      Destination length
kusano fc6ab3
     D  source                    65535    const options(*varsize)              Source buffer
kusano fc6ab3
     D  sourceLen                    10U 0 value                                Source length
kusano fc6ab3
      *
kusano fc6ab3
      /if not defined(LARGE_FILES)
kusano fc6ab3
     D gzopen          PR                  extproc('gzopen')
kusano fc6ab3
     D                                     like(gzFile)
kusano fc6ab3
     D  path                           *   value options(*string)               File pathname
kusano fc6ab3
     D  mode                           *   value options(*string)               Open mode
kusano fc6ab3
      /else
kusano fc6ab3
     D gzopen          PR                  extproc('gzopen64')
kusano fc6ab3
     D                                     like(gzFile)
kusano fc6ab3
     D  path                           *   value options(*string)               File pathname
kusano fc6ab3
     D  mode                           *   value options(*string)               Open mode
kusano fc6ab3
      *
kusano fc6ab3
     D gzopen64        PR                  extproc('gzopen64')
kusano fc6ab3
     D                                     like(gzFile)
kusano fc6ab3
     D  path                           *   value options(*string)               File pathname
kusano fc6ab3
     D  mode                           *   value options(*string)               Open mode
kusano fc6ab3
      /endif
kusano fc6ab3
      *
kusano fc6ab3
     D gzdopen         PR                  extproc('gzdopen')
kusano fc6ab3
     D                                     like(gzFile)
kusano fc6ab3
     D  fd                           10I 0 value                                File descriptor
kusano fc6ab3
     D  mode                           *   value options(*string)               Open mode
kusano fc6ab3
      *
kusano fc6ab3
     D gzbuffer        PR            10I 0 extproc('gzbuffer')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  size                         10U 0 value
kusano fc6ab3
      *
kusano fc6ab3
     D gzsetparams     PR            10I 0 extproc('gzsetparams')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  level                        10I 0 value
kusano fc6ab3
     D  strategy                     10I 0 value
kusano fc6ab3
      *
kusano fc6ab3
     D gzread          PR            10I 0 extproc('gzread')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  buf                       65535    options(*varsize)                    Buffer
kusano fc6ab3
     D  len                          10u 0 value                                Buffer length
kusano fc6ab3
      *
kusano fc6ab3
     D gzwrite         PR            10I 0 extproc('gzwrite')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  buf                       65535    const options(*varsize)              Buffer
kusano fc6ab3
     D  len                          10u 0 value                                Buffer length
kusano fc6ab3
      *
kusano fc6ab3
     D gzputs          PR            10I 0 extproc('gzputs')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  s                              *   value options(*string)               String to output
kusano fc6ab3
      *
kusano fc6ab3
     D gzgets          PR              *   extproc('gzgets')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  buf                       65535    options(*varsize)                    Read buffer
kusano fc6ab3
     D  len                          10i 0 value                                Buffer length
kusano fc6ab3
      *
kusano fc6ab3
     D gzputc          PR            10i 0 extproc('gzputc')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  c                            10I 0 value                                Character to write
kusano fc6ab3
      *
kusano fc6ab3
     D gzgetc          PR            10i 0 extproc('gzgetc')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzgetc_         PR            10i 0 extproc('gzgetc_')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzungetc        PR            10i 0 extproc('gzungetc')
kusano fc6ab3
     D  c                            10I 0 value                                Character to push
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzflush         PR            10i 0 extproc('gzflush')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  flush                        10I 0 value                                Type of flush
kusano fc6ab3
      *
kusano fc6ab3
      /if not defined(LARGE_FILES)
kusano fc6ab3
     D gzseek          PR                  extproc('gzseek')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  offset                             value like(z_off_t)                  Offset
kusano fc6ab3
     D  whence                       10i 0 value                                Origin
kusano fc6ab3
      /else
kusano fc6ab3
     D gzseek          PR                  extproc('gzseek64')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  offset                             value like(z_off_t)                  Offset
kusano fc6ab3
     D  whence                       10i 0 value                                Origin
kusano fc6ab3
      *
kusano fc6ab3
     D gzseek64        PR                  extproc('gzseek64')
kusano fc6ab3
     D                                     like(z_off64_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  offset                             value like(z_off64_t)                Offset
kusano fc6ab3
     D  whence                       10i 0 value                                Origin
kusano fc6ab3
      /endif
kusano fc6ab3
      *
kusano fc6ab3
     D gzrewind        PR            10i 0 extproc('gzrewind')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
      /if not defined(LARGE_FILES)
kusano fc6ab3
     D gztell          PR                  extproc('gztell')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      /else
kusano fc6ab3
     D gztell          PR                  extproc('gztell64')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gztell64        PR                  extproc('gztell64')
kusano fc6ab3
     D                                     like(z_off64_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      /endif
kusano fc6ab3
      *
kusano fc6ab3
      /if not defined(LARGE_FILES)
kusano fc6ab3
     D gzoffset        PR                  extproc('gzoffset')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      /else
kusano fc6ab3
     D gzoffset        PR                  extproc('gzoffset64')
kusano fc6ab3
     D                                     like(z_off_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzoffset64      PR                  extproc('gzoffset64')
kusano fc6ab3
     D                                     like(z_off64_t)
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      /endif
kusano fc6ab3
      *
kusano fc6ab3
     D gzeof           PR            10i 0 extproc('gzeof')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzclose_r       PR            10i 0 extproc('gzclose_r')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzclose_w       PR            10i 0 extproc('gzclose_w')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzclose         PR            10i 0 extproc('gzclose')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
     D gzerror         PR              *   extproc('gzerror')                   Error string
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
     D  errnum                       10I 0                                      Error code
kusano fc6ab3
      *
kusano fc6ab3
     D gzclearerr      PR                  extproc('gzclearerr')
kusano fc6ab3
     D  file                               value like(gzFile)                   File pointer
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                        Basic function prototypes
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D zlibVersion     PR              *   extproc('zlibVersion')               Version string
kusano fc6ab3
      *
kusano fc6ab3
     D deflateInit     PR            10I 0 extproc('deflateInit_')              Init. compression
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  level                        10I 0 value                                Compression level
kusano fc6ab3
     D  version                        *   value options(*string)               Version string
kusano fc6ab3
     D  stream_size                  10i 0 value                                Stream struct. size
kusano fc6ab3
      *
kusano fc6ab3
     D deflate         PR            10I 0 extproc('deflate')                   Compress data
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  flush                        10I 0 value                                Flush type required
kusano fc6ab3
      *
kusano fc6ab3
     D deflateEnd      PR            10I 0 extproc('deflateEnd')                Termin. compression
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
      *
kusano fc6ab3
     D inflateInit     PR            10I 0 extproc('inflateInit_')              Init. expansion
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  version                        *   value options(*string)               Version string
kusano fc6ab3
     D  stream_size                  10i 0 value                                Stream struct. size
kusano fc6ab3
      *
kusano fc6ab3
     D inflate         PR            10I 0 extproc('inflate')                   Expand data
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  flush                        10I 0 value                                Flush type required
kusano fc6ab3
      *
kusano fc6ab3
     D inflateEnd      PR            10I 0 extproc('inflateEnd')                Termin. expansion
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                        Advanced function prototypes
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D deflateInit2    PR            10I 0 extproc('deflateInit2_')             Init. compression
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  level                        10I 0 value                                Compression level
kusano fc6ab3
     D  method                       10I 0 value                                Compression method
kusano fc6ab3
     D  windowBits                   10I 0 value                                log2(window size)
kusano fc6ab3
     D  memLevel                     10I 0 value                                Mem/cmpress tradeoff
kusano fc6ab3
     D  strategy                     10I 0 value                                Compression stategy
kusano fc6ab3
     D  version                        *   value options(*string)               Version string
kusano fc6ab3
     D  stream_size                  10i 0 value                                Stream struct. size
kusano fc6ab3
      *
kusano fc6ab3
     D deflateSetDictionary...
kusano fc6ab3
     D                 PR            10I 0 extproc('deflateSetDictionary')      Init. dictionary
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  dictionary                65535    const options(*varsize)              Dictionary bytes
kusano fc6ab3
     D  dictLength                   10U 0 value                                Dictionary length
kusano fc6ab3
      *
kusano fc6ab3
     D deflateCopy     PR            10I 0 extproc('deflateCopy')               Compress strm 2 strm
kusano fc6ab3
     D  dest                               like(z_stream)                       Destination stream
kusano fc6ab3
     D  source                             like(z_stream)                       Source stream
kusano fc6ab3
      *
kusano fc6ab3
     D deflateReset    PR            10I 0 extproc('deflateReset')              End and init. stream
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
      *
kusano fc6ab3
     D deflateParams   PR            10I 0 extproc('deflateParams')             Change level & strat
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  level                        10I 0 value                                Compression level
kusano fc6ab3
     D  strategy                     10I 0 value                                Compression stategy
kusano fc6ab3
      *
kusano fc6ab3
     D deflateBound    PR            10U 0 extproc('deflateBound')              Change level & strat
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  sourcelen                    10U 0 value                                Compression level
kusano fc6ab3
      *
kusano fc6ab3
     D deflatePending  PR            10I 0 extproc('deflatePending')            Change level & strat
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  pending                      10U 0                                      Pending bytes
kusano fc6ab3
     D  bits                         10I 0                                      Pending bits
kusano fc6ab3
      *
kusano fc6ab3
     D deflatePrime    PR            10I 0 extproc('deflatePrime')              Change level & strat
kusano fc6ab3
     D  strm                               like(z_stream)                       Compression stream
kusano fc6ab3
     D  bits                         10I 0 value                                # of bits to insert
kusano fc6ab3
     D  value                        10I 0 value                                Bits to insert
kusano fc6ab3
      *
kusano fc6ab3
     D inflateInit2    PR            10I 0 extproc('inflateInit2_')             Init. expansion
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  windowBits                   10I 0 value                                log2(window size)
kusano fc6ab3
     D  version                        *   value options(*string)               Version string
kusano fc6ab3
     D  stream_size                  10i 0 value                                Stream struct. size
kusano fc6ab3
      *
kusano fc6ab3
     D inflateSetDictionary...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateSetDictionary')      Init. dictionary
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  dictionary                65535    const options(*varsize)              Dictionary bytes
kusano fc6ab3
     D  dictLength                   10U 0 value                                Dictionary length
kusano fc6ab3
      *
kusano fc6ab3
     D inflateGetDictionary...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateGetDictionary')      Get dictionary
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  dictionary                65535    options(*varsize)                    Dictionary bytes
kusano fc6ab3
     D  dictLength                   10U 0                                      Dictionary length
kusano fc6ab3
      *
kusano fc6ab3
     D inflateSync     PR            10I 0 extproc('inflateSync')               Sync. expansion
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D inflateCopy     PR            10I 0 extproc('inflateCopy')
kusano fc6ab3
     D  dest                               like(z_stream)                       Destination stream
kusano fc6ab3
     D  source                             like(z_stream)                       Source stream
kusano fc6ab3
      *
kusano fc6ab3
     D inflateReset    PR            10I 0 extproc('inflateReset')              End and init. stream
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D inflateReset2   PR            10I 0 extproc('inflateReset2')             End and init. stream
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  windowBits                   10I 0 value                                Log2(buffer size)
kusano fc6ab3
      *
kusano fc6ab3
     D inflatePrime    PR            10I 0 extproc('inflatePrime')              Insert bits
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  bits                         10I 0 value                                Bit count
kusano fc6ab3
     D  value                        10I 0 value                                Bits to insert
kusano fc6ab3
      *
kusano fc6ab3
     D inflateMark     PR            10I 0 extproc('inflateMark')               Get inflate info
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D inflateBackInit...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateBackInit_')
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  windowBits                   10I 0 value                                Log2(buffer size)
kusano fc6ab3
     D  window                    65535    options(*varsize)                    Buffer
kusano fc6ab3
     D  version                        *   value options(*string)               Version string
kusano fc6ab3
     D  stream_size                  10i 0 value                                Stream struct. size
kusano fc6ab3
      *
kusano fc6ab3
     D inflateBack     PR            10I 0 extproc('inflateBack')
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  in                             *   value procptr                        Input function
kusano fc6ab3
     D  in_desc                        *   value                                Input descriptor
kusano fc6ab3
     D  out                            *   value procptr                        Output function
kusano fc6ab3
     D  out_desc                       *   value                                Output descriptor
kusano fc6ab3
      *
kusano fc6ab3
     D inflateBackEnd  PR            10I 0 extproc('inflateBackEnd')
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D zlibCompileFlags...
kusano fc6ab3
     D                 PR            10U 0 extproc('zlibCompileFlags')
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                        Checksum function prototypes
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D adler32         PR            10U 0 extproc('adler32')                   New checksum
kusano fc6ab3
     D  adler                        10U 0 value                                Old checksum
kusano fc6ab3
     D  buf                       65535    const options(*varsize)              Bytes to accumulate
kusano fc6ab3
     D  len                          10U 0 value                                Buffer length
kusano fc6ab3
      *
kusano fc6ab3
     D crc32           PR            10U 0 extproc('crc32')                     New checksum
kusano fc6ab3
     D  crc                          10U 0 value                                Old checksum
kusano fc6ab3
     D  buf                       65535    const options(*varsize)              Bytes to accumulate
kusano fc6ab3
     D  len                          10U 0 value                                Buffer length
kusano fc6ab3
      *
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *                     Miscellaneous function prototypes
kusano fc6ab3
      **************************************************************************
kusano fc6ab3
      *
kusano fc6ab3
     D zError          PR              *   extproc('zError')                    Error string
kusano fc6ab3
     D  err                          10I 0 value                                Error code
kusano fc6ab3
      *
kusano fc6ab3
     D inflateSyncPoint...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateSyncPoint')
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D get_crc_table   PR              *   extproc('get_crc_table')             Ptr to ulongs
kusano fc6ab3
      *
kusano fc6ab3
     D inflateUndermine...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateUndermine')
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
     D  arg                          10I 0 value                                Error code
kusano fc6ab3
      *
kusano fc6ab3
     D inflateResetKeep...
kusano fc6ab3
     D                 PR            10I 0 extproc('inflateResetKeep')          End and init. stream
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
     D deflateResetKeep...
kusano fc6ab3
     D                 PR            10I 0 extproc('deflateResetKeep')          End and init. stream
kusano fc6ab3
     D  strm                               like(z_stream)                       Expansion stream
kusano fc6ab3
      *
kusano fc6ab3
      /endif