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

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

?? zip.cpp

?? zip解壓源碼.
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
        bi_buf |= (value << bi_valid);
        put_short(bi_buf);
        bi_buf = (ush)value >> (Buf_size - bi_valid);
        bi_valid += length - Buf_size;
    } else {
        bi_buf |= value << bi_valid;
        bi_valid += length;
    }
}

/* ===================================================*/
unsigned bi_reverse(ZipDate* zipdate,unsigned code, /* the value to invert */
					int		 len)       /* its bit length */
{
    register unsigned res = 0;
    do {
        res |= code & 1;
        code >>= 1, res <<= 1;
    } while (--len > 0);
    return res >> 1;
}

/* =====Write out any remaining bits in an incomplete byte.======================================== */
void bi_windup(ZipDate* zipdate)
{
    if (bi_valid > 8) {
        put_short(bi_buf);
    } else if (bi_valid > 0) {
        put_byte(bi_buf);
    }
    bi_buf = 0;
    bi_valid = 0;
}

/* ===========================================================================
 * Copy a stored block to the zip file, storing first the length and its
 * one's complement if requested.
 */
void copy_block(ZipDate* zipdate,char    *buf,    /* the input data */
				unsigned len,     /* its length */
				int      header)  /* true if block header must be written */
{
    bi_windup( zipdate);              /* align on byte boundary */

    if (header) {
        put_short((ush)len);   
        put_short((ush)~len);
    }
    while (len--) {
	put_byte(*buf++);
    }
}


//===============================================
//#include "deflate.h"
#define H_SHIFT  ((HASH_BITS+MIN_MATCH-1)/MIN_MATCH)
#define UPDATE_HASH(h,c) (h = (((h)<<H_SHIFT) ^ (c)) & HASH_MASK)
#define INSERT_STRING(s, match_head) \
   (UPDATE_HASH(ins_h, window[(s) + MIN_MATCH-1]), \
    prev[(s) & WMASK] = match_head = head[ins_h], \
    head[ins_h] = (s))



/* ===========================================================================
 * Initialize the "longest match" routines for a new file
 */
void lm_init(ZipDate* zipdate,int pack_level) /* 0: store, 1: best speed, 9: best compression */
{
    register unsigned j;
	pack_level=6;

    /* Initialize the hash table. */
#if defined(MAXSEG_64K) && HASH_BITS == 15
    for (j = 0;  j < HASH_SIZE; j++) head[j] = NIL;
#else
    memzero((char*)head, HASH_SIZE*sizeof(*head));
#endif
    /* prev will be initialized on the fly */

    /* Set the default configuration parameters:
     */
    max_lazy_match   = configuration_table[pack_level].max_lazy;
    good_match       = configuration_table[pack_level].good_length;
#ifndef FULL_SEARCH
    nice_match       = configuration_table[pack_level].nice_length;
#endif
    max_chain_length = configuration_table[pack_level].max_chain;

    strstart = 0;
    block_start = 0L;

    lookahead = read_buf( zipdate,(char*)window,
			 sizeof(int) <= 2 ? (unsigned)WSIZE : 2*WSIZE);

    if (lookahead == 0 || lookahead == (unsigned)EOF) {
       eofile = 1, lookahead = 0;
       return;
    }
    eofile = 0;
    /* Make sure that we always have enough lookahead. This is important
     * if input comes from a device such as a tty.
     */
    while (lookahead < MIN_LOOKAHEAD && !eofile) fill_window( zipdate);

    ins_h = 0;
    for (j=0; j<MIN_MATCH-1; j++) UPDATE_HASH(ins_h, window[j]);
    /* If lookahead < MIN_MATCH, ins_h is garbage, but this is
     * not important since only literal bytes will be emitted.
     */
}

/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 */
#ifndef ASMV
/* For MSDOS, OS/2 and 386 Unix, an optimized version is in match.asm or
 * match.s. The code is functionally equivalent, so you can use the C version
 * if desired.
 */
