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

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

?? zip.cpp

?? zip解壓源碼.
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
#include "stdafx.h"
#include <sys/stat.h>
#include <ctype.h>
#include <errno.h>

#include "zipsha.h"
#include "revision.h"
#include "tailor.h"

#include "Zip.h"
#include "ZipDate.h"

//bits.cpp--------------------------------
typedef struct config {
   ush good_length; /* reduce lazy search above this match length */
   ush max_lazy;    /* do not perform lazy search above this match length */
   ush nice_length; /* quit search above this match length */
   ush max_chain;
} config;

local config configuration_table[10] = {
/*      good lazy nice chain */
/* 0 */ {0,    0,  0,    0},  /* store only */
/* 1 */ {4,    4,  8,    4},  /* maximum speed, no lazy matches */
/* 2 */ {4,    5, 16,    8},
/* 3 */ {4,    6, 32,   32},

/* 4 */ {4,    4, 16,   16},  /* lazy matches */
/* 5 */ {8,   16, 32,   32},
/* 6 */ {8,   16, 128, 128},
/* 7 */ {8,   32, 128, 256},
/* 8 */ {32, 128, 258, 1024},
/* 9 */ {32, 258, 258, 4096}}; /* maximum compression */


//////////////////////////////////////////////////
local int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};

local int extra_dbits[D_CODES] /* extra bits for each distance code */
   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};

local int extra_blbits[BL_CODES]/* extra bits for each bit length code */
   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};

extern ulg __crc_32_tab[];

//part1-----------------------------------------------
#define source1 zipdate-> source1 
#define dest1 zipdate-> dest1 
#define sourceLen1 zipdate-> sourceLen1 
#define destLen1 zipdate-> destLen1 
#define inSize zipdate-> inSize 
#define outSize zipdate-> outSize
#define errorNumber zipdate->errorNumber

#define crc zipdate-> crc 
#define static_crc zipdate-> static_crc 
#define header_bytes zipdate-> header_bytes 
#define verbose zipdate-> verbose 
#define level zipdate-> level 
#define bytes_in zipdate-> bytes_in 
#define bytes_out zipdate-> bytes_out
#define insize zipdate-> insize
#define inptr zipdate-> inptr
#define outcnt zipdate-> outcnt
//part2----------------------------------------
//bits
#define bi_buf zipdate-> bi_buf
#define bi_valid zipdate-> bi_valid
//tree
#define file_type zipdate-> file_type
#define bl_count zipdate-> bl_count
#define bl_order zipdate-> bl_order
#define heap zipdate-> heap
#define heap_len  zipdate-> heap_len 
#define heap_max zipdate-> heap_max
#define depth zipdate-> depth
#define length_code zipdate-> length_code
#define dist_code zipdate-> dist_code
#define base_length zipdate-> base_length
#define base_dist zipdate-> base_dist
#define flag_buf zipdate-> flag_buf
#define last_lit  zipdate-> last_lit 
#define last_dist zipdate-> last_dist
#define last_flags zipdate-> last_flags
#define flags zipdate-> flags
#define flag_bit zipdate-> flag_bit
#define opt_len zipdate-> opt_len 
#define static_len zipdate-> static_len
#define compressed_len zipdate-> compressed_len
#define input_len zipdate-> input_len
//part3-----------------------------------------------------
//deflate
#define block_start zipdate-> block_start
#define strstart zipdate-> strstart
#define window_size zipdate-> window_size
#define nice_match zipdate-> nice_match
#define match_start zipdate-> match_start
#define prev_length zipdate-> prev_length
#define max_chain_length zipdate-> max_chain_length
#define good_match zipdate-> good_match
#define ins_h zipdate-> ins_h
#define eofile zipdate-> eofile
#define lookahead zipdate-> lookahead
#define max_lazy_match zipdate-> max_lazy_match
//part4-----------------------------------------------------
#define dyn_ltree zipdate-> dyn_ltree
#define dyn_dtree zipdate-> dyn_dtree
#define static_ltree zipdate-> static_ltree
#define static_dtree zipdate-> static_dtree
#define bl_tree zipdate-> bl_tree
#define l_desc zipdate-> l_desc
#define d_desc zipdate-> d_desc
#define bl_desc zipdate-> bl_desc

#define inbuf zipdate-> inbuf
#define outbuf zipdate-> outbuf
#define d_buf zipdate-> d_buf
#define window zipdate-> window
#ifndef MAXSEG_64K
//	#define tab_prefix zipdate-> tab_prefix
	#define prev zipdate->prev
#else
	#define tab_prefix0 zipdate-> tab_prefix0
	#define prev zipdate->prev
	#define tab_prefix1 zipdate-> tab_prefix1
	#define head zipdate->tab_prefix1
