2 * Public domain stdio wrapper for libz, written by Johan Danielsson.
4 * $FreeBSD: src/lib/libz/zopen.c,v 1.2.2.2 2003/02/01 13:33:12 sobomax Exp $
5 * $DragonFly: src/lib/libz/zopen.c,v 1.2 2003/06/17 04:26:52 dillon Exp $
11 FILE *zopen(const char *fname
, const char *mode
);
13 /* convert arguments */
15 xgzread(void *cookie
, char *data
, int size
)
17 return gzread(cookie
, data
, size
);
21 xgzwrite(void *cookie
, const char *data
, int size
)
23 return gzwrite(cookie
, (void*)data
, size
);
27 zopen(const char *fname
, const char *mode
)
29 gzFile gz
= gzopen(fname
, mode
);
34 return (funopen(gz
, xgzread
, NULL
, NULL
, gzclose
));
36 return (funopen(gz
, NULL
, xgzwrite
, NULL
, gzclose
));