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

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

?? gzappend.c

?? 一個本地database引擎,支持中文T_Sql查詢,兼容DELPHI標準數據庫控件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* gzappend -- command to append to a gzip file

  Copyright (C) 2003 Mark Adler, all rights reserved
  version 1.1, 4 Nov 2003

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the author be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

  Mark Adler    madler@alumni.caltech.edu
 */

/*
 * Change history:
 *
 * 1.0  19 Oct 2003     - First version
 * 1.1   4 Nov 2003     - Expand and clarify some comments and notes
 *                      - Add version and copyright to help
 *                      - Send help to stdout instead of stderr
 *                      - Add some preemptive typecasts
 *                      - Add L to constants in lseek() calls
 *                      - Remove some debugging information in error messages
 *                      - Use new data_type definition for zlib 1.2.1
 *                      - Simplfy and unify file operations
 *                      - Finish off gzip file in gztack()
 *                      - Use deflatePrime() instead of adding empty blocks
 *                      - Keep gzip file clean on appended file read errors
 *                      - Use in-place rotate instead of auxiliary buffer
 *                        (Why you ask?  Because it was fun to write!)
 */

/*
   gzappend takes a gzip file and appends to it, compressing files from the
   command line or data from stdin.  The gzip file is written to directly, to
   avoid copying that file, in case it's large.  Note that this results in the
   unfriendly behavior that if gzappend fails, the gzip file is corrupted.

   This program was written to illustrate the use of the new Z_BLOCK option of
   zlib 1.2.x's inflate() function.  This option returns from inflate() at each
   block boundary to facilitate locating and modifying the last block bit at
   the start of the final deflate block.  Also whether using Z_BLOCK or not,
   another required feature of zlib 1.2.x is that inflate() now provides the
   number of unusued bits in the last input byte used.  gzappend will not work
   with versions of zlib earlier than 1.2.1.

   gzappend first decompresses the gzip file internally, discarding all but
   the last 32K of uncompressed data, and noting the location of the last block
   bit and the number of unused bits in the last byte of the compressed data.
   The gzip trailer containing the CRC-32 and length of the uncompressed data
   is verified.  This trailer will be later overwritten.

   Then the last block bit is cleared by seeking back in the file and rewriting
   the byte that contains it.  Seeking forward, the last byte of the compressed
   data is saved along with the number of unused bits to initialize deflate.

   A deflate process is initialized, using the last 32K of the uncompressed
   data from the gzip file to initialize the dictionary.  If the total
   uncompressed data was less than 32K, then all of it is used to initialize
   the dictionary.  The deflate output bit buffer is also initialized with the
   last bits from the original deflate stream.  From here on, the data to
   append is simply compressed using deflate, and written to the gzip file.
   When that is complete, the new CRC-32 and uncompressed length are written
   as the trailer of the gzip file.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "zlib.h"

#define local static
#define LGCHUNK 14
#define CHUNK (1U << LGCHUNK)
#define DSIZE 32768U

/* print an error message and terminate with extreme prejudice */
local void bye(char *msg1, char *msg2)
{
    fprintf(stderr, "gzappend error: %s%s\n", msg1, msg2);
    exit(1);
}

/* return the greatest common divisor of a and b using Euclid's algorithm,
   modified to be fast when one argument much greater than the other, and
   coded to avoid unnecessary swapping */
local unsigned gcd(unsigned a, unsigned b)
{
    unsigned c;

    while (a && b)
        if (a > b) {
            c = b;
            while (a - c >= c)
                c <<= 1;
            a -= c;
        }
        else {
            c = a;
            while (b - c >= c)
                c <<= 1;
            b -= c;
        }
    return a + b;
}

/* rotate list[0..len-1] left by rot positions, in place */
local void rotate(unsigned char *list, unsigned len, unsigned rot)
{
    unsigned char tmp;
    unsigned cycles;
    unsigned char *start, *last, *to, *from;

    /* normalize rot and handle degenerate cases */
    if (len < 2) return;
    if (rot >= len) rot %= len;
    if (rot == 0) return;

    /* pointer to last entry in list */
    last = list + (len - 1);

    /* do simple left shift by one */
    if (rot == 1) {
        tmp = *list;
        memcpy(list, list + 1, len - 1);
        *last = tmp;
        return;
    }

    /* do simple right shift by one */
    if (rot == len - 1) {
        tmp = *last;
        memmove(list + 1, list, len - 1);
        *list = tmp;
        return;
    }

    /* otherwise do rotate as a set of cycles in place */
    cycles = gcd(len, rot);             /* number of cycles */
    do {
        start = from = list + cycles;   /* start index is arbitrary */
        tmp = *from;                    /* save entry to be overwritten */
        for (;;) {
            to = from;                  /* next step in cycle */
            from += rot;                /* go right rot positions */
            if (from > last) from -= len;   /* (pointer better not wrap) */
            if (from == start) break;   /* all but one shifted */
            *to = *from;                /* shift left */
        }
        *to = tmp;                      /* complete the circle */
    } while (--cycles);
}

