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

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

?? infblock.c

?? zlib源碼
?? C
字號(hào):
/* infblock.c -- interpret and process block types to last block
 * Copyright (C) 1995-1998 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

#include "zutil.h"
#include "infblock.h"
#include "inftrees.h"
#include "infcodes.h"
#include "infutil.h"

struct inflate_codes_state {int dummy;}; /* for buggy compilers */

/* simplify the use of the inflate_huft type with some defines */
#define exop word.what.Exop
#define bits word.what.Bits

/* Table for deflate from PKZIP's appnote.txt. */
local const uInt border[] = { /* Order of the bit length code lengths */
        16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};

/*
   Notes beyond the 1.93a appnote.txt:

   1. Distance pointers never point before the beginning of the output
      stream.
   2. Distance pointers can point back across blocks, up to 32k away.
   3. There is an implied maximum of 7 bits for the bit length table and
      15 bits for the actual data.
   4. If only one code exists, then it is encoded using one bit.  (Zero
      would be more efficient, but perhaps a little confusing.)  If two
      codes exist, they are coded using one bit each (0 and 1).
   5. There is no way of sending zero distance codes--a dummy must be
      sent if there are none.  (History: a pre 2.0 version of PKZIP would
      store blocks with no distance codes, but this was discovered to be
      too harsh a criterion.)  Valid only for 1.93a.  2.04c does allow
      zero distance codes, which is sent as one code of zero bits in
      length.
   6. There are up to 286 literal/length codes.  Code 256 represents the
      end-of-block.  Note however that the static length tree defines
      288 codes just to fill out the Huffman codes.  Codes 286 and 287
      cannot be used though, since there is no length base or extra bits
      defined for them.  Similarily, there are up to 30 distance codes.
      However, static trees define 32 codes (all 5 bits) to fill out the
      Huffman codes, but the last two had better not show up in the data.
   7. Unzip can check dynamic Huffman blocks for complete code sets.
      The exception is that a single code would not be complete (see #4).
   8. The five bits following the block type is really the number of
      literal codes sent minus 257.
   9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
      (1+6+6).  Therefore, to output three times the length, you output
      three codes (1+1+1), whereas to output four times the same length,
      you only need two codes (1+3).  Hmm.
  10. In the tree reconstruction algorithm, Code = Code + Increment
      only if BitLength(i) is not zero.  (Pretty obvious.)
  11. Correction: 4 Bits: # of Bit Length codes - 4     (4 - 19)
  12. Note: length code 284 can represent 227-258, but length code 285
      really is 258.  The last length deserves its own, short code
      since it gets used a lot in very redundant files.  The length
      258 is special since 258 - 3 (the min match length) is 255.
  13. The literal/length and distance code bit lengths are read as a
      single stream of lengths.  It is possible (and advantageous) for
      a repeat code (16, 17, or 18) to go across the boundary between
      the two sets of lengths.
 */


void inflate_blocks_reset(s, z, c)
inflate_blocks_statef *s;
z_streamp z;
uLongf *c;
{
  if (c != Z_NULL)
    *c = s->check;
  if (s->mode == BTREE || s->mode == DTREE)
    ZFREE(z, s->sub.trees.blens);
  if (s->mode == CODES)
    inflate_codes_free(s->sub.decode.codes, z);
  s->mode = TYPE;
  s->bitk = 0;
  s->bitb = 0;
  s->read = s->write = s->window;
  if (s->checkfn != Z_NULL)
    z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
  Tracev((stderr, "inflate:   blocks reset\n"));
}


