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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? example.c

?? 一個delphi下壓縮成zip文件的例子
?? C
字號:
/* example.c -- usage example of the zlib compression library
 * Copyright (C) 1995-1996 Jean-loup Gailly.
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

/* $Id: example.c,v 1.16 1996/05/23 17:11:28 me Exp $ */

#include <stdio.h>
#include "zlib.h"
#include "zutil.h"

#ifdef STDC
#  include <string.h>
#  include <stdlib.h>
#else
   extern void exit  OF((int));
#endif

#define CHECK_ERR(err, msg) { \
    if (err != Z_OK) { \
        fprintf(stderr, "%s error: %d\n", msg, err); \
        exit(1); \
    } \
}

const char hello[] = "hello, hello!";
/* "hello world" would be more standard, but the repeated "hello"
 * stresses the compression code better, sorry...
 */

const char dictionary[] = "hello";
uLong dictId; /* Adler32 value of the dictionary */

void test_compress      OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));
void test_gzio          OF((const char *out, const char *in, 
		            Byte *uncompr, int uncomprLen));
void test_deflate       OF((Byte *compr, uLong comprLen));
void test_inflate       OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));
void test_large_deflate OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));
void test_large_inflate OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));
void test_flush         OF((Byte *compr, uLong comprLen));
void test_sync          OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));
void test_dict_deflate  OF((Byte *compr, uLong comprLen));
void test_dict_inflate  OF((Byte *compr, uLong comprLen,
		            Byte *uncompr, uLong uncomprLen));

/* ===========================================================================
 * Test compress() and uncompress()
 */
void test_compress(compr, comprLen, uncompr, uncomprLen)
    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;
{
    int err;
    uLong len = strlen(hello)+1;

    err = compress(compr, &comprLen, (const Bytef*)hello, len);
    CHECK_ERR(err, "compress");

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

    err = uncompress(uncompr, &uncomprLen, compr, comprLen);
    CHECK_ERR(err, "uncompress");

    if (strcmp((char*)uncompr, hello)) {
        fprintf(stderr, "bad uncompress\n");
    } else {
        printf("uncompress(): %s\n", uncompr);
    }
}

/* ===========================================================================
 * Test read/write of .gz files
 */
void test_gzio(
    const char *out, /* output file */
    const char *in,  /* input file */
    Byte *uncompr,
    int  uncomprLen)
{
    int err;
    int len = strlen(hello)+1;
    gzFile file;

    file = gzopen(out, "wb");
    if (file == NULL) {
        fprintf(stderr, "gzopen error\n");
        exit(1);
    }

    if (gzwrite(file, (const voidp)hello, (unsigned)len) != len) {
        fprintf(stderr, "gzwrite err: %s\n", gzerror(file, &err));
    }
    gzclose(file);

    file = gzopen(in, "rb");
    if (file == NULL) {
        fprintf(stderr, "gzopen error\n");
    }
    strcpy((char*)uncompr, "garbage");

    uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen);
    if (uncomprLen != len) {
        fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
    }
    gzclose(file);

    if (strcmp((char*)uncompr, hello)) {
        fprintf(stderr, "bad gzread\n");
    } else {
        printf("gzread(): %s\n", uncompr);
    }
}

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

    c_stream.zalloc = zcalloc;
    c_stream.zfree = zcfree;
    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;

    while (c_stream.total_in != (uLong)len && c_stream.total_out < comprLen) {
        c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
        err = deflate(&c_stream, Z_NO_FLUSH);
        CHECK_ERR(err, "deflate");
    }
    /* Finish the stream, still forcing small buffers: */
    for (;;) {
        c_stream.avail_out = 1;
        err = deflate(&c_stream, Z_FINISH);
        if (err == Z_STREAM_END) break;
        CHECK_ERR(err, "deflate");
    }

    err = deflateEnd(&c_stream);
    CHECK_ERR(err, "deflateEnd");
}

/* ===========================================================================
 * Test inflate() with small buffers
 */
void test_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 = zcalloc;
    d_stream.zfree = zcfree;
    d_stream.opaque = (voidpf)0;

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

    d_stream.next_in  = compr;
    d_stream.next_out = uncompr;

    while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
        d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
        err = inflate(&d_stream, Z_NO_FLUSH);
        if (err == Z_STREAM_END) break;
        CHECK_ERR(err, "inflate");
    }

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

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

/* ===========================================================================
 * Test deflate() with large buffers and dynamic change of compression level
 */
