亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩免费一区二区三区| 亚洲精品一区二区三区影院 | 成人免费观看男女羞羞视频| 日韩精品一二区| 亚洲不卡av一区二区三区| 亚洲精品伦理在线| 亚洲午夜一区二区三区| 亚洲国产成人91porn| 婷婷综合五月天| 日韩中文字幕1| 老司机精品视频在线| 精品一区二区三区在线播放视频| 免费一级片91| 国产精品夜夜嗨| 成人妖精视频yjsp地址| 91丨九色丨黑人外教| 欧美日韩一区中文字幕| 日韩三级视频在线看| 精品国产三级a在线观看| 久久久影视传媒| 中文字幕欧美国产| 亚洲综合图片区| 视频一区在线视频| 国内欧美视频一区二区| 99久久婷婷国产| 欧美日韩高清一区二区不卡 | 久久国产日韩欧美精品| 国产精选一区二区三区| av福利精品导航| 欧美日韩一区二区在线观看| 欧美成人性福生活免费看| 国产欧美精品一区二区三区四区| 亚洲欧美偷拍卡通变态| 蜜桃视频一区二区三区在线观看| 久久91精品国产91久久小草| 色综合久久久久网| 欧美成人伊人久久综合网| 中文字幕一区二区日韩精品绯色| 亚洲一区二区免费视频| 成人一区二区三区在线观看 | 国产成人精品免费视频网站| 91国产免费看| 2023国产精品自拍| 亚洲国产综合视频在线观看| 国产精品一区免费在线观看| 欧美三级日本三级少妇99| 久久久国产精品麻豆| 午夜一区二区三区在线观看| eeuss国产一区二区三区| 欧美日韩精品欧美日韩精品| 国产欧美一区二区三区在线看蜜臀| 亚洲激情男女视频| 国产一区二区成人久久免费影院| 欧美日韩视频不卡| 国产精品二三区| 国产东北露脸精品视频| 欧美视频一区二| 亚洲视频中文字幕| 成人一区二区视频| 国产人伦精品一区二区| 麻豆国产精品官网| 欧美日韩aaa| 亚洲与欧洲av电影| 91九色最新地址| 一区二区三区在线免费播放| 成人精品免费看| 久久毛片高清国产| 国模大尺度一区二区三区| 欧美精三区欧美精三区| 午夜精品久久久久久久| 欧美日本国产一区| 午夜精品福利一区二区三区av| 色欧美乱欧美15图片| 亚洲欧美日韩小说| 欧美天天综合网| 视频一区国产视频| 日韩午夜激情视频| 国产九九视频一区二区三区| 久久噜噜亚洲综合| av在线这里只有精品| 亚洲色图视频免费播放| 色综合久久99| 亚洲国产一区二区三区| 欧美日韩国产首页| 日韩av不卡一区二区| 日韩欧美色综合| 国内精品久久久久影院薰衣草 | 色哟哟国产精品| 亚洲一区在线播放| 精品视频在线免费观看| 无码av免费一区二区三区试看| 欧美视频一区二区三区四区| 舔着乳尖日韩一区| 日韩精品一区二区三区蜜臀| 国产乱一区二区| 国产精品久久久久三级| 色婷婷av一区二区三区之一色屋| 亚洲一区二区三区四区在线免费观看| 欧美亚洲动漫精品| 免费成人av资源网| 国产欧美精品一区二区三区四区| 91在线你懂得| 男男gaygay亚洲| 国产精品不卡一区| 日韩一区国产二区欧美三区| 国产乱码精品一区二区三区av | 精品国产免费视频| 不卡视频在线观看| 亚洲成年人影院| 国产亚洲精品精华液| 日本精品一级二级| 狠狠久久亚洲欧美| 亚洲精品国产第一综合99久久| 精品视频一区三区九区| 韩国女主播一区二区三区| 亚洲男同性恋视频| 久久综合色播五月| 欧美午夜不卡视频| 不卡的av电影在线观看| 天天影视网天天综合色在线播放| 中文字幕成人网| 日韩视频在线你懂得| 色菇凉天天综合网| 丰满放荡岳乱妇91ww| 日本成人在线看| 亚洲婷婷综合久久一本伊一区 | 在线观看日韩一区| 国产91露脸合集magnet| 五月天一区二区三区| 亚洲欧美一区二区三区极速播放 | 亚洲福利视频三区| 欧美国产一区视频在线观看| 欧美一区二视频| 欧美日精品一区视频| 一本到三区不卡视频| 岛国av在线一区| 国产精品18久久久久久vr| 美腿丝袜亚洲三区| 五月天欧美精品| 日韩综合在线视频| 亚洲高清不卡在线| 亚洲成人av福利| 午夜精品影院在线观看| 一区二区三区精品视频| 亚洲美女区一区| 日本一区二区电影| 亚洲国产精品成人综合| 久久九九久精品国产免费直播| 欧美精品一区二区三区蜜桃视频| 91精品国产欧美一区二区18| 欧美体内she精视频| 在线免费av一区| 色妹子一区二区| 欧美精品日韩精品| 欧美一区二区啪啪| 精品女同一区二区| 精品免费99久久| 久久精品一区二区三区不卡| 国产天堂亚洲国产碰碰| 国产欧美视频一区二区三区| 欧美激情一区二区三区| 国产精品三级视频| 国产精品灌醉下药二区| 亚洲免费av观看| 亚洲国产aⅴ成人精品无吗| 日韩精品电影一区亚洲| 久久99国产精品久久| 成人激情免费网站| 欧美亚洲国产一区二区三区va| 欧美麻豆精品久久久久久| 精品国产1区2区3区| 久久精品视频免费观看| 国产精品福利影院| 午夜在线成人av| 韩国av一区二区三区在线观看| 国产电影一区二区三区| 91美女在线观看| 欧美日韩久久久| 精品国产乱码久久久久久蜜臀 | 4438x亚洲最大成人网| 日韩一二三四区| 国产精品日韩成人| 亚洲图片自拍偷拍| 国产a级毛片一区| 欧美优质美女网站| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲欧美偷拍另类a∨色屁股| 日韩免费观看高清完整版| 欧美mv和日韩mv国产网站| 国产欧美日韩在线| 精品福利一区二区三区免费视频| 国产精品国产自产拍高清av王其 | 欧美日韩精品一区二区三区| 国产成人精品亚洲777人妖| 亚洲精品一区二区三区精华液| 色香蕉成人二区免费| 日韩一区二区免费在线观看| 欧美美女黄视频| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 成人性生交大片免费看中文 |