Lines Matching defs:file
9 * full-featured gzip. No attempt is made to deal with file systems
12 * real thing. On MSDOS, use only on file names without extension
37 # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
39 # define SET_BINARY_MODE(file)
49 # define fileno(file) file->__file
82 void file_compress OF((char *file, char *mode));
83 void file_uncompress OF((char *file));
130 /* Try compressing the input file at once using mmap. Return Z_OK if
140 caddr_t buf; /* mmap'ed buffer for the entire input file */
141 off_t buf_len; /* length of the input file */
144 /* Determine the size of the file, needed for mmap: */
153 /* Compress the whole file at once: */
192 * Compress the given file: create a corresponding .gz file and remove the
195 void file_compress(file, mode)
196 char *file;
203 strcpy(outfile, file);
206 in = fopen(file, "rb");
208 perror(file);
218 unlink(file);
223 * Uncompress the given file and remove the original.
225 void file_uncompress(file)
226 char *file;
232 int len = strlen(file);
234 strcpy(buf, file);
236 if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
237 infile = file;
241 outfile = file;
252 perror(file);
275 gzFile file;
301 file = gzdopen(fileno(stdin), "rb");
302 if (file == NULL) error("can't gzdopen stdin");
303 gz_uncompress(file, stdout);
305 file = gzdopen(fileno(stdout), outmode);
306 if (file == NULL) error("can't gzdopen stdout");
307 gz_compress(stdin, file);