void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;
{
    z_stream c_stream; /* compression stream */
    int err;

    c_stream.zalloc = zcalloc;
    c_stream.zfree = zcfree;
    c_stream.opaque = (voidpf)0;

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

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

    /* At this point, uncompr is still mostly zeroes, so it should compress
     * very well:
     */
    c_stream.next_in = uncompr;
    c_stream.avail_in = (uInt)uncomprLen;
    err = deflate(&c_stream, Z_NO_FLUSH);
    CHECK_ERR(err, "deflate");
    if (c_stream.avail_in != 0) {
        fprintf(stderr, "deflate not greedy\n");
    }

    /* Feed in already compressed data and switch to no compression: */
    deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
    c_stream.next_in = compr;
    c_stream.avail_in = (uInt)comprLen/2;
    err = deflate(&c_stream, Z_NO_FLUSH);
    CHECK_ERR(err, "deflate");

    /* 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");
    }
    err = deflateEnd(&c_stream);
    CHECK_ERR(err, "deflateEnd");
}

/* ===========================================================================
 * Test inflate() with large buffers
 */
void test_large_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 = zcalloc;
    d_stream.zfree = zcfree;
    d_stream.opaque = (voidpf)0;

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

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

    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);
    } 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 = zcalloc;
    c_stream.zfree = zcfree;
    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");
}

