summaryrefslogtreecommitdiffstats
path: root/libpng/compress.c
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2008-01-16 19:20:21 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2008-01-16 19:20:21 (GMT)
commitfc90c25edfba404f54319eaeeacca39246f95c9e (patch)
tree78bac4e928b25e139605aceefa82537f378d8af0 /libpng/compress.c
parentf57b7d974fec18d1d8f325c102efd8be5930131d (diff)
downloadDoxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.zip
Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.gz
Doxygen-fc90c25edfba404f54319eaeeacca39246f95c9e.tar.bz2
Release-1.5.4
Diffstat (limited to 'libpng/compress.c')
-rw-r--r--libpng/compress.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/libpng/compress.c b/libpng/compress.c
index fcd0fa8..df04f01 100644
--- a/libpng/compress.c
+++ b/libpng/compress.c
@@ -1,10 +1,11 @@
/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
+ * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
+#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
@@ -18,7 +19,12 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
-int ZEXPORT compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+ int level;
{
z_stream stream;
int err;
@@ -53,7 +59,21 @@ int ZEXPORT compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong
/* ===========================================================================
*/
-int ZEXPORT compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong 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) + 11;
+}