68 fprintf(stderr,
"gzjoin error: %s%s, output incomplete\n", why1, why2);
108 in->fd = open(
name, O_RDONLY, 0);
109 if (
in->buf ==
NULL ||
in->fd == -1) {
134 in->left += (unsigned)
len;
136 return len == 0 ? 1 : 0;
140#define bget(in) (in->left ? 0 : bload(in), \
141 in->left ? (in->left--, *(in->next)++) : \
142 bail("unexpected end of file on ", in->name))
164 if (skip <= in->left) {
184 bail(
"unexpected end of file on ",
in->name);
196 bail(
"unexpected end of file on ",
in->name);
210 bail(
in->name,
" is not a valid gzip file");
214 if ((flags & 0xe0) != 0)
215 bail(
"unknown reserved bits set in ",
in->name);
247 putc(val & 0xff,
out);
248 putc((val >> 8) & 0xff,
out);
249 putc((val >> 16) & 0xff,
out);
250 putc((val >> 24) & 0xff,
out);
259 bail(
"unexpected end of file on ",
in->name);
260 strm->avail_in =
in->left;
261 strm->next_in =
in->next;
267 fwrite(
"\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10,
out);
286 unsigned char *start;
307 bail(
"out of memory",
"");
332 bail(
"out of memory",
"");
334 bail(
"invalid compressed data in ",
in->name);
379 fwrite(start, 1,
in->next - start - 1,
out);
381 if (pos == 0 || !clr)
386 last &= ((0x100 >> pos) - 1);
392 fwrite(
"\0\0\xff\xff", 1, 4,
out);
429 unsigned long crc,
tot;
437 fputs(
"gzjoin usage: gzjoin f1.gz [f2.gz [f3.gz ...]] > fjoin.gz\n",
uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
unsigned in(void *in_desc, z_const unsigned char **buf)
void skip(file *in, unsigned n)
void gzinit(unsigned long *crc, unsigned long *tot, FILE *out)
void gzcopy(char *name, int clr, unsigned long *crc, unsigned long *tot, FILE *out)
int bail(char *why1, char *why2)
void zpull(z_streamp strm, bin *in)
unsigned long bget4(bin *in)
void bskip(bin *in, unsigned skip)
void put4(unsigned long val, FILE *out)
int ZEXPORT inflate(z_streamp strm, int flush)
int ZEXPORT inflateEnd(z_streamp strm)
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
#define inflateInit2(strm, windowBits)
int read(izstream &zs, T *x, Items items)