diff options
author | 1996-10-27 00:29:31 +0000 | |
---|---|---|
committer | 1996-10-27 00:29:31 +0000 | |
commit | 0bf3195f0275f2240e89ed573d29ed13e8ce3a5c (patch) | |
tree | 4fec057451e6c7b564c936e5c1d60638f249ca90 | |
parent | ep at same places at generic (diff) | |
download | wireguard-openbsd-0bf3195f0275f2240e89ed573d29ed13e8ce3a5c.tar.xz wireguard-openbsd-0bf3195f0275f2240e89ed573d29ed13e8ce3a5c.zip |
Adds gz_iszipped() function.
-rw-r--r-- | lib/libz/gzio.c | 13 | ||||
-rw-r--r-- | lib/libz/zlib.h | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/libz/gzio.c b/lib/libz/gzio.c index 7af63495ce5..8a2b770252d 100644 --- a/lib/libz/gzio.c +++ b/lib/libz/gzio.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* $Id: gzio.c,v 1.1 1996/07/27 02:39:45 tholo Exp $ */ +/* $Id: gzio.c,v 1.2 1996/10/27 00:29:33 millert Exp $ */ #include <stdio.h> @@ -521,3 +521,14 @@ char* gzerror (file, errnum) strcat(s->msg, m); return s->msg; } + +/* =========================================================================== + Returns true (1) if file is zipped, else returns false (0). +*/ +int gz_iszipped (file) + gzFile file; +{ + gz_stream *s = (gz_stream*)file; + + return(!(s->transparent)); +} diff --git a/lib/libz/zlib.h b/lib/libz/zlib.h index 6a9e5d57475..32109747f82 100644 --- a/lib/libz/zlib.h +++ b/lib/libz/zlib.h @@ -701,6 +701,11 @@ extern char EXPORT *gzerror OF((gzFile file, int *errnum)); to get the exact error code. */ +/* =========================================================================== + Returns true (1) if file is zipped, else returns false (0). +*/ +extern int gz_iszipped OF((gzFile file)); + /* checksum functions */ /* |