zopen.c (237410) | zopen.c (256644) |
---|---|
1/* 2 * Public domain stdio wrapper for libz, written by Johan Danielsson. 3 */ 4 5#include <sys/cdefs.h> 6__FBSDID("$FreeBSD: head/lib/libz/zopen.c 84228 2001-09-30 22:39:00Z dillon $"); 7 8#include <stdio.h> --- 15 unchanged lines hidden (view full) --- 24} 25 26static int 27xgzclose(void *cookie) 28{ 29 return gzclose(cookie); 30} 31 | 1/* 2 * Public domain stdio wrapper for libz, written by Johan Danielsson. 3 */ 4 5#include <sys/cdefs.h> 6__FBSDID("$FreeBSD: head/lib/libz/zopen.c 84228 2001-09-30 22:39:00Z dillon $"); 7 8#include <stdio.h> --- 15 unchanged lines hidden (view full) --- 24} 25 26static int 27xgzclose(void *cookie) 28{ 29 return gzclose(cookie); 30} 31 |
32static fpos_t 33xgzseek(void *cookie, fpos_t offset, int whence) 34{ 35 return gzseek(cookie, (z_off_t)offset, whence); 36} 37 |
|
32FILE * 33zopen(const char *fname, const char *mode) 34{ 35 gzFile gz = gzopen(fname, mode); 36 if(gz == NULL) 37 return NULL; 38 39 if(*mode == 'r') | 38FILE * 39zopen(const char *fname, const char *mode) 40{ 41 gzFile gz = gzopen(fname, mode); 42 if(gz == NULL) 43 return NULL; 44 45 if(*mode == 'r') |
40 return (funopen(gz, xgzread, NULL, NULL, xgzclose)); | 46 return (funopen(gz, xgzread, NULL, xgzseek, xgzclose)); |
41 else | 47 else |
42 return (funopen(gz, NULL, xgzwrite, NULL, xgzclose)); | 48 return (funopen(gz, NULL, xgzwrite, xgzseek, xgzclose)); |
43} | 49} |