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

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

?? inflate.c

?? ZIP壓縮算法源代碼,可以直接加入C++Project中編譯調用
?? C
?? 第 1 頁 / 共 4 頁
字號:
        state->whave = 0;
    }

    /* copy state->wsize or less output bytes into the circular window */
    copy = out - strm->avail_out;
    if (copy >= state->wsize) {
        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
        state->write = 0;
        state->whave = state->wsize;
    }
    else {
        dist = state->wsize - state->write;
        if (dist > copy) dist = copy;
        zmemcpy(state->window + state->write, strm->next_out - copy, dist);
        copy -= dist;
        if (copy) {
            zmemcpy(state->window, strm->next_out - copy, copy);
            state->write = copy;
            state->whave = state->wsize;
        }
        else {
            state->write += dist;
            if (state->write == state->wsize) state->write = 0;
            if (state->whave < state->wsize) state->whave += dist;
        }
    }
    return 0;
}

/* Macros for inflate(): */

/* check function to use adler32() for zlib or crc32() for gzip */
#ifdef GUNZIP
#  define UPDATE(check, buf, len) \
    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
#else
#  define UPDATE(check, buf, len) adler32(check, buf, len)
#endif

/* check macros for header crc */
#ifdef GUNZIP
#  define CRC2(check, word) \
    do { \
        hbuf[0] = (unsigned char)(word); \
        hbuf[1] = (unsigned char)((word) >> 8); \
        check = crc32(check, hbuf, 2); \
    } while (0)

#  define CRC4(check, word) \
    do { \
        hbuf[0] = (unsigned char)(word); \
        hbuf[1] = (unsigned char)((word) >> 8); \
        hbuf[2] = (unsigned char)((word) >> 16); \
        hbuf[3] = (unsigned char)((word) >> 24); \
        check = crc32(check, hbuf, 4); \
    } while (0)
#endif

/* Load registers with state in inflate() for speed */
#define LOAD() \
    do { \
        put = strm->next_out; \
        left = strm->avail_out; \
        next = strm->next_in; \
        have = strm->avail_in; \
        hold = state->hold; \
        bits = state->bits; \
    } while (0)

/* Restore state from registers in inflate() */
#define RESTORE() \
    do { \
        strm->next_out = put; \
        strm->avail_out = left; \
        strm->next_in = next; \
        strm->avail_in = have; \
        state->hold = hold; \
        state->bits = bits; \
    } while (0)

/* Clear the input bit accumulator */
#define INITBITS() \
    do { \
        hold = 0; \
        bits = 0; \
    } while (0)

/* Get a byte of input into the bit accumulator, or return from inflate()
   if there is no input available. */
#define PULLBYTE() \
    do { \
        if (have == 0) goto inf_leave; \
        have--; \
        hold += (unsigned long)(*next++) << bits; \
        bits += 8; \
    } while (0)

/* Assure that there are at least n bits in the bit accumulator.  If there is
   not enough available input to do that, then return from inflate(). */
#define NEEDBITS(n) \
    do { \
        while (bits < (unsigned)(n)) \
            PULLBYTE(); \
    } while (0)

/* Return the low n bits of the bit accumulator (n < 16) */
#define BITS(n) \
    ((unsigned)hold & ((1U << (n)) - 1))

/* Remove n bits from the bit accumulator */
#define DROPBITS(n) \
    do { \
        hold >>= (n); \
        bits -= (unsigned)(n); \
    } while (0)

/* Remove zero to seven bits as needed to go to a byte boundary */
#define BYTEBITS() \
    do { \
        hold >>= bits & 7; \
        bits -= bits & 7; \
    } while (0)

/* Reverse the bytes in a 32-bit value */
#define REVERSE(q) \
    ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))