int longest_match(ZipDate* zipdate,IPos cur_match)               /* current match */
{
    unsigned chain_length = max_chain_length;   /* max hash chain length */
    register uch *scan = window + strstart;     /* current string */
    register uch *match;                        /* matched string */
    register int len;                           /* length of current match */
    int best_len = prev_length;                 /* best match length so far */
    IPos limit = strstart > (IPos)MAX_DIST ? strstart - (IPos)MAX_DIST : NIL;
    /* Stop when cur_match becomes <= limit. To simplify the code,
     * we prevent matches with the string of window index 0.
     */

/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 * It is easy to get rid of this optimization if necessary.
 */
#if HASH_BITS < 8 || MAX_MATCH != 258
   error: Code too clever
#endif

#ifdef UNALIGNED_OK
    /* Compare two bytes at a time. Note: this is not always beneficial.
     * Try with and without -DUNALIGNED_OK to check.
     */
    register uch *strend = window + strstart + MAX_MATCH - 1;
    register ush scan_start = *(ush*)scan;
    register ush scan_end   = *(ush*)(scan+best_len-1);
#else
    register uch *strend = window + strstart + MAX_MATCH;
    register uch scan_end1  = scan[best_len-1];
    register uch scan_end   = scan[best_len];
#endif

    /* Do not waste too much time if we already have a good match: */
    if (prev_length >= good_match) {
        chain_length >>= 2;
    }

    do {
        match = window + cur_match;

        /* Skip to next match if the match length cannot increase
         * or if the match length is less than 2:
         */
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
        /* This code assumes sizeof(unsigned short) == 2. Do not use
         * UNALIGNED_OK if your compiler uses a different size.
         */
        if (*(ush*)(match+best_len-1) != scan_end ||
            *(ush*)match != scan_start) continue;

        /* It is not necessary to compare scan[2] and match[2] since they are
         * always equal when the other bytes match, given that the hash keys
         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
         * strstart+3, +5, ... up to strstart+257. We check for insufficient
         * lookahead only every 4th comparison; the 128th check will be made
         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
         * necessary to put more guard bytes at the end of the window, or
         * to check more often for insufficient lookahead.
         */
        scan++, match++;
        do {
        } while (*(ush*)(scan+=2) == *(ush*)(match+=2) &&
                 *(ush*)(scan+=2) == *(ush*)(match+=2) &&
                 *(ush*)(scan+=2) == *(ush*)(match+=2) &&
                 *(ush*)(scan+=2) == *(ush*)(match+=2) &&
                 scan < strend);
        /* The funny "do {}" generates better code on most compilers */

        /* Here, scan <= window+strstart+257 */
        if (*scan == *match) scan++;

        len = (MAX_MATCH - 1) - (int)(strend-scan);
        scan = strend - (MAX_MATCH-1);

#else /* UNALIGNED_OK */

        if (match[best_len]   != scan_end  ||
            match[best_len-1] != scan_end1 ||
            *match            != *scan     ||
            *++match          != scan[1])      continue;

        /* The check at best_len-1 can be removed because it will be made
         * again later. (This heuristic is not always a win.)
         * It is not necessary to compare scan[2] and match[2] since they
         * are always equal when the other bytes match, given that
         * the hash keys are equal and that HASH_BITS >= 8.
         */
        scan += 2, match++;

        /* We check for insufficient lookahead only every 8th comparison;
         * the 256th check will be made at strstart+258.
         */
        do {
        } while (*++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 *++scan == *++match && *++scan == *++match &&
                 scan < strend);

        len = MAX_MATCH - (int)(strend - scan);
        scan = strend - MAX_MATCH;

#endif /* UNALIGNED_OK */

        if (len > best_len) {
            match_start = cur_match;
            best_len = len;
            if (len >= nice_match) break;
#ifdef UNALIGNED_OK
            scan_end = *(ush*)(scan+best_len-1);
#else
            scan_end1  = scan[best_len-1];
            scan_end   = scan[best_len];
#endif
        }
    } while ((cur_match = prev[cur_match & WMASK]) > limit
	     && --chain_length != 0);

    return best_len;
}
#endif /* ASMV */


/* ===========================================================================
 * Fill the window when the lookahead becomes insufficient.
 * Updates strstart and lookahead, and sets eofile if end of input file.
 * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0
 * OUT assertions: at least one byte has been read, or eofile is set;
 *    file reads are performed for at least two bytes (required for the
 *    translate_eol option).
 */
void fill_window(ZipDate* zipdate)
{
    register unsigned n, m;
    unsigned more = (unsigned)(window_size - (ulg)lookahead - (ulg)strstart);
    /* Amount of free space at the end of the window. */

    /* If the window is almost full and there is insufficient lookahead,
     * move the upper half to the lower one to make room in the upper half.
     */
    if (more == (unsigned)EOF) {
        /* Very unlikely, but possible on 16 bit machine if strstart == 0
         * and lookahead == 1 (input done one byte at time)
         */
        more--;
    } else if (strstart >= WSIZE+MAX_DIST) {
        /* By the IN assertion, the window is not empty so we can't confuse
         * more == 0 with more == 64K on a 16 bit machine.
         */

        memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE);
        match_start -= WSIZE;
        strstart    -= WSIZE; /* we now have strstart >= MAX_DIST: */

        block_start -= (long) WSIZE;

        for (n = 0; n < HASH_SIZE; n++) {
            m = head[n];
            head[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL);
        }
        for (n = 0; n < WSIZE; n++) {
            m = prev[n];
            prev[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL);
            /* If n is not on any hash chain, prev[n] is garbage but
             * its value will never be used.
             */
        }
        more += WSIZE;
    }
    /* At this point, more >= 2 */
    if (!eofile) {
        n = read_buf( zipdate,(char*)window+strstart+lookahead, more);
        if (n == 0 || n == (unsigned)EOF) {
            eofile = 1;
        } else {
            lookahead += n;
        }
    }
}

