亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? example.cpp

?? 一個C語言實現(xiàn)的壓縮解壓的工具代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
    /* Switch back to compressing mode: */
    deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED);
    c_stream.next_in = uncompr;
    c_stream.avail_in = (uInt)uncomprLen;
    err = deflate(&c_stream, Z_NO_FLUSH);
    CHECK_ERR(err, "deflate");

    err = deflate(&c_stream, Z_FINISH);
    if (err != Z_STREAM_END) {
        fprintf(stderr, "deflate should report Z_STREAM_END\n");
	exit(1);
    }
    err = deflateEnd(&c_stream);
    CHECK_ERR(err, "deflateEnd");
}

/* ===========================================================================
 * Test inflate() with large buffers
 */
void test_large_inflate(    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;)

{
    int err;
    z_stream d_stream; /* decompression stream */

    strcpy((char*)uncompr, "garbage");

    d_stream.zalloc = (alloc_func)0;
    d_stream.zfree = (free_func)0;
    d_stream.opaque = (voidpf)0;

    d_stream.next_in  = compr;
    d_stream.avail_in = (uInt)comprLen;

    err = inflateInit(&d_stream);
    CHECK_ERR(err, "inflateInit");

    for (;;) {
        d_stream.next_out = uncompr;            /* discard the output */
	d_stream.avail_out = (uInt)uncomprLen;
        err = inflate(&d_stream, Z_NO_FLUSH);
        if (err == Z_STREAM_END) break;
        CHECK_ERR(err, "large inflate");
    }

    err = inflateEnd(&d_stream);
    CHECK_ERR(err, "inflateEnd");

    if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
        fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
	exit(1);
    } else {
        printf("large_inflate(): OK\n");
    }
}

/* ===========================================================================
 * Test deflate() with full flush
 */
void test_flush(compr, comprLen)
    Byte *compr;
    uLong *comprLen;
{
    z_stream c_stream; /* compression stream */
    int err;
    int len = strlen(hello)+1;

    c_stream.zalloc = (alloc_func)0;
    c_stream.zfree = (free_func)0;
    c_stream.opaque = (voidpf)0;

    err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
    CHECK_ERR(err, "deflateInit");

    c_stream.next_in  = (Bytef*)hello;
    c_stream.next_out = compr;
    c_stream.avail_in = 3;
    c_stream.avail_out = (uInt)*comprLen;
    err = deflate(&c_stream, Z_FULL_FLUSH);
    CHECK_ERR(err, "deflate");

    compr[3]++; /* force an error in first compressed block */
    c_stream.avail_in = len - 3;

    err = deflate(&c_stream, Z_FINISH);
    if (err != Z_STREAM_END) {
        CHECK_ERR(err, "deflate");
    }
    err = deflateEnd(&c_stream);
    CHECK_ERR(err, "deflateEnd");

    *comprLen = c_stream.total_out;
}

/* ===========================================================================
 * Test inflateSync()
 */
void test_sync(compr, comprLen, uncompr, uncomprLen)
    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;
{
    int err;
    z_stream d_stream; /* decompression stream */

    strcpy((char*)uncompr, "garbage");

    d_stream.zalloc = (alloc_func)0;
    d_stream.zfree = (free_func)0;
    d_stream.opaque = (voidpf)0;

    d_stream.next_in  = compr;
    d_stream.avail_in = 2; /* just read the zlib header */

    err = inflateInit(&d_stream);
    CHECK_ERR(err, "inflateInit");

    d_stream.next_out = uncompr;
    d_stream.avail_out = (uInt)uncomprLen;

    inflate(&d_stream, Z_NO_FLUSH);
    CHECK_ERR(err, "inflate");

    d_stream.avail_in = (uInt)comprLen-2;   /* read all compressed data */
    err = inflateSync(&d_stream);           /* but skip the damaged part */
    CHECK_ERR(err, "inflateSync");

    err = inflate(&d_stream, Z_FINISH);
    if (err != Z_DATA_ERROR) {
        fprintf(stderr, "inflate should report DATA_ERROR\n");
        /* Because of incorrect adler32 */
	exit(1);
    }
    err = inflateEnd(&d_stream);
    CHECK_ERR(err, "inflateEnd");

    printf("after inflateSync(): hel%s\n", (char *)uncompr);
}

/* ===========================================================================
 * Test deflate() with preset dictionary
 */
void test_dict_deflate(compr, comprLen)
    Byte *compr;
    uLong comprLen;
{
    z_stream c_stream; /* compression stream */
    int err;

    c_stream.zalloc = (alloc_func)0;
    c_stream.zfree = (free_func)0;
    c_stream.opaque = (voidpf)0;

    err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
    CHECK_ERR(err, "deflateInit");

    err = deflateSetDictionary(&c_stream,
			       (const Bytef*)dictionary, sizeof(dictionary));
    CHECK_ERR(err, "deflateSetDictionary");

    dictId = c_stream.adler;
    c_stream.next_out = compr;
    c_stream.avail_out = (uInt)comprLen;

    c_stream.next_in = (Bytef*)hello;
    c_stream.avail_in = (uInt)strlen(hello)+1;

    err = deflate(&c_stream, Z_FINISH);
    if (err != Z_STREAM_END) {
        fprintf(stderr, "deflate should report Z_STREAM_END\n");
	exit(1);
    }
    err = deflateEnd(&c_stream);
    CHECK_ERR(err, "deflateEnd");
}

