From 6065389b17b61eed25622f233752ab3eb9cee37f Mon Sep 17 00:00:00 2001 From: gwr Date: Tue, 20 May 1997 14:41:54 +0000 Subject: [PATCH] Sync with src/lib/libz --- sys/lib/libz/adler32.c | 4 +- sys/lib/libz/crc32.c | 4 +- sys/lib/libz/infblock.c | 2 +- sys/lib/libz/infblock.h | 2 +- sys/lib/libz/infcodes.c | 2 +- sys/lib/libz/infcodes.h | 2 +- sys/lib/libz/inffast.c | 2 +- sys/lib/libz/inffast.h | 2 +- sys/lib/libz/inflate.c | 2 +- sys/lib/libz/inftrees.c | 2 +- sys/lib/libz/inftrees.h | 2 +- sys/lib/libz/infutil.c | 2 +- sys/lib/libz/infutil.h | 2 +- sys/lib/libz/zconf.h | 39 ++++++++---- sys/lib/libz/zlib.h | 136 ++++++++++++++++++++-------------------- sys/lib/libz/zutil.h | 4 +- 16 files changed, 116 insertions(+), 93 deletions(-) diff --git a/sys/lib/libz/adler32.c b/sys/lib/libz/adler32.c index 53d9cc9748a1..c50058aee881 100644 --- a/sys/lib/libz/adler32.c +++ b/sys/lib/libz/adler32.c @@ -1,10 +1,12 @@ -/* $NetBSD: adler32.c,v 1.1 1997/01/16 00:21:43 cgd Exp $ */ +/* $NetBSD: adler32.c,v 1.2 1997/05/20 14:41:54 gwr Exp $ */ /* adler32.c -- compute the Adler-32 checksum of a data stream * Copyright (C) 1995-1996 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ +/* from: Id: adler32.c,v 1.10 1996/05/22 11:52:18 me Exp */ + #include "zlib.h" #define BASE 65521L /* largest prime smaller than 65536 */ diff --git a/sys/lib/libz/crc32.c b/sys/lib/libz/crc32.c index 4d17cf621bd1..97f993708f36 100644 --- a/sys/lib/libz/crc32.c +++ b/sys/lib/libz/crc32.c @@ -1,10 +1,12 @@ -/* $NetBSD: crc32.c,v 1.1 1997/01/16 00:21:44 cgd Exp $ */ +/* $NetBSD: crc32.c,v 1.2 1997/05/20 14:41:55 gwr Exp $ */ /* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-1996 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ +/* from: Id: crc32.c,v 1.8 1996/01/30 21:59:10 me Exp */ + #include "zlib.h" #define local static diff --git a/sys/lib/libz/infblock.c b/sys/lib/libz/infblock.c index 418be8369578..526bf83649a3 100644 --- a/sys/lib/libz/infblock.c +++ b/sys/lib/libz/infblock.c @@ -1,4 +1,4 @@ -/* $NetBSD: infblock.c,v 1.1 1997/01/16 00:21:44 cgd Exp $ */ +/* $NetBSD: infblock.c,v 1.2 1997/05/20 14:41:56 gwr Exp $ */ /* infblock.c -- interpret and process block types to last block * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/infblock.h b/sys/lib/libz/infblock.h index fc27e4cf19b3..224f07680baf 100644 --- a/sys/lib/libz/infblock.h +++ b/sys/lib/libz/infblock.h @@ -1,4 +1,4 @@ -/* $NetBSD: infblock.h,v 1.1 1997/01/16 00:21:45 cgd Exp $ */ +/* $NetBSD: infblock.h,v 1.2 1997/05/20 14:41:57 gwr Exp $ */ /* infblock.h -- header to use infblock.c * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/infcodes.c b/sys/lib/libz/infcodes.c index 5ff5ab4d749a..99ef776ef3b3 100644 --- a/sys/lib/libz/infcodes.c +++ b/sys/lib/libz/infcodes.c @@ -1,4 +1,4 @@ -/* $NetBSD: infcodes.c,v 1.1 1997/01/16 00:21:46 cgd Exp $ */ +/* $NetBSD: infcodes.c,v 1.2 1997/05/20 14:41:57 gwr Exp $ */ /* infcodes.c -- process literals and length/distance pairs * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/infcodes.h b/sys/lib/libz/infcodes.h index 2aa9d4c773eb..36cdcaa65878 100644 --- a/sys/lib/libz/infcodes.h +++ b/sys/lib/libz/infcodes.h @@ -1,4 +1,4 @@ -/* $NetBSD: infcodes.h,v 1.1 1997/01/16 00:21:46 cgd Exp $ */ +/* $NetBSD: infcodes.h,v 1.2 1997/05/20 14:41:58 gwr Exp $ */ /* infcodes.h -- header to use infcodes.c * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/inffast.c b/sys/lib/libz/inffast.c index 2c6049c2d0c6..9b8119569f74 100644 --- a/sys/lib/libz/inffast.c +++ b/sys/lib/libz/inffast.c @@ -1,4 +1,4 @@ -/* $NetBSD: inffast.c,v 1.1 1997/01/16 00:21:47 cgd Exp $ */ +/* $NetBSD: inffast.c,v 1.2 1997/05/20 14:41:59 gwr Exp $ */ /* inffast.c -- process literals and length/distance pairs fast * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/inffast.h b/sys/lib/libz/inffast.h index fddfa7a18909..2e044af3f0f3 100644 --- a/sys/lib/libz/inffast.h +++ b/sys/lib/libz/inffast.h @@ -1,4 +1,4 @@ -/* $NetBSD: inffast.h,v 1.1 1997/01/16 00:21:47 cgd Exp $ */ +/* $NetBSD: inffast.h,v 1.2 1997/05/20 14:42:00 gwr Exp $ */ /* inffast.h -- header to use inffast.c * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/inflate.c b/sys/lib/libz/inflate.c index 67e1b5b348b1..5cce45b88be8 100644 --- a/sys/lib/libz/inflate.c +++ b/sys/lib/libz/inflate.c @@ -1,4 +1,4 @@ -/* $NetBSD: inflate.c,v 1.1 1997/01/16 00:21:48 cgd Exp $ */ +/* $NetBSD: inflate.c,v 1.2 1997/05/20 14:42:01 gwr Exp $ */ /* inflate.c -- zlib interface to inflate modules * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c index 1af83a4acdc2..cfa030620f9a 100644 --- a/sys/lib/libz/inftrees.c +++ b/sys/lib/libz/inftrees.c @@ -1,4 +1,4 @@ -/* $NetBSD: inftrees.c,v 1.1 1997/01/16 00:21:49 cgd Exp $ */ +/* $NetBSD: inftrees.c,v 1.2 1997/05/20 14:42:02 gwr Exp $ */ /* inftrees.c -- generate Huffman trees for efficient decoding * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/inftrees.h b/sys/lib/libz/inftrees.h index e65aed13e85b..c1882b7f2757 100644 --- a/sys/lib/libz/inftrees.h +++ b/sys/lib/libz/inftrees.h @@ -1,4 +1,4 @@ -/* $NetBSD: inftrees.h,v 1.1 1997/01/16 00:21:50 cgd Exp $ */ +/* $NetBSD: inftrees.h,v 1.2 1997/05/20 14:42:03 gwr Exp $ */ /* inftrees.h -- header to use inftrees.c * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/infutil.c b/sys/lib/libz/infutil.c index ccf16384fdac..b69085d986f6 100644 --- a/sys/lib/libz/infutil.c +++ b/sys/lib/libz/infutil.c @@ -1,4 +1,4 @@ -/* $NetBSD: infutil.c,v 1.1 1997/01/16 00:21:50 cgd Exp $ */ +/* $NetBSD: infutil.c,v 1.2 1997/05/20 14:42:04 gwr Exp $ */ /* inflate_util.c -- data and routines common to blocks and codes * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/infutil.h b/sys/lib/libz/infutil.h index c4794a9e8505..9082885c77d1 100644 --- a/sys/lib/libz/infutil.h +++ b/sys/lib/libz/infutil.h @@ -1,4 +1,4 @@ -/* $NetBSD: infutil.h,v 1.1 1997/01/16 00:21:51 cgd Exp $ */ +/* $NetBSD: infutil.h,v 1.2 1997/05/20 14:42:04 gwr Exp $ */ /* infutil.h -- types and macros common to blocks and codes * Copyright (C) 1995-1996 Mark Adler diff --git a/sys/lib/libz/zconf.h b/sys/lib/libz/zconf.h index 7a9818ec7144..bfb1dd4d50b0 100644 --- a/sys/lib/libz/zconf.h +++ b/sys/lib/libz/zconf.h @@ -1,13 +1,24 @@ -/* $NetBSD: zconf.h,v 1.1 1997/01/16 00:21:51 cgd Exp $ */ +/* $NetBSD: zconf.h,v 1.2 1997/05/20 14:42:05 gwr Exp $ */ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-1996 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ +/* from: Id: zconf.h,v 1.20 1996/07/02 15:09:28 me Exp */ + #ifndef _ZCONF_H #define _ZCONF_H +/* + * Warning: This file pollutes the user's namespace with: + * Byte Bytef EXPORT FAR OF STDC + * charf intf uInt uIntf uLong uLonf + * Programs using this library appear to expect those... + */ + +#include + /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. @@ -59,7 +70,7 @@ # define MAXSEG_64K #endif -#ifdef MSDOS /* XXX - Yuck! */ +#if 0 /* XXX: Are there machines where we should define this? m68k? */ # define UNALIGNED_OK #endif @@ -107,14 +118,16 @@ for small objects. */ +/* Warts... */ +#define EXPORT +#define FAR +#define OF(args) __P(args) + /* Type declarations */ -#define OF(args) __P(args) -#define FAR - -typedef u_char Byte; /* 8 bits */ -typedef u_int uInt; /* 16 bits or more */ -typedef u_long uLong; /* 32 bits or more */ +typedef unsigned char Byte; /* 8 bits */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ typedef Byte FAR Bytef; typedef char FAR charf; @@ -122,9 +135,13 @@ typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; -#define voidpf void * -#define voidp void * +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif -#define EXPORT #endif /* _ZCONF_H */ diff --git a/sys/lib/libz/zlib.h b/sys/lib/libz/zlib.h index 37ebde95dabe..43bd98936ed8 100644 --- a/sys/lib/libz/zlib.h +++ b/sys/lib/libz/zlib.h @@ -1,4 +1,4 @@ -/* $NetBSD: zlib.h,v 1.1 1997/01/16 00:21:52 cgd Exp $ */ +/* $NetBSD: zlib.h,v 1.2 1997/05/20 14:42:06 gwr Exp $ */ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.0.4, Jul 24th, 1996. @@ -33,6 +33,12 @@ #ifndef _ZLIB_H #define _ZLIB_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "zconf.h" + #define ZLIB_VERSION "1.0.4" /* @@ -59,41 +65,33 @@ for some forms of corrupted input. */ -#include - -#ifdef _ZLIB_PRIVATE -#include "zconf.h" -#endif - -__BEGIN_DECLS - -typedef void *((*alloc_func) __P((void *opaque, u_int items, u_int size))); -typedef void (*free_func) __P((void *opaque, void *address)); +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { - u_char *next_in; /* next input byte */ - u_int avail_in; /* number of bytes available at next_in */ - u_long total_in; /* total nb of input bytes read so far */ + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ - u_char *next_out; /* next output byte should be put there */ - u_int avail_out; /* remaining free space at next_out */ - u_long total_out; /* total nb of bytes output so far */ + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ - struct internal_state *state; /* not visible by applications */ + struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ - void *opaque; /* private data object passed to zalloc and zfree */ + voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: ascii or binary */ - u_long adler; /* adler32 value of the uncompressed data */ - u_long reserved; /* reserved for future use */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ } z_stream; -typedef z_stream *z_streamp; +typedef z_stream FAR *z_streamp; /* The application must update next_in and avail_in when avail_in has @@ -172,7 +170,7 @@ typedef z_stream *z_streamp; /* basic functions */ -extern __const char * zlibVersion __P((void)); +extern const char * EXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. @@ -180,7 +178,7 @@ extern __const char * zlibVersion __P((void)); */ /* -extern int deflateInit __P((z_streamp strm, int level)); +extern int EXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -202,7 +200,7 @@ extern int deflateInit __P((z_streamp strm, int level)); */ -extern int deflate __P((z_streamp strm, int flush)); +extern int EXPORT deflate OF((z_streamp strm, int flush)); /* Performs one or both of the following actions: @@ -271,7 +269,7 @@ extern int deflate __P((z_streamp strm, int flush)); */ -extern int deflateEnd __P((z_streamp strm)); +extern int EXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any @@ -286,7 +284,7 @@ extern int deflateEnd __P((z_streamp strm)); /* -extern int inflateInit __P((z_streamp strm)); +extern int EXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields zalloc, zfree and opaque must be initialized before by the caller. If @@ -301,7 +299,7 @@ extern int inflateInit __P((z_streamp strm)); */ -extern int inflate __P((z_streamp strm, int flush)); +extern int EXPORT inflate OF((z_streamp strm, int flush)); /* Performs one or both of the following actions: @@ -356,7 +354,7 @@ extern int inflate __P((z_streamp strm, int flush)); */ -extern int inflateEnd __P((z_streamp strm)); +extern int EXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any @@ -374,7 +372,7 @@ extern int inflateEnd __P((z_streamp strm)); */ /* -extern int deflateInit2 __P((z_streamp strm, +extern int EXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, @@ -432,9 +430,9 @@ extern int deflateInit2 __P((z_streamp strm, deflate(). */ -extern int deflateSetDictionary __P((z_streamp strm, - __const u_char *dictionary, - u_int dictLength)); +extern int EXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); /* Initializes the compression dictionary (history buffer) from the given byte sequence without producing any compressed output. This function must @@ -461,7 +459,7 @@ extern int deflateSetDictionary __P((z_streamp strm, be done by deflate(). */ -extern int deflateCopy __P((z_streamp dest, +extern int EXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. If @@ -484,7 +482,7 @@ extern int deflateCopy __P((z_streamp dest, destination. */ -extern int deflateReset __P((z_streamp strm)); +extern int EXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. @@ -495,7 +493,7 @@ extern int deflateReset __P((z_streamp strm)); stream state was inconsistent (such as zalloc or state being NULL). */ -extern int deflateParams __P((z_streamp strm, int level, int strategy)); +extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. This can be used to switch between compression and straight copy of @@ -514,7 +512,7 @@ extern int deflateParams __P((z_streamp strm, int level, int strategy)); */ /* -extern int inflateInit2 __P((z_streamp strm, +extern int EXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with more compression options. The @@ -548,9 +546,9 @@ extern int inflateInit2 __P((z_streamp strm, inflate(). */ -extern int inflateSetDictionary __P((z_streamp strm, - __const u_char *dictionary, - u_int dictLength)); +extern int EXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); /* Initializes the decompression dictionary (history buffer) from the given uncompressed byte sequence. This function must be called immediately after @@ -567,7 +565,7 @@ extern int inflateSetDictionary __P((z_streamp strm, inflate(). */ -extern int inflateSync __P((z_streamp strm)); +extern int EXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until the special marker (see deflate() above) can be found, or until all available input is skipped. No output @@ -582,7 +580,7 @@ extern int inflateSync __P((z_streamp strm)); until success or end of the input data. */ -extern int inflateReset __P((z_streamp strm)); +extern int EXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. @@ -603,8 +601,8 @@ extern int inflateReset __P((z_streamp strm)); utility functions can easily be modified if you need special options. */ -extern int compress __P((u_char *dest, u_long *destLen, - __const u_char *source, u_long sourceLen)); +extern int EXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total @@ -618,8 +616,8 @@ extern int compress __P((u_char *dest, u_long *destLen, buffer. */ -extern int uncompress __P((u_char *dest, u_long *destLen, - __const u_char *source, u_long sourceLen)); +extern int EXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total @@ -637,9 +635,9 @@ extern int uncompress __P((u_char *dest, u_long *destLen, */ -typedef void *gzFile; +typedef voidp gzFile; -extern gzFile gzopen __P((__const char *path, __const char *mode)); +extern gzFile EXPORT gzopen OF((const char *path, const char *mode)); /* Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level @@ -651,7 +649,7 @@ extern gzFile gzopen __P((__const char *path, __const char *mode)); zlib error is Z_MEM_ERROR). */ -extern gzFile gzdopen __P((int fd, __const char *mode)); +extern gzFile EXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen() associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or @@ -664,7 +662,7 @@ extern gzFile gzdopen __P((int fd, __const char *mode)); the (de)compression state. */ -extern int gzread __P((gzFile file, void *buf, unsigned len)); +extern int EXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file was not in gzip format, gzread copies the given number @@ -672,14 +670,14 @@ extern int gzread __P((gzFile file, void *buf, unsigned len)); gzread returns the number of uncompressed bytes actually read (0 for end of file, -1 for error). */ -extern int gzwrite __P((gzFile file, __const void *buf, unsigned len)); +extern int EXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes actually written (0 in case of error). */ -extern int gzflush __P((gzFile file, int flush)); +extern int EXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib @@ -689,14 +687,14 @@ extern int gzflush __P((gzFile file, int flush)); degrade compression. */ -extern int gzclose __P((gzFile file)); +extern int EXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates all the (de)compression state. The return value is the zlib error number (see function gzerror below). */ -extern __const char * gzerror __P((gzFile file, int *errnum)); +extern const char * EXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an @@ -713,7 +711,7 @@ extern __const char * gzerror __P((gzFile file, int *errnum)); compression library. */ -extern u_long adler32 __P((u_long adler, __const u_char *buf, u_int len)); +extern uLong EXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and @@ -722,7 +720,7 @@ extern u_long adler32 __P((u_long adler, __const u_char *buf, u_int len)); An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: - u_long adler = adler32(0L, Z_NULL, 0); + uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); @@ -730,7 +728,7 @@ extern u_long adler32 __P((u_long adler, __const u_char *buf, u_int len)); if (adler != original_adler) error(); */ -extern u_long crc32 __P((u_long crc, __const u_char *buf, u_int len)); +extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running crc with the bytes buf[0..len-1] and return the updated crc. If buf is NULL, this function returns the required initial value @@ -738,7 +736,7 @@ extern u_long crc32 __P((u_long crc, __const u_char *buf, u_int len)); within this function so it shouldn't be done by the application. Usage example: - u_long crc = crc32(0L, Z_NULL, 0); + uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); @@ -752,15 +750,15 @@ extern u_long crc32 __P((u_long crc, __const u_char *buf, u_int len)); /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -extern int deflateInit_ __P((z_streamp strm, int level, - __const char *version, int stream_size)); -extern int inflateInit_ __P((z_streamp strm, - __const char *version, int stream_size)); -extern int deflateInit2_ __P((z_streamp strm, int level, int method, +extern int EXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +extern int EXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +extern int EXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, - __const char *version, int stream_size)); -extern int inflateInit2_ __P((z_streamp strm, int windowBits, - __const char *version, int stream_size)); + const char *version, int stream_size)); +extern int EXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit(strm) \ @@ -771,8 +769,10 @@ extern int inflateInit2_ __P((z_streamp strm, int windowBits, #define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -u_long *get_crc_table __P((void)); /* can be used by asm versions of crc32() */ +uLongf *get_crc_table OF((void)); /* can be used by asm versions of crc32() */ -__END_DECLS +#ifdef __cplusplus +} +#endif #endif /* _ZLIB_H */ diff --git a/sys/lib/libz/zutil.h b/sys/lib/libz/zutil.h index 4785b31e32b3..4c67e3d2fcf6 100644 --- a/sys/lib/libz/zutil.h +++ b/sys/lib/libz/zutil.h @@ -1,4 +1,4 @@ -/* $NetBSD: zutil.h,v 1.1 1997/01/16 00:21:53 cgd Exp $ */ +/* $NetBSD: zutil.h,v 1.2 1997/05/20 14:42:07 gwr Exp $ */ /* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995-1996 Jean-loup Gailly. @@ -10,6 +10,8 @@ subject to change. Applications should only use zlib.h. */ +/* from: Id: zutil.h,v 1.16 1996/07/24 13:41:13 me Exp */ + #ifndef _Z_UTIL_H #define _Z_UTIL_H