tests/zdeflate.c
/* report a zlib or i/o error */
report a zlib or i/o error
report a zlib or i / o error
void zerr(int ret)
{
    fputs("zdeflate: ", stderr);
    switch (ret) {
    case Z_ERRNO:
        if (ferror(stdin))
            fputs("error reading stdin\n", stderr);
        if (ferror(stdout))
            fputs("error writing stdout\n", stderr);
        break;
    case Z_STREAM_ERROR:
        fputs("invalid compression level\n", stderr);
        break;
    case Z_DATA_ERROR:
        fputs("invalid or incomplete deflate data\n", stderr);
        break;
    case Z_MEM_ERROR:
        fputs("out of memory\n", stderr);
        break;
    case Z_VERSION_ERROR:
        fputs("zlib version mismatch!\n", stderr);
    case EXTRA_BYTE_AFTER_STREAM_ERROR:
        fputs("Extra bytes after deflate data\n", stderr);
    }
}
void zerr ( int ret ) { fputs ( " " , stderr ) ; switch ( ret ) { case Z_ERRNO : if ( ferror ( stdin ) ) fputs ( " \n " , stderr ) ; if ( ferror ( stdout ) ) fputs ( " \n " , stderr ) ; break ; case Z_STREAM_ERROR : fputs ( " \n " , stderr ) ; break ; case Z_DATA_ERROR : fputs ( " \n " , stderr ) ; break ; case Z_MEM_ERROR : fputs ( " \n " , stderr ) ; break ; case Z_VERSION_ERROR : fputs ( " \n " , stderr ) ; case EXTRA_BYTE_AFTER_STREAM_ERROR : fputs ( " \n " , stderr ) ; } }
report a zlib or i/o error
report a zlib or i / o error