/* ===========================================================================
 * Test inflate() with a preset dictionary
 */
void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;
{
    int err;
    z_stream d_stream; /* decompression stream */

    strcpy((char*)uncompr, "garbage");

    d_stream.zalloc = (alloc_func)0;
    d_stream.zfree = (free_func)0;
    d_stream.opaque = (voidpf)0;

    d_stream.next_in  = compr;
    d_stream.avail_in = (uInt)comprLen;

    err = inflateInit(&d_stream);
    CHECK_ERR(err, "inflateInit");

    d_stream.next_out = uncompr;
    d_stream.avail_out = (uInt)uncomprLen;

    for (;;) {
        err = inflate(&d_stream, Z_NO_FLUSH);
        if (err == Z_STREAM_END) break;
	if (err == Z_NEED_DICT) {
	    if (d_stream.adler != dictId) {
		fprintf(stderr, "unexpected dictionary");
		exit(1);
	    }
	    err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
				       sizeof(dictionary));
	}
        CHECK_ERR(err, "inflate with dict");
    }

    err = inflateEnd(&d_stream);
    CHECK_ERR(err, "inflateEnd");

    if (strcmp((char*)uncompr, hello)) {
        fprintf(stderr, "bad inflate with dict\n");
	exit(1);
    } else {
        printf("inflate with dictionary: %s\n", (char *)uncompr);
    }
}

/* ===========================================================================
 * Usage:  example [output.gz  [input.gz]]
 */

