diff options
author | rsc <devnull@localhost> | 2004-04-14 20:09:21 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-14 20:09:21 +0000 |
commit | ff3adf608207084d1454acddfdb8904bb139c5e4 (patch) | |
tree | 5910aeb723542a38d374f84c575e94ddfd935eb9 /src/cmd/bzip2/lib/bzlib_stdio_private.h | |
parent | 4314729ddef28cb619ce97d50f0968ca24c93803 (diff) | |
download | plan9port-ff3adf608207084d1454acddfdb8904bb139c5e4.tar.gz plan9port-ff3adf608207084d1454acddfdb8904bb139c5e4.tar.bz2 plan9port-ff3adf608207084d1454acddfdb8904bb139c5e4.zip |
add gzip, bzip2
'
Diffstat (limited to 'src/cmd/bzip2/lib/bzlib_stdio_private.h')
-rw-r--r-- | src/cmd/bzip2/lib/bzlib_stdio_private.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/cmd/bzip2/lib/bzlib_stdio_private.h b/src/cmd/bzip2/lib/bzlib_stdio_private.h new file mode 100644 index 00000000..24b31144 --- /dev/null +++ b/src/cmd/bzip2/lib/bzlib_stdio_private.h @@ -0,0 +1,69 @@ +/* + * THIS FILE IS NOT IDENTICAL TO THE ORIGINAL + * FROM THE BZIP2 DISTRIBUTION. + * + * It has been modified, mainly to break the library + * into smaller pieces. + * + * Russ Cox + * rsc@plan9.bell-labs.com + * July 2000 + */ + +extern void BZ2_bz__AssertH__fail ( int errcode ); + +/* undo definitions in bzlib_private.h */ +#undef AssertH +#undef AssertD +#undef VPrintf0 +#undef VPrintf1 +#undef VPrintf2 +#undef VPrintf3 +#undef VPrintf4 +#undef VPrintf5 + +#define AssertH(cond,errcode) \ + { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } +#if BZ_DEBUG +#define AssertD(cond,msg) \ + { if (!(cond)) { \ + fprintf ( stderr, \ + "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ + exit(1); \ + }} +#else +#define AssertD(cond,msg) /* */ +#endif +#define VPrintf0(zf) \ + fprintf(stderr,zf) +#define VPrintf1(zf,za1) \ + fprintf(stderr,zf,za1) +#define VPrintf2(zf,za1,za2) \ + fprintf(stderr,zf,za1,za2) +#define VPrintf3(zf,za1,za2,za3) \ + fprintf(stderr,zf,za1,za2,za3) +#define VPrintf4(zf,za1,za2,za3,za4) \ + fprintf(stderr,zf,za1,za2,za3,za4) +#define VPrintf5(zf,za1,za2,za3,za4,za5) \ + fprintf(stderr,zf,za1,za2,za3,za4,za5) + +#define BZ_SETERR(eee) \ +{ \ + if (bzerror != NULL) *bzerror = eee; \ + if (bzf != NULL) bzf->lastErr = eee; \ +} + +typedef + struct { + FILE* handle; + Char buf[BZ_MAX_UNUSED]; + Int32 bufN; + Bool writing; + bz_stream strm; + Int32 lastErr; + Bool initialisedOk; + } + bzFile; + +extern Bool bz_feof( FILE* ); + |