20 #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
23 # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
25 # define SET_BINARY_MODE(file)
70 if (fwrite(
out, 1, have,
dest) != have || ferror(
dest)) {
136 if (fwrite(
out, 1, have,
dest) != have || ferror(
dest)) {
153 fputs(
"zpipe: ", stderr);
157 fputs(
"error reading stdin\n", stderr);
159 fputs(
"error writing stdout\n", stderr);
162 fputs(
"invalid compression level\n", stderr);
165 fputs(
"invalid or incomplete deflate data\n", stderr);
168 fputs(
"out of memory\n", stderr);
171 fputs(
"zlib version mismatch!\n", stderr);
193 else if (argc == 2 && strcmp(
argv[1],
"-d") == 0) {
194 ret =
inf(stdin, stdout);
202 fputs(
"zpipe usage: zpipe [-d] < source > dest\n", stderr);
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
int ZEXPORT deflateEnd(z_streamp strm)
int ZEXPORT deflate(z_streamp strm, int flush)
int ZEXPORT inflate(z_streamp strm, int flush)
int ZEXPORT inflateEnd(z_streamp strm)
static static fork const void static count static fd const char const char static newpath char char argv
assert(limit<=UINT32_MAX/2)
#define inflateInit(strm)
#define deflateInit(strm, level)
#define Z_DEFAULT_COMPRESSION
int inf(FILE *source, FILE *dest)
int main(int argc, char **argv)
int def(FILE *source, FILE *dest, int level)
#define SET_BINARY_MODE(file)