Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/net Pull up revision 1.6 (requested by fvdl):



details:   https://anonhg.NetBSD.org/src/rev/362262a04ad4
branches:  netbsd-1-5
changeset: 492974:362262a04ad4
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 20 23:18:32 2002 +0000

description:
Pull up revision 1.6 (requested by fvdl):
  Upgrade libz to 1.1.4 due to a possible security bug.

diffstat:

 sys/net/zlib.h |  738 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 475 insertions(+), 263 deletions(-)

diffs (truncated from 1188 to 300 lines):

diff -r f902be6661c7 -r 362262a04ad4 sys/net/zlib.h
--- a/sys/net/zlib.h    Wed Mar 20 23:18:29 2002 +0000
+++ b/sys/net/zlib.h    Wed Mar 20 23:18:32 2002 +0000
@@ -1,25 +1,9 @@
-/*     $NetBSD: zlib.h,v 1.5 1999/02/15 04:54:36 hubertf Exp $ */
-
-/*
- * This file is derived from zlib.h and zconf.h from the zlib-1.0.4
- * distribution by Jean-loup Gailly and Mark Adler, with some additions
- * by Paul Mackerras to aid in implementing Deflate compression and
- * decompression for PPP packets.
- */
+/* $NetBSD: zlib.h,v 1.5.18.1 2002/03/20 23:18:32 he Exp $ */
 
-/*
- *  ==FILEVERSION 971127==
- *
- * This marker is used by the Linux installation script to determine
- * whether an up-to-date version of this file is already installed.
- */
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.1.4, March 11th, 2002
 
-
-/* +++ zlib.h */
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.0.4, Jul 24th, 1996.
-
-  Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,7 +22,7 @@
   3. This notice may not be removed or altered from any source distribution.
 
   Jean-loup Gailly        Mark Adler
