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
38 # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
40 # define SET_BINARY_MODE(file)
50 # define fileno(file) file->__file
167 FILE *file;
218 gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
220 if (gz->file == NULL) {
249 fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
274 got = fread(in, 1, 1, gz->file);
309 fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
315 fclose(gz->file);
340 void file_compress OF((char *file, char *mode));
341 void file_uncompress OF((char *file));
388 /* Try compressing the input file at once using mmap. Return Z_OK if
398 caddr_t buf; /* mmap'ed buffer for the entire input file */
399 off_t buf_len; /* length of the input file */
402 /* Determine the size of the file, needed for mmap: */
411 /* Compress the whole file at once: */
450 * Compress the given file: create a corresponding .gz file and remove the
453 void file_compress(file, mode)
454 char *file;
461 if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
466 strcpy(outfile, file);
469 in = fopen(file, "rb");
471 perror(file);
481 unlink(file);
486 * Uncompress the given file and remove the original.
488 void file_uncompress(file)
489 char *file;
495 size_t len = strlen(file);
502 strcpy(buf, file);
504 if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
505 infile = file;
509 outfile = file;
520 perror(file);
546 gzFile file;
588 file = gzdopen(fileno(stdin), "rb");
589 if (file == NULL) error("can't gzdopen stdin");
590 gz_uncompress(file, stdout);
592 file = gzdopen(fileno(stdout), outmode);
593 if (file == NULL) error("can't gzdopen stdout");
594 gz_compress(stdin, file);
603 file = gzopen(*argv, "rb");
604 if (file == NULL)
607 gz_uncompress(file, stdout);
618 file = gzdopen(fileno(stdout), outmode);
619 if (file == NULL) error("can't gzdopen stdout");
621 gz_compress(in, file);