2 * Public domain stdio wrapper for libz, written by Johan Danielsson.
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 xgzclose(void *cookie
)
29 return gzclose(cookie
);
33 xgzseek(void *cookie
, fpos_t offset
, int whence
)
35 return gzseek(cookie
, (z_off_t
)offset
, whence
);
39 zopen(const char *fname
, const char *mode
)
41 gzFile gz
= gzopen(fname
, mode
);
46 return (funopen(gz
, xgzread
, NULL
, xgzseek
, xgzclose
));
48 return (funopen(gz
, NULL
, xgzwrite
, xgzseek
, xgzclose
));