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

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

?? gun.c

?? 一個本地database引擎,支持中文T_Sql查詢,兼容DELPHI標準數據庫控件
?? 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一区二区三区免费野_久草精品视频
欧美天天综合网| 欧美va亚洲va香蕉在线| 欧美日韩成人一区二区| 日本高清无吗v一区| 一本色道久久加勒比精品| 在线观看精品一区| 欧美一级电影网站| 欧美色视频在线观看| 欧美视频完全免费看| 欧美群妇大交群中文字幕| 欧美一卡二卡三卡四卡| 精品日产卡一卡二卡麻豆| 91视频观看免费| 91精品中文字幕一区二区三区 | 日韩欧美一级精品久久| 亚洲精品在线观看网站| 国产精品麻豆久久久| 亚洲黄色录像片| 蜜臀av一区二区在线观看| 粉嫩av一区二区三区粉嫩| 91久久国产综合久久| 日韩欧美区一区二| 国产欧美精品一区aⅴ影院| 亚洲免费观看高清完整版在线观看| 一区二区三区日韩欧美精品| 久草热8精品视频在线观看| 97超碰欧美中文字幕| 日韩欧美国产1| 亚洲国产精品久久不卡毛片| 成人激情黄色小说| 91精品国产高清一区二区三区| 久久人人97超碰com| 亚洲精品国产高清久久伦理二区| 三级精品在线观看| 一本到不卡精品视频在线观看| 色欧美日韩亚洲| 国产欧美久久久精品影院| 中文字幕一区二区在线播放| 亚洲激情中文1区| 麻豆成人在线观看| 日韩美女天天操| 无码av中文一区二区三区桃花岛| 欧洲日韩一区二区三区| 国产欧美视频一区二区三区| 国产在线精品免费| 久久综合狠狠综合久久激情| 麻豆精品久久久| 日韩精品一区二区三区视频| 婷婷中文字幕一区三区| 色哟哟亚洲精品| 中文字幕一区三区| 白白色 亚洲乱淫| 国产精品欧美一区喷水| 激情综合一区二区三区| 日韩一级完整毛片| 男女男精品视频| 欧美久久婷婷综合色| 日韩精品91亚洲二区在线观看 | 成人一区二区在线观看| 亚洲少妇30p| 337p亚洲精品色噜噜| 国产精品乡下勾搭老头1| 夜夜精品视频一区二区| 欧美少妇性性性| 久久精品久久精品| 18成人在线观看| 欧美日韩免费观看一区二区三区 | 亚洲欧美电影院| 欧美一区二区三区四区五区| 国产麻豆一精品一av一免费 | 91精品国产综合久久蜜臀| 成人免费高清在线| 亚洲一级不卡视频| 欧美疯狂性受xxxxx喷水图片| 久久久五月婷婷| 国产老肥熟一区二区三区| 精品成人在线观看| 99国产欧美另类久久久精品| 日产精品久久久久久久性色| 欧美激情艳妇裸体舞| 69成人精品免费视频| 国产成人啪免费观看软件| 国产精品久久久久久久久图文区| 欧美群妇大交群中文字幕| 国产大陆亚洲精品国产| 日韩精品亚洲专区| 夜夜爽夜夜爽精品视频| 777奇米四色成人影色区| 国产一区二区主播在线| 午夜欧美电影在线观看| 亚洲一区二三区| 一区二区三区欧美日韩| 久久五月婷婷丁香社区| 欧美一级生活片| 日韩免费成人网| 欧美一级二级三级乱码| 日韩欧美国产综合一区 | 欧美精品丝袜久久久中文字幕| 91理论电影在线观看| 波多野结衣精品在线| 成人黄页毛片网站| 色又黄又爽网站www久久| 色综合天天综合色综合av| 色8久久精品久久久久久蜜| 色婷婷久久综合| 欧美精品一卡二卡| 欧美精选一区二区| 日韩欧美一区二区久久婷婷| 久久久精品欧美丰满| 亚洲国产精品久久久久婷婷884| 欧美一区欧美二区| 综合网在线视频| 国产宾馆实践打屁股91| 2019国产精品| 久久99热国产| 色悠久久久久综合欧美99| 久久久激情视频| 日韩激情一二三区| 欧美精品自拍偷拍动漫精品| 亚洲精品视频在线观看免费| 成人精品高清在线| 精品日韩欧美一区二区| 国精产品一区一区三区mba视频 | 国产偷国产偷亚洲高清人白洁| 欧美一区午夜视频在线观看| 99久久精品情趣| 欧美裸体一区二区三区| 久久久精品蜜桃| 青青草成人在线观看| 国产精品一二三在| 久久青草国产手机看片福利盒子| 2020日本不卡一区二区视频| 五月婷婷色综合| 色综合天天综合狠狠| 久久精品一区二区三区不卡牛牛| 午夜精品视频一区| 欧美猛男男办公室激情| 亚洲一二三四区不卡| 99久久er热在这里只有精品66| 久久久天堂av| 免费成人在线观看| 久久久国产午夜精品| 韩国成人在线视频| 国产欧美日韩亚州综合| 成人伦理片在线| 亚洲视频在线一区二区| 在线观看视频91| 图片区小说区区亚洲影院| 在线观看国产精品网站| 免费欧美日韩国产三级电影| 91蝌蚪国产九色| 青青草一区二区三区| 久久久久久久电影| 91福利精品视频| 亚洲一卡二卡三卡四卡无卡久久| 国产精品灌醉下药二区| 激情综合网激情| 91福利在线观看| 91精品综合久久久久久| 国产精品天天看| 国产麻豆精品一区二区| 91欧美激情一区二区三区成人| 日韩三级在线观看| 国产日韩精品一区二区三区| av成人免费在线观看| 日韩综合一区二区| 久久精品男人天堂av| 在线视频欧美区| 亚洲香蕉伊在人在线观| 欧美电影在线免费观看| 精品在线视频一区| 国产精品美女久久久久av爽李琼 | 精品国产精品一区二区夜夜嗨| 成人小视频在线| 亚洲成av人片在线| 中文字幕国产一区二区| 日韩精品一区二区三区三区免费| 91在线视频观看| 爽好久久久欧美精品| 亚洲精品高清在线| 国产精品久久久久影院老司| 精品国产制服丝袜高跟| 884aa四虎影成人精品一区| 日本精品视频一区二区| 91视频精品在这里| 色综合亚洲欧洲| 99麻豆久久久国产精品免费优播| 午夜精品一区二区三区电影天堂| 国产精品久久久久久久久图文区| 久久人人爽人人爽| 欧美一区二区三区公司| 精品少妇一区二区三区视频免付费 | 日韩欧美不卡在线观看视频| 日韩一区二区三区高清免费看看| 欧美日韩视频在线观看一区二区三区| 色婷婷亚洲一区二区三区| 欧美日韩高清一区| 国产精品乱码人人做人人爱| 中文字幕亚洲一区二区va在线| 亚洲精选在线视频|