int main(argc, argv)
    int argc;
    char *argv[];
{
    Byte *compr, *uncompr;
    uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */
    uLong uncomprLen = comprLen;
    static const char* myVersion = ZLIB_VERSION;

    if (zlibVersion()[0] != myVersion[0]) {
        fprintf(stderr, "incompatible zlib version\n");
        exit(1);

    } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) {
        fprintf(stderr, "warning: different zlib version\n");
    }

    compr    = (Byte*)calloc((uInt)comprLen, 1);
    uncompr  = (Byte*)calloc((uInt)uncomprLen, 1);
    /* compr and uncompr are cleared to avoid reading uninitialized
     * data and to ensure that uncompr compresses well.
     */
    if (compr == Z_NULL || uncompr == Z_NULL) {
        printf("out of memory\n");
	exit(1);
    }
    test_compress(compr, comprLen, uncompr, uncomprLen);

    test_gzio((argc > 1 ? argv[1] : TESTFILE),
              (argc > 2 ? argv[2] : TESTFILE),
	      uncompr, (int)uncomprLen);

    test_deflate(compr, comprLen);
    test_inflate(compr, comprLen, uncompr, uncomprLen);

    test_large_deflate(compr, comprLen, uncompr, uncomprLen);
    test_large_inflate(compr, comprLen, uncompr, uncomprLen);

    test_flush(compr, &comprLen);
    test_sync(compr, comprLen, uncompr, uncomprLen);
    comprLen = uncomprLen;

    test_dict_deflate(compr, comprLen);
    test_dict_inflate(compr, comprLen, uncompr, uncomprLen);

    exit(0);
    return 0; /* to avoid warning */
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区视频免付费 | 亚洲欧美电影院| 欧美视频精品在线| 国产成人啪免费观看软件| 亚洲网友自拍偷拍| 中文子幕无线码一区tr| 欧美一区二区三区免费视频| 99久久国产免费看| 美女久久久精品| 一区二区三区四区蜜桃| 日本一区二区三区四区| 欧美大黄免费观看| 欧美日韩精品一区二区三区四区| 丁香激情综合国产| 国产一区二区在线影院| 同产精品九九九| 亚洲精品久久嫩草网站秘色| 国产日本欧美一区二区| 日韩精品中文字幕一区| 91福利在线看| 91麻豆自制传媒国产之光| 成人免费高清在线| 国产一区二区三区久久悠悠色av| 婷婷丁香激情综合| 亚洲成人中文在线| 亚洲与欧洲av电影| 亚洲欧美激情视频在线观看一区二区三区 | 91高清在线观看| 99精品在线免费| 成人免费毛片高清视频| 丁香亚洲综合激情啪啪综合| 国产伦精品一区二区三区免费迷| 国产很黄免费观看久久| 免费观看久久久4p| 日韩成人一级大片| 蜜桃av一区二区在线观看| 亚瑟在线精品视频| 亚洲成人tv网| 日韩精品1区2区3区| 香蕉久久夜色精品国产使用方法| 亚洲在线免费播放| 五月婷婷激情综合| 青青草国产成人av片免费| 日韩不卡一区二区三区| 美女精品一区二区| 国产一区二区三区在线观看免费视频| 精品一区二区三区在线播放| 美腿丝袜亚洲色图| 韩国三级中文字幕hd久久精品| 另类中文字幕网| 国产综合久久久久影院| 国产精品一区二区三区99| 国产盗摄女厕一区二区三区| 成人少妇影院yyyy| 在线一区二区三区四区| 欧美精品vⅰdeose4hd| 欧美大片一区二区| 国产性做久久久久久| 中文字幕永久在线不卡| 一区二区三区精品视频| 日韩精品成人一区二区在线| 激情文学综合网| 成人久久久精品乱码一区二区三区 | 欧美美女一区二区| 日韩女优av电影在线观看| 国产三级三级三级精品8ⅰ区| 国产精品色一区二区三区| 一区二区三区精品视频| 免费精品视频最新在线| 成人福利视频在线看| 在线亚洲免费视频| 精品入口麻豆88视频| 欧美国产视频在线| 亚洲国产成人porn| 国产一区在线不卡| 色偷偷88欧美精品久久久| 日韩一区二区三区观看| 国产精品久线观看视频| 亚洲成人av福利| 国产精品88888| 欧美性极品少妇| xnxx国产精品| 亚洲一区电影777| 99视频精品在线| 91麻豆精品国产自产在线| 国产色产综合色产在线视频 | 国内外成人在线| www.亚洲色图.com| 日韩精品最新网址| 亚洲免费观看高清完整版在线| 免费成人av在线播放| 99在线视频精品| 精品国产区一区| 亚洲国产精品综合小说图片区| 国产成人综合在线| 欧美人动与zoxxxx乱| 中文字幕一区三区| 免费日本视频一区| 色哟哟国产精品| 国产网站一区二区| 麻豆91在线看| 欧美日韩二区三区| 中文字幕欧美一区| 国产成人aaa| 久久夜色精品国产噜噜av| 午夜精品爽啪视频| 91久久精品网| 亚洲欧美一区二区视频| 国产激情一区二区三区四区| 91精品国产综合久久婷婷香蕉| 亚洲日本va午夜在线电影| 国产精品一卡二| 亚洲精品在线观看视频| 日韩不卡一二三区| 在线成人av网站| 亚洲福中文字幕伊人影院| 91色porny在线视频| 国产清纯美女被跳蛋高潮一区二区久久w | 日韩午夜电影av| 亚洲成在线观看| 欧美亚洲国产一区在线观看网站| 亚洲同性同志一二三专区| 国产91精品一区二区麻豆亚洲| 精品国产一区久久| 日本成人在线视频网站| 欧美日韩国产综合久久| 一区二区高清在线| 色综合久久久久综合| 国产精品国产三级国产三级人妇| 国产福利一区在线| 久久色.com| 国产成人在线免费| 久久久亚洲午夜电影| 久久国产婷婷国产香蕉| 精品国产欧美一区二区| 久久精品二区亚洲w码| 日韩精品一区二区三区四区| 日韩高清在线观看| 日韩欧美一卡二卡| 国内精品自线一区二区三区视频| www国产成人免费观看视频 深夜成人网| 捆绑变态av一区二区三区| 欧美mv和日韩mv的网站| 国产一区二区电影| 中文字幕不卡在线| 97精品超碰一区二区三区| 一区二区三区四区精品在线视频 | 国产精品污www在线观看| 国产.精品.日韩.另类.中文.在线.播放| 国产亚洲欧美激情| av电影天堂一区二区在线| 一区二区三区在线免费| 欧美精品在线一区二区| 老司机免费视频一区二区三区| 久久精品亚洲乱码伦伦中文| 成人网在线播放| 亚洲无线码一区二区三区| 欧美一级一区二区| 粉嫩av一区二区三区在线播放 | 91视频com| 亚洲成人777| 欧美不卡123| va亚洲va日韩不卡在线观看| 亚洲激情图片qvod| 日韩一区二区三区高清免费看看| 国产乱码精品一品二品| 亚洲精品一二三| 3d成人h动漫网站入口| 国产一区二区影院| 洋洋成人永久网站入口| 欧美一区二区三区在线观看视频| 国产精品一卡二卡| 亚洲韩国一区二区三区| 精品国产成人在线影院| 99r国产精品| 免费人成精品欧美精品 | 国产精品久久久久久久午夜片 | gogo大胆日本视频一区| 五月婷婷激情综合| 亚洲国产精品v| 欧美精品v国产精品v日韩精品 | 亚洲精品免费在线观看| 91精品国产麻豆| av网站免费线看精品| 日韩av成人高清| 国产精品三级av| 精品日韩在线一区| 欧美性感一类影片在线播放| 久久97超碰国产精品超碰| 亚洲六月丁香色婷婷综合久久 | 国产精品人成在线观看免费| 欧美日韩高清不卡| 99精品在线免费| 狠狠色狠狠色合久久伊人| 亚洲国产精品久久不卡毛片| 国产精品人人做人人爽人人添| 7777精品伊人久久久大香线蕉最新版| 日本高清不卡视频| 国产精品主播直播| 美女视频网站黄色亚洲|