diff options
Diffstat (limited to 'archived/ptlibzippy/os400')
| -rw-r--r-- | archived/ptlibzippy/os400/README400 | 48 | ||||
| -rw-r--r-- | archived/ptlibzippy/os400/bndsrc | 144 | ||||
| -rw-r--r-- | archived/ptlibzippy/os400/make.sh | 383 | ||||
| -rw-r--r-- | archived/ptlibzippy/os400/ptlibzippyfixed.rpgle | 578 | ||||
| -rw-r--r-- | archived/ptlibzippy/os400/ptlibzippyfree.rpgle | 634 |
5 files changed, 1787 insertions, 0 deletions
diff --git a/archived/ptlibzippy/os400/README400 b/archived/ptlibzippy/os400/README400 new file mode 100644 index 0000000000..aacb172812 --- /dev/null +++ b/archived/ptlibzippy/os400/README400 @@ -0,0 +1,48 @@ + PTlibzippy version 0.0.5.1 for OS/400 installation instructions + +1) Download and unpack the PTlibzippy tarball to some IFS directory. + (i.e.: /path/to/the/ptlibzippy/ifs/source/directory) + + If the installed IFS command supports gzip format, this is straightforward, +else you have to unpack first to some directory on a system supporting it, +then move the whole directory to the IFS via the network (via SMB or FTP). + +2) Edit the configuration parameters in the compilation script. + + EDTF STMF('/path/to/the/ptlibzippy/ifs/source/directory/os400/make.sh') + +Tune the parameters according to your needs if not matching the defaults. +Save the file and exit after edition. + +3) Enter qshell, then work in the PTlibzippy OS/400 specific directory. + + QSH + cd /path/to/the/ptlibzippy/ifs/source/directory/os400 + +4) Compile and install + + sh make.sh + +The script will: +- create the libraries, objects and IFS directories for the PTlibzippy environment, +- compile all modules, +- create a service program, +- create a static and a dynamic binding directory, +- install header files for C/C++ and for ILE/RPG, both for compilation in + DB2 and IFS environments. + +That's all. + + +Notes: For OS/400 ILE RPG programmers, a /copy member defining the PTlibzippy + API prototypes for ILE RPG can be found in PTLIBZIPPY/H(PTLIBZIPPY.INC). + In the ILE environment, the same definitions are available from + file ptlibzippy.inc located in the same IFS include directory as the + C/C++ header files. + Please read comments in this member for more information. + + Remember that most foreign textual data are ASCII coded: this + implementation does not handle conversion from/to ASCII, so + text data code conversions must be done explicitly. + + Mainly for the reason above, always open zipped files in binary mode. diff --git a/archived/ptlibzippy/os400/bndsrc b/archived/ptlibzippy/os400/bndsrc new file mode 100644 index 0000000000..c0a8d8571d --- /dev/null +++ b/archived/ptlibzippy/os400/bndsrc @@ -0,0 +1,144 @@ +STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('PTLIBZIPPY') + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.1.3 entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("adler32") + EXPORT SYMBOL("compress") + EXPORT SYMBOL("compress2") + EXPORT SYMBOL("crc32") + EXPORT SYMBOL("get_crc_table") + EXPORT SYMBOL("deflate") + EXPORT SYMBOL("deflateEnd") + EXPORT SYMBOL("deflateSetDictionary") + EXPORT SYMBOL("deflateCopy") + EXPORT SYMBOL("deflateReset") + EXPORT SYMBOL("deflateParams") + EXPORT SYMBOL("deflatePrime") + EXPORT SYMBOL("deflateInit_") + EXPORT SYMBOL("deflateInit2_") + EXPORT SYMBOL("gzopen") + EXPORT SYMBOL("gzdopen") + EXPORT SYMBOL("gzsetparams") + EXPORT SYMBOL("gzread") + EXPORT SYMBOL("gzwrite") + EXPORT SYMBOL("gzprintf") + EXPORT SYMBOL("gzputs") + EXPORT SYMBOL("gzgets") + EXPORT SYMBOL("gzputc") + EXPORT SYMBOL("gzgetc") + EXPORT SYMBOL("gzflush") + EXPORT SYMBOL("gzseek") + EXPORT SYMBOL("gzrewind") + EXPORT SYMBOL("gztell") + EXPORT SYMBOL("gzeof") + EXPORT SYMBOL("gzclose") + EXPORT SYMBOL("gzerror") + EXPORT SYMBOL("inflate") + EXPORT SYMBOL("inflateEnd") + EXPORT SYMBOL("inflateSetDictionary") + EXPORT SYMBOL("inflateSync") + EXPORT SYMBOL("inflateReset") + EXPORT SYMBOL("inflateInit_") + EXPORT SYMBOL("inflateInit2_") + EXPORT SYMBOL("inflateSyncPoint") + EXPORT SYMBOL("uncompress") + EXPORT SYMBOL("ptlibzippyVersion") + EXPORT SYMBOL("ptError") + EXPORT SYMBOL("z_errmsg") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.1 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("compressBound") + EXPORT SYMBOL("deflateBound") + EXPORT SYMBOL("deflatePending") + EXPORT SYMBOL("gzungetc") + EXPORT SYMBOL("gzclearerr") + EXPORT SYMBOL("inflateBack") + EXPORT SYMBOL("inflateBackEnd") + EXPORT SYMBOL("inflateBackInit_") + EXPORT SYMBOL("inflateCopy") + EXPORT SYMBOL("ptlibzippyCompileFlags") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.4 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("adler32_combine") + EXPORT SYMBOL("adler32_combine64") + EXPORT SYMBOL("crc32_combine") + EXPORT SYMBOL("crc32_combine64") + EXPORT SYMBOL("deflateSetHeader") + EXPORT SYMBOL("deflateTune") + EXPORT SYMBOL("gzbuffer") + EXPORT SYMBOL("gzclose_r") + EXPORT SYMBOL("gzclose_w") + EXPORT SYMBOL("gzdirect") + EXPORT SYMBOL("gzoffset") + EXPORT SYMBOL("gzoffset64") + EXPORT SYMBOL("gzopen64") + EXPORT SYMBOL("gzseek64") + EXPORT SYMBOL("gztell64") + EXPORT SYMBOL("inflateGetHeader") + EXPORT SYMBOL("inflateMark") + EXPORT SYMBOL("inflatePrime") + EXPORT SYMBOL("inflateReset2") + EXPORT SYMBOL("inflateUndermine") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.6 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("deflateResetKeep") + EXPORT SYMBOL("gzgetc_") + EXPORT SYMBOL("inflateResetKeep") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.8 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("gzvprintf") + EXPORT SYMBOL("inflateGetDictionary") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.9 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("adler32_z") + EXPORT SYMBOL("crc32_z") + EXPORT SYMBOL("deflateGetDictionary") + EXPORT SYMBOL("gzfread") + EXPORT SYMBOL("gzfwrite") + EXPORT SYMBOL("inflateCodesUsed") + EXPORT SYMBOL("inflateValidate") + EXPORT SYMBOL("uncompress2") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.12 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("crc32_combine_gen64") + EXPORT SYMBOL("crc32_combine_gen") + EXPORT SYMBOL("crc32_combine_op") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.3.1.2 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("deflateUsed") + +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 0.0.5.1 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("compressBound_z") + EXPORT SYMBOL("deflateBound_z") + EXPORT SYMBOL("compress_z") + EXPORT SYMBOL("compress2_z") + EXPORT SYMBOL("uncompress_z") + EXPORT SYMBOL("uncompress2_z") + +ENDPGMEXP diff --git a/archived/ptlibzippy/os400/make.sh b/archived/ptlibzippy/os400/make.sh new file mode 100644 index 0000000000..cc35c7bf4c --- /dev/null +++ b/archived/ptlibzippy/os400/make.sh @@ -0,0 +1,383 @@ +#!/bin/sh +# +# PTLIBZIPPY compilation script for the OS/400. +# +# +# This is a shell script since make is not a standard component of OS/400. + + +################################################################################ +# +# Tunable configuration parameters. +# +################################################################################ + +TARGETLIB='PTLIBZIPPY' # Target OS/400 program library +STATBNDDIR='PTLIBZIPPY_A' # Static binding directory. +DYNBNDDIR='PTLIBZIPPY' # Dynamic binding directory. +SRVPGM="PTLIBZIPPY" # Service program. +IFSDIR='/ptlibzippy' # IFS support base directory. +TGTCCSID='500' # Target CCSID of objects +DEBUG='*NONE' # Debug level +OPTIMIZE='40' # Optimisation level +OUTPUT='*NONE' # Compilation output option. +TGTRLS='V6R1M0' # Target OS release + +export TARGETLIB STATBNDDIR DYNBNDDIR SRVPGM IFSDIR +export TGTCCSID DEBUG OPTIMIZE OUTPUT TGTRLS + + +################################################################################ +# +# OS/400 specific definitions. +# +################################################################################ + +LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB" + + +################################################################################ +# +# Procedures. +# +################################################################################ + +# action_needed dest [src] +# +# dest is an object to build +# if specified, src is an object on which dest depends. +# +# exit 0 (succeeds) if some action has to be taken, else 1. + +action_needed() + +{ + [ ! -e "${1}" ] && return 0 + [ "${2}" ] || return 1 + [ "${1}" -ot "${2}" ] && return 0 + return 1 +} + + +# make_module module_name source_name [additional_definitions] +# +# Compile source name into module if needed. +# As side effect, append the module name to variable MODULES. +# Set LINK to "YES" if the module has been compiled. + +make_module() + +{ + MODULES="${MODULES} ${1}" + MODIFSNAME="${LIBIFSNAME}/${1}.MODULE" + CSRC="`basename \"${2}\"`" + + if action_needed "${MODIFSNAME}" "${2}" + then : + elif [ ! "`sed -e \"/<source name=\\\"${CSRC}\\\">/,/<\\\\/source>/!d\" \ + -e '/<depend /!d' \ + -e 's/.* name=\"\\([^\"]*\\)\".*/\\1/' < \"${TOPDIR}/treebuild.xml\" | + while read HDR + do if action_needed \"${MODIFSNAME}\" \"${IFSDIR}/include/${HDR}\" + then echo recompile + break + fi + done`" ] + then return 0 + fi + + CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('${2}')" + CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)" + CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)" + CMD="${CMD} INCDIR('${IFSDIR}/include' ${INCLUDES})" + CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})" + CMD="${CMD} OUTPUT(${OUTPUT})" + CMD="${CMD} OPTIMIZE(${OPTIMIZE})" + CMD="${CMD} DBGVIEW(${DEBUG})" + system "${CMD}" + LINK=YES +} + + +# Determine DB2 object name from IFS name. + +db2_name() + +{ + basename "${1}" | + tr 'a-z-' 'A-Z_' | + sed -e 's/\..*//' \ + -e 's/^\(.\).*\(.........\)$/\1\2/' +} + + +# Force enumeration types to be the same size as integers. + +copy_hfile() + +{ + sed -e '1i\ +#pragma enum(int)\ +' "${@}" -e '$a\ +#pragma enum(pop)\ +' +} + + +################################################################################ +# +# Script initialization. +# +################################################################################ + +SCRIPTDIR=`dirname "${0}"` + +case "${SCRIPTDIR}" in +/*) ;; +*) SCRIPTDIR="`pwd`/${SCRIPTDIR}" +esac + +while true +do case "${SCRIPTDIR}" in + */.) SCRIPTDIR="${SCRIPTDIR%/.}";; + *) break;; + esac +done + +# The script directory is supposed to be in ${TOPDIR}/os400. + +TOPDIR=`dirname "${SCRIPTDIR}"` +export SCRIPTDIR TOPDIR +cd "${TOPDIR}" + + +# Extract the version from the master compilation XML file. + +VERSION=`sed -e '/^<package /!d' \ + -e 's/^.* version="\([0-9.]*\)".*$/\1/' -e 'q' \ + < treebuild.xml` +export VERSION + +################################################################################ + + +# Create the OS/400 library if it does not exist. + +if action_needed "${LIBIFSNAME}" +then CMD="CRTLIB LIB(${TARGETLIB}) TEXT('PTLIBZIPPY: Data compression API')" + system "${CMD}" +fi + + +# Create the DOCS source file if it does not exist. + +if action_needed "${LIBIFSNAME}/DOCS.FILE" +then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(112)" + CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')" + system "${CMD}" +fi + +# Copy some documentation files if needed. + +for TEXT in "${TOPDIR}/ChangeLog" "${TOPDIR}/FAQ" \ + "${TOPDIR}/README" "${SCRIPTDIR}/README400" +do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR" + + if action_needed "${MEMBER}" "${TEXT}" + then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})" + CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + system "CHGPFM FILE(${TARGETLIB}/DOCS) MBR(`basename ${TEXT}`) SRCTYPE(TXT)" + fi +done + + +# Create the OS/400 source program file for the C header files. + +SRCPF="${LIBIFSNAME}/H.FILE" + +if action_needed "${SRCPF}" +then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)" + CMD="${CMD} CCSID(${TGTCCSID}) TEXT('PTLIBZIPPY: C/C++ header files')" + system "${CMD}" +fi + + +# Create the IFS directory for the C header files. + +if action_needed "${IFSDIR}/include" +then mkdir -p "${IFSDIR}/include" +fi + +# Copy the header files to DB2 library. Link from IFS include directory. + +for HFILE in "${TOPDIR}/"*.h +do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR" + + if action_needed "${DEST}" "${HFILE}" + then copy_hfile < "${HFILE}" > tmphdrfile + + # Need to translate to target CCSID. + + CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DEST}')" + CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + system "CHGPFM FILE(${TARGETLIB}/H) MBR(`basename ${HFILE} .h`) SRCTYPE(H)" + # touch -r "${HFILE}" "${DEST}" + rm -f tmphdrfile + fi + + IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`" + + if action_needed "${IFSFILE}" "${DEST}" + then rm -f "${IFSFILE}" + ln -s "${DEST}" "${IFSFILE}" + fi +done + + +# Install the ILE/RPG header file. + + +HFILE="${SCRIPTDIR}/ptlibzippyfixed.rpgle" +MBR="PTLIBZIPPYFIXED" +DEST="${SRCPF}/${MBR}.MBR" + +if action_needed "${DEST}" "${HFILE}" +then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')" + CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + # touch -r "${HFILE}" "${DEST}" + system "CHGPFM FILE(${TARGETLIB}/H) MBR(${MBR}) SRCTYPE(RPGLE)" +fi + +HFILE="${SCRIPTDIR}/ptlibzippyfree.rpgle" +MBR="PTLIBZIPPYFREE" +DEST="${SRCPF}/${MBR}.MBR" + +if action_needed "${DEST}" "${HFILE}" +then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')" + CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + # touch -r "${HFILE}" "${DEST}" + system "CHGPFM FILE(${TARGETLIB}/H) MBR(${MBR}) SRCTYPE(RPGLE)" +fi + +IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`" + +if action_needed "${IFSFILE}" "${DEST}" +then rm -f "${IFSFILE}" + ln -s "${DEST}" "${IFSFILE}" +fi + + +# Create and compile the identification source file. + +echo '#pragma comment(user, "PTLIBZIPPY version '"${VERSION}"'")' > os400.c +echo '#pragma comment(user, __DATE__)' >> os400.c +echo '#pragma comment(user, __TIME__)' >> os400.c +echo '#pragma comment(copyright, "Copyright (C) 1995-2026 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c +make_module OS400 os400.c +LINK= # No need to rebuild service program yet. +MODULES= + + +# Get source list. + +CSOURCES=`sed -e '/<source name="/!d' \ + -e 's/.* name="\([^"]*\)".*/\1/' < treebuild.xml` + +# Compile the sources into modules. + +for SRC in ${CSOURCES} +do MODULE=`db2_name "${SRC}"` + make_module "${MODULE}" "${SRC}" +done + + +# If needed, (re)create the static binding directory. + +if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" +then LINK=YES +fi + +if [ "${LINK}" ] +then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" + CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})" + CMD="${CMD} TEXT('PTLIBZIPPY static binding directory')" + system "${CMD}" + + for MODULE in ${MODULES} + do CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${STATBNDDIR})" + CMD="${CMD} OBJ((${TARGETLIB}/${MODULE} *MODULE))" + system "${CMD}" + done +fi + + +# The exportation file for service program creation must be in a DB2 +# source file, so make sure it exists. + +if action_needed "${LIBIFSNAME}/TOOLS.FILE" +then CMD="CRTSRCPF FILE(${TARGETLIB}/TOOLS) RCDLEN(112)" + CMD="${CMD} CCSID(${TGTCCSID}) TEXT('PTLIBZIPPY: build tools')" + system "${CMD}" +fi + + +DEST="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR" + +if action_needed "${DEST}" "${SCRIPTDIR}/bndsrc" +then CMD="CPY OBJ('${SCRIPTDIR}/bndsrc') TOOBJ('${DEST}')" + CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + system "CHGPFM FILE(${TARGETLIB}/TOOLS) MBR(BNDSRC) SRCTYPE(BND)" + # touch -r "${SCRIPTDIR}/bndsrc" "${DEST}" + LINK=YES +fi + + +# Build the service program if needed. + +if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM" +then LINK=YES +fi + +if [ "${LINK}" ] +then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})" + CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)" + CMD="${CMD} MODULE(${TARGETLIB}/OS400)" + CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR})" + CMD="${CMD} TEXT('PTLIBZIPPY ${VERSION} dynamic library')" + CMD="${CMD} TGTRLS(${TGTRLS})" + system "${CMD}" + LINK=YES + + # Duplicate the service program for a versioned backup. + + BACKUP=`echo "${SRVPGM}${VERSION}" | + sed -e 's/.*\(..........\)$/\1/' -e 's/\./_/g'` + BACKUP="`db2_name \"${BACKUP}\"`" + BKUPIFSNAME="${LIBIFSNAME}/${BACKUP}.SRVPGM" + rm -f "${BKUPIFSNAME}" + CMD="CRTDUPOBJ OBJ(${SRVPGM}) FROMLIB(${TARGETLIB})" + CMD="${CMD} OBJTYPE(*SRVPGM) NEWOBJ(${BACKUP})" + system "${CMD}" +fi + + +# If needed, (re)create the dynamic binding directory. + +if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" +then LINK=YES +fi + +if [ "${LINK}" ] +then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" + CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})" + CMD="${CMD} TEXT('PTLIBZIPPY dynamic binding directory')" + system "${CMD}" + CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})" + CMD="${CMD} OBJ((${TARGETLIB}/${SRVPGM} *SRVPGM))" + system "${CMD}" +fi diff --git a/archived/ptlibzippy/os400/ptlibzippyfixed.rpgle b/archived/ptlibzippy/os400/ptlibzippyfixed.rpgle new file mode 100644 index 0000000000..2d9232a6c5 --- /dev/null +++ b/archived/ptlibzippy/os400/ptlibzippyfixed.rpgle @@ -0,0 +1,578 @@ + * PTLIBZIPPY.INC - Interface to the general purpose compression library + * + * ILE RPG400 version by Patrick Monnerat, DATASPHERE. + * Version 0.0.5.1 + * + * + * WARNING: + * Procedures inflateInit(), inflateInit2(), deflateInit(), + * deflateInit2() and inflateBackInit() need to be called with + * two additional arguments: + * the package version string and the stream control structure. + * size. This is needed because RPG lacks some macro feature. + * Call these procedures as: + * inflateInit(...: PTLIBZIPPY_VERSION: %size(z_stream)) + * + /if not defined(PTLIBZIPPY_H_) + /define PTLIBZIPPY_H_ + * + ************************************************************************** + * Constants + ************************************************************************** + * + * Versioning information. + * + D PTLIBZIPPY_VERSION C '0.0.5.1' + D PTLIBZIPPY_VERNUM C X'12a0' + D PTLIBZIPPY_VER_MAJOR C 0 + D PTLIBZIPPY_VER_MINOR C 0 + D PTLIBZIPPY_VER_REVISION... + D C 5 + D PTLIBZIPPY_VER_SUBREVISION... + D C 1 + * + * Other equates. + * + D Z_NO_FLUSH C 0 + D Z_PARTIAL_FLUSH... + D C 1 + D Z_SYNC_FLUSH C 2 + D Z_FULL_FLUSH C 3 + D Z_FINISH C 4 + D Z_BLOCK C 5 + D Z_TREES C 6 + * + D Z_OK C 0 + D Z_STREAM_END C 1 + D Z_NEED_DICT C 2 + D Z_ERRNO C -1 + D Z_STREAM_ERROR C -2 + D Z_DATA_ERROR C -3 + D Z_MEM_ERROR C -4 + D Z_BUF_ERROR C -5 + D Z_VERSION_ERROR... + D C -6 + * + D Z_NO_COMPRESSION... + D C 0 + D Z_BEST_SPEED C 1 + D Z_BEST_COMPRESSION... + D C 9 + D Z_DEFAULT_COMPRESSION... + D C -1 + * + D Z_FILTERED C 1 + D Z_HUFFMAN_ONLY C 2 + D Z_RLE C 3 + D Z_DEFAULT_STRATEGY... + D C 0 + * + D Z_BINARY C 0 + D Z_ASCII C 1 + D Z_UNKNOWN C 2 + * + D Z_DEFLATED C 8 + * + D Z_NULL C 0 + * + ************************************************************************** + * Types + ************************************************************************** + * + D z_streamp S * Stream struct ptr + D gzFile S * File pointer + D gz_headerp S * + D z_off_t S 10i 0 Stream offsets + D z_off64_t S 20i 0 Stream offsets + * + ************************************************************************** + * Structures + ************************************************************************** + * + * The GZIP encode/decode stream support structure. + * + D z_stream DS align based(z_streamp) + D zs_next_in * Next input byte + D zs_avail_in 10U 0 Byte cnt at next_in + D zs_total_in 10U 0 Total bytes read + D zs_next_out * Output buffer ptr + D zs_avail_out 10U 0 Room left @ next_out + D zs_total_out 10U 0 Total bytes written + D zs_msg * Last errmsg or null + D zs_state * Internal state + D zs_zalloc * procptr Int. state allocator + D zs_free * procptr Int. state dealloc. + D zs_opaque * Private alloc. data + D zs_data_type 10i 0 ASC/BIN best guess + D zs_adler 10u 0 Uncompr. adler32 val + D 10U 0 Reserved + D 10U 0 Ptr. alignment + * + ************************************************************************** + * Utility function prototypes + ************************************************************************** + * + D compress PR 10I 0 extproc('compress') + D dest 65535 options(*varsize) Destination buffer + D destLen 10U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 10u 0 value Source length + * + D compress2 PR 10I 0 extproc('compress2') + D dest 65535 options(*varsize) Destination buffer + D destLen 10U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 10U 0 value Source length + D level 10I 0 value Compression level + * + D compress_z PR 10I 0 extproc('compress') + D dest 65535 options(*varsize) Destination buffer + D destLen 20U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 20u 0 value Source length + * + D compress2_z PR 10I 0 extproc('compress2') + D dest 65535 options(*varsize) Destination buffer + D destLen 20U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 20U 0 value Source length + D level 10I 0 value Compression level + * + D compressBound PR 10U 0 extproc('compressBound') + D sourceLen 10U 0 value + * + D compressBound_z PR 20U 0 extproc('compressBound') + D sourceLen 20U 0 value + * + D uncompress PR 10I 0 extproc('uncompress') + D dest 65535 options(*varsize) Destination buffer + D destLen 10U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 10U 0 value Source length + * + D uncompress2 PR 10I 0 extproc('uncompress2') + D dest 65535 options(*varsize) Destination buffer + D destLen 10U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 10U 0 Source length + * + D uncompress_z PR 10I 0 extproc('uncompress') + D dest 65535 options(*varsize) Destination buffer + D destLen 20U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 20U 0 value Source length + * + D uncompress2_z PR 10I 0 extproc('uncompress2') + D dest 65535 options(*varsize) Destination buffer + D destLen 20U 0 Destination length + D source 65535 const options(*varsize) Source buffer + D sourceLen 20U 0 Source length + * + /if not defined(LARGE_FILES) + D gzopen PR extproc('gzopen') + D like(gzFile) + D path * value options(*string) File pathname + D mode * value options(*string) Open mode + /else + D gzopen PR extproc('gzopen64') + D like(gzFile) + D path * value options(*string) File pathname + D mode * value options(*string) Open mode + * + D gzopen64 PR extproc('gzopen64') + D like(gzFile) + D path * value options(*string) File pathname + D mode * value options(*string) Open mode + /endif + * + D gzdopen PR extproc('gzdopen') + D like(gzFile) + D fd 10I 0 value File descriptor + D mode * value options(*string) Open mode + * + D gzbuffer PR 10I 0 extproc('gzbuffer') + D file value like(gzFile) File pointer + D size 10U 0 value + * + D gzsetparams PR 10I 0 extproc('gzsetparams') + D file value like(gzFile) File pointer + D level 10I 0 value + D strategy 10I 0 value + * + D gzread PR 10I 0 extproc('gzread') + D file value like(gzFile) File pointer + D buf 65535 options(*varsize) Buffer + D len 10u 0 value Buffer length + * + D gzfread PR 20I 0 extproc('gzfread') + D buf 65535 options(*varsize) Buffer + D size 20u 0 value Buffer length + D nitems 20u 0 value Buffer length + D file value like(gzFile) File pointer + * + D gzwrite PR 10I 0 extproc('gzwrite') + D file value like(gzFile) File pointer + D buf 65535 const options(*varsize) Buffer + D len 10u 0 value Buffer length + * + D gzfwrite PR 20I 0 extproc('gzfwrite') + D buf 65535 options(*varsize) Buffer + D size 20u 0 value Buffer length + D nitems 20u 0 value Buffer length + D file value like(gzFile) File pointer + * + D gzputs PR 10I 0 extproc('gzputs') + D file value like(gzFile) File pointer + D s * value options(*string) String to output + * + D gzgets PR * extproc('gzgets') + D file value like(gzFile) File pointer + D buf 65535 options(*varsize) Read buffer + D len 10i 0 value Buffer length + * + D gzputc PR 10i 0 extproc('gzputc') + D file value like(gzFile) File pointer + D c 10I 0 value Character to write + * + D gzgetc PR 10i 0 extproc('gzgetc') + D file value like(gzFile) File pointer + * + D gzgetc_ PR 10i 0 extproc('gzgetc_') + D file value like(gzFile) File pointer + * + D gzungetc PR 10i 0 extproc('gzungetc') + D c 10I 0 value Character to push + D file value like(gzFile) File pointer + * + D gzflush PR 10i 0 extproc('gzflush') + D file value like(gzFile) File pointer + D flush 10I 0 value Type of flush + * + /if not defined(LARGE_FILES) + D gzseek PR extproc('gzseek') + D like(z_off_t) + D file value like(gzFile) File pointer + D offset value like(z_off_t) Offset + D whence 10i 0 value Origin + /else + D gzseek PR extproc('gzseek64') + D like(z_off_t) + D file value like(gzFile) File pointer + D offset value like(z_off_t) Offset + D whence 10i 0 value Origin + * + D gzseek64 PR extproc('gzseek64') + D like(z_off64_t) + D file value like(gzFile) File pointer + D offset value like(z_off64_t) Offset + D whence 10i 0 value Origin + /endif + * + D gzrewind PR 10i 0 extproc('gzrewind') + D file value like(gzFile) File pointer + * + /if not defined(LARGE_FILES) + D gztell PR extproc('gztell') + D like(z_off_t) + D file value like(gzFile) File pointer + /else + D gztell PR extproc('gztell64') + D like(z_off_t) + D file value like(gzFile) File pointer + * + D gztell64 PR extproc('gztell64') + D like(z_off64_t) + D file value like(gzFile) File pointer + /endif + * + /if not defined(LARGE_FILES) + D gzoffset PR extproc('gzoffset') + D like(z_off_t) + D file value like(gzFile) File pointer + /else + D gzoffset PR extproc('gzoffset64') + D like(z_off_t) + D file value like(gzFile) File pointer + * + D gzoffset64 PR extproc('gzoffset64') + D like(z_off64_t) + D file value like(gzFile) File pointer + /endif + * + D gzeof PR 10i 0 extproc('gzeof') + D file value like(gzFile) File pointer + * + D gzdirect PR 10i 0 extproc('gzdirect') + D file value like(gzFile) File pointer + * + D gzclose_r PR 10i 0 extproc('gzclose_r') + D file value like(gzFile) File pointer + * + D gzclose_w PR 10i 0 extproc('gzclose_w') + D file value like(gzFile) File pointer + * + D gzclose PR 10i 0 extproc('gzclose') + D file value like(gzFile) File pointer + * + D gzerror PR * extproc('gzerror') Error string + D file value like(gzFile) File pointer + D errnum 10I 0 Error code + * + D gzclearerr PR extproc('gzclearerr') + D file value like(gzFile) File pointer + * + ************************************************************************** + * Basic function prototypes + ************************************************************************** + * + D ptlibzippyVersion PR * extproc('ptlibzippyVersion') Version string + * + D deflateInit PR 10I 0 extproc('deflateInit_') Init. compression + D strm like(z_stream) Compression stream + D level 10I 0 value Compression level + D version * value options(*string) Version string + D stream_size 10i 0 value Stream struct. size + * + D deflate PR 10I 0 extproc('deflate') Compress data + D strm like(z_stream) Compression stream + D flush 10I 0 value Flush type required + * + D deflateEnd PR 10I 0 extproc('deflateEnd') Termin. compression + D strm like(z_stream) Compression stream + * + D inflateInit PR 10I 0 extproc('inflateInit_') Init. expansion + D strm like(z_stream) Expansion stream + D version * value options(*string) Version string + D stream_size 10i 0 value Stream struct. size + * + D inflate PR 10I 0 extproc('inflate') Expand data + D strm like(z_stream) Expansion stream + D flush 10I 0 value Flush type required + * + D inflateEnd PR 10I 0 extproc('inflateEnd') Termin. expansion + D strm like(z_stream) Expansion stream + * + ************************************************************************** + * Advanced function prototypes + ************************************************************************** + * + D deflateInit2 PR 10I 0 extproc('deflateInit2_') Init. compression + D strm like(z_stream) Compression stream + D level 10I 0 value Compression level + D method 10I 0 value Compression method + D windowBits 10I 0 value log2(window size) + D memLevel 10I 0 value Mem/cmpress tradeoff + D strategy 10I 0 value Compression strategy + D version * value options(*string) Version string + D stream_size 10i 0 value Stream struct. size + * + D deflateSetDictionary... + D PR 10I 0 extproc('deflateSetDictionary') Init. dictionary + D strm like(z_stream) Compression stream + D dictionary 65535 const options(*varsize) Dictionary bytes + D dictLength 10U 0 value Dictionary length + * + D deflateCopy PR 10I 0 extproc('deflateCopy') Compress strm 2 strm + D dest like(z_stream) Destination stream + D source like(z_stream) Source stream + * + D deflateReset PR 10I 0 extproc('deflateReset') End and init. stream + D strm like(z_stream) Compression stream + * + D deflateParams PR 10I 0 extproc('deflateParams') Change level & strat + D strm like(z_stream) Compression stream + D level 10I 0 value Compression level + D strategy 10I 0 value Compression strategy + * + D deflateTune PR 10I 0 extproc('deflateTune') + D strm like(z_stream) Compression stream + D good 10I 0 value + D lazy 10I 0 value + D nice 10I 0 value + D chain 10I 0 value + * + D deflateBound PR 10U 0 extproc('deflateBound') Change level & strat + D strm like(z_stream) Compression stream + D sourcelen 10U 0 value Compression level + * + D deflateBound_z PR 20U 0 extproc('deflateBound') Change level & strat + D strm like(z_stream) Compression stream + D sourcelen 20U 0 value Compression level + * + D deflatePending PR 10I 0 extproc('deflatePending') Change level & strat + D strm like(z_stream) Compression stream + D pending 10U 0 Pending bytes + D bits 10I 0 Pending bits + * + D deflateUsed PR 10I 0 extproc('deflateUsed') Get used bits + D strm like(z_stream) Compression stream + D bits 10I 0 Used bits + * + D deflatePrime PR 10I 0 extproc('deflatePrime') Change level & strat + D strm like(z_stream) Compression stream + D bits 10I 0 value # of bits to insert + D value 10I 0 value Bits to insert + * + D inflateInit2 PR 10I 0 extproc('inflateInit2_') Init. expansion + D strm like(z_stream) Expansion stream + D windowBits 10I 0 value log2(window size) + D version * value options(*string) Version string + D stream_size 10i 0 value Stream struct. size + * + D inflateSetDictionary... + D PR 10I 0 extproc('inflateSetDictionary') Init. dictionary + D strm like(z_stream) Expansion stream + D dictionary 65535 const options(*varsize) Dictionary bytes + D dictLength 10U 0 value Dictionary length + * + D inflateGetDictionary... + D PR 10I 0 extproc('inflateGetDictionary') Get dictionary + D strm like(z_stream) Expansion stream + D dictionary 65535 options(*varsize) Dictionary bytes + D dictLength 10U 0 Dictionary length + * + D deflateGetDictionary... + D PR 10I 0 extproc('deflateGetDictionary') Get dictionary + D strm like(z_stream) Expansion stream + D dictionary 65535 options(*varsize) Dictionary bytes + D dictLength 10U 0 Dictionary length + * + D inflateSync PR 10I 0 extproc('inflateSync') Sync. expansion + D strm like(z_stream) Expansion stream + * + D inflateCopy PR 10I 0 extproc('inflateCopy') + D dest like(z_stream) Destination stream + D source like(z_stream) Source stream + * + D inflateReset PR 10I 0 extproc('inflateReset') End and init. stream + D strm like(z_stream) Expansion stream + * + D inflateReset2 PR 10I 0 extproc('inflateReset2') End and init. stream + D strm like(z_stream) Expansion stream + D windowBits 10I 0 value Log2(buffer size) + * + D inflatePrime PR 10I 0 extproc('inflatePrime') Insert bits + D strm like(z_stream) Expansion stream + D bits 10I 0 value Bit count + D value 10I 0 value Bits to insert + * + D inflateMark PR 10I 0 extproc('inflateMark') Get inflate info + D strm like(z_stream) Expansion stream + * + D inflateCodesUsed... + D PR 20U 0 extproc('inflateCodesUsed') + D strm like(z_stream) Expansion stream + * + D inflateValidate... + D PR 20U 0 extproc('inflateValidate') + D strm like(z_stream) Expansion stream + D check 10I 0 value + * + D inflateGetHeader... + D PR 10U 0 extproc('inflateGetHeader') + D strm like(z_stream) Expansion stream + D head like(gz_headerp) + * + D deflateSetHeader... + D PR 10U 0 extproc('deflateSetHeader') + D strm like(z_stream) Expansion stream + D head like(gz_headerp) + * + D inflateBackInit... + D PR 10I 0 extproc('inflateBackInit_') + D strm like(z_stream) Expansion stream + D windowBits 10I 0 value Log2(buffer size) + D window 65535 options(*varsize) Buffer + D version * value options(*string) Version string + D stream_size 10i 0 value Stream struct. size + * + D inflateBack PR 10I 0 extproc('inflateBack') + D strm like(z_stream) Expansion stream + D in * value procptr Input function + D in_desc * value Input descriptor + D out * value procptr Output function + D out_desc * value Output descriptor + * + D inflateBackEnd PR 10I 0 extproc('inflateBackEnd') + D strm like(z_stream) Expansion stream + * + D ptlibzippyCompileFlags... + D PR 10U 0 extproc('ptlibzippyCompileFlags') + * + ************************************************************************** + * Checksum function prototypes + ************************************************************************** + * + D adler32 PR 10U 0 extproc('adler32') New checksum + D adler 10U 0 value Old checksum + D buf 65535 const options(*varsize) Bytes to accumulate + D len 10U 0 value Buffer length + * + D adler32_combine... + D PR 10U 0 extproc('adler32_combine') New checksum + D adler1 10U 0 value Old checksum + D adler2 10U 0 value Old checksum + D len2 20U 0 value Buffer length + * + D adler32_z PR 10U 0 extproc('adler32_z') New checksum + D adler 10U 0 value Old checksum + D buf 65535 const options(*varsize) Bytes to accumulate + D len 20U 0 value Buffer length + * + D crc32 PR 10U 0 extproc('crc32') New checksum + D crc 10U 0 value Old checksum + D buf 65535 const options(*varsize) Bytes to accumulate + D len 10U 0 value Buffer length + * + D crc32_combine... + D PR 10U 0 extproc('crc32_combine') New checksum + D crc1 10U 0 value Old checksum + D crc2 10U 0 value Old checksum + D len2 20U 0 value Buffer length + * + D crc32_z PR 10U 0 extproc('crc32_z') New checksum + D crc 10U 0 value Old checksum + D buf 65535 const options(*varsize) Bytes to accumulate + D len 20U 0 value Buffer length + * + D crc32_combine_gen... + D PR 10U 0 extproc('crc32_combine_gen') Operator + D len2 20U 0 value Buffer length + * + D crc32_combine_gen64... + D PR 10U 0 extproc('crc32_combine_gen64') Operator + D len2 20U 0 value Buffer length + * + D crc32_combine_op... + D PR 10U 0 extproc('crc32_combine_op') New Checksum + D crc1 10U 0 value Old checksum + D crc2 10U 0 value Old checksum + D op 10U 0 value Operator + * + ************************************************************************** + * Miscellaneous function prototypes + ************************************************************************** + * + D ptError PR * extproc('ptError') Error string + D err 10I 0 value Error code + * + D inflateSyncPoint... + D PR 10I 0 extproc('inflateSyncPoint') + D strm like(z_stream) Expansion stream + * + D get_crc_table PR * extproc('get_crc_table') Ptr to ulongs + * + D inflateUndermine... + D PR 10I 0 extproc('inflateUndermine') + D strm like(z_stream) Expansion stream + D arg 10I 0 value Error code + * + D inflateResetKeep... + D PR 10I 0 extproc('inflateResetKeep') End and init. stream + D strm like(z_stream) Expansion stream + * + D deflateResetKeep... + D PR 10I 0 extproc('deflateResetKeep') End and init. stream + D strm like(z_stream) Expansion stream + * + /endif diff --git a/archived/ptlibzippy/os400/ptlibzippyfree.rpgle b/archived/ptlibzippy/os400/ptlibzippyfree.rpgle new file mode 100644 index 0000000000..90bf1ca1b7 --- /dev/null +++ b/archived/ptlibzippy/os400/ptlibzippyfree.rpgle @@ -0,0 +1,634 @@ +**free +// PTLIBZIPPY.INC - Interface to the general purpose compression library + +// ILE RPG400 version by Patrick Monnerat, DATASPHERE. +// Version 1.3.2.1 + + +// WARNING: +// Procedures inflateInit(), inflateInit2(), deflateInit(), +// deflateInit2() and inflateBackInit() need to be called with +// two additional arguments: +// the package version string and the stream control structure. +// size. This is needed because RPG lacks some macro feature. +// Call these procedures as: +// inflateInit(...: PTLIBZIPPY_VERSION: %size(z_stream)) + +/if not defined(PTLIBZIPPY_H_) +/define PTLIBZIPPY_H_ + +//************************************************************************* +// Constants +//************************************************************************* + +// Versioning information. + +Dcl-C PTLIBZIPPY_VERSION '0.0.5.1'; +Dcl-C PTLIBZIPPY_VERNUM X'12A0'; +Dcl-C PTLIBZIPPY_VER_MAJOR 0; +Dcl-C PTLIBZIPPY_VER_MINOR 0; +Dcl-C PTLIBZIPPY_VER_REVISION 5; +Dcl-C PTLIBZIPPY_VER_SUBREVISION 1; + +// Other equates. + +Dcl-C Z_NO_FLUSH 0; +Dcl-C Z_PARTIAL_FLUSH 1; +Dcl-C Z_SYNC_FLUSH 2; +Dcl-C Z_FULL_FLUSH 3; +Dcl-C Z_FINISH 4; +Dcl-C Z_BLOCK 5; +Dcl-C Z_TREES 6; + +Dcl-C Z_OK 0; +Dcl-C Z_STREAM_END 1; +Dcl-C Z_NEED_DICT 2; +Dcl-C Z_ERRNO -1; +Dcl-C Z_STREAM_ERROR -2; +Dcl-C Z_DATA_ERROR -3; +Dcl-C Z_MEM_ERROR -4; +Dcl-C Z_BUF_ERROR -5; +Dcl-C Z_VERSION_ERROR -6; + +Dcl-C Z_NO_COMPRESSION 0; +Dcl-C Z_BEST_SPEED 1; +Dcl-C Z_BEST_COMPRESSION 9; +Dcl-C Z_DEFAULT_COMPRESSION -1; + +Dcl-C Z_FILTERED 1; +Dcl-C Z_HUFFMAN_ONLY 2; +Dcl-C Z_RLE 3; +Dcl-C Z_DEFAULT_STRATEGY 0; + +Dcl-C Z_BINARY 0; +Dcl-C Z_ASCII 1; +Dcl-C Z_UNKNOWN 2; + +Dcl-C Z_DEFLATED 8; + +Dcl-C Z_NULL 0; + +//************************************************************************* +// Types +//************************************************************************* + +Dcl-S z_streamp Pointer; // Stream struct ptr +Dcl-S gzFile Pointer; // File pointer +Dcl-S gz_headerp Pointer; +Dcl-S z_off_t Int(10); // Stream offsets +Dcl-S z_off64_t Int(20); // Stream offsets + +//************************************************************************* +// Structures +//************************************************************************* + +// The GZIP encode/decode stream support structure. + +Dcl-Ds z_stream Align Based(z_streamp); + zs_next_in Pointer; // Next input byte + zs_avail_in Uns(10); // Byte cnt at next_in + zs_total_in Uns(10); // Total bytes read + zs_next_out Pointer; // Output buffer ptr + zs_avail_out Uns(10); // Room left @ next_out + zs_total_out Uns(10); // Total bytes written + zs_msg Pointer; // Last errmsg or null + zs_state Pointer; // Internal state + zs_zalloc Pointer(*PROC); // Int. state allocator + zs_free Pointer(*PROC); // Int. state dealloc. + zs_opaque Pointer; // Private alloc. data + zs_data_type Int(10); // ASC/BIN best guess + zs_adler Uns(10); // Uncompr. adler32 val + *N Uns(10); // Reserved + *N Uns(10); // Ptr. alignment +End-Ds; + +//************************************************************************* +// Utility function prototypes +//************************************************************************* + +Dcl-Pr compress Int(10) Extproc('compress'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(10); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(10) Value; // Source length +End-Pr; + +Dcl-Pr compress_z Int(10) Extproc('compress_z'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(20); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(20) Value; // Source length +End-Pr; + +Dcl-Pr compress2 Int(10) Extproc('compress2'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(10); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(10) Value; // Source length + level Int(10) Value; // Compression level +End-Pr; + +Dcl-Pr compress2_z Int(10) Extproc('compress2_z'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(20); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(20) Value; // Source length + level Int(10) Value; // Compression level +End-Pr; + +Dcl-Pr compressBound Uns(10) Extproc('compressBound'); + sourceLen Uns(10) Value; +End-Pr; + +Dcl-Pr compressBound_z Uns(10) Extproc('compressBound_z'); + sourceLen Uns(20) Value; +End-Pr; + +Dcl-Pr uncompress Int(10) Extproc('uncompress'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(10); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(10) Value; // Source length +End-Pr; + +Dcl-Pr uncompress_z Int(10) Extproc('uncompress_z'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(20); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(20) Value; // Source length +End-Pr; + +Dcl-Pr uncompress2 Int(10) Extproc('uncompress2'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(10); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(10); // Source length +End-Pr; + +Dcl-Pr uncompress2_z Int(10) Extproc('uncompress2_z'); + dest Char(65535) Options(*VARSIZE); // Destination buffer + destLen Uns(20); // Destination length + source Char(65535) Const Options(*VARSIZE); // Source buffer + sourceLen Uns(20); // Source length +End-Pr; + +/if not defined(LARGE_FILES) + Dcl-Pr gzopen Extproc('gzopen') Like(gzFile); + path Pointer Value Options(*STRING); // File pathname + mode Pointer Value Options(*STRING); // Open mode + End-Pr; +/else + Dcl-Pr gzopen Extproc('gzopen64') Like(gzFile); + path Pointer Value Options(*STRING); // File pathname + mode Pointer Value Options(*STRING); // Open mode + End-Pr; + + Dcl-Pr gzopen64 Extproc('gzopen64') Like(gzFile); + path Pointer Value Options(*STRING); // File pathname + mode Pointer Value Options(*STRING); // Open mode + End-Pr; +/endif + +Dcl-Pr gzdopen Extproc('gzdopen') Like(gzFile); + fd Int(10) Value; // File descriptor + mode Pointer Value Options(*STRING); // Open mode +End-Pr; + +Dcl-Pr gzbuffer Int(10) Extproc('gzbuffer'); + file Value Like(gzFile); // File pointer + size Uns(10) Value; +End-Pr; + +Dcl-Pr gzsetparams Int(10) Extproc('gzsetparams'); + file Value Like(gzFile); // File pointer + level Int(10) Value; + strategy Int(10) Value; +End-Pr; + +Dcl-Pr gzread Int(10) Extproc('gzread'); + file Value Like(gzFile); // File pointer + buf Char(65535) Options(*VARSIZE); // Buffer + len Uns(10) Value; // Buffer length +End-Pr; + +Dcl-Pr gzfread Int(20) Extproc('gzfread'); + buf Char(65535) Options(*VARSIZE); // Buffer + size Uns(20) Value; // Buffer length + nitems Uns(20) Value; // Buffer length + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzwrite Int(10) Extproc('gzwrite'); + file Value Like(gzFile); // File pointer + buf Char(65535) Const Options(*VARSIZE); // Buffer + len Uns(10) Value; // Buffer length +End-Pr; + +Dcl-Pr gzfwrite Int(20) Extproc('gzfwrite'); + buf Char(65535) Options(*VARSIZE); // Buffer + size Uns(20) Value; // Buffer length + nitems Uns(20) Value; // Buffer length + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzputs Int(10) Extproc('gzputs'); + file Value Like(gzFile); // File pointer + s Pointer Value Options(*STRING); // String to output +End-Pr; + +Dcl-Pr gzgets Pointer Extproc('gzgets'); + file Value Like(gzFile); // File pointer + buf Char(65535) Options(*VARSIZE); // Read buffer + len Int(10) Value; // Buffer length +End-Pr; + +Dcl-Pr gzputc Int(10) Extproc('gzputc'); + file Value Like(gzFile); // File pointer + c Int(10) Value; // Character to write +End-Pr; + +Dcl-Pr gzgetc Int(10) Extproc('gzgetc'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzgetc_ Int(10) Extproc('gzgetc_'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzungetc Int(10) Extproc('gzungetc'); + c Int(10) Value; // Character to push + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzflush Int(10) Extproc('gzflush'); + file Value Like(gzFile); // File pointer + flush Int(10) Value; // Type of flush +End-Pr; + +/if not defined(LARGE_FILES) + Dcl-Pr gzseek Extproc('gzseek') Like(z_off_t); + file Value Like(gzFile); // File pointer + offset Value Like(z_off_t); // Offset + whence Int(10) Value; // Origin + End-Pr; +/else + Dcl-Pr gzseek Extproc('gzseek64') Like(z_off_t); + file Value Like(gzFile); // File pointer + offset Value Like(z_off_t); // Offset + whence Int(10) Value; // Origin + End-Pr; + + Dcl-Pr gzseek64 Extproc('gzseek64') Like(z_off64_t); + file Value Like(gzFile); // File pointer + offset Value Like(z_off64_t); // Offset + whence Int(10) Value; // Origin + End-Pr; +/endif + +Dcl-Pr gzrewind Int(10) Extproc('gzrewind'); + file Value Like(gzFile); // File pointer +End-Pr; + +/if not defined(LARGE_FILES) + Dcl-Pr gztell Extproc('gztell') Like(z_off_t); + file Value Like(gzFile); // File pointer + End-Pr; +/else + Dcl-Pr gztell Extproc('gztell64') Like(z_off_t); + file Value Like(gzFile); // File pointer + End-Pr; + + Dcl-Pr gztell64 Extproc('gztell64') Like(z_off64_t); + file Value Like(gzFile); // File pointer + End-Pr; +/endif + +/if not defined(LARGE_FILES) + Dcl-Pr gzoffset Extproc('gzoffset') Like(z_off_t); + file Value Like(gzFile); // File pointer + End-Pr; +/else + Dcl-Pr gzoffset Extproc('gzoffset64') Like(z_off_t); + file Value Like(gzFile); // File pointer + End-Pr; + + Dcl-Pr gzoffset64 Extproc('gzoffset64') Like(z_off64_t); + file Value Like(gzFile); // File pointer + End-Pr; +/endif + +Dcl-Pr gzeof Int(10) Extproc('gzeof'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzdirect Int(10) Extproc('gzdirect'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzclose_r Int(10) Extproc('gzclose_r'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzclose_w Int(10) Extproc('gzclose_w'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzclose Int(10) Extproc('gzclose'); + file Value Like(gzFile); // File pointer +End-Pr; + +Dcl-Pr gzerror Pointer Extproc('gzerror'); // Error string + file Value Like(gzFile); // File pointer + errnum Int(10); // Error code +End-Pr; + +Dcl-Pr gzclearerr Extproc('gzclearerr'); + file Value Like(gzFile); // File pointer +End-Pr; + +//************************************************************************* +// Basic function prototypes +//************************************************************************* + +Dcl-Pr ptlibzippyVersion Pointer Extproc('ptlibzippyVersion'); // Version string +End-Pr; + +Dcl-Pr deflateInit Int(10) Extproc('deflateInit_'); // Init. compression + strm Like(z_stream); // Compression stream + level Int(10) Value; // Compression level + version Pointer Value Options(*STRING); // Version string + stream_size Int(10) Value; // Stream struct. size +End-Pr; + +Dcl-Pr deflate Int(10) Extproc('deflate'); // Compress data + strm Like(z_stream); // Compression stream + flush Int(10) Value; // Flush type required +End-Pr; + +Dcl-Pr deflateEnd Int(10) Extproc('deflateEnd'); // Termin. compression + strm Like(z_stream); // Compression stream +End-Pr; + +Dcl-Pr inflateInit Int(10) Extproc('inflateInit_'); // Init. expansion + strm Like(z_stream); // Expansion stream + version Pointer Value Options(*STRING); // Version string + stream_size Int(10) Value; // Stream struct. size +End-Pr; + +Dcl-Pr inflate Int(10) Extproc('inflate'); // Expand data + strm Like(z_stream); // Expansion stream + flush Int(10) Value; // Flush type required +End-Pr; + +Dcl-Pr inflateEnd Int(10) Extproc('inflateEnd'); // Termin. expansion + strm Like(z_stream); // Expansion stream +End-Pr; + +//************************************************************************* +// Advanced function prototypes +//************************************************************************* + +Dcl-Pr deflateInit2 Int(10) Extproc('deflateInit2_'); // Init. compression + strm Like(z_stream); // Compression stream + level Int(10) Value; // Compression level + method Int(10) Value; // Compression method + windowBits Int(10) Value; // log2(window size) + memLevel Int(10) Value; // Mem/cmpress tradeoff + strategy Int(10) Value; // Compression strategy + version Pointer Value Options(*STRING); // Version string + stream_size Int(10) Value; // Stream struct. size +End-Pr; + +Dcl-Pr deflateSetDictionary Int(10) Extproc('deflateSetDictionary'); // Init. dictionary + strm Like(z_stream); // Compression stream + dictionary Char(65535) Const Options(*VARSIZE); // Dictionary bytes + dictLength Uns(10) Value; // Dictionary length +End-Pr; + +Dcl-Pr deflateCopy Int(10) Extproc('deflateCopy'); // Compress strm 2 strm + dest Like(z_stream); // Destination stream + source Like(z_stream); // Source stream +End-Pr; + +Dcl-Pr deflateReset Int(10) Extproc('deflateReset'); // End and init. stream + strm Like(z_stream); // Compression stream +End-Pr; + +Dcl-Pr deflateParams Int(10) Extproc('deflateParams'); // Change level & strat + strm Like(z_stream); // Compression stream + level Int(10) Value; // Compression level + strategy Int(10) Value; // Compression strategy +End-Pr; + +Dcl-Pr deflateTune Int(10) Extproc('deflateTune'); + strm Like(z_stream); // Compression stream + good Int(10) Value; + lazy Int(10) Value; + nice Int(10) Value; + chain_ Int(10) Value; +End-Pr; + +Dcl-Pr deflateBound Uns(10) Extproc('deflateBound'); // Change level & strat + strm Like(z_stream); // Compression stream + sourcelen Uns(10) Value; // Source length +End-Pr; + +Dcl-Pr deflateBound_z Uns(10) Extproc('deflateBound_z'); // Change level & strat + strm Like(z_stream); // Compression stream + sourcelen Uns(20) Value; // Source length +End-Pr; + +Dcl-Pr deflatePending Int(10) Extproc('deflatePending'); // Change level & strat + strm Like(z_stream); // Compression stream + pending Uns(10); // Pending bytes + bits Int(10); // Pending bits +End-Pr; + +Dcl-Pr deflateUsed Int(10) Extproc('deflateUsed'); // Get used bits + strm Like(z_stream); // Compression stream + bits Int(10); // Used bits +End-Pr; + +Dcl-Pr deflatePrime Int(10) Extproc('deflatePrime'); // Change level & strat + strm Like(z_stream); // Compression stream + bits Int(10) Value; // # of bits to insert + value Int(10) Value; // Bits to insert +End-Pr; + +Dcl-Pr inflateInit2 Int(10) Extproc('inflateInit2_'); // Init. expansion + strm Like(z_stream); // Expansion stream + windowBits Int(10) Value; // log2(window size) + version Pointer Value Options(*STRING); // Version string + stream_size Int(10) Value; // Stream struct. size +End-Pr; + +Dcl-Pr inflateSetDictionary Int(10) Extproc('inflateSetDictionary'); // Init. dictionary + strm Like(z_stream); // Expansion stream + dictionary Char(65535) Const Options(*VARSIZE); // Dictionary bytes + dictLength Uns(10) Value; // Dictionary length +End-Pr; + +Dcl-Pr inflateGetDictionary Int(10) Extproc('inflateGetDictionary'); // Get dictionary + strm Like(z_stream); // Expansion stream + dictionary Char(65535) Options(*VARSIZE); // Dictionary bytes + dictLength Uns(10); // Dictionary length +End-Pr; + +Dcl-Pr deflateGetDictionary Int(10) Extproc('deflateGetDictionary'); // Get dictionary + strm Like(z_stream); // Expansion stream + dictionary Char(65535) Options(*VARSIZE); // Dictionary bytes + dictLength Uns(10); // Dictionary length +End-Pr; + +Dcl-Pr inflateSync Int(10) Extproc('inflateSync'); // Sync. expansion + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr inflateCopy Int(10) Extproc('inflateCopy'); + dest Like(z_stream); // Destination stream + source Like(z_stream); // Source stream +End-Pr; + +Dcl-Pr inflateReset Int(10) Extproc('inflateReset'); // End and init. stream + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr inflateReset2 Int(10) Extproc('inflateReset2'); // End and init. stream + strm Like(z_stream); // Expansion stream + windowBits Int(10) Value; // Log2(buffer size) +End-Pr; + +Dcl-Pr inflatePrime Int(10) Extproc('inflatePrime'); // Insert bits + strm Like(z_stream); // Expansion stream + bits Int(10) Value; // Bit count + value Int(10) Value; // Bits to insert +End-Pr; + +Dcl-Pr inflateMark Int(10) Extproc('inflateMark'); // Get inflate info + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr inflateCodesUsed Uns(20) Extproc('inflateCodesUsed'); + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr inflateValidate Uns(20) Extproc('inflateValidate'); + strm Like(z_stream); // Expansion stream + check Int(10) Value; +End-Pr; + +Dcl-Pr inflateGetHeader Uns(10) Extproc('inflateGetHeader'); + strm Like(z_stream); // Expansion stream + head Like(GZ_HEADERP); +End-Pr; + +Dcl-Pr deflateSetHeader Uns(10) Extproc('deflateSetHeader'); + strm Like(z_stream); // Expansion stream + head Like(GZ_HEADERP); +End-Pr; + +Dcl-Pr inflateBackInit Int(10) Extproc('inflateBackInit_'); + strm Like(z_stream); // Expansion stream + windowBits Int(10) Value; // Log2(buffer size) + window Char(65535) Options(*VARSIZE); // Buffer + version Pointer Value Options(*STRING); // Version string + stream_size Int(10) Value; // Stream struct. size +End-Pr; + +Dcl-Pr inflateBack Int(10) Extproc('inflateBack'); + strm Like(z_stream); // Expansion stream + in_ Pointer(*PROC) Value; // Input function + in_desc Pointer Value; // Input descriptor + out_ Pointer(*PROC) Value; // Output function + out_desc Pointer Value; // Output descriptor +End-Pr; + +Dcl-Pr inflateBackEnd Int(10) Extproc('inflateBackend'); + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr ptlibzippyCompileFlags Uns(10) Extproc('ptlibzippyCompileFlags') End-Pr; + +//************************************************************************* +// Checksum function prototypes +//************************************************************************* + +Dcl-Pr adler32 Uns(10) Extproc('adler32'); // New checksum + adler Uns(10) Value; // Old checksum + buf Char(65535) Const Options(*VARSIZE); // Bytes to accumulate + len Uns(10) Value; // Buffer length +End-Pr; + +Dcl-Pr adler32_combine Uns(10) Extproc('adler32_combine'); // New checksum + adler1 Uns(10) Value; // Old checksum + adler2 Uns(10) Value; // Old checksum + len2 Uns(20) Value; // Buffer length +End-Pr; + +Dcl-Pr adler32_z Uns(10) Extproc('adler32_z'); // New checksum + adler Uns(10) Value; // Old checksum + buf Char(65535) Const Options(*VARSIZE); // Bytes to accumulate + len Uns(20) Value; // Buffer length +End-Pr; + +Dcl-Pr crc32 Uns(10) Extproc('crc32'); // New checksum + crc Uns(10) Value; // Old checksum + buf Char(65535) Const Options(*VARSIZE); // Bytes to accumulate + len Uns(10) Value; // Buffer length +End-Pr; + +Dcl-Pr crc32_combine Uns(10) Extproc('crc32_combine'); // New checksum + crc1 Uns(10) Value; // Old checksum + crc2 Uns(10) Value; // Old checksum + len2 Uns(20) Value; // 2nd Buffer length +End-Pr; + +Dcl-Pr crc32_z Uns(10) Extproc('crc32_z'); // New checksum + crc Uns(10) Value; // Old checksum + buf Char(65535) Const Options(*VARSIZE); // Bytes to accumulate + len Uns(20) Value; // Buffer length +End-Pr; + +Dcl-Pr crc32_combine_gen Uns(10) Extproc('crc32_combine_gen'); + len Uns(20) Value; // 2nd Buffer length +End-Pr; + +Dcl-Pr crc32_combine_gen64 Uns(10) Extproc('crc32_combine_gen64'); + len Uns(20) Value; // 2nd Buffer length +End-Pr; + +Dcl-Pr crc32_combine_op Uns(10) Extproc('crc32_combine_op'); // New checksum + crc1 Uns(10) Value; // Old checksum + crc2 Uns(10) Value; // Old checksum + op Uns(10) Value; // Operator +End-Pr; + +//************************************************************************* +// Miscellaneous function prototypes +//************************************************************************* + +Dcl-Pr ptError Pointer Extproc('ptError'); // Error string + err Int(10) Value; // Error code +End-Pr; + +Dcl-Pr inflateSyncPoint Int(10) Extproc('inflateSyncPoint'); + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr get_crc_table Pointer Extproc('get_crc_table'); // Ptr to ulongs +End-Pr; + +Dcl-Pr inflateUndermine Int(10) Extproc('inflateUndermine'); + strm Like(z_stream); // Expansion stream + arg Int(10) Value; // Error code +End-Pr; + +Dcl-Pr inflateResetKeep Int(10) Extproc('inflateResetKeep'); // End and init. stream + strm Like(z_stream); // Expansion stream +End-Pr; + +Dcl-Pr deflateResetKeep Int(10) Extproc('deflateResetKeep'); // End and init. stream + strm Like(z_stream); // Expansion stream +End-Pr; + +/endif |