/* structure for gzip file read operations */
typedef struct {
    int fd;                     /* file descriptor */
    int size;                   /* 1 << size is bytes in buf */
    unsigned left;              /* bytes available at next */
    unsigned char *buf;         /* buffer */
    unsigned char *next;        /* next byte in buffer */
    char *name;                 /* file name for error messages */
} file;

/* reload buffer */
local int readin(file *in)
{
    int len;

    len = read(in->fd, in->buf, 1 << in->size);
    if (len == -1) bye("error reading ", in->name);
    in->left = (unsigned)len;
    in->next = in->buf;
    return len;
}

/* read from file in, exit if end-of-file */
local int readmore(file *in)
{
    if (readin(in) == 0) bye("unexpected end of ", in->name);
    return 0;
}

#define read1(in) (in->left == 0 ? readmore(in) : 0, \
                   in->left--, *(in->next)++)

/* skip over n bytes of in */
local void skip(file *in, unsigned n)
{
    unsigned bypass;

    if (n > in->left) {
        n -= in->left;
        bypass = n & ~((1U << in->size) - 1);
        if (bypass) {
            if (lseek(in->fd, (off_t)bypass, SEEK_CUR) == -1)
                bye("seeking ", in->name);
            n -= bypass;
        }
        readmore(in);
        if (n > in->left)
            bye("unexpected end of ", in->name);
    }
    in->left -= n;
    in->next += n;
}

/* read a four-byte unsigned integer, little-endian, from in */
unsigned long read4(file *in)
{
    unsigned long val;

    val = read1(in);
    val += (unsigned)read1(in) << 8;
    val += (unsigned long)read1(in) << 16;
    val += (unsigned long)read1(in) << 24;
    return val;
}

