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

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

?? gun.c

?? StormLib是對MPQ文件進行處理的庫 MPQ是暴雪公司的私有的一種壓縮格式
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* gun.c -- simple gunzip to give an example of the use of inflateBack() * Copyright (C) 2003, 2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h   Version 1.3  12 June 2005  Mark Adler *//* Version history:   1.0  16 Feb 2003  First version for testing of inflateBack()   1.1  21 Feb 2005  Decompress concatenated gzip streams                     Remove use of "this" variable (C++ keyword)                     Fix return value for in()                     Improve allocation failure checking                     Add typecasting for void * structures                     Add -h option for command version and usage                     Add a bunch of comments   1.2  20 Mar 2005  Add Unix compress (LZW) decompression                     Copy file attributes from input file to output file   1.3  12 Jun 2005  Add casts for error messages [Oberhumer] *//*   gun [ -t ] [ name ... ]   decompresses the data in the named gzip files.  If no arguments are given,   gun will decompress from stdin to stdout.  The names must end in .gz, -gz,   .z, -z, _z, or .Z.  The uncompressed data will be written to a file name   with the suffix stripped.  On success, the original file is deleted.  On   failure, the output file is deleted.  For most failures, the command will   continue to process the remaining names on the command line.  A memory   allocation failure will abort the command.  If -t is specified, then the   listed files or stdin will be tested as gzip files for integrity (without   checking for a proper suffix), no output will be written, and no files   will be deleted.   Like gzip, gun allows concatenated gzip streams and will decompress them,   writing all of the uncompressed data to the output.  Unlike gzip, gun allows   an empty file on input, and will produce no error writing an empty output   file.   gun will also decompress files made by Unix compress, which uses LZW   compression.  These files are automatically detected by virtue of their   magic header bytes.  Since the end of Unix compress stream is marked by the   end-of-file, they cannot be concantenated.  If a Unix compress stream is   encountered in an input file, it is the last stream in that file.   Like gunzip and uncompress, the file attributes of the orignal compressed   file are maintained in the final uncompressed file, to the extent that the   user permissions allow it.   On my Mac OS X PowerPC G4, gun is almost twice as fast as gunzip (version   1.2.4) is on the same file, when gun is linked with zlib 1.2.2.  Also the   LZW decompression provided by gun is about twice as fast as the standard   Unix uncompress command. *//* external functions and related types and constants */#include <stdio.h>          /* fprintf() */#include <stdlib.h>         /* malloc(), free() */#include <string.h>         /* strerror(), strcmp(), strlen(), memcpy() */#include <errno.h>          /* errno */#include <fcntl.h>          /* open() */#include <unistd.h>         /* read(), write(), close(), chown(), unlink() */#include <sys/types.h>#include <sys/stat.h>       /* stat(), chmod() */#include <utime.h>          /* utime() */#include "zlib.h"           /* inflateBackInit(), inflateBack(), */                            /* inflateBackEnd(), crc32() *//* function declaration */#define local static/* buffer constants */#define SIZE 32768U         /* input and output buffer sizes */#define PIECE 16384         /* limits i/o chunks for 16-bit int case *//* structure for infback() to pass to input function in() -- it maintains the   input file and a buffer of size SIZE */struct ind {    int infile;    unsigned char *inbuf;};/* Load input buffer, assumed to be empty, and return bytes loaded and a   pointer to them.  read() is called until the buffer is full, or until it   returns end-of-file or error.  Return 0 on error. */local unsigned in(void *in_desc, unsigned char **buf){    int ret;    unsigned len;    unsigned char *next;    struct ind *me = (struct ind *)in_desc;    next = me->inbuf;    *buf = next;    len = 0;    do {        ret = PIECE;        if ((unsigned)ret > SIZE - len)            ret = (int)(SIZE - len);        ret = (int)read(me->infile, next, ret);        if (ret == -1) {            len = 0;            break;        }        next += ret;        len += ret;    } while (ret != 0 && len < SIZE);    return len;}/* structure for infback() to pass to output function out() -- it maintains the   output file, a running CRC-32 check on the output and the total number of   bytes output, both for checking against the gzip trailer.  (The length in   the gzip trailer is stored modulo 2^32, so it's ok if a long is 32 bits and   the output is greater than 4 GB.) */struct outd {    int outfile;    int check;                  /* true if checking crc and total */    unsigned long crc;    unsigned long total;};/* Write output buffer and update the CRC-32 and total bytes written.  write()   is called until all of the output is written or an error is encountered.   On success out() returns 0.  For a write failure, out() returns 1.  If the   output file descriptor is -1, then nothing is written. */local int out(void *out_desc, unsigned char *buf, unsigned len){    int ret;    struct outd *me = (struct outd *)out_desc;    if (me->check) {        me->crc = crc32(me->crc, buf, len);        me->total += len;    }    if (me->outfile != -1)        do {            ret = PIECE;            if ((unsigned)ret > len)                ret = (int)len;            ret = (int)write(me->outfile, buf, ret);            if (ret == -1)                return 1;            buf += ret;            len -= ret;        } while (len != 0);    return 0;}/* next input byte macro for use inside lunpipe() and gunpipe() */#define NEXT() (have ? 0 : (have = in(indp, &next)), \                last = have ? (have--, (int)(*next++)) : -1)/* memory for gunpipe() and lunpipe() --   the first 256 entries of prefix[] and suffix[] are never used, could   have offset the index, but it's faster to waste the memory */unsigned char inbuf[SIZE];              /* input buffer */unsigned char outbuf[SIZE];             /* output buffer */unsigned short prefix[65536];           /* index to LZW prefix string */unsigned char suffix[65536];            /* one-character LZW suffix */unsigned char match[65280 + 2];         /* buffer for reversed match or gzip                                           32K sliding window *//* throw out what's left in the current bits byte buffer (this is a vestigial   aspect of the compressed data format derived from an implementation that   made use of a special VAX machine instruction!) */#define FLUSHCODE() \    do { \        left = 0; \        rem = 0; \        if (chunk > have) { \            chunk -= have; \            have = 0; \            if (NEXT() == -1) \                break; \            chunk--; \            if (chunk > have) { \                chunk = have = 0; \                break; \            } \        } \        have -= chunk; \        next += chunk; \        chunk = 0; \    } while (0)/* Decompress a compress (LZW) file from indp to outfile.  The compress magic   header (two bytes) has already been read and verified.  There are have bytes   of buffered input at next.  strm is used for passing error information back   to gunpipe().   lunpipe() will return Z_OK on success, Z_BUF_ERROR for an unexpected end of   file, read error, or write error (a write error indicated by strm->next_in   not equal to Z_NULL), or Z_DATA_ERROR for invalid input. */local int lunpipe(unsigned have, unsigned char *next, struct ind *indp,                  int outfile, z_stream *strm){    int last;                   /* last byte read by NEXT(), or -1 if EOF */    int chunk;                  /* bytes left in current chunk */    int left;                   /* bits left in rem */    unsigned rem;               /* unused bits from input */    int bits;                   /* current bits per code */    unsigned code;              /* code, table traversal index */    unsigned mask;              /* mask for current bits codes */    int max;                    /* maximum bits per code for this stream */    int flags;                  /* compress flags, then block compress flag */    unsigned end;               /* last valid entry in prefix/suffix tables */    unsigned temp;              /* current code */    unsigned prev;              /* previous code */    unsigned final;             /* last character written for previous code */    unsigned stack;             /* next position for reversed string */    unsigned outcnt;            /* bytes in output buffer */    struct outd outd;           /* output structure */    /* set up output */    outd.outfile = outfile;    outd.check = 0;    /* process remainder of compress header -- a flags byte */    flags = NEXT();    if (last == -1)        return Z_BUF_ERROR;    if (flags & 0x60) {        strm->msg = (char *)"unknown lzw flags set";        return Z_DATA_ERROR;    }    max = flags & 0x1f;    if (max < 9 || max > 16) {        strm->msg = (char *)"lzw bits out of range";        return Z_DATA_ERROR;    }    if (max == 9)                           /* 9 doesn't really mean 9 */        max = 10;    flags &= 0x80;                          /* true if block compress */    /* clear table */    bits = 9;    mask = 0x1ff;    end = flags ? 256 : 255;    /* set up: get first 9-bit code, which is the first decompressed byte, but       don't create a table entry until the next code */    if (NEXT() == -1)                       /* no compressed data is ok */        return Z_OK;    final = prev = (unsigned)last;          /* low 8 bits of code */    if (NEXT() == -1)                       /* missing a bit */        return Z_BUF_ERROR;    if (last & 1) {                         /* code must be < 256 */        strm->msg = (char *)"invalid lzw code";        return Z_DATA_ERROR;    }    rem = (unsigned)last >> 1;              /* remaining 7 bits */    left = 7;    chunk = bits - 2;                       /* 7 bytes left in this chunk */    outbuf[0] = (unsigned char)final;       /* write first decompressed byte */    outcnt = 1;    /* decode codes */    stack = 0;    for (;;) {        /* if the table will be full after this, increment the code size */        if (end >= mask && bits < max) {            FLUSHCODE();            bits++;            mask <<= 1;            mask++;        }        /* get a code of length bits */        if (chunk == 0)                     /* decrement chunk modulo bits */            chunk = bits;        code = rem;                         /* low bits of code */        if (NEXT() == -1) {                 /* EOF is end of compressed data */            /* write remaining buffered output */            if (outcnt && out(&outd, outbuf, outcnt)) {                strm->next_in = outbuf;     /* signal write error */                return Z_BUF_ERROR;            }            return Z_OK;        }        code += (unsigned)last << left;     /* middle (or high) bits of code */        left += 8;        chunk--;        if (bits > left) {                  /* need more bits */            if (NEXT() == -1)               /* can't end in middle of code */                return Z_BUF_ERROR;            code += (unsigned)last << left; /* high bits of code */            left += 8;            chunk--;        }        code &= mask;                       /* mask to current code length */        left -= bits;                       /* number of unused bits */        rem = (unsigned)last >> (8 - left); /* unused bits from last byte */        /* process clear code (256) */        if (code == 256 && flags) {            FLUSHCODE();            bits = 9;                       /* initialize bits and mask */            mask = 0x1ff;            end = 255;                      /* empty table */            continue;                       /* get next code */        }        /* special code to reuse last match */        temp = code;                        /* save the current code */        if (code > end) {            /* Be picky on the allowed code here, and make sure that the code               we drop through (prev) will be a valid index so that random               input does not cause an exception.  The code != end + 1 check is               empirically derived, and not checked in the original uncompress               code.  If this ever causes a problem, that check could be safely               removed.  Leaving this check in greatly improves gun's ability               to detect random or corrupted input after a compress header.               In any case, the prev > end check must be retained. */            if (code != end + 1 || prev > end) {                strm->msg = (char *)"invalid lzw code";                return Z_DATA_ERROR;            }            match[stack++] = (unsigned char)final;            code = prev;        }        /* walk through linked list to generate output in reverse order */        while (code >= 256) {            match[stack++] = suffix[code];            code = prefix[code];        }        match[stack++] = (unsigned char)code;        final = code;        /* link new table entry */        if (end < mask) {            end++;            prefix[end] = (unsigned short)prev;            suffix[end] = (unsigned char)final;        }        /* set previous code for next iteration */        prev = temp;        /* write output in forward order */        while (stack > SIZE - outcnt) {            while (outcnt < SIZE)                outbuf[outcnt++] = match[--stack];            if (out(&outd, outbuf, outcnt)) {                strm->next_in = outbuf; /* signal write error */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产精品青草| 亚洲色图制服诱惑 | 国产成人午夜高潮毛片| 美女诱惑一区二区| 久久精品国产精品青草| 美脚の诱脚舐め脚责91 | 91精品婷婷国产综合久久性色| 色综合中文字幕国产| 国产成人精品www牛牛影视| 激情六月婷婷久久| 成熟亚洲日本毛茸茸凸凹| 成人h动漫精品一区二区| 91在线国产福利| 欧美三级乱人伦电影| 911精品产国品一二三产区 | 国产一区二区电影| 国产一区二区日韩精品| 北条麻妃国产九九精品视频| 97久久精品人人爽人人爽蜜臀| 日本黄色一区二区| 日韩视频一区二区三区在线播放| 久久嫩草精品久久久久| 国产精品超碰97尤物18| 亚洲mv大片欧洲mv大片精品| 美国毛片一区二区| 成人激情开心网| 7777精品伊人久久久大香线蕉经典版下载 | 日韩一区二区三区三四区视频在线观看 | 久久精品国产77777蜜臀| 成人激情黄色小说| 欧美狂野另类xxxxoooo| 中文字幕+乱码+中文字幕一区| 一区二区三区产品免费精品久久75| 午夜精品久久久久久久99水蜜桃 | 日本一区二区三区国色天香| 亚洲丝袜精品丝袜在线| 青青草视频一区| www.在线欧美| 日韩三级精品电影久久久| 国产精品美女www爽爽爽| 午夜成人在线视频| 99久久精品免费观看| 日韩欧美高清一区| 一区二区三区在线播放| 国产99精品在线观看| 欧美一区二区福利在线| 亚洲女同一区二区| 麻豆精品一区二区三区| 欧美中文字幕久久| 国产日产精品1区| 午夜精品久久久久久久 | 极品少妇xxxx精品少妇| 色综合久久综合网97色综合| 国产亚洲欧美在线| 久久se精品一区精品二区| 欧美老肥妇做.爰bbww视频| 亚洲人成网站影音先锋播放| 激情五月激情综合网| 8x福利精品第一导航| 亚洲国产精品一区二区久久恐怖片| 国产精品1区2区3区| 日韩精品一区二区三区在线播放 | 欧美精品一区二区三区在线| 一个色综合av| 91香蕉视频黄| 国产精品精品国产色婷婷| 成人毛片在线观看| 久久久久久一二三区| 久久99国产精品久久| 欧美一级视频精品观看| 秋霞电影一区二区| 日韩欧美国产一二三区| 精品在线观看视频| 欧美成人欧美edvon| 麻豆成人综合网| 欧美变态tickle挠乳网站| 久久99精品久久久久久国产越南 | 国产成人精品免费一区二区| 国产亚洲美州欧州综合国| 国产成人免费在线观看| 国产精品第一页第二页第三页| 国产成人精品一区二区三区四区| 久久―日本道色综合久久| 国产成a人亚洲精| 国产精品国产自产拍高清av| 色婷婷一区二区| 亚洲国产sm捆绑调教视频 | 中文av一区特黄| 懂色av一区二区三区免费观看| 国产精品免费网站在线观看| 91福利在线观看| 日韩电影在线看| 久久久久久**毛片大全| 97成人超碰视| 一区二区三区四区精品在线视频| 欧美日韩一卡二卡| 久久99精品久久久久久久久久久久 | 日韩欧美专区在线| 国产精品影视网| 亚洲乱码中文字幕综合| 在线电影欧美成精品| 极品瑜伽女神91| 国产精品成人免费在线| 欧美精品乱人伦久久久久久| 激情欧美日韩一区二区| 久久中文字幕电影| 国产在线视频精品一区| 1024精品合集| 91精品国产日韩91久久久久久| 国产麻豆精品久久一二三| 亚洲乱码国产乱码精品精98午夜| 91精品国产综合久久福利| 风流少妇一区二区| 青青草原综合久久大伊人精品| 亚洲国产成人在线| 欧美一卡二卡在线| 色香色香欲天天天影视综合网| 日韩不卡在线观看日韩不卡视频| 亚洲欧洲99久久| 精品日韩一区二区三区免费视频| 一本一道波多野结衣一区二区| 黄色资源网久久资源365| 亚洲主播在线观看| 国产精品乱人伦| 日韩欧美一区在线观看| 一本一道综合狠狠老| 国产成人免费9x9x人网站视频| 日韩精品欧美精品| 亚洲综合清纯丝袜自拍| 国产精品女人毛片| 久久综合久久99| 日韩视频在线一区二区| 在线成人高清不卡| 欧亚一区二区三区| 91蜜桃视频在线| 成人福利在线看| 高清不卡在线观看av| 国产乱理伦片在线观看夜一区| 丝袜国产日韩另类美女| 亚洲制服欧美中文字幕中文字幕| 亚洲欧美自拍偷拍色图| 国产精品免费久久久久| 国产女人水真多18毛片18精品视频 | 亚洲乱码中文字幕| 最新国产成人在线观看| 国产精品成人免费精品自在线观看| 久久人人爽爽爽人久久久| 精品国产乱码久久久久久蜜臀| 欧美变态tickle挠乳网站| 欧美一级xxx| 欧美一区二区三区在线观看视频| 欧美日韩国产一区二区三区地区| 色诱视频网站一区| 色就色 综合激情| 在线视频欧美精品| 欧美老女人在线| 5月丁香婷婷综合| 日韩欧美另类在线| 久久先锋资源网| 日韩亚洲欧美中文三级| 精品国产91乱码一区二区三区| www国产亚洲精品久久麻豆| 久久精品在这里| 国产精品色在线观看| 亚洲婷婷国产精品电影人久久| 亚洲人成网站在线| 午夜电影网亚洲视频| 久久se精品一区二区| 国产成人午夜视频| 91免费观看国产| 欧美日本国产一区| 精品日韩在线观看| 欧美国产视频在线| 国产精品天美传媒| 亚洲在线免费播放| 久久99日本精品| 99国内精品久久| 欧美精品乱码久久久久久按摩| 日韩一区二区三区电影| 国产精品久久久久7777按摩| 亚洲午夜在线电影| 国产一区亚洲一区| 日本福利一区二区| 精品1区2区在线观看| 亚洲精品久久久蜜桃| 麻豆精品一区二区三区| av色综合久久天堂av综合| 欧美日本在线视频| 国产精品每日更新在线播放网址| 亚洲成人av电影在线| 国产成人免费视频网站 | 日韩久久免费av| 中文字幕乱码亚洲精品一区| 亚洲成年人影院| 不卡的电影网站| 日韩三级电影网址| 夜色激情一区二区| 国产一区二区三区在线看麻豆| 91福利精品第一导航| 国产精品丝袜91|