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

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

?? zran.c

?? 一個本地database引擎,支持中文T_Sql查詢,兼容DELPHI標準數據庫控件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* zran.c -- example of zlib/gzip stream indexing and random access
 * Copyright (C) 2005 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
   Version 1.0  29 May 2005  Mark Adler */

/* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary()
   for random access of a compressed file.  A file containing a zlib or gzip
   stream is provided on the command line.  The compressed stream is decoded in
   its entirety, and an index built with access points about every SPAN bytes
   in the uncompressed output.  The compressed file is left open, and can then
   be read randomly, having to decompress on the average SPAN/2 uncompressed
   bytes before getting to the desired block of data.

   An access point can be created at the start of any deflate block, by saving
   the starting file offset and bit of that block, and the 32K bytes of
   uncompressed data that precede that block.  Also the uncompressed offset of
   that block is saved to provide a referece for locating a desired starting
   point in the uncompressed stream.  build_index() works by decompressing the
   input zlib or gzip stream a block at a time, and at the end of each block
   deciding if enough uncompressed data has gone by to justify the creation of
   a new access point.  If so, that point is saved in a data structure that
   grows as needed to accommodate the points.

   To use the index, an offset in the uncompressed data is provided, for which
   the latest accees point at or preceding that offset is located in the index.
   The input file is positioned to the specified location in the index, and if
   necessary the first few bits of the compressed data is read from the file.
   inflate is initialized with those bits and the 32K of uncompressed data, and
   the decompression then proceeds until the desired offset in the file is
   reached.  Then the decompression continues to read the desired uncompressed
   data from the file.

   Another approach would be to generate the index on demand.  In that case,
   requests for random access reads from the compressed data would try to use
   the index, but if a read far enough past the end of the index is required,
   then further index entries would be generated and added.

   There is some fair bit of overhead to starting inflation for the random
   access, mainly copying the 32K byte dictionary.  So if small pieces of the
   file are being accessed, it would make sense to implement a cache to hold
   some lookahead and avoid many calls to extract() for small lengths.

   Another way to build an index would be to use inflateCopy().  That would
   not be constrained to have access points at block boundaries, but requires
   more memory per access point, and also cannot be saved to file due to the
   use of pointers in the state.  The approach here allows for storage of the
   index in a file.
 */

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

#define local static

#define SPAN 1048576L       /* desired distance between access points */
#define WINSIZE 32768U      /* sliding window size */
#define CHUNK 16384         /* file input buffer size */

/* access point entry */
struct point {
    off_t out;          /* corresponding offset in uncompressed data */
    off_t in;           /* offset in input file of first full byte */
    int bits;           /* number of bits (1-7) from byte at in - 1, or 0 */
    unsigned char window[WINSIZE];  /* preceding 32K of uncompressed data */
};

/* access point list */
struct access {
    int have;           /* number of list entries filled in */
    int size;           /* number of list entries allocated */
    struct point *list; /* allocated list */
};

/* Deallocate an index built by build_index() */
local void free_index(struct access *index)
{
    if (index != NULL) {
        free(index->list);
        free(index);
    }
}

/* Add an entry to the access point list.  If out of memory, deallocate the
   existing list and return NULL. */
local struct access *addpoint(struct access *index, int bits,
    off_t in, off_t out, unsigned left, unsigned char *window)
{
    struct point *next;

    /* if list is empty, create it (start with eight points) */
    if (index == NULL) {
        index = malloc(sizeof(struct access));
        if (index == NULL) return NULL;
        index->list = malloc(sizeof(struct point) << 3);
        if (index->list == NULL) {
            free(index);
            return NULL;
        }
        index->size = 8;
        index->have = 0;
    }

    /* if list is full, make it bigger */
    else if (index->have == index->size) {
        index->size <<= 1;
        next = realloc(index->list, sizeof(struct point) * index->size);
        if (next == NULL) {
            free_index(index);
            return NULL;
        }
        index->list = next;
    }

    /* fill in entry and increment how many we have */
    next = index->list + index->have;
    next->bits = bits;
    next->in = in;
    next->out = out;
    if (left)
        memcpy(next->window, window + WINSIZE - left, left);
    if (left < WINSIZE)
        memcpy(next->window + left, window, WINSIZE - left);
    index->have++;

    /* return list, possibly reallocated */
    return index;
}

/* Make one entire pass through the compressed stream and build an index, with
   access points about every span bytes of uncompressed output -- span is
   chosen to balance the speed of random access against the memory requirements
   of the list, about 32K bytes per access point.  Note that data after the end
   of the first zlib or gzip stream in the file is ignored.  build_index()
   returns the number of access points on success (>= 1), Z_MEM_ERROR for out
   of memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a
   file read error.  On success, *built points to the resulting index. */