-  gzip%prep.ai.mit.edu@localhost    madler%alumni.caltech.edu@localhost
+  jloup%gzip.org@localhost          madler%alumni.caltech.edu@localhost
 
 
   The data format used by the zlib library is described by RFCs (Request for
@@ -49,23 +33,31 @@
 #ifndef _ZLIB_H
 #define _ZLIB_H
 
-#ifdef __cplusplus
-extern "C" {
+#ifdef __NetBSD__
+#include <sys/cdefs.h>
 #endif
 
-
 /* +++ zconf.h */
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* From: zconf.h,v 1.20 1996/07/02 15:09:28 me Exp $ */
+/* @(#) $Id: zlib.h,v 1.5.18.1 2002/03/20 23:18:32 he 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 <sys/types.h>
+
+/*
  * 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.
  */
@@ -84,8 +76,10 @@
 #  define inflateInit2_        z_inflateInit2_
 #  define inflateSetDictionary z_inflateSetDictionary
 #  define inflateSync  z_inflateSync
+#  define inflateSyncPoint z_inflateSyncPoint
 #  define inflateReset z_inflateReset
 #  define compress     z_compress
+#  define compress2    z_compress2
 #  define uncompress   z_uncompress
 #  define adler32      z_adler32
 #  define crc32                z_crc32
@@ -103,16 +97,9 @@
 #  define voidp                z_voidp
 #endif
 
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-#  define WIN32
-#endif
-#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
-#  ifndef __32BIT__
-#    define __32BIT__
-#  endif
-#endif
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
+#ifndef __32BIT__
+/* Don't be alarmed; this just means we have at least 32-bits */
+#  define __32BIT__
 #endif
 
 /*
@@ -122,19 +109,24 @@
 #if defined(MSDOS) && !defined(__32BIT__)
 #  define MAXSEG_64K
 #endif
-#ifdef MSDOS
+
+#if 0
+/* XXX: Are there machines where we should define this?  m68k? */
 #  define UNALIGNED_OK
 #endif
 
-#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
+#if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
+/* XXX: Look out - this is used in zutil.h and elsewhere... */
 #  define STDC
 #endif
-#if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
-#  define STDC
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+#  ifndef STDC
+#    define STDC
+#  endif
 #endif
 
 #ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#  ifndef const
 #    define const
 #  endif
 #endif
@@ -144,6 +136,12 @@
 #  define NO_DUMMY_DECL
 #endif
 
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+#  define NEED_DUMMY_RETURN
+#endif
+
+
 /* Maximum value for memLevel in deflateInit2 */
 #ifndef MAX_MEM_LEVEL
 #  ifdef MAXSEG_64K
@@ -153,13 +151,17 @@
 #  endif
 #endif
 
-/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
 #ifndef MAX_WBITS
 #  define MAX_WBITS   15 /* 32K LZ77 window */
 #endif
 
 /* The memory requirements for deflate are (in bytes):
-            1 << (windowBits+2)   +  1 << (memLevel+9)
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
  plus a few kilobytes for small objects. For example, if you want to reduce
  the default memory requirements from 256K to 128K, compile with
@@ -173,11 +175,11 @@
 
                         /* Type declarations */
 
-#ifndef OF /* function prototypes */
+#ifndef __P /* function prototypes */
 #  ifdef STDC
-#    define OF(args)  args
+#    define __P(args)  args
 #  else
-#    define OF(args)  ()
+#    define __P(args)  ()
 #  endif
 #endif
 
@@ -191,7 +193,7 @@
    /* MSC small or medium model */
 #  define SMALL_MEDIUM
 #  ifdef _MSC_VER
-#    define FAR __far
+#    define FAR _far
 #  else
 #    define FAR far
 #  endif
@@ -199,19 +201,68 @@
 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
 #  ifndef __32BIT__
 #    define SMALL_MEDIUM
-#    define FAR __far
+#    define FAR _far
 #  endif
 #endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+#  if defined(_WINDOWS) || defined(WINDOWS)
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+#    define ZEXPORT  WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA  WINAPIV
+#    else
+#      define ZEXPORTVA  FAR _cdecl _export
+#    endif
+#  endif
+#  if defined (__BORLANDC__)
+#    if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+#      include <windows.h>
+#      define ZEXPORT __declspec(dllexport) WINAPI
+#      define ZEXPORTRVA __declspec(dllexport) WINAPIV
+#    else
+#      if defined (_Windows) && defined (__DLL__)
+#        define ZEXPORT _export
+#        define ZEXPORTVA _export
+#      endif
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  if defined (ZLIB_DLL)
+#    define ZEXTERN extern __declspec(dllexport)
+#  else
+#    define ZEXTERN extern __declspec(dllimport)
+#  endif
+#endif
+
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+
 #ifndef FAR
 #   define FAR
 #endif
 
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
 typedef unsigned char  Byte;  /* 8 bits */
+#endif
 typedef unsigned int   uInt;  /* 16 bits or more */
 typedef unsigned long  uLong; /* 32 bits or more */
 
-#if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
-   /* Borland C/C++ ignores FAR inside typedef */
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
 #  define Bytef Byte FAR
 #else
    typedef Byte  FAR Bytef;
@@ -229,46 +280,79 @@
    typedef Byte     *voidp;
 #endif
 
+#if (defined(HAVE_UNISTD_H) || defined(__NetBSD__)) && !defined(_KERNEL)
+#  include <sys/types.h> /* for off_t */
+#  include <unistd.h>    /* for SEEK_* and off_t */
+#  define z_off_t  off_t
+#endif
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+#  define  z_off_t long
+#endif
 
-/* Compile with -DZLIB_DLL for Windows DLL support */
-#if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
-#  include <windows.h>
-#  define EXPORT  WINAPI
-#else
-#  define EXPORT
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+#   pragma map(deflateInit_,"DEIN")
+#   pragma map(deflateInit2_,"DEIN2")
+#   pragma map(deflateEnd,"DEEND")
+#   pragma map(inflateInit_,"ININ")
+#   pragma map(inflateInit2_,"ININ2")



Home | Main Index | Thread Index | Old Index