#endif
//part5------------------------------------------
//gzip
extern DWORD ZipMain(ZipDate* zipdate);
extern int read_buf(ZipDate* zipdate,char *buf,  unsigned size);
extern ulg  updcrc(ZipDate* zipdate,uch *s, unsigned n);
extern void flush_outbuf(ZipDate* zipdate);
extern void write_buf(ZipDate* zipdate,voidp buf, unsigned cnt);
extern UINT Read(ZipDate* zipdate,char *buf,UINT size);
extern UINT Write(ZipDate* zipdate,char *buf,UINT size);

//deflate
extern void fill_window(ZipDate* zipdate);
extern int  longest_match(ZipDate* zipdate,IPos cur_match);
extern void lm_init(ZipDate* zipdate,int pack_level);
extern ulg  deflate(ZipDate* zipdate);

//tree------------------
//	
extern void ct_init(ZipDate* zipdate);
extern int  ct_tally(ZipDate* zipdate,int dist, int lc);
extern ulg  flush_block(ZipDate* zipdate,char *buf, ulg stored_len, int eof);
extern void init_block(ZipDate* zipdate);
extern void pqdownheap(ZipDate* zipdate,ct_data *tree, int k);
extern void gen_bitlen(ZipDate* zipdate,tree_desc *desc);
extern void gen_codes(ZipDate* zipdate,ct_data *tree, int max_code);
extern void build_tree(ZipDate* zipdate,tree_desc  *desc);
extern void scan_tree(ZipDate* zipdate,ct_data *tree, int max_code);
extern void send_tree(ZipDate* zipdate,ct_data *tree, int max_code);
extern int  build_bl_tree(ZipDate* zipdate);
extern void send_all_trees(ZipDate* zipdate,int lcodes, int dcodes, int blcodes);
extern void compress_block(ZipDate* zipdate,ct_data *ltree, ct_data *dtree);
extern void set_file_type(ZipDate* zipdate);
////////////////
//bits
extern void     bi_init(ZipDate* zipdate);
extern void     send_bits(ZipDate* zipdate,int value, int length);
extern unsigned bi_reverse(ZipDate* zipdate,unsigned value, int length);
extern void     bi_windup(ZipDate* zipdate);
extern void     copy_block(ZipDate* zipdate,char *buf, unsigned len, int header);

//part6------------------------------------------

void ZipDate_init(ZipDate* zipdate)
{
	tree_desc desc1={dyn_ltree, static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS, 0};
	l_desc =desc1;
	tree_desc desc2={dyn_dtree, static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS, 0};
	d_desc =desc2;
	tree_desc desc3={bl_tree, (ct_data near *)0, extra_blbits, 0,      BL_CODES, MAX_BL_BITS, 0};
	bl_desc =desc3;
	uch bl_order1[BL_CODES]  = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
	for(int i=0;i<BL_CODES;i++)	bl_order[i]= bl_order1[i];

}

/* ======================================================================== */
DWORD ZipMain(ZipDate* zipdate)
{	
	inSize=outSize=0;
	errorNumber=0;
	
	ZipDate_init(zipdate);
	verbose = 0;
	window_size = (ulg)2*WSIZE;
	level = 6;
	file_type = 0;          /* ascii/binary flag */
    outcnt = 0;
	insize = inptr = 0;
	bytes_in = bytes_out = 0L;
	static_crc=(ulg)0xffffffffL;

	/* Write the header to the gzip file. See algorithm.doc for the format */
	put_byte(GZIP_MAGIC[0]); /* magic header */
	put_byte(GZIP_MAGIC[1]);
	put_byte(DEFLATED);      /* compression method */
	crc = updcrc( zipdate,0, 0);
	bi_init( zipdate);
	ct_init( zipdate);
	lm_init( zipdate,level);
	header_bytes = (long)outcnt;
	deflate( zipdate);
	put_long(crc);
	put_long(isize);
	header_bytes += 2*sizeof(long);
	flush_outbuf(zipdate);

	if(errorNumber!=0) return -2;

	if(destLen1<outSize)return 0;
	return DEFLATED;
}

/* ===========================================================================
 * Read a new buffer from the current input file, perform end-of-line
 * translation, and update the crc and input file size.
 * IN assertion: size >= 2 (for end-of-line translation)
 */
int read_buf(ZipDate* zipdate,char* buf, unsigned size)
{
    unsigned len;

	len = Read( zipdate, buf, size);

    if (len == (unsigned)(-1) || len == 0) return (int)len;

    crc = updcrc( zipdate,(uch*)buf, len);
    isize += (ulg)len;
    return (int)len;
}

/* ===========================================================================
 * Run a set of bytes through the crc shift register.  If s is a NULL
 * pointer, then initialize the crc shift register contents instead.
 * Return the current crc in either case.
 */