/*
   inflate() uses a state machine to process as much input data and generate as
   much output data as possible before returning.  The state machine is
   structured roughly as follows:

    for (;;) switch (state) {
    ...
    case STATEn:
        if (not enough input data or output space to make progress)
            return;
        ... make progress ...
        state = STATEm;
        break;
    ...
    }

   so when inflate() is called again, the same case is attempted again, and
   if the appropriate resources are provided, the machine proceeds to the
   next state.  The NEEDBITS() macro is usually the way the state evaluates
   whether it can proceed or should return.  NEEDBITS() does the return if
   the requested bits are not available.  The typical use of the BITS macros
   is:

        NEEDBITS(n);
        ... do something with BITS(n) ...
        DROPBITS(n);

   where NEEDBITS(n) either returns from inflate() if there isn't enough
   input left to load n bits into the accumulator, or it continues.  BITS(n)
   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
   the low n bits off the accumulator.  INITBITS() clears the accumulator
   and sets the number of available bits to zero.  BYTEBITS() discards just
   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.

   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
   if there is no input available.  The decoding of variable length codes uses
   PULLBYTE() directly in order to pull just enough bytes to decode the next
   code, and no more.

   Some states loop until they get enough input, making sure that enough
   state information is maintained to continue the loop where it left off
   if NEEDBITS() returns in the loop.  For example, want, need, and keep
   would all have to actually be part of the saved state in case NEEDBITS()
   returns:

    case STATEw:
        while (want < need) {
            NEEDBITS(n);
            keep[want++] = BITS(n);
            DROPBITS(n);
        }
        state = STATEx;
    case STATEx:

   As shown above, if the next state is also the next case, then the break
   is omitted.

   A state may also return if there is not enough output space available to
   complete that state.  Those states are copying stored data, writing a
   literal byte, and copying a matching string.

   When returning, a "goto inf_leave" is used to update the total counters,
   update the check value, and determine whether any progress has been made
   during that inflate() call in order to return the proper return code.
   Progress is defined as a change in either strm->avail_in or strm->avail_out.
   When there is a window, goto inf_leave will update the window with the last
   output written.  If a goto inf_leave occurs in the middle of decompression
   and there is no window currently, goto inf_leave will create one and copy
   output to the window for the next call of inflate().

   In this implementation, the flush parameter of inflate() only affects the
   return code (per zlib.h).  inflate() always writes as much as possible to
   strm->next_out, given the space available and the provided input--the effect
   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
   the allocation of and copying into a sliding window until necessary, which
   provides the effect documented in zlib.h for Z_FINISH when the entire input
   stream available.  So the only thing the flush parameter actually does is:
   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
   will return Z_BUF_ERROR if it has not reached the end of the stream.
 */

int ZEXPORT inflate(strm, flush)
z_streamp strm;
int flush;
{
    struct inflate_state FAR *state;
    unsigned char FAR *next;    /* next input */
    unsigned char FAR *put;     /* next output */
    unsigned have, left;        /* available input and output */
    unsigned long hold;         /* bit buffer */
    unsigned bits;              /* bits in bit buffer */
    unsigned in, out;           /* save starting available input and output */
    unsigned copy;              /* number of stored or match bytes to copy */
    unsigned char FAR *from;    /* where to copy match bytes from */
    code this;                  /* current decoding table entry */
    code last;                  /* parent table entry */
    unsigned len;               /* length to copy for repeats, bits to drop */
    int ret;                    /* return code */
#ifdef GUNZIP
    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
#endif
    static const unsigned short order[19] = /* permutation of code lengths */
        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};

    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
        (strm->next_in == Z_NULL && strm->avail_in != 0))
        return Z_STREAM_ERROR;

    state = (struct inflate_state FAR *)strm->state;
    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
    LOAD();
    in = have;
    out = left;
    ret = Z_OK;
    for (;;)
        switch (state->mode) {
        case HEAD:
            if (state->wrap == 0) {
                state->mode = TYPEDO;
                break;
            }
            NEEDBITS(16);
#ifdef GUNZIP
            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
                state->check = crc32(0L, Z_NULL, 0);
                CRC2(state->check, hold);
                INITBITS();
                state->mode = FLAGS;
                break;
            }
            state->flags = 0;           /* expect zlib header */
            if (state->head != Z_NULL)
                state->head->done = -1;
            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
#else
            if (
#endif
                ((BITS(8) << 8) + (hold >> 8)) % 31) {
                strm->msg = (char *)"incorrect header check";
                state->mode = BAD;
                break;
            }
            if (BITS(4) != Z_DEFLATED) {
                strm->msg = (char *)"unknown compression method";
                state->mode = BAD;
                break;
            }
            DROPBITS(4);
            len = BITS(4) + 8;
            if (len > state->wbits) {
                strm->msg = (char *)"invalid window size";
                state->mode = BAD;
                break;
            }
            state->dmax = 1U << len;
            Tracev((stderr, "inflate:   zlib header ok\n"));
            strm->adler = state->check = adler32(0L, Z_NULL, 0);
            state->mode = hold & 0x200 ? DICTID : TYPE;
            INITBITS();
            break;
