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

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

?? puff.c

?? StormLib是對MPQ文件進行處理的庫 MPQ是暴雪公司的私有的一種壓縮格式
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * puff.c * Copyright (C) 2002-2004 Mark Adler * For conditions of distribution and use, see copyright notice in puff.h * version 1.8, 9 Jan 2004 * * puff.c is a simple inflate written to be an unambiguous way to specify the * deflate format.  It is not written for speed but rather simplicity.  As a * side benefit, this code might actually be useful when small code is more * important than speed, such as bootstrap applications.  For typical deflate * data, zlib's inflate() is about four times as fast as puff().  zlib's * inflate compiles to around 20K on my machine, whereas puff.c compiles to * around 4K on my machine (a PowerPC using GNU cc).  If the faster decode() * function here is used, then puff() is only twice as slow as zlib's * inflate(). * * All dynamically allocated memory comes from the stack.  The stack required * is less than 2K bytes.  This code is compatible with 16-bit int's and * assumes that long's are at least 32 bits.  puff.c uses the short data type, * assumed to be 16 bits, for arrays in order to to conserve memory.  The code * works whether integers are stored big endian or little endian. * * In the comments below are "Format notes" that describe the inflate process * and document some of the less obvious aspects of the format.  This source * code is meant to supplement RFC 1951, which formally describes the deflate * format: * *    http://www.zlib.org/rfc-deflate.html *//* * Change history: * * 1.0  10 Feb 2002     - First version * 1.1  17 Feb 2002     - Clarifications of some comments and notes *                      - Update puff() dest and source pointers on negative *                        errors to facilitate debugging deflators *                      - Remove longest from struct huffman -- not needed *                      - Simplify offs[] index in construct() *                      - Add input size and checking, using longjmp() to *                        maintain easy readability *                      - Use short data type for large arrays *                      - Use pointers instead of long to specify source and *                        destination sizes to avoid arbitrary 4 GB limits * 1.2  17 Mar 2002     - Add faster version of decode(), doubles speed (!), *                        but leave simple version for readabilty *                      - Make sure invalid distances detected if pointers *                        are 16 bits *                      - Fix fixed codes table error *                      - Provide a scanning mode for determining size of *                        uncompressed data * 1.3  20 Mar 2002     - Go back to lengths for puff() parameters [Jean-loup] *                      - Add a puff.h file for the interface *                      - Add braces in puff() for else do [Jean-loup] *                      - Use indexes instead of pointers for readability * 1.4  31 Mar 2002     - Simplify construct() code set check *                      - Fix some comments *                      - Add FIXLCODES #define * 1.5   6 Apr 2002     - Minor comment fixes * 1.6   7 Aug 2002     - Minor format changes * 1.7   3 Mar 2003     - Added test code for distribution *                      - Added zlib-like license * 1.8   9 Jan 2004     - Added some comments on no distance codes case */#include <setjmp.h>             /* for setjmp(), longjmp(), and jmp_buf */#include "puff.h"               /* prototype for puff() */#define local static            /* for local function definitions */#define NIL ((unsigned char *)0)        /* for no output option *//* * Maximums for allocations and loops.  It is not useful to change these -- * they are fixed by the deflate format. */#define MAXBITS 15              /* maximum bits in a code */#define MAXLCODES 286           /* maximum number of literal/length codes */#define MAXDCODES 30            /* maximum number of distance codes */#define MAXCODES (MAXLCODES+MAXDCODES)  /* maximum codes lengths to read */#define FIXLCODES 288           /* number of fixed literal/length codes *//* input and output state */struct state {    /* output state */    unsigned char *out;         /* output buffer */    unsigned long outlen;       /* available space at out */    unsigned long outcnt;       /* bytes written to out so far */    /* input state */    unsigned char *in;          /* input buffer */    unsigned long inlen;        /* available input at in */    unsigned long incnt;        /* bytes read so far */    int bitbuf;                 /* bit buffer */    int bitcnt;                 /* number of bits in bit buffer */    /* input limit error return state for bits() and decode() */    jmp_buf env;};/* * Return need bits from the input stream.  This always leaves less than * eight bits in the buffer.  bits() works properly for need == 0. * * Format notes: * * - Bits are stored in bytes from the least significant bit to the most *   significant bit.  Therefore bits are dropped from the bottom of the bit *   buffer, using shift right, and new bytes are appended to the top of the *   bit buffer, using shift left. */local int bits(struct state *s, int need){    long val;           /* bit accumulator (can use up to 20 bits) */    /* load at least need bits into val */    val = s->bitbuf;    while (s->bitcnt < need) {        if (s->incnt == s->inlen) longjmp(s->env, 1);   /* out of input */        val |= (long)(s->in[s->incnt++]) << s->bitcnt;  /* load eight bits */        s->bitcnt += 8;    }    /* drop need bits and update buffer, always zero to seven bits left */    s->bitbuf = (int)(val >> need);    s->bitcnt -= need;    /* return need bits, zeroing the bits above that */    return (int)(val & ((1L << need) - 1));}/* * Process a stored block. * * Format notes: * * - After the two-bit stored block type (00), the stored block length and *   stored bytes are byte-aligned for fast copying.  Therefore any leftover *   bits in the byte that has the last bit of the type, as many as seven, are *   discarded.  The value of the discarded bits are not defined and should not *   be checked against any expectation. * * - The second inverted copy of the stored block length does not have to be *   checked, but it's probably a good idea to do so anyway. * * - A stored block can have zero length.  This is sometimes used to byte-align *   subsets of the compressed data for random access or partial recovery. */local int stored(struct state *s){    unsigned len;       /* length of stored block */    /* discard leftover bits from current byte (assumes s->bitcnt < 8) */    s->bitbuf = 0;    s->bitcnt = 0;    /* get length and check against its one's complement */    if (s->incnt + 4 > s->inlen) return 2;      /* not enough input */    len = s->in[s->incnt++];    len |= s->in[s->incnt++] << 8;    if (s->in[s->incnt++] != (~len & 0xff) ||        s->in[s->incnt++] != ((~len >> 8) & 0xff))        return -2;                              /* didn't match complement! */    /* copy len bytes from in to out */    if (s->incnt + len > s->inlen) return 2;    /* not enough input */    if (s->out != NIL) {        if (s->outcnt + len > s->outlen)            return 1;                           /* not enough output space */        while (len--)            s->out[s->outcnt++] = s->in[s->incnt++];    }    else {                                      /* just scanning */        s->outcnt += len;        s->incnt += len;    }    /* done with a valid stored block */    return 0;}/* * Huffman code decoding tables.  count[1..MAXBITS] is the number of symbols of * each length, which for a canonical code are stepped through in order. * symbol[] are the symbol values in canonical order, where the number of * entries is the sum of the counts in count[].  The decoding process can be * seen in the function decode() below. */struct huffman {    short *count;       /* number of symbols of each length */    short *symbol;      /* canonically ordered symbols */};/* * Decode a code from the stream s using huffman table h.  Return the symbol or * a negative value if there is an error.  If all of the lengths are zero, i.e. * an empty code, or if the code is incomplete and an invalid code is received, * then -9 is returned after reading MAXBITS bits. * * Format notes: * * - The codes as stored in the compressed data are bit-reversed relative to *   a simple integer ordering of codes of the same lengths.  Hence below the *   bits are pulled from the compressed data one at a time and used to *   build the code value reversed from what is in the stream in order to *   permit simple integer comparisons for decoding.  A table-based decoding *   scheme (as used in zlib) does not need to do this reversal. * * - The first code for the shortest length is all zeros.  Subsequent codes of *   the same length are simply integer increments of the previous code.  When *   moving up a length, a zero bit is appended to the code.  For a complete *   code, the last code of the longest length will be all ones. * * - Incomplete codes are handled by this decoder, since they are permitted *   in the deflate format.  See the format notes for fixed() and dynamic(). */#ifdef SLOWlocal int decode(struct state *s, struct huffman *h){    int len;            /* current number of bits in code */    int code;           /* len bits being decoded */    int first;          /* first code of length len */    int count;          /* number of codes of length len */    int index;          /* index of first code of length len in symbol table */    code = first = index = 0;    for (len = 1; len <= MAXBITS; len++) {        code |= bits(s, 1);             /* get next bit */        count = h->count[len];        if (code < first + count)       /* if length len, return symbol */            return h->symbol[index + (code - first)];        index += count;                 /* else update for next length */        first += count;        first <<= 1;        code <<= 1;    }    return -9;                          /* ran out of codes */}/* * A faster version of decode() for real applications of this code.   It's not * as readable, but it makes puff() twice as fast.  And it only makes the code * a few percent larger. */#else /* !SLOW */local int decode(struct state *s, struct huffman *h){    int len;            /* current number of bits in code */    int code;           /* len bits being decoded */    int first;          /* first code of length len */    int count;          /* number of codes of length len */    int index;          /* index of first code of length len in symbol table */    int bitbuf;         /* bits from stream */    int left;           /* bits left in next or left to process */    short *next;        /* next number of codes */    bitbuf = s->bitbuf;    left = s->bitcnt;    code = first = index = 0;    len = 1;    next = h->count + 1;    while (1) {        while (left--) {            code |= bitbuf & 1;            bitbuf >>= 1;            count = *next++;            if (code < first + count) { /* if length len, return symbol */                s->bitbuf = bitbuf;                s->bitcnt = (s->bitcnt - len) & 7;                return h->symbol[index + (code - first)];            }            index += count;             /* else update for next length */            first += count;            first <<= 1;            code <<= 1;            len++;        }        left = (MAXBITS+1) - len;        if (left == 0) break;        if (s->incnt == s->inlen) longjmp(s->env, 1);   /* out of input */        bitbuf = s->in[s->incnt++];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美成人激情| 欧美亚洲国产一区二区三区| 五月激情六月综合| 一区二区三区免费网站| 综合色中文字幕| 中文字幕日韩av资源站| 亚洲色图在线看| 一区二区三区在线高清| 亚洲综合丝袜美腿| 免费高清不卡av| 国产精品一区二区男女羞羞无遮挡| 久久狠狠亚洲综合| 国产成人午夜精品影院观看视频| 国产美女精品在线| 不卡视频一二三四| 欧美性感一区二区三区| 91精品国产欧美一区二区18| 欧美成人r级一区二区三区| 久久伊人中文字幕| 中文字幕一区二区三区视频| 亚洲精品国产高清久久伦理二区| 亚洲国产欧美在线人成| 免费在线欧美视频| 国产999精品久久| 91搞黄在线观看| 日韩一区二区在线观看视频播放| 久久影院午夜片一区| 亚洲免费资源在线播放| 免费人成精品欧美精品| 成人性生交大片免费看在线播放| 日本久久一区二区| 日韩午夜在线观看视频| 国产精品一区二区黑丝| 日韩成人免费看| 国产一区二三区| 色av一区二区| 欧美成人福利视频| 亚洲免费毛片网站| 国产美女一区二区| 欧美图片一区二区三区| 久久女同精品一区二区| 亚洲欧美日韩一区二区| 久久国产三级精品| 色婷婷激情综合| 精品嫩草影院久久| 亚洲永久免费av| 成人午夜伦理影院| 日韩一区二区电影网| 一区二区三区波多野结衣在线观看| 麻豆精品在线播放| 欧美亚男人的天堂| 亚洲欧洲韩国日本视频| 国产福利精品一区| 91精品国产综合久久精品麻豆| 亚洲国产精品二十页| 免费观看成人av| 欧美日韩免费不卡视频一区二区三区| 久久久激情视频| 精品一区二区在线播放| 欧美日韩高清在线| 亚洲成精国产精品女| 91在线精品一区二区| 国产喂奶挤奶一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美丝袜自拍制服另类| 亚洲精品国产一区二区三区四区在线| 不卡电影一区二区三区| 欧美激情中文不卡| 国产精品一区不卡| 久久久不卡网国产精品一区| 久久国产尿小便嘘嘘尿| 欧美一区二区三区在线观看| 偷窥国产亚洲免费视频| 欧美日韩国产首页在线观看| 亚洲一区二区三区四区的| 91久久免费观看| 亚洲一区二区视频在线| 精品视频在线看| 午夜天堂影视香蕉久久| 欧美日韩高清一区二区不卡| 亚洲国产综合91精品麻豆| 欧美三级在线看| 日韩电影一二三区| 精品日本一线二线三线不卡| 国内精品免费**视频| 久久久国产一区二区三区四区小说| 国产精品一区二区久激情瑜伽| 国产三区在线成人av| 成人网在线免费视频| 亚洲欧洲日本在线| 在线免费观看日本一区| 日韩国产欧美一区二区三区| 日韩精品一区二区在线观看| 国产精品一区专区| 亚洲免费观看高清完整版在线观看| 色妞www精品视频| 午夜久久久影院| 亚洲精品一区二区三区精华液 | 欧美日韩另类一区| 美腿丝袜亚洲三区| 国产精品视频一二三| 91官网在线免费观看| 美女在线一区二区| 国产精品国产a| 欧美亚洲一区二区三区四区| 蜜臀av一区二区三区| 中文字幕+乱码+中文字幕一区| 色婷婷精品久久二区二区蜜臀av | 亚洲人吸女人奶水| 日韩一区二区三区精品视频| 丁香一区二区三区| 日韩在线一区二区| 亚洲国产精品99久久久久久久久| 在线视频中文字幕一区二区| 久久99国产精品成人| 亚洲激情五月婷婷| 337p日本欧洲亚洲大胆色噜噜| 99久久99久久久精品齐齐| 久久国产三级精品| 亚洲综合在线第一页| 国产视频在线观看一区二区三区| 欧美亚洲动漫制服丝袜| 成人av中文字幕| 久久66热偷产精品| 亚洲第一综合色| **网站欧美大片在线观看| 日韩免费视频一区二区| 在线观看免费一区| av电影一区二区| 国产一区二区不卡| 日本在线不卡视频一二三区| 亚洲免费视频成人| 中文字幕中文字幕中文字幕亚洲无线| 678五月天丁香亚洲综合网| 一本久久综合亚洲鲁鲁五月天 | 国产精品美女久久久久aⅴ国产馆| 欧美日韩小视频| 欧美视频在线一区| 96av麻豆蜜桃一区二区| 国产精品99久久久久久久vr| 免费在线欧美视频| 日韩激情一区二区| 亚洲一区二区视频| 亚洲一级不卡视频| 一区二区日韩av| 亚洲资源中文字幕| 亚洲一区在线免费观看| 亚洲激情一二三区| 亚洲国产精品一区二区www在线| 综合激情网...| 亚洲同性同志一二三专区| 久久精品欧美日韩精品| 国产亚洲美州欧州综合国| 国产亚洲一区二区三区| 国产午夜精品福利| 一色桃子久久精品亚洲| 亚洲免费在线视频| 亚洲成人一区二区在线观看| 亚洲国产毛片aaaaa无费看| 亚洲国产日韩精品| 蜜臀a∨国产成人精品| 免费观看成人av| 国产精品99久久不卡二区| 国产成人av福利| 99久久精品免费看国产免费软件| 国产91精品精华液一区二区三区| 成人毛片视频在线观看| 91亚洲精品久久久蜜桃| 欧美亚洲免费在线一区| 制服丝袜亚洲色图| 久久网站热最新地址| 石原莉奈一区二区三区在线观看| 国产精品全国免费观看高清| 国产视频在线观看一区二区三区| 久久影院视频免费| 欧美极品少妇xxxxⅹ高跟鞋 | 免费久久99精品国产| 国产在线日韩欧美| 岛国精品在线观看| 日本韩国欧美一区| 欧美一三区三区四区免费在线看| 精品国产自在久精品国产| 欧美国产日本视频| 亚洲成人黄色影院| 国产一区二区久久| 在线观看视频一区二区欧美日韩| 91精品国产综合久久久久久| 久久婷婷色综合| 一区二区三区在线观看欧美| 蜜臀av性久久久久蜜臀aⅴ| 成人免费精品视频| 6080日韩午夜伦伦午夜伦| 国产精品久久久久影院老司| 香蕉加勒比综合久久| 国产成人精品1024| 亚洲日本va午夜在线影院| 亚洲色图在线看| 欧美a级一区二区| 91在线视频官网| 精品日韩一区二区|