ulg updcrc(ZipDate* zipdate,	uch *	 s,                 /* pointer to bytes to pump through */
			unsigned n)             /* number of bytes in s[] */
{
    register ulg c;         /* temporary variable */

//    static ulg crc = (ulg)0xffffffffL; /* shift register contents */

    if (s == NULL) {
	c = 0xffffffffL;
    } else {
	c = static_crc;
        if (n) do {
            c = __crc_32_tab[((int)c ^ (*s++)) & 0xff] ^ (c >> 8);
        } while (--n);
    }
    static_crc = c;
    return c ^ 0xffffffffL;       /* (instead of ~c for 64-bit machines) */
}

/* ===========================================================================
 * Write the output buffer outbuf[0..outcnt-1] and update bytes_out.
 * (used for the compressed data only)
 */
void flush_outbuf(ZipDate* zipdate)
{
    if (outcnt == 0) return;

    write_buf( zipdate,(char *)outbuf, outcnt);
    bytes_out += (ulg)outcnt;
    outcnt = 0;
}

/* ===========================================================================
 * Does the same as write(), but also handles partial pipe writes and checks for error return.
 */
void write_buf(ZipDate* zipdate,	voidp     buf,		unsigned  cnt)
{
    unsigned  n;
    n = Write( zipdate, buf, cnt);
	cnt -= n;
	buf = (voidp)((char*)buf+n);
}

UINT Read(ZipDate* zipdate,char *buf,UINT size)
{
	UINT i,size0;
	DWORD temp;
	char *p1;
	BYTE *p2;
	p1=buf;		p2=source1+inSize;


	if(sourceLen1>inSize)
	{	temp=sourceLen1-inSize;
		size0=size;
		if(temp<size)size0=temp;
		if(inSize+size0<inSize)
		{	errorNumber=1;
			return EOF;
		}

		i=0;
		while(i<size0)
		{	
			*p1++=*p2++;
			i++;
		}
		inSize+=size0;
		return size0;
	}
	else
		return EOF;
}

UINT Write(ZipDate* zipdate,char *buf,UINT size)
{
	UINT i,size0;
	DWORD temp;
	char *p1;
	BYTE *p2;
	p1=buf;		p2=dest1+outSize;

	if(outSize+size<outSize)
	{	errorNumber=2;
		return size;
	}

	if(destLen1>outSize)
	{
		temp=destLen1-outSize;
		size0=size;
		if(temp<size)	size0=temp;
		i=0;
		while(i<size0)
		{	*p2++=*p1++;
			i++;
		}
	}
	outSize+=size;
	return size;
}

//===============================================
//#include "Bits.h"
/* =========Initialize the bit string routines.===================*/
void bi_init (ZipDate* zipdate) /* output zip file, NO_FILE for in-memory compression */
{
    bi_buf = 0;
    bi_valid = 0;
}