/* ===========================================================================
 * 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 = zcalloc;
    d_stream.zfree = zcfree;
    d_stream.opaque = (voidpf)0;

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

    d_stream.next_in  = compr;
    d_stream.next_out = uncompr;
    d_stream.avail_in = 2; /* just read the zlib header */
    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 */
    }
    err = inflateEnd(&d_stream);
    CHECK_ERR(err, "inflateEnd");

    printf("after inflateSync(): hel%s\n", 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 = zcalloc;
    c_stream.zfree = zcfree;
    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");
    }
    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 = zcalloc;
    d_stream.zfree = zcfree;
    d_stream.opaque = (voidpf)0;

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

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

    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");
    } else {
        printf("inflate with dictionary: %s\n", uncompr);
    }
}

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

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

    if (zlibVersion()[0] != ZLIB_VERSION[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] : "foo.gz"),
              (argc > 2 ? argv[2] : "foo.gz"),
	      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);

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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
三级在线观看一区二区 | 亚洲欧洲日韩女同| 欧美大片在线观看一区二区| 欧美视频在线不卡| 欧美一区三区四区| 日韩精品一区二区三区中文不卡| 911国产精品| 91精品国产欧美一区二区18| 这里是久久伊人| 日韩精品中文字幕在线一区| www国产亚洲精品久久麻豆| 精品av综合导航| 国产精品美女视频| 一区二区三区日韩| 免费看欧美美女黄的网站| 国产自产v一区二区三区c| 国产精品一区在线观看你懂的| 国产精品18久久久久久久久久久久| 国产成人亚洲综合a∨婷婷| 波多野结衣一区二区三区 | 亚洲精品日韩综合观看成人91| 亚洲国产精品成人综合| 亚洲欧美综合另类在线卡通| 亚洲一区中文日韩| 美女视频网站黄色亚洲| 成人国产精品免费网站| 欧美日韩国产综合久久| 国产午夜一区二区三区| 一区二区三区在线看| 麻豆成人免费电影| 99国产欧美另类久久久精品| 日韩一区二区视频在线观看| 国产日韩高清在线| 午夜一区二区三区视频| 国产一区二区视频在线| 在线一区二区视频| 久久久久亚洲综合| 亚洲国产欧美一区二区三区丁香婷| 日本sm残虐另类| 日本丶国产丶欧美色综合| 亚洲精品在线观看网站| 一区二区三区91| 国产精品99久久久久久久vr | 丰满少妇在线播放bd日韩电影| 91国产视频在线观看| 26uuu久久天堂性欧美| 一区二区三区日韩欧美| 国产成人h网站| 91麻豆精品久久久久蜜臀| 亚洲色图清纯唯美| 国产一区在线观看视频| 欧美顶级少妇做爰| 日韩久久一区二区| 高清成人免费视频| 精品日韩在线观看| 秋霞影院一区二区| 精品视频全国免费看| 亚洲裸体xxx| 成人av中文字幕| 国产女人水真多18毛片18精品视频| 亚洲国产欧美日韩另类综合| 91欧美一区二区| 国产精品毛片久久久久久久| 国产美女久久久久| 精品国产99国产精品| 日韩av一区二| 欧美福利一区二区| 日韩电影免费在线| 欧美精品亚洲一区二区在线播放| 亚洲一二三区不卡| 欧美亚洲国产一区在线观看网站| 亚洲人成人一区二区在线观看 | 中文字幕在线免费不卡| 成人深夜在线观看| 国产精品你懂的| 波多野结衣精品在线| 国产精品灌醉下药二区| 北岛玲一区二区三区四区| 国产精品美女久久久久久| 99精品视频在线观看| 国产精品国产自产拍高清av王其| 成人激情小说网站| 亚洲欧美日韩国产一区二区三区| heyzo一本久久综合| 成人欧美一区二区三区黑人麻豆| 91视频一区二区| 亚洲成av人**亚洲成av**| 制服丝袜亚洲网站| 久草热8精品视频在线观看| 久久久精品欧美丰满| 国产福利一区二区三区视频在线| 日本一区二区三区国色天香| youjizz久久| 亚洲综合色自拍一区| 欧美一区二区三区男人的天堂| 蜜臀久久99精品久久久久久9| 精品久久国产老人久久综合| 国产一区二区精品在线观看| 日韩美女视频一区| 欧美性一级生活| 精品伊人久久久久7777人| 国产人成亚洲第一网站在线播放 | 欧美高清激情brazzers| 国模娜娜一区二区三区| 亚洲激情校园春色| 日韩一区二区高清| 粉嫩一区二区三区性色av| 亚洲国产日韩综合久久精品| 久久久.com| 91精品国产综合久久久蜜臀粉嫩| 国产精选一区二区三区| 亚洲综合在线五月| 国产日韩综合av| 欧美日本在线视频| 丁香网亚洲国际| 免费在线看成人av| 亚洲视频1区2区| 久久久久免费观看| 4438x亚洲最大成人网| 成人免费黄色在线| 日本午夜精品视频在线观看| 亚洲图片激情小说| 精品电影一区二区| 欧美三级视频在线观看| 成人免费看片app下载| 看电影不卡的网站| 日日嗨av一区二区三区四区| 亚洲人成伊人成综合网小说| 久久女同互慰一区二区三区| 欧美日韩高清不卡| 欧美亚洲免费在线一区| 99视频一区二区| 国产成人综合视频| 国产一区二区精品久久99| 日本中文一区二区三区| 艳妇臀荡乳欲伦亚洲一区| **欧美大码日韩| 国产精品国产三级国产三级人妇 | 亚洲综合激情小说| 亚洲天堂成人在线观看| 久久精品人人做| 久久久亚洲精品石原莉奈| 2017欧美狠狠色| 精品国产sm最大网站| 精品久久五月天| 日韩免费在线观看| 欧美一区二区三区的| 欧美一区二区三区的| 91精品国产综合久久久久久| 91精品福利在线一区二区三区| 欧美日韩高清一区二区不卡| 欧美日韩一区二区不卡| 欧美一区中文字幕| 欧美成人精品二区三区99精品| 欧美撒尿777hd撒尿| 欧美日本在线看| 欧美一卡二卡三卡四卡| 91精品国产乱| 久久精品一区蜜桃臀影院| 国产亚洲视频系列| 国产精品美女久久久久aⅴ| 中文字幕一区二区三区av| 自拍偷自拍亚洲精品播放| 亚洲精品成人天堂一二三| 亚洲国产色一区| 精品一区二区三区久久| 国产成人在线观看| 91搞黄在线观看| 4438x亚洲最大成人网| 久久无码av三级| 亚洲欧美日韩综合aⅴ视频| 性做久久久久久免费观看| 麻豆精品一区二区三区| 成人一区在线观看| 欧美色网站导航| 日韩视频一区二区三区 | 色综合久久久久综合体| 欧美性生活一区| 久久五月婷婷丁香社区| 亚洲免费观看在线视频| 奇米综合一区二区三区精品视频| 久草这里只有精品视频| 91蝌蚪porny成人天涯| 欧美丰满高潮xxxx喷水动漫| 国产欧美日产一区| 亚洲成年人网站在线观看| 国产成人亚洲综合色影视| 在线精品亚洲一区二区不卡| 精品剧情v国产在线观看在线| 亚洲欧洲成人精品av97| 麻豆91精品91久久久的内涵| 成人免费毛片高清视频| 69堂精品视频| 自拍偷自拍亚洲精品播放| 美女视频一区二区| 欧亚洲嫩模精品一区三区| 久久久99免费| 免费人成在线不卡| 欧美色老头old∨ideo| 中文字幕av资源一区|