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

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

?? example.c

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* example.c -- usage example of the zlib compression library
 * Copyright (C) 1995-2003 Jean-loup Gailly.
 * For conditions of distribution and use, see copyright notice in zlib.h
 */

/* @(#) $Id: example.c,v 1.1 2004/03/16 21:45:10 drolon Exp $ */

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

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

#if defined(VMS) || defined(RISCOS)
#  define TESTFILE "foo-gz"
#else
#  define TESTFILE "foo.gz"
#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 *fname,
                            Byte *uncompr, uLong 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));
int  main               OF((int argc, char *argv[]));

/* ===========================================================================
 * Test compress() and uncompress()
 */
void test_compress(compr, comprLen, uncompr, uncomprLen)
    Byte *compr, *uncompr;
    uLong comprLen, uncomprLen;
{
    int err;
    uLong len = (uLong)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");
        exit(1);
    } else {
        printf("uncompress(): %s\n", (char *)uncompr);
    }
}

/* ===========================================================================
 * Test read/write of .gz files
 */
void test_gzio(fname, uncompr, uncomprLen)
    const char *fname; /* compressed file name */
    Byte *uncompr;
    uLong uncomprLen;
{
#ifdef NO_GZCOMPRESS
    fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n");
#else
    int err;
    int len = (int)strlen(hello)+1;
    gzFile file;
    z_off_t pos;

    file = gzopen(fname, "wb");
    if (file == NULL) {
        fprintf(stderr, "gzopen error\n");
        exit(1);
    }
    gzputc(file, 'h');
    if (gzputs(file, "ello") != 4) {
        fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));
        exit(1);
    }
    if (gzprintf(file, ", %s!", "hello") != 8) {
        fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));
        exit(1);
    }
    gzseek(file, 1L, SEEK_CUR); /* add one zero byte */
    gzclose(file);

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

    if (gzread(file, uncompr, (unsigned)uncomprLen) != len) {
        fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
        exit(1);
    }
    if (strcmp((char*)uncompr, hello)) {
        fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
        exit(1);
    } else {
        printf("gzread(): %s\n", (char*)uncompr);
    }

    pos = gzseek(file, -8L, SEEK_CUR);
    if (pos != 6 || gztell(file) != pos) {
        fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
                (long)pos, (long)gztell(file));
        exit(1);
    }

    if (gzgetc(file) != ' ') {
        fprintf(stderr, "gzgetc error\n");
        exit(1);
    }

    if (gzungetc(' ', file) != ' ') {
        fprintf(stderr, "gzungetc error\n");
        exit(1);
    }

    gzgets(file, (char*)uncompr, (int)uncomprLen);
    if (strlen((char*)uncompr) != 7) { /* " hello!" */
        fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));
        exit(1);
    }
    if (strcmp((char*)uncompr, hello + 6)) {
        fprintf(stderr, "bad gzgets after gzseek\n");
        exit(1);
    } else {
        printf("gzgets() after gzseek: %s\n", (char*)uncompr);
    }

    gzclose(file);
#endif
}

/* ===========================================================================
 * Test deflate() with small buffers
 */