/* skip over gzip header */
local void gzheader(file *in)
{
    int flags;
    unsigned n;

    if (read1(in) != 31 || read1(in) != 139) bye(in->name, " not a gzip file");
    if (read1(in) != 8) bye("unknown compression method in", in->name);
    flags = read1(in);
    if (flags & 0xe0) bye("unknown header flags set in", in->name);
    skip(in, 6);
    if (flags & 4) {
        n = read1(in);
        n += (unsigned)(read1(in)) << 8;
        skip(in, n);
    }
    if (flags & 8) while (read1(in) != 0) ;
    if (flags & 16) while (read1(in) != 0) ;
    if (flags & 2) skip(in, 2);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精选一二三| 欧美日韩精品欧美日韩精品一| 欧美激情一区不卡| 欧美日韩aaaaaa| 成人在线综合网| 亚洲电影在线免费观看| 国产视频一区二区在线| 欧美成人福利视频| 精品国产sm最大网站免费看| 欧美精品一二三区| 91久久人澡人人添人人爽欧美| 成人av先锋影音| jizz一区二区| 在线观看国产日韩| 欧美精品 日韩| 欧美成人aa大片| 精品女同一区二区| 久久免费精品国产久精品久久久久| 精品视频一区三区九区| 久久草av在线| 免费成人美女在线观看| 精品在线播放免费| 成人午夜精品在线| 91国内精品野花午夜精品| 制服丝袜中文字幕一区| 日韩欧美一级在线播放| 中文字幕永久在线不卡| 午夜精品久久久久久久99樱桃| 日韩国产精品久久久久久亚洲| 国产美女娇喘av呻吟久久| 成人高清视频免费观看| 欧美一区二区三区电影| 国产精品免费aⅴ片在线观看| 亚洲综合一区二区三区| 国产美女一区二区| 97se亚洲国产综合自在线| 欧美日本在线视频| 欧美韩日一区二区三区| 久久午夜色播影院免费高清| 夜夜嗨av一区二区三区| 波多野结衣中文字幕一区二区三区| a级高清视频欧美日韩| 91精品国产丝袜白色高跟鞋| 亚洲视频免费在线观看| 国产高清无密码一区二区三区| 欧洲国内综合视频| 亚洲乱码精品一二三四区日韩在线 | 成人高清视频免费观看| 久久免费午夜影院| 国产超碰在线一区| 欧美激情一区二区三区在线| 国产一区视频网站| 久久久精品蜜桃| 国产成人av资源| 国产精品美女久久久久av爽李琼| 久久99精品久久久久久| 精品日韩在线一区| 国产69精品久久777的优势| 日韩三级中文字幕| 午夜免费久久看| 6080国产精品一区二区| 日本91福利区| 国产午夜精品一区二区| 不卡一区中文字幕| 午夜视频在线观看一区| 欧美一区二区三区白人| 国产成人在线观看| 亚洲精品国产成人久久av盗摄 | 欧美高清激情brazzers| 奇米777欧美一区二区| 国产午夜亚洲精品不卡| 日本精品裸体写真集在线观看| 天堂成人国产精品一区| 国产亚洲精品7777| 色综合 综合色| 久久99国产精品尤物| 国产精品福利影院| 日韩视频免费观看高清在线视频| 国产成人亚洲精品狼色在线| 亚洲成人手机在线| 中文字幕一区免费在线观看| 欧美性videosxxxxx| 国产精品亚洲专一区二区三区 | 在线成人小视频| 成人午夜电影网站| 亚洲高清免费视频| 国产精品久久久久久久久图文区| 91精品国产丝袜白色高跟鞋| 欧美在线观看视频一区二区| 成人午夜激情影院| 成人在线视频一区| 国产成人av一区二区三区在线观看| 中文字幕一区二区三区视频| 日韩小视频在线观看专区| 欧美三级电影一区| 欧美系列一区二区| 欧美日韩精品一区二区三区四区| 99精品视频在线观看免费| 国v精品久久久网| 国产美女精品人人做人人爽| 国产在线不卡一区| 不卡av免费在线观看| 五月开心婷婷久久| 久久99国产乱子伦精品免费| 国产一区二区免费看| 国产69精品久久久久777| 91小宝寻花一区二区三区| 色偷偷久久人人79超碰人人澡| 色婷婷综合久久| 日韩免费福利电影在线观看| 精品电影一区二区| 亚洲色图欧洲色图婷婷| 丝袜美腿亚洲综合| 成人性生交大片| 欧美日韩成人综合在线一区二区| 日韩一区二区三区免费看 | 色系网站成人免费| 国产福利精品导航| 蜜臀av一区二区在线免费观看 | 欧美吞精做爰啪啪高潮| 久久综合狠狠综合久久激情| 成人欧美一区二区三区视频网页| 亚洲成年人网站在线观看| 国产在线视频一区二区| 欧美精品乱码久久久久久| 国产精品污网站| 免费人成精品欧美精品| 不卡av在线网| 久久综合色婷婷| 青青草视频一区| 欧美三级欧美一级| 一区二区三区在线观看欧美| 国产精品亚洲人在线观看| 日韩视频一区二区三区| 亚洲一区二区在线视频| 99re8在线精品视频免费播放| 日韩一区二区在线看| 一区二区三区中文免费| 久久99精品一区二区三区三区| 欧美亚洲国产bt| 亚洲国产另类av| 欧美午夜宅男影院| 亚洲大片在线观看| 欧美日韩中字一区| 日韩综合一区二区| 91精品国产色综合久久久蜜香臀| 日韩 欧美一区二区三区| 在线视频一区二区三| 亚洲国产精品久久不卡毛片| 欧美女孩性生活视频| 蜜臀久久久99精品久久久久久| 91精品国产综合久久久久久漫画 | 亚洲成人在线观看视频| 欧美日韩一区久久| 精品一二三四在线| 日韩欧美精品在线视频| 久久99久国产精品黄毛片色诱| 欧美肥妇毛茸茸| 国产91丝袜在线播放| 亚洲综合久久久| 精品国产a毛片| 色婷婷久久综合| 久久精品国产一区二区三| 久久久久久久久久久久久女国产乱 | 欧美天天综合网| 国产麻豆91精品| 亚洲国产日韩av| 国产精品久久久久毛片软件| 日韩一级欧美一级| 91美女福利视频| 成人亚洲精品久久久久软件| 婷婷亚洲久悠悠色悠在线播放| 久久婷婷成人综合色| 51久久夜色精品国产麻豆| 成人av网站免费观看| 久久精品国产精品亚洲精品| 亚洲成人激情社区| 中文字幕一区二区在线观看| 久久精品一区蜜桃臀影院| 精品久久久久久综合日本欧美| 欧美亚男人的天堂| 色综合久久99| 成人免费黄色大片| 懂色一区二区三区免费观看| 美女一区二区视频| 久久精品国内一区二区三区 | 日韩av电影免费观看高清完整版在线观看 | 日韩视频免费观看高清完整版 | 国产成人免费视频网站| 成人爽a毛片一区二区免费| 国产成人一级电影| 欧美午夜宅男影院| 91.xcao| 国产精品理伦片| 亚洲r级在线视频| 成人黄色电影在线| 欧美一级生活片| 亚洲日本丝袜连裤袜办公室| 日韩中文字幕不卡| 一本大道综合伊人精品热热|