]> git.saurik.com Git - wxWidgets.git/blobdiff - src/zlib/compress.c
Fix install_name_tool calls in OS X "make install".
[wxWidgets.git] / src / zlib / compress.c
index 51761b105e2f2d3c6962f8034d37c47c8390c8a0..8699c7abeb0f7ca298e4ee6b2cade77111bb054e 100644 (file)
@@ -1,11 +1,11 @@
 /* compress.c -- compress a memory buffer
- * Copyright (C) 1995-1998 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h 
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-/* @(#) $Id$ */
 
-#include "../zlib/zlib.h"
+#define ZLIB_INTERNAL
+#include "zlib.h"
 
 /* ===========================================================================
      Compresses the source buffer into the destination buffer. The level
@@ -28,7 +28,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
     z_stream stream;
     int err;
 
-    stream.next_in = (Bytef*)source;
+    stream.next_in = (z_const Bytef *)source;
     stream.avail_in = (uInt)sourceLen;
 #ifdef MAXSEG_64K
     /* Check for source > 64K on 16-bit machine: */
@@ -66,3 +66,14 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
 {
     return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
 }
+
+/* ===========================================================================
+     If the default memLevel or windowBits for deflateInit() is changed, then
+   this function needs to be updated.
+ */
+uLong ZEXPORT compressBound (sourceLen)
+    uLong sourceLen;
+{
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13;
+}