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

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

?? gzio.c

?? 一個(gè)本地database引擎,支持中文T_Sql查詢,兼容DELPHI標(biāo)準(zhǔn)數(shù)據(jù)庫控件
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/* gzio.c -- IO on .gz files
 * Copyright (C) 1995-2005 Jean-loup Gailly.
 * For conditions of distribution and use, see copyright notice in zlib.h
 *
 * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
 */

/* @(#) $Id$ */

#include <stdio.h>

#include "zutil.h"

#ifdef NO_DEFLATE       /* for compatibility with old definition */
#  define NO_GZCOMPRESS
#endif

#ifndef NO_DUMMY_DECL
struct internal_state {int dummy;}; /* for buggy compilers */
#endif

#ifndef Z_BUFSIZE
#  ifdef MAXSEG_64K
#    define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
#  else
#    define Z_BUFSIZE 16384
#  endif
#endif
#ifndef Z_PRINTF_BUFSIZE
#  define Z_PRINTF_BUFSIZE 4096
#endif

#ifdef __MVS__
#  pragma map (fdopen , "\174\174FDOPEN")
   FILE *fdopen(int, const char *);
#endif

#ifndef STDC
extern voidp  malloc OF((uInt size));
extern void   free   OF((voidpf ptr));
#endif

#define ALLOC(size) malloc(size)
#define TRYFREE(p) {if (p) free(p);}

static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */

/* gzip flag byte */
#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
#define HEAD_CRC     0x02 /* bit 1 set: header CRC present */
#define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
#define ORIG_NAME    0x08 /* bit 3 set: original file name present */
#define COMMENT      0x10 /* bit 4 set: file comment present */
#define RESERVED     0xE0 /* bits 5..7: reserved */

typedef struct gz_stream {
    z_stream stream;
    int      z_err;   /* error code for last stream operation */
    int      z_eof;   /* set if end of input file */
    FILE     *file;   /* .gz file */
    Byte     *inbuf;  /* input buffer */
    Byte     *outbuf; /* output buffer */
    uLong    crc;     /* crc32 of uncompressed data */
    char     *msg;    /* error message */
    char     *path;   /* path name for debugging only */
    int      transparent; /* 1 if input file is not a .gz file */
    char     mode;    /* 'w' or 'r' */
    z_off_t  start;   /* start of compressed data in file (header skipped) */
    z_off_t  in;      /* bytes into deflate or inflate */
    z_off_t  out;     /* bytes out of deflate or inflate */
    int      back;    /* one character push-back */
    int      last;    /* true if push-back is last character */
} gz_stream;


local gzFile gz_open      OF((const char *path, const char *mode, int  fd));
local int do_flush        OF((gzFile file, int flush));
local int    get_byte     OF((gz_stream *s));
local void   check_header OF((gz_stream *s));
local int    destroy      OF((gz_stream *s));
local void   putLong      OF((FILE *file, uLong x));
local uLong  getLong      OF((gz_stream *s));

