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 $
10 FILE *zopen(const char *fname
, const char *mode
);
12 /* convert arguments */
14 xgzread(void *cookie
, char *data
, int size
)
16 return gzread(cookie
, data
, size
);
20 xgzwrite(void *cookie
, const char *data
, int size
)
22 return gzwrite(cookie
, (void*)data
, size
);
26 xgzclose(void *cookie
)
28 return gzclose((gzFile
) cookie
);
32 zopen(const char *fname
, const char *mode
)
34 gzFile gz
= gzopen(fname
, mode
);
39 return (funopen(gz
, xgzread
, NULL
, NULL
, xgzclose
));
41 return (funopen(gz
, NULL
, xgzwrite
, NULL
, xgzclose
));