#ifdef GUNZIP
        case FLAGS:
            NEEDBITS(16);
            state->flags = (int)(hold);
            if ((state->flags & 0xff) != Z_DEFLATED) {
                strm->msg = (char *)"unknown compression method";
                state->mode = BAD;
                break;
            }
            if (state->flags & 0xe000) {
                strm->msg = (char *)"unknown header flags set";
                state->mode = BAD;
                break;
            }
            if (state->head != Z_NULL)
                state->head->text = (int)((hold >> 8) & 1);
            if (state->flags & 0x0200) CRC2(state->check, hold);
            INITBITS();
            state->mode = TIME;
        case TIME:
            NEEDBITS(32);
            if (state->head != Z_NULL)
                state->head->time = hold;
            if (state->flags & 0x0200) CRC4(state->check, hold);
            INITBITS();
            state->mode = OS;
        case OS:
            NEEDBITS(16);
            if (state->head != Z_NULL) {
                state->head->xflags = (int)(hold & 0xff);
                state->head->os = (int)(hold >> 8);
            }
            if (state->flags & 0x0200) CRC2(state->check, hold);
            INITBITS();
            state->mode = EXLEN;
        case EXLEN:
            if (state->flags & 0x0400) {
                NEEDBITS(16);
                state->length = (unsigned)(hold);
                if (state->head != Z_NULL)
                    state->head->extra_len = (unsigned)hold;
                if (state->flags & 0x0200) CRC2(state->check, hold);
                INITBITS();
            }
            else if (state->head != Z_NULL)
                state->head->extra = Z_NULL;
            state->mode = EXTRA;
        case EXTRA:
            if (state->flags & 0x0400) {
                copy = state->length;
                if (copy > have) copy = have;
                if (copy) {
                    if (state->head != Z_NULL &&
                        state->head->extra != Z_NULL) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品自在在线| 欧美一区二区三区视频免费播放| 欧美激情在线一区二区| 欧美一区午夜精品| 日本黄色一区二区| 男女性色大片免费观看一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 国产欧美日韩久久| 久久久亚洲综合| 久久先锋影音av鲁色资源| 6080日韩午夜伦伦午夜伦| 欧美剧情电影在线观看完整版免费励志电影 | 免费人成精品欧美精品| 国产精品久久久爽爽爽麻豆色哟哟 | 伦理电影国产精品| 三级欧美在线一区| 日产欧产美韩系列久久99| 亚洲蜜臀av乱码久久精品蜜桃| 国产日韩精品一区二区三区| 久久午夜免费电影| 国产天堂亚洲国产碰碰| 中文字幕精品—区二区四季| 日韩福利电影在线| 蜜臂av日日欢夜夜爽一区| 亚洲精品一二三四区| 精品久久久久久久人人人人传媒 | 欧美日韩极品在线观看一区| 麻豆久久久久久久| 蜜桃精品视频在线观看| 韩日欧美一区二区三区| 国产一区欧美日韩| 成人午夜视频福利| 色噜噜狠狠色综合欧洲selulu| 欧美日韩国产综合一区二区三区 | 欧美成人性战久久| 久久人人超碰精品| 日韩精品中文字幕在线一区| 日韩精品欧美精品| 欧美日韩国产中文| 国产精品主播直播| 97久久精品人人做人人爽50路| 色综合天天综合网天天看片| 91精品国产综合久久小美女| 精品噜噜噜噜久久久久久久久试看 | 日韩avvvv在线播放| 国产一区二区三区黄视频| 97aⅴ精品视频一二三区| 欧美一级精品在线| 中文av字幕一区| 夜夜嗨av一区二区三区| 精品一区二区三区欧美| 在线免费不卡视频| 欧美国产日韩一二三区| 日韩电影免费在线看| 99热精品国产| 日韩欧美中文字幕精品| 色综合中文字幕国产| 91丨porny丨蝌蚪视频| 日韩午夜精品电影| 一区二区三区在线视频观看 | 久久在线免费观看| 午夜视频在线观看一区二区三区| 国产乱码精品一区二区三区五月婷| 色噜噜狠狠色综合欧洲selulu| 国产视频一区在线播放| 老汉av免费一区二区三区 | 看电影不卡的网站| 欧美美女网站色| 一区二区成人在线| 色综合激情久久| 国产免费成人在线视频| 极品美女销魂一区二区三区| 3d成人h动漫网站入口| 精品国免费一区二区三区| 日本道色综合久久| 91浏览器入口在线观看| 日韩西西人体444www| 亚洲五月六月丁香激情| 在线观看网站黄不卡| 亚洲免费成人av| av在线播放一区二区三区| 国产女主播一区| 激情综合色丁香一区二区| 欧美日韩高清一区| 天天综合网 天天综合色| 欧美精选一区二区| 一区二区三区日韩在线观看| 91丝袜美女网| 一区二区三区在线影院| 色妹子一区二区| 丝袜亚洲另类欧美| 日韩午夜av电影| 国产一区二区三区精品欧美日韩一区二区三区 | 精品视频一区二区不卡| 午夜精品免费在线| 欧美一区二区三区在线| 久久成人羞羞网站| 久久久久久夜精品精品免费| 国产成人精品亚洲日本在线桃色| 国产精品剧情在线亚洲| 在线免费观看视频一区| 秋霞电影网一区二区| 色狠狠av一区二区三区| 亚洲欧美精品午睡沙发| 欧美性视频一区二区三区| 日韩国产高清在线| 久久久久国产精品麻豆ai换脸| 成人av综合一区| 亚洲精选视频在线| 欧美精品久久久久久久久老牛影院 | 美女看a上一区| 国产精品国产自产拍高清av| 欧美中文字幕久久| 久久精品99国产精品| 国产精品三级电影| 欧美另类一区二区三区| 国产福利一区二区| 亚洲电影在线播放| 欧美成人a∨高清免费观看| 色偷偷成人一区二区三区91| 九色porny丨国产精品| 亚洲欧洲精品一区二区三区不卡| 欧美日韩成人综合天天影院| 国产成人av在线影院| 亚洲成人激情自拍| 久久精品欧美一区二区三区麻豆 | 国产在线精品免费av| 亚洲午夜在线视频| 亚洲国产高清在线观看视频| 欧美日韩免费电影| av在线一区二区三区| 久久超碰97人人做人人爱| 一区二区三区国产| 中文字幕高清一区| 日韩免费在线观看| 欧美视频在线观看一区| www.亚洲人| 国产激情精品久久久第一区二区| 亚洲国产精品一区二区尤物区| 国产精品欧美久久久久一区二区 | 国产精品色在线观看| 日韩视频一区二区三区在线播放| 91蝌蚪porny成人天涯| 韩国av一区二区| 美日韩黄色大片| 一区二区三区资源| 亚洲精品成人在线| 国产精品黄色在线观看| 久久久国产精品麻豆| 久久青草欧美一区二区三区| 欧美大肚乱孕交hd孕妇| 欧美一级免费观看| 欧美精品电影在线播放| 欧美高清视频www夜色资源网| 91久久精品一区二区三| 欧洲日韩一区二区三区| 欧洲激情一区二区| 欧美丝袜丝交足nylons| 欧美三级三级三级爽爽爽| 欧洲国产伦久久久久久久| 色噜噜夜夜夜综合网| 91丨九色丨黑人外教| 一本大道av伊人久久综合| 成人精品一区二区三区四区 | 欧美精品777| 色激情天天射综合网| 成人午夜视频在线观看| 国产精品免费久久久久| 亚洲精品在线免费观看视频| 毛片av一区二区| 日韩av电影天堂| 亚洲电影在线免费观看| 一区二区三区四区国产精品| 精品久久久影院| 欧美一区二区三区爱爱| 欧美性色欧美a在线播放| 日韩精品免费视频人成| 久久久av毛片精品| 欧美人xxxx| 欧美三级欧美一级| 欧美在线观看一二区| 欧美在线短视频| 91国产免费观看| 91视频精品在这里| 日本乱码高清不卡字幕| 99国产精品久久久久久久久久久| 麻豆一区二区三| 北条麻妃一区二区三区| 成人免费看黄yyy456| 成人久久视频在线观看| 成人精品免费看| 成人av片在线观看| 91小视频在线观看| 欧美性大战xxxxx久久久| 欧美性色黄大片手机版| 欧美日韩国产三级| 99精品国产一区二区三区不卡| 国产成人精品影视| 972aa.com艺术欧美| 91在线免费看|