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

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

?? gzappend.c

?? minix操作系統最新版本(3.1.1)的源代碼
?? 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一区二区三区免费野_久草精品视频
亚洲少妇屁股交4| 日韩亚洲欧美成人一区| 另类小说视频一区二区| 亚洲国产精品久久一线不卡| 一区二区三区毛片| 亚洲国产精品欧美一二99| 亚洲女同一区二区| 一区二区三区免费观看| 亚洲一区二区欧美激情| 亚洲成精国产精品女| 视频一区二区中文字幕| 人妖欧美一区二区| 免费的成人av| 成人免费高清在线| 白白色 亚洲乱淫| 色婷婷综合久色| 欧美精品电影在线播放| 久久综合九色综合97_久久久| 久久亚洲私人国产精品va媚药| 久久久精品一品道一区| 国产精品国产三级国产aⅴ中文| 国产精品国产三级国产三级人妇| 亚洲情趣在线观看| 日本系列欧美系列| 国产成人精品亚洲午夜麻豆| av一二三不卡影片| 制服丝袜中文字幕亚洲| 国产亚洲精品aa| 亚洲免费在线视频| 蜜桃av一区二区三区| 国产精品911| 欧美亚洲国产一区二区三区va| 制服.丝袜.亚洲.中文.综合| 亚洲精品一区二区三区精华液 | 99麻豆久久久国产精品免费优播| 99久久精品一区二区| 韩国三级电影一区二区| 欧美中文字幕一二三区视频| 亚洲精品欧美在线| 欧美三电影在线| 日韩av在线发布| 精品国产91久久久久久久妲己| 六月婷婷色综合| 久久免费精品国产久精品久久久久| 麻豆成人久久精品二区三区红 | 亚洲国产精品成人综合色在线婷婷| 激情六月婷婷综合| 国产精品视频一二三区| 成人av中文字幕| 亚洲精品国产a久久久久久 | 色综合久久中文字幕| 亚洲人成影院在线观看| 欧美日韩不卡在线| 久国产精品韩国三级视频| 亚洲精品一区二区三区蜜桃下载| 国产999精品久久| 亚洲伦在线观看| 欧美精品色一区二区三区| 国产一区二区在线免费观看| 国产精品乱码一区二区三区软件| 99久久综合狠狠综合久久| 国产精品成人在线观看| 欧美欧美欧美欧美| 国产精品1024| 亚洲宅男天堂在线观看无病毒| 欧美理论在线播放| 国产黄色91视频| 亚洲第一电影网| 久久精品人人做人人爽人人| 99国产精品99久久久久久| 婷婷开心激情综合| 中文幕一区二区三区久久蜜桃| 国产美女在线精品| 日韩一区二区三区视频在线观看 | 激情偷乱视频一区二区三区| 丁香网亚洲国际| 久久久午夜精品| 国产盗摄女厕一区二区三区| 色综合久久久久久久久| 久久综合九色综合97婷婷| 亚洲欧洲www| 午夜成人免费视频| 91年精品国产| 亚洲综合在线视频| 黑人精品欧美一区二区蜜桃 | 欧美成人乱码一区二区三区| 99久久精品一区二区| 亚洲精品在线电影| 麻豆精品视频在线观看| 久久品道一品道久久精品| 亚洲人成网站在线| 亚洲精品日韩综合观看成人91| 国产精品伦理在线| 久久国产精品色| 在线国产电影不卡| 中文字幕av资源一区| 午夜精品久久久久久久蜜桃app| 国产一区二区视频在线| 欧美大度的电影原声| 国产成a人亚洲精| 国产精品99久| 成人动漫一区二区在线| 色婷婷av一区二区三区软件| 色婷婷av一区二区三区大白胸| 欧美在线三级电影| 亚洲精品一区二区三区蜜桃下载| 免费看欧美女人艹b| 最新国产の精品合集bt伙计| 久久国产精品一区二区| 中国色在线观看另类| 欧美色手机在线观看| 国产欧美日韩另类一区| 4438x亚洲最大成人网| 欧美日韩国产小视频| 欧美日韩和欧美的一区二区| 国产精品你懂的在线| 91丨porny丨户外露出| 日韩制服丝袜av| 最近中文字幕一区二区三区| 欧美剧情片在线观看| 99在线热播精品免费| 麻豆91在线观看| 亚洲chinese男男1069| 国产日韩精品一区二区浪潮av| 精品视频免费看| 99国产精品久久久久久久久久| 日韩专区中文字幕一区二区| 久久精品一区二区三区四区| 这里只有精品视频在线观看| 91天堂素人约啪| 国产传媒久久文化传媒| 蜜桃一区二区三区在线| 一区二区三区在线不卡| 国产精品无遮挡| 久久一区二区视频| 欧美年轻男男videosbes| 91麻豆国产福利在线观看| 日韩和欧美的一区| 亚洲狠狠爱一区二区三区| 国产精品色眯眯| 粉嫩一区二区三区在线看| 成人理论电影网| 欧美日免费三级在线| 欧美哺乳videos| 成人激情图片网| 久久成人麻豆午夜电影| 男女视频一区二区| 日本中文字幕一区二区视频| 亚洲第四色夜色| 欧美成人性战久久| 中文字幕亚洲成人| 麻豆免费看一区二区三区| 成人免费毛片片v| 制服丝袜日韩国产| 国产精品少妇自拍| 奇米精品一区二区三区在线观看一| 国产精品91一区二区| 欧美精选午夜久久久乱码6080| 久久精品人人做人人综合| 婷婷国产v国产偷v亚洲高清| fc2成人免费人成在线观看播放 | 91麻豆精品国产综合久久久久久| 精品美女一区二区| 亚洲在线视频一区| 不卡视频一二三| 精品国产免费久久| 亚洲r级在线视频| 91在线观看污| 日韩一级片网站| 亚洲综合免费观看高清完整版在线 | 日韩精品欧美精品| 色综合天天性综合| 国产日本欧美一区二区| 美女视频一区二区| 欧美日韩和欧美的一区二区| 中文字幕一区二区三区在线播放| 另类小说欧美激情| 91麻豆精品国产91久久久更新时间 | 日本一二三不卡| 九色|91porny| 91精品中文字幕一区二区三区| 亚洲女人的天堂| 91亚洲国产成人精品一区二三| 久久久久国产精品人| 亚洲男人电影天堂| 久久精品国产亚洲a| 97超碰欧美中文字幕| 日韩一区二区不卡| 亚洲图片你懂的| 久久99精品久久久久婷婷| 成a人片国产精品| 日韩一区二区高清| 亚洲精品国产无套在线观| 裸体健美xxxx欧美裸体表演| 99久久99久久综合| 337p日本欧洲亚洲大胆精品| 樱桃视频在线观看一区| 国产不卡视频一区| 欧美变态口味重另类| 亚洲一区二区四区蜜桃|