64 fprintf(stderr,
"fitblk abort: %s\n", why);
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;
152 if (ret !=
Z_OK || blk == NULL)
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);
187 if (ret !=
Z_OK || tmp == NULL)
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)
int deflateEnd(z_streamp strm)
static void quit(char *why)
int deflateReset(z_streamp strm)
int inf(FILE *source, FILE *dest)
int inflateReset(z_streamp strm)
static unsigned in(void *in_desc, z_const unsigned char **buf)
#define deflateInit(strm, level)
#define inflateInit(strm)
int inflateEnd(z_streamp strm)
int inflate(z_streamp strm, int flush)
static int recompress(z_streamp inf, z_streamp def)
int def(FILE *source, FILE *dest, int level)
int deflate(z_streamp strm, int flush)
static int partcompress(FILE *in, z_streamp def)
#define Z_DEFAULT_COMPRESSION