64 fprintf(stderr,
"fitblk abort: %s\n", why);
80 def->avail_in = fread(raw, 1,
RAWLEN, in);
88 }
while (def->avail_out != 0 && flush ==
Z_NO_FLUSH);
113 def->avail_in =
RAWLEN - inf->avail_out;
115 if (inf->avail_out != 0)
127 int main(
int argc,
char **argv)
138 quit(
"need one argument: size of output block");
139 ret = strtol(argv[1], argv + 1, 10);
141 quit(
"argument must be a number");
143 quit(
"need positive size of 8 or greater");
144 size = (unsigned)ret;
153 quit(
"out of memory");
160 quit(
"error reading input");
166 if (fwrite(blk, 1, have, stdout) != have || ferror(stdout))
167 quit(
"error writing output");
174 "%u bytes unused out of %u requested (all input)\n",
186 tmp =
malloc(size + EXCESS);
188 quit(
"out of memory");
199 quit(
"out of memory");
214 quit(
"out of memory");
219 if (fwrite(blk, 1, have, stdout) != have || ferror(stdout))
220 quit(
"error writing output");
230 "%u bytes unused out of %u requested (%lu input)\n",
int main(int argc, char **argv)
#define Z_DEFAULT_COMPRESSION
int ZEXPORT inflateReset(z_streamp strm)
int ZEXPORT deflateEnd(z_streamp strm)
#define inflateInit(strm)
local int partcompress(FILE *in, z_streamp def)
local int recompress(z_streamp inf, z_streamp def)
#define deflateInit(strm, level)
int ZEXPORT inflate(z_streamp strm, int flush)
int inf(FILE *source, FILE *dest)
int ZEXPORT deflate(z_streamp strm, int flush)
int ZEXPORT deflateReset(z_streamp strm)
local void quit(char *why)
int def(FILE *source, FILE *dest, int level)
int ZEXPORT inflateEnd(z_streamp strm)