inflate_blocks_statef *inflate_blocks_new(z, c, w)
z_streamp z;
check_func c;
uInt w;
{
  inflate_blocks_statef *s;

  if ((s = (inflate_blocks_statef *)ZALLOC
       (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
    return s;
  if ((s->hufts =
       (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
  {
    ZFREE(z, s);
    return Z_NULL;
  }
  if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
  {
    ZFREE(z, s->hufts);
    ZFREE(z, s);
    return Z_NULL;
  }
  s->end = s->window + w;
  s->checkfn = c;
  s->mode = TYPE;
  Tracev((stderr, "inflate:   blocks allocated\n"));
  inflate_blocks_reset(s, z, Z_NULL);
  return s;
}


int inflate_blocks(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
{
  uInt t;               /* temporary storage */
  uLong b;              /* bit buffer */
  uInt k;               /* bits in bit buffer */
  Bytef *p;             /* input data pointer */
  uInt n;               /* bytes available there */
  Bytef *q;             /* output window write pointer */
  uInt m;               /* bytes to end of window or read pointer */

  /* copy input/output information to locals (UPDATE macro restores) */
  LOAD

  /* process input based on current state */
  while (1) switch (s->mode)
  {
    case TYPE:
      NEEDBITS(3)
      t = (uInt)b & 7;
      s->last = t & 1;
      switch (t >> 1)
      {
        case 0:                         /* stored */
          Tracev((stderr, "inflate:     stored block%s\n",
                 s->last ? " (last)" : ""));
          DUMPBITS(3)
          t = k & 7;                    /* go to byte boundary */
          DUMPBITS(t)
          s->mode = LENS;               /* get length of stored block */
          break;
        case 1:                         /* fixed */
          Tracev((stderr, "inflate:     fixed codes block%s\n",
                 s->last ? " (last)" : ""));
          {
            uInt bl, bd;
            inflate_huft *tl, *td;

            inflate_trees_fixed(&bl, &bd, &tl, &td, z);
            s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
            if (s->sub.decode.codes == Z_NULL)
            {
              r = Z_MEM_ERROR;
              LEAVE
            }
          }
          DUMPBITS(3)
          s->mode = CODES;
          break;
        case 2:                         /* dynamic */
          Tracev((stderr, "inflate:     dynamic codes block%s\n",
                 s->last ? " (last)" : ""));
          DUMPBITS(3)
          s->mode = TABLE;
          break;
        case 3:                         /* illegal */
          DUMPBITS(3)
          s->mode = BAD;
          z->msg = (char*)"invalid block type";
          r = Z_DATA_ERROR;
          LEAVE
      }
      break;
    case LENS:
      NEEDBITS(32)
      if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
      {
        s->mode = BAD;
        z->msg = (char*)"invalid stored block lengths";
        r = Z_DATA_ERROR;
        LEAVE
      }
      s->sub.left = (uInt)b & 0xffff;
      b = k = 0;                      /* dump bits */
      Tracev((stderr, "inflate:       stored length %u\n", s->sub.left));
      s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
      break;
    case STORED:
      if (n == 0)
        LEAVE
      NEEDOUT
      t = s->sub.left;
      if (t > n) t = n;
      if (t > m) t = m;
      zmemcpy(q, p, t);
      p += t;  n -= t;
      q += t;  m -= t;
      if ((s->sub.left -= t) != 0)
        break;
      Tracev((stderr, "inflate:       stored end, %lu total out\n",
              z->total_out + (q >= s->read ? q - s->read :
              (s->end - s->read) + (q - s->window))));
      s->mode = s->last ? DRY : TYPE;
      break;
    case TABLE:
      NEEDBITS(14)
      s->sub.trees.table = t = (uInt)b & 0x3fff;
#ifndef PKZIP_BUG_WORKAROUND
      if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
      {
        s->mode = BAD;
        z->msg = (char*)"too many length or distance symbols";
        r = Z_DATA_ERROR;
        LEAVE
      }
#endif
      t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
      if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
      {
        r = Z_MEM_ERROR;
        LEAVE
      }
      DUMPBITS(14)
      s->sub.trees.index = 0;
      Tracev((stderr, "inflate:       table sizes ok\n"));
      s->mode = BTREE;
    case BTREE:
      while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
      {
        NEEDBITS(3)
        s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
        DUMPBITS(3)
      }
      while (s->sub.trees.index < 19)
        s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
      s->sub.trees.bb = 7;
      t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
                             &s->sub.trees.tb, s->hufts, z);
      if (t != Z_OK)
      {
        ZFREE(z, s->sub.trees.blens);
        r = t;
        if (r == Z_DATA_ERROR)
          s->mode = BAD;
        LEAVE
      }
      s->sub.trees.index = 0;
      Tracev((stderr, "inflate:       bits tree ok\n"));
      s->mode = DTREE;
    case DTREE:
      while (t = s->sub.trees.table,
             s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
      {
        inflate_huft *h;
        uInt i, j, c;

        t = s->sub.trees.bb;
        NEEDBITS(t)
        h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
        t = h->bits;
        c = h->base;
        if (c < 16)
        {
          DUMPBITS(t)
          s->sub.trees.blens[s->sub.trees.index++] = c;
        }
        else /* c == 16..18 */
        {
          i = c == 18 ? 7 : c - 14;
          j = c == 18 ? 11 : 3;
          NEEDBITS(t + i)
          DUMPBITS(t)
          j += (uInt)b & inflate_mask[i];
          DUMPBITS(i)
          i = s->sub.trees.index;
          t = s->sub.trees.table;
          if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
              (c == 16 && i < 1))
          {
            ZFREE(z, s->sub.trees.blens);
            s->mode = BAD;
            z->msg = (char*)"invalid bit length repeat";
            r = Z_DATA_ERROR;
            LEAVE
          }
          c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
          do {
            s->sub.trees.blens[i++] = c;
          } while (--j);
          s->sub.trees.index = i;
        }
      }
      s->sub.trees.tb = Z_NULL;
      {
        uInt bl, bd;
        inflate_huft *tl, *td;
        inflate_codes_statef *c;

        bl = 9;         /* must be <= 9 for lookahead assumptions */
        bd = 6;         /* must be <= 9 for lookahead assumptions */
        t = s->sub.trees.table;
        t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
                                  s->sub.trees.blens, &bl, &bd, &tl, &td,
                                  s->hufts, z);
        ZFREE(z, s->sub.trees.blens);
        if (t != Z_OK)
        {
          if (t == (uInt)Z_DATA_ERROR)
            s->mode = BAD;
          r = t;
          LEAVE
        }
        Tracev((stderr, "inflate:       trees ok\n"));
        if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
        {
          r = Z_MEM_ERROR;
          LEAVE
        }
        s->sub.decode.codes = c;
      }
      s->mode = CODES;
    case CODES:
      UPDATE
      if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
        return inflate_flush(s, z, r);
      r = Z_OK;
      inflate_codes_free(s->sub.decode.codes, z);
      LOAD
      Tracev((stderr, "inflate:       codes end, %lu total out\n",
              z->total_out + (q >= s->read ? q - s->read :
              (s->end - s->read) + (q - s->window))));
      if (!s->last)
      {
        s->mode = TYPE;
        break;
      }
      s->mode = DRY;
    case DRY:
      FLUSH
      if (s->read != s->write)
        LEAVE
      s->mode = DONE;
    case DONE:
      r = Z_STREAM_END;
      LEAVE
    case BAD:
      r = Z_DATA_ERROR;
      LEAVE
    default:
      r = Z_STREAM_ERROR;
      LEAVE
  }
}


int inflate_blocks_free(s, z)
inflate_blocks_statef *s;
z_streamp z;
{
  inflate_blocks_reset(s, z, Z_NULL);
  ZFREE(z, s->window);
  ZFREE(z, s->hufts);
  ZFREE(z, s);
  Tracev((stderr, "inflate:   blocks freed\n"));
  return Z_OK;
}


void inflate_set_dictionary(s, d, n)
inflate_blocks_statef *s;
const Bytef *d;
uInt  n;
{
  zmemcpy(s->window, d, n);
  s->read = s->write = s->window + n;
}


/* Returns true if inflate is currently at the end of a block generated
 * by Z_SYNC_FLUSH or Z_FULL_FLUSH. 
 * IN assertion: s != Z_NULL
 */
int inflate_blocks_sync_point(s)
inflate_blocks_statef *s;
{
  return s->mode == LENS;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一本大道香蕉久在线精品| 日韩欧美一二三四区| 欧美一区二区三区成人| 一区二区三区日韩精品视频| 成人精品视频网站| 久久久久九九视频| 久久97超碰国产精品超碰| 欧美一区二区网站| 在线亚洲精品福利网址导航| 国产精品美女久久久久久| 国产一区在线看| 久久久久久久久久久电影| 欧美日免费三级在线| 一区二区三区在线高清| 国产欧美一区视频| 成人av高清在线| 亚洲午夜久久久| 欧美日韩国产电影| 青青草精品视频| 日韩女优毛片在线| 欧美精品自拍偷拍动漫精品| 国产一区在线观看视频| 蜜桃精品视频在线| 国产精品女主播在线观看| 欧美电视剧免费观看| 欧美色中文字幕| 国产一区二区在线看| 日韩不卡一区二区三区 | 日韩视频中午一区| 日韩激情视频在线观看| 久久精品亚洲精品国产欧美kt∨| 99精品视频在线观看| 亚洲电影欧美电影有声小说| 精品国产乱码久久久久久闺蜜| 国产91露脸合集magnet| 午夜影院久久久| 亚洲444eee在线观看| 亚洲成人动漫在线观看| 亚洲乱码国产乱码精品精98午夜| 亚洲一区二区三区不卡国产欧美| 日本高清不卡视频| 亚洲色图在线播放| 精品中文字幕一区二区| 亚洲美女视频在线观看| 日韩精品一级中文字幕精品视频免费观看| 91小宝寻花一区二区三区| 欧美精品一区二区三| 在线观看网站黄不卡| 国产精品系列在线播放| 国产精品拍天天在线| 日韩视频不卡中文| 日韩欧美综合一区| 精品一区二区三区av| 亚洲欧美日韩综合aⅴ视频| 久久午夜色播影院免费高清 | 色吊一区二区三区| 日韩一区在线播放| 亚洲免费视频成人| 欧美艳星brazzers| 精品一区二区三区视频| 欧美国产精品中文字幕| 首页综合国产亚洲丝袜| 中文字幕在线一区| 国产成人免费在线观看不卡| 久久精品欧美日韩精品 | 中文字幕一区在线观看视频| 精品久久久久香蕉网| 欧美在线看片a免费观看| 在线免费精品视频| 欧美美女视频在线观看| 精品国产乱子伦一区| 国产精品久久毛片a| 亚洲一区在线免费观看| 美女久久久精品| 成人黄色一级视频| 欧美乱妇20p| 久久久久久久综合色一本| 综合电影一区二区三区 | 色哟哟一区二区在线观看| 欧美欧美欧美欧美| 国产女人aaa级久久久级 | 国产精品狼人久久影院观看方式| 亚洲精品免费看| 另类的小说在线视频另类成人小视频在线 | 久久综合久久综合九色| 国产精品白丝在线| 免费欧美在线视频| 色综合天天综合给合国产| 粉嫩绯色av一区二区在线观看| 欧美综合久久久| 精品久久一二三区| 一区二区在线观看免费| 国产精品一区二区男女羞羞无遮挡| 欧美亚洲综合久久| 中文字幕av不卡| 老司机精品视频导航| 色综合久久88色综合天天免费| 亚洲精品在线免费播放| 亚洲成av人片在www色猫咪| 成人av片在线观看| 久久精子c满五个校花| 麻豆精品久久精品色综合| 欧美专区日韩专区| 国产欧美视频在线观看| 久久99精品久久久久久国产越南 | 91理论电影在线观看| 久久亚洲综合色| 日韩国产一二三区| 欧美性猛交一区二区三区精品| 国产精品成人午夜| 国产精品18久久久久久久久久久久| 欧美高清视频www夜色资源网| 国产精品理伦片| 丁香天五香天堂综合| 欧美精品一区二区在线播放| 天堂成人免费av电影一区| 欧美综合一区二区| 亚洲精品日产精品乱码不卡| 成人白浆超碰人人人人| 国产欧美精品一区二区色综合| 美腿丝袜在线亚洲一区| 91精品国产综合久久福利| 日韩精品视频网| 欧美日韩欧美一区二区| 亚洲电影在线播放| 在线日韩国产精品| 亚洲自拍偷拍欧美| 欧美性受xxxx黑人xyx性爽| 亚洲精品久久7777| 色88888久久久久久影院按摩| 亚洲欧洲精品天堂一级| 成人午夜看片网址| 欧美国产1区2区| 丁香亚洲综合激情啪啪综合| 欧美激情在线观看视频免费| 国产成人综合亚洲91猫咪| 精品福利一二区| 国产传媒日韩欧美成人| 久久婷婷综合激情| 精品亚洲porn| 久久久久88色偷偷免费| 国产91综合网| 亚洲美腿欧美偷拍| 欧美亚洲国产一区二区三区| 亚洲福利视频一区二区| 精品国产91乱码一区二区三区| 免费在线观看一区二区三区| 日韩欧美国产一区二区三区| 国内精品国产成人| 色吊一区二区三区| 亚洲成人资源在线| 91精品国产综合久久精品 | 亚洲乱码国产乱码精品精可以看 | 91精品久久久久久蜜臀| 日本不卡一区二区| 久久久久久久综合| 北岛玲一区二区三区四区| 精品少妇一区二区三区视频免付费 | 亚洲高清一区二区三区| 日韩欧美一二三| 国产成a人亚洲| 一区二区三区四区五区视频在线观看| 欧美日韩一区在线观看| 久久精品免费看| 欧美国产日韩精品免费观看| 91美女视频网站| 日韩黄色免费网站| 国产欧美日韩精品在线| 欧洲视频一区二区| 久久精品国产色蜜蜜麻豆| 国产精品白丝在线| 91精品国产综合久久久久久久久久| 国产自产视频一区二区三区| 自拍偷拍国产亚洲| 日韩一级大片在线| 成人黄色av网站在线| 日韩在线播放一区二区| 日本一区二区在线不卡| 欧美电影在线免费观看| 国产精品一区二区视频| 亚洲成av人片一区二区| 久久精品亚洲精品国产欧美| 欧美三片在线视频观看| 国产福利91精品一区二区三区| 亚洲色图19p| 精品国产在天天线2019| 色综合久久中文综合久久牛| 精久久久久久久久久久| 亚洲免费电影在线| 欧美国产日韩亚洲一区| 91精品国产91久久综合桃花| 99这里只有久久精品视频| 男男gaygay亚洲| 亚洲第一福利一区| 中文字幕在线一区| 久久久亚洲精华液精华液精华液| 欧美日韩国产综合草草| 99视频一区二区| 国产乱码字幕精品高清av| 日本在线不卡视频|