/* ===========================================================================
     Opens a gzip (.gz) file for reading or writing. The mode parameter
   is as in fopen ("rb" or "wb"). The file is given either by file descriptor
   or path name (if fd == -1).
     gz_open returns NULL if the file could not be opened or if there was
   insufficient memory to allocate the (de)compression state; errno
   can be checked to distinguish the two cases (if errno is zero, the
   zlib error is Z_MEM_ERROR).
*/
local gzFile gz_open (path, mode, fd)
    const char *path;
    const char *mode;
    int  fd;
{
    int err;
    int level = Z_DEFAULT_COMPRESSION; /* compression level */
    int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
    char *p = (char*)mode;
    gz_stream *s;
    char fmode[80]; /* copy of mode, without the compression level */
    char *m = fmode;

    if (!path || !mode) return Z_NULL;

    s = (gz_stream *)ALLOC(sizeof(gz_stream));
    if (!s) return Z_NULL;

    s->stream.zalloc = (alloc_func)0;
    s->stream.zfree = (free_func)0;
    s->stream.opaque = (voidpf)0;
    s->stream.next_in = s->inbuf = Z_NULL;
    s->stream.next_out = s->outbuf = Z_NULL;
    s->stream.avail_in = s->stream.avail_out = 0;
    s->file = NULL;
    s->z_err = Z_OK;
    s->z_eof = 0;
    s->in = 0;
    s->out = 0;
    s->back = EOF;
    s->crc = crc32(0L, Z_NULL, 0);
    s->msg = NULL;
    s->transparent = 0;

    s->path = (char*)ALLOC(strlen(path)+1);
    if (s->path == NULL) {
        return destroy(s), (gzFile)Z_NULL;
    }
    strcpy(s->path, path); /* do this early for debugging */

    s->mode = '\0';
    do {
        if (*p == 'r') s->mode = 'r';
        if (*p == 'w' || *p == 'a') s->mode = 'w';
        if (*p >= '0' && *p <= '9') {
            level = *p - '0';
        } else if (*p == 'f') {
          strategy = Z_FILTERED;
        } else if (*p == 'h') {
          strategy = Z_HUFFMAN_ONLY;
        } else if (*p == 'R') {
          strategy = Z_RLE;
        } else {
            *m++ = *p; /* copy the mode */
        }
    } while (*p++ && m != fmode + sizeof(fmode));
    if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;

    if (s->mode == 'w') {
#ifdef NO_GZCOMPRESS
        err = Z_STREAM_ERROR;
#else
        err = deflateInit2(&(s->stream), level,
                           Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
        /* windowBits is passed < 0 to suppress zlib header */

        s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
#endif
        if (err != Z_OK || s->outbuf == Z_NULL) {
            return destroy(s), (gzFile)Z_NULL;
        }
    } else {
        s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);

        err = inflateInit2(&(s->stream), -MAX_WBITS);
        /* windowBits is passed < 0 to tell that there is no zlib header.
         * Note that in this case inflate *requires* an extra "dummy" byte
         * after the compressed stream in order to complete decompression and
         * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
         * present after the compressed stream.
         */
        if (err != Z_OK || s->inbuf == Z_NULL) {
            return destroy(s), (gzFile)Z_NULL;
        }
    }
    s->stream.avail_out = Z_BUFSIZE;

    errno = 0;
    s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);

    if (s->file == NULL) {
        return destroy(s), (gzFile)Z_NULL;
    }
    if (s->mode == 'w') {
        /* Write a very simple .gz header:
         */
        fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
        s->start = 10L;
        /* We use 10L instead of ftell(s->file) to because ftell causes an
         * fflush on some systems. This version of the library doesn't use
         * start anyway in write mode, so this initialization is not
         * necessary.
         */
    } else {
        check_header(s); /* skip the .gz header */
        s->start = ftell(s->file) - s->stream.avail_in;
    }

    return (gzFile)s;
}

/* ===========================================================================
     Opens a gzip (.gz) file for reading or writing.
*/
gzFile ZEXPORT gzopen (path, mode)
    const char *path;
    const char *mode;
{
    return gz_open (path, mode, -1);
}

/* ===========================================================================
     Associate a gzFile with the file descriptor fd. fd is not dup'ed here
   to mimic the behavio(u)r of fdopen.
*/
gzFile ZEXPORT gzdopen (fd, mode)
    int fd;
    const char *mode;
{
    char name[46];      /* allow for up to 128-bit integers */

    if (fd < 0) return (gzFile)Z_NULL;
    sprintf(name, "<fd:%d>", fd); /* for debugging */

    return gz_open (name, mode, fd);
}

/* ===========================================================================
 * Update the compression level and strategy
 */
int ZEXPORT gzsetparams (file, level, strategy)
    gzFile file;
    int level;
    int strategy;
{
    gz_stream *s = (gz_stream*)file;

    if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;

    /* Make room to allow flushing */
    if (s->stream.avail_out == 0) {

        s->stream.next_out = s->outbuf;
        if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
            s->z_err = Z_ERRNO;
        }
        s->stream.avail_out = Z_BUFSIZE;
    }

    return deflateParams (&(s->stream), level, strategy);
}

/* ===========================================================================
     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
   for end of file.
   IN assertion: the stream s has been sucessfully opened for reading.
*/
local int get_byte(s)
    gz_stream *s;
{
    if (s->z_eof) return EOF;
    if (s->stream.avail_in == 0) {
        errno = 0;
        s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
        if (s->stream.avail_in == 0) {
            s->z_eof = 1;
            if (ferror(s->file)) s->z_err = Z_ERRNO;
            return EOF;
        }
        s->stream.next_in = s->inbuf;
    }
    s->stream.avail_in--;
    return *(s->stream.next_in)++;
}