void test_deflate(compr, comprLen)
    Byte *compr;
    uLong comprLen;
{
    z_stream c_stream; /* compression stream */
    int err;
    uLong len = (uLong)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;

    while (c_stream.total_in != 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 = (alloc_func)0;
    d_stream.zfree = (free_func)0;
    d_stream.opaque = (voidpf)0;

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

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

    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");
        exit(1);
    } else {
        printf("inflate(): %s\n", (char *)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 = (alloc_func)0;
    c_stream.zfree = (free_func)0;
    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");
        exit(1);
    }

    /* 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");

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
乱中年女人伦av一区二区| 日本不卡一二三| 欧美日韩精品一二三区| 美女视频黄免费的久久 | 亚洲国产日韩a在线播放| 欧美一区二区久久| 久久99国产精品久久99 | av资源网一区| 午夜精品aaa| 欧美精品一区二区久久婷婷| 不卡视频免费播放| 一区二区三区丝袜| 91精品国产一区二区三区| 国产精品亚洲专一区二区三区| 亚洲蜜桃精久久久久久久| 91精品国产一区二区人妖| 成人avav影音| 黄色资源网久久资源365| 亚洲女同ⅹxx女同tv| 国产欧美日韩不卡免费| 欧美精品高清视频| 国内精品写真在线观看| 亚洲男人电影天堂| 欧美一级日韩免费不卡| 一本色道a无线码一区v| 国产乱妇无码大片在线观看| 亚洲国产日产av| 中文字幕中文字幕在线一区 | 久久爱另类一区二区小说| 亚洲欧美乱综合| 精品国产乱子伦一区| 这里只有精品99re| 欧美在线色视频| 日韩电影网1区2区| 国产精品久久久久四虎| 日韩免费视频一区二区| 欧美日韩一区精品| 99热99精品| 成人综合婷婷国产精品久久蜜臀| 日韩电影一区二区三区| 亚洲国产一区二区在线播放| 亚洲欧洲国产专区| 国产日韩精品视频一区| 精品成人一区二区三区| 8x8x8国产精品| 欧美天天综合网| 成人激情小说网站| 日本亚洲三级在线| 日韩电影一区二区三区四区| 精品一区二区成人精品| 日韩中文欧美在线| 亚洲h在线观看| 亚洲一区二区免费视频| 一区二区欧美国产| 夜夜精品视频一区二区| 亚洲美女区一区| 国产欧美日韩另类视频免费观看| 欧美videofree性高清杂交| 欧美一区二区三区视频在线| 欧美精品aⅴ在线视频| 欧美老女人在线| 91精品国产综合久久久久| 在线精品视频小说1| 欧美性感一类影片在线播放| 欧美午夜精品久久久| 99精品欧美一区| 成人午夜又粗又硬又大| 国产综合一区二区| 4438亚洲最大| 欧美一区二区不卡视频| 91精品国产欧美一区二区成人| 欧美乱妇23p| 日韩女优毛片在线| 国产午夜精品一区二区| 国产精品少妇自拍| 中文天堂在线一区| 一区二区在线电影| 首页国产欧美久久| 国内精品国产成人国产三级粉色| 国产不卡在线一区| 91九色02白丝porn| 在线播放视频一区| www国产精品av| 久久久亚洲精华液精华液精华液| 国产欧美精品一区二区色综合朱莉| 国产精品卡一卡二卡三| 亚洲一区二区三区美女| 美女www一区二区| 成人app软件下载大全免费| 色综合久久综合网97色综合| 在线视频一区二区免费| 欧美日韩亚洲另类| 久久久久久久av麻豆果冻| 国产精品伦理在线| 天堂一区二区在线免费观看| 韩国av一区二区| 97精品国产97久久久久久久久久久久| 欧美亚洲国产怡红院影院| 欧美日韩国产三级| 欧美不卡视频一区| 亚洲女同ⅹxx女同tv| 久久国产精品免费| 91丨porny丨中文| 日韩久久免费av| 亚洲特级片在线| 精品一区二区影视| 日本精品一级二级| 欧美日韩不卡一区| 亚洲精品一线二线三线| 一区二区三区毛片| 在线观看免费亚洲| 精品国产伦理网| 亚洲国产综合在线| 成人黄色在线视频| 日韩欧美国产午夜精品| 亚洲精品乱码久久久久| 狠狠色狠狠色综合| 欧美日韩aaa| 久久亚洲影视婷婷| 一区二区三区日韩欧美| 国产美女视频91| 欧美一区二区三区四区高清| 亚洲美女一区二区三区| 国产成人日日夜夜| 欧美大片日本大片免费观看| 亚洲综合在线视频| 精彩视频一区二区三区| 欧美高清视频在线高清观看mv色露露十八 | 久久精品免费观看| 欧美日韩国产另类一区| 亚洲三级在线免费观看| 成人avav在线| 亚洲欧洲中文日韩久久av乱码| 成人激情综合网站| 中文字幕一区二区三区四区| 不卡区在线中文字幕| 亚洲欧洲av在线| 91国产成人在线| 亚洲国产精品欧美一二99| 日韩一区国产二区欧美三区| 日本午夜精品一区二区三区电影| 欧美日韩一区成人| 爽好久久久欧美精品| 欧美一区二区三区男人的天堂| 日日摸夜夜添夜夜添亚洲女人| 欧美一级高清片在线观看| 久久精品免费看| 国产午夜精品久久久久久免费视| 粉嫩高潮美女一区二区三区| 国产欧美精品区一区二区三区| 成人福利视频网站| 一区2区3区在线看| 欧美日韩国产成人在线免费| 免费人成精品欧美精品| 久久综合狠狠综合久久激情| 国产成人免费网站| 亚洲欧美激情在线| 欧美另类z0zxhd电影| 韩国在线一区二区| 国产精品国产自产拍高清av王其| 色婷婷狠狠综合| 免费在线观看精品| 国产亚洲短视频| 99re亚洲国产精品| 亚洲高清免费视频| 久久美女艺术照精彩视频福利播放 | 久久欧美一区二区| 97久久人人超碰| 一区二区三区在线视频免费| 欧美精品在线观看一区二区| 国内欧美视频一区二区| 一色屋精品亚洲香蕉网站| 欧美午夜一区二区| 欧美视频在线一区二区三区 | 欧美国产欧美综合| 欧美色视频一区| 国产一区二区三区四区五区入口| 亚洲欧美日韩一区二区三区在线观看| 欧美丰满一区二区免费视频| 国产高清不卡一区二区| 亚洲国产视频一区| 久久久久97国产精华液好用吗| 成人黄动漫网站免费app| 婷婷夜色潮精品综合在线| 国产亚洲午夜高清国产拍精品| 欧美伊人精品成人久久综合97| 久久se精品一区二区| 亚洲综合小说图片| 国产偷国产偷精品高清尤物| 欧美丝袜丝交足nylons图片| 国产成人精品一区二区三区四区| 亚洲高清视频的网址| 中文字幕+乱码+中文字幕一区| 欧美高清视频不卡网| 91免费在线播放| 激情五月婷婷综合网| 亚洲福利视频一区二区| 日韩理论片一区二区| 久久久噜噜噜久久中文字幕色伊伊 | 亚洲午夜激情网页|