local int build_index(FILE *in, off_t span, struct access **built)
{
    int ret;
    off_t totin, totout;        /* our own total counters to avoid 4GB limit */
    off_t last;                 /* totout value of last access point */
    struct access *index;       /* access points being generated */
    z_stream strm;
    unsigned char input[CHUNK];
    unsigned char window[WINSIZE];

    /* initialize inflate */
    strm.zalloc = Z_NULL;
    strm.zfree = Z_NULL;
    strm.opaque = Z_NULL;
    strm.avail_in = 0;
    strm.next_in = Z_NULL;
    ret = inflateInit2(&strm, 47);      /* automatic zlib or gzip decoding */
    if (ret != Z_OK)
        return ret;

    /* inflate the input, maintain a sliding window, and build an index -- this
       also validates the integrity of the compressed data using the check
       information at the end of the gzip or zlib stream */
    totin = totout = last = 0;
    index = NULL;               /* will be allocated by first addpoint() */
    strm.avail_out = 0;
    do {
        /* get some compressed data from input file */
        strm.avail_in = fread(input, 1, CHUNK, in);
        if (ferror(in)) {
            ret = Z_ERRNO;
            goto build_index_error;
        }
        if (strm.avail_in == 0) {
            ret = Z_DATA_ERROR;
            goto build_index_error;
        }
        strm.next_in = input;

        /* process all of that, or until end of stream */
        do {
            /* reset sliding window if necessary */
            if (strm.avail_out == 0) {
                strm.avail_out = WINSIZE;
                strm.next_out = window;
            }

            /* inflate until out of input, output, or at end of block --
               update the total input and output counters */
            totin += strm.avail_in;
            totout += strm.avail_out;
            ret = inflate(&strm, Z_BLOCK);      /* return at end of block */
            totin -= strm.avail_in;
            totout -= strm.avail_out;
            if (ret == Z_NEED_DICT)
                ret = Z_DATA_ERROR;
            if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR)
                goto build_index_error;
            if (ret == Z_STREAM_END)
                break;

            /* if at end of block, consider adding an index entry (note that if
               data_type indicates an end-of-block, then all of the
               uncompressed data from that block has been delivered, and none
               of the compressed data after that block has been consumed,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频一区在线观看| 精品免费日韩av| 亚洲丝袜自拍清纯另类| 成人性生交大片免费看在线播放| 欧美变态凌虐bdsm| 久久精品日产第一区二区三区高清版 | 欧美一卡二卡在线| 欧美日韩亚洲高清一区二区| 国产欧美视频一区二区| 麻豆精品一区二区| 91精品国产综合久久香蕉麻豆| 成人性视频免费网站| 亚洲精品视频一区二区| 日韩欧美综合在线| www.日韩精品| 午夜欧美一区二区三区在线播放| 精品国产一二三区| 一本大道久久a久久精二百| 三级久久三级久久| 亚洲综合视频在线观看| 国产欧美精品一区| 337p亚洲精品色噜噜狠狠| 国产一区二区三区av电影| 国产欧美va欧美不卡在线| 99久久精品免费看国产 | 欧美高清精品3d| 91视频www| 一本久久综合亚洲鲁鲁五月天| 九色综合国产一区二区三区| 洋洋成人永久网站入口| 亚洲国产精品精华液2区45| 2021久久国产精品不只是精品| 91成人免费网站| 国产成人精品免费看| 美女国产一区二区三区| 五月激情综合婷婷| 日韩国产精品久久| 免费亚洲电影在线| 国产真实乱对白精彩久久| 国产在线精品一区二区三区不卡 | 久久精品一区二区三区不卡牛牛| 欧美视频精品在线观看| 在线视频国内自拍亚洲视频| 91在线视频播放地址| 欧美日韩一区二区三区在线看| 欧美性受极品xxxx喷水| 日韩一二三区不卡| 国产精品污网站| 亚洲在线视频免费观看| 国产激情精品久久久第一区二区| 国产高清久久久久| 欧美性生活大片视频| 精品三级在线观看| 国产精品嫩草99a| 首页综合国产亚洲丝袜| 国产一区二区三区精品欧美日韩一区二区三区 | 日韩国产精品91| 99久久亚洲一区二区三区青草| 色综合激情五月| 欧美一卡二卡在线观看| 中文在线资源观看网站视频免费不卡| 久久午夜老司机| 日韩av一区二区三区四区| 成人国产在线观看| 久久久久久久免费视频了| 午夜精品成人在线| 97aⅴ精品视频一二三区| 日韩亚洲欧美在线观看| 一区二区三区四区蜜桃| 麻豆精品国产传媒mv男同| 床上的激情91.| 这里只有精品99re| 日日摸夜夜添夜夜添精品视频 | 国产成人精品免费一区二区| 欧美成人乱码一区二区三区| 一区二区三区在线观看动漫| av爱爱亚洲一区| 亚洲欧美在线另类| www.激情成人| 中文文精品字幕一区二区| 精品一区二区在线看| 国产欧美精品一区| 成人性生交大合| 亚洲精品va在线观看| 在线不卡a资源高清| 久久精品久久综合| 久久免费电影网| 色婷婷av一区二区三区gif| 亚洲高清在线视频| 精品国产第一区二区三区观看体验 | 99免费精品视频| 亚洲一区二区三区四区五区黄 | 成人免费高清视频| 一区二区高清免费观看影视大全| 欧美日韩一区久久| 成人精品在线视频观看| 亚洲国产精品影院| 欧美一区二区三区视频免费| 国产成人精品综合在线观看| 亚洲v日本v欧美v久久精品| 欧美精品v国产精品v日韩精品| 美女视频网站久久| 亚洲精品一二三| 欧美在线观看一二区| 成人精品gif动图一区| 久久av资源网| 日欧美一区二区| 国产精品久久久久影院| 欧美精品在线视频| 欧美色图天堂网| www.日韩在线| 国产美女一区二区| 日韩精品91亚洲二区在线观看| 国产欧美日韩亚州综合| 亚洲精品一区二区三区精华液| 欧美日韩免费高清一区色橹橹| 国产成人自拍网| 精品一二三四在线| 国产麻豆视频一区二区| 五月天婷婷综合| 26uuu国产日韩综合| 欧美一级黄色录像| 欧美亚洲综合色| 色先锋aa成人| 欧美日韩aaaaaa| 日本福利一区二区| 色综合久久久久综合| 色94色欧美sute亚洲13| 一道本成人在线| 色综合久久综合| 欧美日韩精品一区二区三区四区| 欧美日韩国产天堂| 久久久综合精品| 一区二区三区四区在线播放| 天天影视色香欲综合网老头| 日韩精品1区2区3区| 国产成人高清在线| 在线不卡中文字幕播放| 日韩精品在线网站| 亚洲美女视频在线| 国产精品中文字幕欧美| 成人福利视频网站| 91精品福利在线一区二区三区 | 亚洲成av人影院在线观看网| 狠狠色综合播放一区二区| 国产精品一级片在线观看| 91麻豆视频网站| 中文字幕在线不卡视频| 亚洲国产日韩av| jlzzjlzz亚洲女人18| 精品黑人一区二区三区久久| 一区二区三区四区中文字幕| 国产精品自产自拍| 日韩女同互慰一区二区| 亚洲欧洲性图库| av激情综合网| 亚洲自拍偷拍图区| 91老司机福利 在线| 中国色在线观看另类| 麻豆视频观看网址久久| 欧美一级国产精品| 一区二区三区欧美| 在线一区二区视频| 国产精品久久久久久一区二区三区 | 精品在线播放免费| 色呦呦日韩精品| 亚洲欧美偷拍另类a∨色屁股| 成人h版在线观看| 自拍偷自拍亚洲精品播放| 成人激情av网| 视频一区二区欧美| 精品国产在天天线2019| 国产成+人+日韩+欧美+亚洲| 国产日韩精品一区二区浪潮av| 99国产精品久久久| 一区二区高清免费观看影视大全| 91麻豆精品国产91久久久更新时间 | 色综合一个色综合| 亚洲欧美一区二区三区孕妇| 欧美无人高清视频在线观看| 午夜精品久久久久| 国产精品三级久久久久三级| 欧美丝袜第三区| 国产精品456露脸| 日韩国产一二三区| 国产精品视频yy9299一区| 91麻豆精品久久久久蜜臀 | 国产一区二区电影| 一区二区视频免费在线观看| 精品国产一区二区国模嫣然| 日本精品一级二级| 成人激情电影免费在线观看| 蜜臂av日日欢夜夜爽一区| 亚洲少妇最新在线视频| 精品少妇一区二区三区在线播放| 91搞黄在线观看| av在线不卡观看免费观看| 国产一区二区美女诱惑| 国产一区中文字幕| 激情文学综合插|