/* ===========================================================================
      Check the gzip header of a gz_stream opened for reading. Set the stream
    mode to transparent if the gzip magic header is not present; set s->err
    to Z_DATA_ERROR if the magic header is present but the rest of the header
    is incorrect.
    IN assertion: the stream s has already been created sucessfully;
       s->stream.avail_in is zero for the first time, but may be non-zero
       for concatenated .gz files.
*/
local void check_header(s)
    gz_stream *s;
{
    int method; /* method byte */
    int flags;  /* flags byte */
    uInt len;
    int c;

    /* Assure two bytes in the buffer so we can peek ahead -- handle case
       where first byte of header is at the end of the buffer after the last
       gzip segment */
    len = s->stream.avail_in;
    if (len < 2) {
        if (len) s->inbuf[0] = s->stream.next_in[0];
        errno = 0;
        len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
        if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
        s->stream.avail_in += len;
        s->stream.next_in = s->inbuf;
        if (s->stream.avail_in < 2) {
            s->transparent = s->stream.avail_in;
            return;
        }
    }

    /* Peek ahead to check the gzip magic header */
    if (s->stream.next_in[0] != gz_magic[0] ||
        s->stream.next_in[1] != gz_magic[1]) {
        s->transparent = 1;
        return;
    }
    s->stream.avail_in -= 2;
    s->stream.next_in += 2;

    /* Check the rest of the gzip header */
    method = get_byte(s);
    flags = get_byte(s);
    if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
        s->z_err = Z_DATA_ERROR;
        return;
    }

    /* Discard time, xflags and OS code: */
    for (len = 0; len < 6; len++) (void)get_byte(s);

    if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
        len  =  (uInt)get_byte(s);
        len += ((uInt)get_byte(s))<<8;
        /* len is garbage if EOF but the loop below will quit anyway */
        while (len-- != 0 && get_byte(s) != EOF) ;
    }
    if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
        while ((c = get_byte(s)) != 0 && c != EOF) ;
    }
    if ((flags & COMMENT) != 0) {   /* skip the .gz file comment */
        while ((c = get_byte(s)) != 0 && c != EOF) ;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女电影在线| 日韩精品在线网站| 久久久www成人免费毛片麻豆| 亚洲天堂免费看| 国产在线一区二区综合免费视频| 91看片淫黄大片一级在线观看| 欧美一级xxx| 夜夜嗨av一区二区三区| 国产成人综合网站| 欧美一区二区三区性视频| 亚洲免费av在线| 国产毛片精品一区| 91精品在线免费| 亚洲精品成a人| 不卡的av电影| 久久精品欧美一区二区三区麻豆| 日本va欧美va精品发布| 91蜜桃在线免费视频| 亚洲国产经典视频| 黑人巨大精品欧美黑白配亚洲| 欧美日韩国产高清一区二区| 亚洲欧美激情小说另类| 成人av电影在线播放| 国产日韩三级在线| 国精品**一区二区三区在线蜜桃| 日韩一区二区影院| 日韩av电影免费观看高清完整版| 91福利社在线观看| 亚洲啪啪综合av一区二区三区| 成人性视频免费网站| 久久综合九色综合久久久精品综合| 老司机午夜精品| 欧美一区二区视频观看视频| 偷窥国产亚洲免费视频| 欧美日韩免费一区二区三区视频| 尤物av一区二区| 在线免费亚洲电影| 亚洲夂夂婷婷色拍ww47| 欧美三级电影网| 亚洲福利视频三区| 欧美日韩国产乱码电影| 视频一区在线播放| 欧美一区二区视频免费观看| 日本特黄久久久高潮| 日韩天堂在线观看| 久色婷婷小香蕉久久| 欧美成人精品1314www| 精品亚洲porn| 久久久精品国产免费观看同学| 国内精品国产成人国产三级粉色 | 狠狠狠色丁香婷婷综合激情| 精品国产亚洲在线| 国模娜娜一区二区三区| 中文字幕欧美日韩一区| 成人av在线一区二区| 亚洲三级小视频| 在线免费观看成人短视频| 久久婷婷综合激情| 久久99国内精品| 欧美大片在线观看一区| 国产精品资源在线| 国产欧美一区二区三区鸳鸯浴 | 日韩精品色哟哟| 欧美精品第1页| 男男视频亚洲欧美| 精品成人私密视频| 国产ts人妖一区二区| 欧美经典一区二区| 国产高清久久久| 国产精品免费丝袜| 欧洲人成人精品| 天堂av在线一区| 精品999在线播放| 大尺度一区二区| 一区二区三区四区高清精品免费观看| 欧洲国内综合视频| 免费xxxx性欧美18vr| 久久久www成人免费毛片麻豆| a级高清视频欧美日韩| 亚洲最大的成人av| 成人天堂资源www在线| 自拍偷在线精品自拍偷无码专区| 91亚洲精品一区二区乱码| 午夜日韩在线电影| 日韩欧美你懂的| va亚洲va日韩不卡在线观看| 一区二区在线观看视频| 日韩亚洲欧美在线| 国产精品亚洲专一区二区三区 | 6080国产精品一区二区| 美日韩一区二区三区| 国产精品免费看片| 欧美丝袜自拍制服另类| 韩国成人精品a∨在线观看| 国产精品乱码一区二区三区软件| 欧美三级电影一区| 激情六月婷婷久久| 综合av第一页| 欧美一区二区三区影视| 成人h精品动漫一区二区三区| 亚洲精品欧美激情| 欧美一级日韩一级| 91亚洲精品一区二区乱码| 石原莉奈在线亚洲二区| 中日韩av电影| 欧美日韩精品一区二区三区 | 午夜欧美一区二区三区在线播放| 26uuu另类欧美亚洲曰本| 99热这里都是精品| 久久国产生活片100| 成人欧美一区二区三区视频网页| 日韩欧美久久久| 91免费在线视频观看| 免费精品视频最新在线| 亚洲视频一二区| 国产片一区二区| 欧美日本高清视频在线观看| av亚洲精华国产精华精华| 日韩在线a电影| 亚洲黄一区二区三区| 久久只精品国产| 欧美疯狂性受xxxxx喷水图片| 粉嫩一区二区三区在线看| 美女脱光内衣内裤视频久久影院| 亚洲欧洲av在线| 久久久午夜精品| 欧美日韩视频第一区| 色婷婷久久久亚洲一区二区三区 | 中文字幕不卡在线观看| 日韩无一区二区| 欧美在线播放高清精品| www.亚洲激情.com| 久久 天天综合| 日韩精品视频网| 亚洲一区在线观看视频| 成人欧美一区二区三区在线播放| 欧美精品一区二区三区蜜臀| 日韩一级精品视频在线观看| 91在线视频官网| 高清在线成人网| 免费在线观看成人| 日韩高清不卡在线| 亚洲午夜精品网| 亚洲夂夂婷婷色拍ww47| 成人欧美一区二区三区1314| 国产欧美日本一区二区三区| 日韩精品专区在线影院重磅| 欧洲亚洲精品在线| 色综合色综合色综合色综合色综合 | 欧美一区二区三区四区五区| 91激情五月电影| 色婷婷av一区二区三区软件| 岛国一区二区三区| 粉嫩绯色av一区二区在线观看| 久久精品国产亚洲高清剧情介绍 | 亚洲欧美在线视频| 国产日韩视频一区二区三区| 久久婷婷成人综合色| 欧美精品一二三| 在线不卡中文字幕| 欧美三级欧美一级| 欧美日韩精品是欧美日韩精品| 色哟哟欧美精品| 色综合久久天天| 99久久久免费精品国产一区二区| 99热99精品| 97久久人人超碰| 欧美少妇性性性| 欧美三电影在线| 91精品国产综合久久福利| 欧美老年两性高潮| 日韩一级大片在线| 日韩欧美一级片| 久久亚洲精精品中文字幕早川悠里| 亚洲啪啪综合av一区二区三区| 国产精品香蕉一区二区三区| 免费在线观看视频一区| 蜜臀av性久久久久蜜臀av麻豆| 亚洲综合精品自拍| 日韩精品一二区| 蜜臀精品久久久久久蜜臀| 麻豆国产欧美日韩综合精品二区 | 97久久精品人人做人人爽50路| 91蜜桃免费观看视频| 性欧美疯狂xxxxbbbb| 日韩二区三区在线观看| 精品一二线国产| 国内精品免费在线观看| 不卡的av电影| 色婷婷久久久亚洲一区二区三区 | 久久成人免费日本黄色| 国产精品一二三区在线| 国产sm精品调教视频网站| av亚洲产国偷v产偷v自拍| kk眼镜猥琐国模调教系列一区二区| 色婷婷国产精品| 欧美做爰猛烈大尺度电影无法无天| 欧美三级三级三级| 欧美大片一区二区三区| 国产日韩欧美精品综合|