summaryrefslogtreecommitdiffstats
path: root/lib/libz/zopen.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-03-19 00:19:55 +0000
committerdelphij <delphij@FreeBSD.org>2010-03-19 00:19:55 +0000
commitf1216d1f0ade038907195fc114b7e630623b402c (patch)
treede5de95cb97d0105ec4dbf6a64d558d96f479060 /lib/libz/zopen.c
parent50b21e387fa29ca09b1e58274ac7c0f5a6eeb5f0 (diff)
downloadFreeBSD-src-f1216d1f0ade038907195fc114b7e630623b402c.zip
FreeBSD-src-f1216d1f0ade038907195fc114b7e630623b402c.tar.gz
Create a custom branch where I will be able to do the merge.
Diffstat (limited to 'lib/libz/zopen.c')
-rw-r--r--lib/libz/zopen.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/libz/zopen.c b/lib/libz/zopen.c
deleted file mode 100644
index 025899f..0000000
--- a/lib/libz/zopen.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Public domain stdio wrapper for libz, written by Johan Danielsson.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stdio.h>
-#include <zlib.h>
-
-FILE *zopen(const char *fname, const char *mode);
-
-/* convert arguments */
-static int
-xgzread(void *cookie, char *data, int size)
-{
- return gzread(cookie, data, size);
-}
-
-static int
-xgzwrite(void *cookie, const char *data, int size)
-{
- return gzwrite(cookie, (void*)data, size);
-}
-
-FILE *
-zopen(const char *fname, const char *mode)
-{
- gzFile gz = gzopen(fname, mode);
- if(gz == NULL)
- return NULL;
-
- if(*mode == 'r')
- return (funopen(gz, xgzread, NULL, NULL, gzclose));
- else
- return (funopen(gz, NULL, xgzwrite, NULL, gzclose));
-}
OpenPOWER on IntegriCloud