/* ===========================================================================
 * Flush the current block, with given end-of-file flag.
 * IN assertion: strstart is set to the end of the current match.
 */
#define FLUSH_BLOCK(eof) \
   flush_block( zipdate,block_start >= 0L ? (char*)&window[(unsigned)block_start] : \
                (char*)NULL, (long)strstart - block_start, (eof))

/* ===========================================================================
 * Same as above, but achieves better compression. We use a lazy
 * evaluation for matches: a match is finally adopted only if there is
 * no better match at the next window position.
 */
ulg deflate(ZipDate* zipdate)
{

    IPos hash_head;          /* head of hash chain */
    IPos prev_match;         /* previous match */
    int flush;               /* set if current block must be flushed */
    int match_available = 0; /* set if previous match exists */
    register unsigned match_length = MIN_MATCH-1; /* length of best match */
#ifdef DEBUG
    //extern long isize;        /* byte length of input file, for debug only */
#endif

    /* Process the input block. */
    while (lookahead != 0) {
        /* Insert the string window[strstart .. strstart+2] in the
         * dictionary, and set hash_head to the head of the hash chain:
         */
        INSERT_STRING(strstart, hash_head);

        /* Find the longest match, discarding those <= prev_length.
         */
        prev_length = match_length, prev_match = match_start;
        match_length = MIN_MATCH-1;

        if (hash_head != NIL && prev_length < max_lazy_match &&
            strstart - hash_head <= MAX_DIST) {
            /* To simplify the code, we prevent matches with the string
             * of window index 0 (in particular we have to avoid a match
             * of the string with itself at the start of the input file).
             */
            match_length = longest_match( zipdate,hash_head);
            /* longest_match() sets match_start */
            if (match_length > lookahead) match_length = lookahead;

            /* Ignore a length 3 match if it is too distant: */
            if (match_length == MIN_MATCH && strstart-match_start > TOO_FAR){
                /* If prev_match is also MIN_MATCH, match_start is garbage
                 * but we will ignore the current match anyway.
                 */
                match_length--;
            }
        }
        /* If there was a match at the previous step and the current
         * match is not better, output the previous match:
         */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲影视婷婷| 六月丁香婷婷久久| 国产精品视频免费| 国产精品灌醉下药二区| 亚洲视频小说图片| 亚洲3atv精品一区二区三区| 亚洲综合色区另类av| 亚洲国产综合人成综合网站| 亚洲综合色自拍一区| 六月丁香婷婷色狠狠久久| 精品一区中文字幕| 99国产精品国产精品久久| 欧洲在线/亚洲| 久久网站最新地址| 亚洲图片有声小说| 国产精品 日产精品 欧美精品| 91在线视频18| 欧美va天堂va视频va在线| 中文字幕一区三区| 麻豆精品一区二区三区| 色综合久久九月婷婷色综合| 日韩欧美一区在线| 成人欧美一区二区三区小说| 日本欧美肥老太交大片| caoporn国产一区二区| 精品福利二区三区| 亚洲va国产天堂va久久en| a在线播放不卡| 久久综合色播五月| 日韩不卡一区二区| 欧美性xxxxx极品少妇| 亚洲国产综合色| 国产精品一色哟哟哟| 日韩免费高清av| 蜜桃av一区二区在线观看| 色一情一伦一子一伦一区| 国产精品午夜免费| 成人国产一区二区三区精品| 久久久噜噜噜久久中文字幕色伊伊| 久久这里只有精品6| 亚洲一二三区不卡| 91美女福利视频| 国产精品久久久久aaaa樱花| www.欧美色图| 亚洲天堂精品视频| 91免费视频网| 亚洲午夜羞羞片| 制服丝袜一区二区三区| 国产一区二区精品久久91| 国产欧美日韩不卡免费| 91原创在线视频| 亚洲五月六月丁香激情| 日韩一区二区三| 99久久久无码国产精品| 亚洲一区二区综合| 2020国产精品自拍| 99re8在线精品视频免费播放| 日韩在线一区二区三区| 久久色中文字幕| 欧美日韩一区二区三区四区五区 | 捆绑调教一区二区三区| 精品久久久网站| 欧美性猛交一区二区三区精品| 精品亚洲国产成人av制服丝袜| 亚洲欧洲精品一区二区三区不卡| 欧美精品 国产精品| 91视频.com| 国产91精品露脸国语对白| 亚洲二区在线视频| 亚洲欧美日韩国产手机在线| 久久精品视频一区| 欧美tickling网站挠脚心| 欧美精品久久一区二区三区| 成人av先锋影音| 久久66热偷产精品| 亚洲无线码一区二区三区| 亚洲少妇30p| 中文字幕人成不卡一区| 亚洲精品一区二区三区香蕉 | 久久老女人爱爱| 日韩一区二区三区视频在线观看| 在线观看亚洲精品视频| 91在线看国产| 97se亚洲国产综合自在线不卡| 国产二区国产一区在线观看| 国产精品一区二区久久精品爱涩| 美女爽到高潮91| 国产麻豆精品久久一二三| 国产一区二区91| 91在线视频播放| 欧美色图免费看| 精品人伦一区二区色婷婷| 国产亚洲成av人在线观看导航 | 美女视频黄频大全不卡视频在线播放| 亚洲一级在线观看| 免费一区二区视频| 国产美女精品一区二区三区| av一区二区不卡| 欧美日韩一级黄| 国产欧美一区二区三区网站| 18欧美亚洲精品| 五月天婷婷综合| 国产麻豆91精品| 欧美日韩成人综合| 中文字幕不卡一区| 免费看日韩a级影片| hitomi一区二区三区精品| 欧美一级片在线观看| 综合在线观看色| 国产成a人无v码亚洲福利| 欧美日韩精品免费观看视频| 国产欧美日韩精品在线| 男人的天堂久久精品| 91福利国产精品| 国产精品久久午夜夜伦鲁鲁| 久久成人久久鬼色| 欧美日韩一区二区三区高清| 自拍偷在线精品自拍偷无码专区| 精品系列免费在线观看| 欧美三级日韩三级国产三级| 9191国产精品| 国产精品久久久久久久裸模| 日本vs亚洲vs韩国一区三区二区| 在线观看日韩一区| 亚洲美女少妇撒尿| 99国产精品一区| 国产精品美女久久久久久久网站| 久久福利视频一区二区| 欧美大片在线观看一区二区| 五月天激情综合| 精品日韩一区二区三区免费视频| 丝袜美腿亚洲综合| 欧美一区二区三区婷婷月色 | 日本电影亚洲天堂一区| 亚洲一区二区三区在线看| 欧美亚洲国产一区二区三区 | 欧美视频一区二区三区| 午夜久久久久久| 久久免费国产精品| av在线一区二区| 日本欧美一区二区三区乱码| 2024国产精品| 欧美亚洲国产一区二区三区va| 亚洲国产成人av网| 91精品在线麻豆| 成人激情开心网| 一卡二卡欧美日韩| 久久久综合精品| 欧美性一二三区| 国产一区二区三区四区在线观看| 1000部国产精品成人观看| 这里只有精品视频在线观看| 国产麻豆午夜三级精品| 亚洲主播在线播放| 精品国产乱码久久久久久老虎| 91啦中文在线观看| 国内成+人亚洲+欧美+综合在线| 亚洲精品日日夜夜| 久久伊99综合婷婷久久伊| 欧美日韩黄色一区二区| aa级大片欧美| 国产高清久久久| 国产综合久久久久久鬼色| 亚洲高清免费一级二级三级| 国产精品国产馆在线真实露脸| 亚洲精品一区二区三区香蕉| 在线成人av网站| 欧美亚洲一区三区| 99久久国产综合精品女不卡| 九九国产精品视频| 午夜视频在线观看一区二区三区| 中文字幕av在线一区二区三区| 欧美高清www午色夜在线视频| a级精品国产片在线观看| 国产精品18久久久久久vr| 国产曰批免费观看久久久| 久久69国产一区二区蜜臀 | 色婷婷激情久久| 在线观看一区日韩| 欧美精品18+| 久久一日本道色综合| 日本一区二区动态图| 亚洲欧美一区二区久久 | 欧美午夜片在线看| 在线电影一区二区三区| 日韩精品一区二区三区四区 | 国产乱码精品一品二品| 国产aⅴ精品一区二区三区色成熟| 国产精品1区二区.| 一本到不卡精品视频在线观看| 91久久精品国产91性色tv| 666欧美在线视频| 亚洲欧洲成人精品av97| 爽好久久久欧美精品| 国产成人综合在线| 51久久夜色精品国产麻豆| 欧美性猛片xxxx免费看久爱| 日韩精品最新网址| 亚洲日本护士毛茸茸| 国内偷窥港台综合视频在线播放|