summaryrefslogtreecommitdiff
path: root/lib/libz/zutil.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-08-08 20:57:35 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-08-08 20:57:35 +0000
commitaa0fd02bc274ee58bfa0fb19a61badd9056a1684 (patch)
tree372873c89ce42e9c83aff4e13fed7903ea351e83 /lib/libz/zutil.c
parent4c71be32916ef366fd3b09ee4bb853100934d643 (diff)
zlib 1.1.3
Diffstat (limited to 'lib/libz/zutil.c')
-rw-r--r--lib/libz/zutil.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/libz/zutil.c b/lib/libz/zutil.c
index 07ca95da019..b8935b5a5d1 100644
--- a/lib/libz/zutil.c
+++ b/lib/libz/zutil.c
@@ -1,11 +1,9 @@
/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-1996 Jean-loup Gailly.
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: zutil.c,v 1.2 1997/01/19 17:11:26 millert Exp $ */
-
-#include <stdio.h>
+/* @(#) $Id: zutil.c,v 1.3 1998/08/08 20:57:33 millert Exp $ */
#include "zutil.h"
@@ -28,12 +26,18 @@ const char *z_errmsg[10] = {
""};
-const char *zlibVersion()
+const char * ZEXPORT zlibVersion()
{
return ZLIB_VERSION;
}
#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int z_verbose = verbose;
+
void z_error (m)
char *m;
{
@@ -42,11 +46,21 @@ void z_error (m)
}
#endif
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+
#ifndef HAVE_MEMCPY
void zmemcpy(dest, source, len)
Bytef* dest;
- Bytef* source;
+ const Bytef* source;
uInt len;
{
if (len == 0) return;
@@ -56,8 +70,8 @@ void zmemcpy(dest, source, len)
}
int zmemcmp(s1, s2, len)
- Bytef* s1;
- Bytef* s2;
+ const Bytef* s1;
+ const Bytef* s2;
uInt len;
{
uInt j;
@@ -164,7 +178,7 @@ void zcfree (voidpf opaque, voidpf ptr)
# define MY_ZCALLOC
-#if (!defined(_MSC_VER) || (_MSC_VER < 600))
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
# define _halloc halloc
# define _hfree hfree
#endif