1 /* $NetBSD: zopen.c,v 1.1 2001/01/02 21:39:37 joda Exp $ */
4 * Public domain stdio wrapper for libz, written by Johan Danielsson.
9 __RCSID("$NetBSD: zopen.c,v 1.1 2001/01/02 21:39:37 joda Exp $");
15 FILE *zopen(const char *fname
, const char *mode
);
17 /* convert arguments */
19 xgzread(void *cookie
, char *data
, int size
)
21 return gzread(cookie
, data
, size
);
25 xgzwrite(void *cookie
, const char *data
, int size
)
27 return gzwrite(cookie
, __UNCONST(data
), size
);
31 zopen(const char *fname
, const char *mode
)
33 gzFile gz
= gzopen(fname
, mode
);
38 return (funopen(gz
, xgzread
, NULL
, NULL
, gzclose
));
40 return (funopen(gz
, NULL
, xgzwrite
, NULL
, gzclose
));