/* =======================================*/
void send_bits(ZipDate* zipdate,	int value,  /* value to send */
				int length) /* number of bits */
{
    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
     * unused bits in value.
     */
    if (bi_valid > (int)Buf_size - length) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲成aⅴ人片在线观看| 久久er精品视频| 不卡av免费在线观看| 国产精品久久久久影视| 成人av免费网站| 亚洲精品视频免费观看| 在线一区二区观看| 日本怡春院一区二区| 欧美一级在线免费| 国产成人一区二区精品非洲| 国产精品国产三级国产aⅴ中文| 99国产精品99久久久久久| 亚洲伦理在线精品| 欧美一区二区三区免费大片| 韩日精品视频一区| 自拍偷自拍亚洲精品播放| 欧美丝袜丝nylons| 久久精品国产999大香线蕉| 国产无一区二区| 91福利小视频| 黄色日韩网站视频| 亚洲人123区| 欧美一区二区在线视频| 高清不卡在线观看av| 亚洲福利视频一区二区| 久久综合中文字幕| 欧日韩精品视频| 精品一区二区三区免费播放| 中文字幕一区二区三区精华液 | 欧美色大人视频| 久久aⅴ国产欧美74aaa| 亚洲乱码国产乱码精品精小说 | 亚洲第一福利视频在线| 久久青草欧美一区二区三区| 色哟哟一区二区三区| 精品日韩在线观看| 93久久精品日日躁夜夜躁欧美| 成人污视频在线观看| 日韩精品一区二区在线观看| 不卡免费追剧大全电视剧网站| 日韩电影在线一区| 亚洲欧美一区二区三区孕妇| 久久综合九色综合久久久精品综合| 91视频在线观看免费| 美女视频黄 久久| 一区二区三区中文在线观看| wwwwxxxxx欧美| 欧美二区在线观看| 一本高清dvd不卡在线观看| 国产麻豆91精品| 经典三级视频一区| 亚洲国产日产av| 一区二区三区日韩在线观看| 国产日韩精品一区二区三区| 在线观看日韩高清av| 激情欧美日韩一区二区| 日本亚洲天堂网| 亚洲一区在线观看免费| 国产精品美女久久久久久2018| 欧美zozo另类异族| 欧美一区二区三区色| 欧美日韩国产高清一区| 91高清视频在线| 91丝袜呻吟高潮美腿白嫩在线观看| 国产电影精品久久禁18| 精品一区二区精品| 黄页视频在线91| 国产在线视频一区二区三区| 麻豆91免费观看| 美女视频一区二区| 日本视频在线一区| 美女视频网站久久| 男男视频亚洲欧美| 麻豆成人av在线| 国产在线精品一区二区三区不卡 | 一区二区不卡在线播放| 樱花草国产18久久久久| 一区二区三区在线免费播放| 亚洲柠檬福利资源导航| 一片黄亚洲嫩模| 婷婷国产在线综合| 日韩avvvv在线播放| 奇米精品一区二区三区四区| 久久99国产精品尤物| 精品在线观看免费| 国产精品一区二区久激情瑜伽 | av中文字幕一区| 97久久久精品综合88久久| 91热门视频在线观看| 日本高清免费不卡视频| 欧美性猛交xxxx黑人交| 欧美精品v国产精品v日韩精品| 欧美精品乱码久久久久久| 日韩一级完整毛片| 26uuu国产日韩综合| 国产精品久久久久久久久晋中 | 亚洲男人电影天堂| 亚洲成a人在线观看| 久久精品国产亚洲a| 国产精品18久久久久久久久 | 日本道精品一区二区三区| 欧美日产在线观看| 久久久久高清精品| 一区二区在线看| 视频在线观看一区二区三区| 极品少妇xxxx精品少妇| 大陆成人av片| 欧美视频精品在线观看| 欧美成人精精品一区二区频| 国产精品妹子av| 天天操天天干天天综合网| 国产一区二区中文字幕| 99久久国产综合精品色伊| 在线播放中文一区| 国产精品无圣光一区二区| 亚洲午夜精品网| 国产一区二区不卡在线| 在线观看视频一区| 久久嫩草精品久久久精品一| 亚洲另类春色校园小说| 老司机精品视频一区二区三区| 成人高清免费观看| 日韩欧美成人激情| 亚洲免费视频成人| 激情五月激情综合网| 91国偷自产一区二区三区成为亚洲经典| 欧美岛国在线观看| 一区二区三区成人| 国产不卡视频在线播放| 欧美日本国产视频| 国产99精品国产| 蜜桃av一区二区在线观看| 99久久国产综合精品色伊| 日韩免费高清电影| 亚洲精品国产高清久久伦理二区| 激情亚洲综合在线| 91麻豆精品国产自产在线观看一区 | 精品国免费一区二区三区| 日韩欧美中文字幕一区| 中文字幕一区二区三区乱码在线| 五月天中文字幕一区二区| 寂寞少妇一区二区三区| 日韩影院免费视频| 国产精品乡下勾搭老头1| 成人免费黄色在线| 免费观看一级特黄欧美大片| 欧美精品色综合| 视频一区视频二区在线观看| 欧美精品vⅰdeose4hd| 丝袜亚洲精品中文字幕一区| 日韩一区二区免费电影| 久久国产精品99精品国产| xnxx国产精品| 成人av资源下载| 一区二区三区四区av| 在线播放视频一区| 国产一级精品在线| 亚洲国产成人私人影院tom| 99精品黄色片免费大全| 亚洲国产另类精品专区| 欧美一个色资源| 国产**成人网毛片九色| 亚洲老妇xxxxxx| 日韩欧美二区三区| 成人动漫av在线| 亚洲成人tv网| 26uuu另类欧美| 色综合一区二区三区| 视频一区二区欧美| 久久精品一区四区| 在线视频国产一区| 精品亚洲国内自在自线福利| 日本一二三四高清不卡| 欧美性xxxxxx少妇| 极品少妇一区二区| 亚洲精品v日韩精品| 精品免费国产二区三区 | 九一久久久久久| 国产精品国产三级国产a| 欧美日韩成人在线一区| 国产成人精品网址| 亚洲成人www| 一区在线观看视频| 日韩一区二区电影| 色综合视频一区二区三区高清| 男女性色大片免费观看一区二区 | 欧美日韩三级一区二区| 国产美女精品人人做人人爽| 亚洲主播在线观看| 久久精品欧美日韩精品| 欧美电影在线免费观看| 波多野结衣中文一区| 麻豆成人av在线| 亚洲成人一区在线| 国产精品国产三级国产专播品爱网 | 国产一区二区免费在线| 亚洲观看高清完整版在线观看| 国产三级三级三级精品8ⅰ区| 欧美日韩国产首页| 色偷偷成人一区二区三区91|