Lines Matching full: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
35 # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
37 # define SET_BINARY_MODE(file)
47 # define fileno(file) file->__file
75 void gz_compress OF((FILE *in, gzFile out));
77 int gz_compress_mmap OF((FILE *in, gzFile out));
79 void gz_uncompress OF((gzFile in, FILE *out));
80 void file_compress OF((char *file, char *mode));
81 void file_uncompress OF((char *file));
99 FILE *in;
128 /* Try compressing the input file at once using mmap. Return Z_OK if
132 FILE *in;
138 caddr_t buf; /* mmap'ed buffer for the entire input file */
139 off_t buf_len; /* length of the input file */
142 /* Determine the size of the file, needed for mmap: */
151 /* Compress the whole file at once: */
168 FILE *out;
190 * Compress the given file: create a corresponding .gz file and remove the
193 void file_compress(file, mode)
194 char *file;
198 FILE *in;
201 strcpy(outfile, file);
204 in = fopen(file, "rb");
206 perror(file);
216 unlink(file);
221 * Uncompress the given file and remove the original.
223 void file_uncompress(file)
224 char *file;
228 FILE *out;
230 uInt len = (uInt)strlen(file);
232 strcpy(buf, file);
234 if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
235 infile = file;
239 outfile = file;
250 perror(file);
274 gzFile file;
304 file = gzdopen(fileno(stdin), "rb");
305 if (file == NULL) error("can't gzdopen stdin");
306 gz_uncompress(file, stdout);
308 file = gzdopen(fileno(stdout), outmode);
309 if (file == NULL) error("can't gzdopen stdout");
310 gz_compress(stdin, file);