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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? unzip.c

?? 這是一個(gè)兼容C++標(biāo)準(zhǔn)的IO流接口
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/* unzip.c -- IO on .zip files using zlib 
   Version 0.15 beta, Mar 19th, 1998,

   Read unzip.h for more info
*/


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

#ifdef STDC
#  include <stddef.h>
#  include <string.h>
#  include <stdlib.h>
#endif
#ifdef NO_ERRNO_H
    extern int errno;
#else
#   include <errno.h>
#endif


#ifndef local
#  define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */



#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \
                      !defined(CASESENSITIVITYDEFAULT_NO)
#define CASESENSITIVITYDEFAULT_NO
#endif


#ifndef UNZ_BUFSIZE
#define UNZ_BUFSIZE (16384)
#endif

#ifndef UNZ_MAXFILENAMEINZIP
#define UNZ_MAXFILENAMEINZIP (256)
#endif

#ifndef ALLOC
# define ALLOC(size) (malloc(size))
#endif
#ifndef TRYFREE
# define TRYFREE(p) {if (p) free(p);}
#endif

#define SIZECENTRALDIRITEM (0x2e)
#define SIZEZIPLOCALHEADER (0x1e)


/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */

#ifndef SEEK_CUR
#define SEEK_CUR    1
#endif

#ifndef SEEK_END
#define SEEK_END    2
#endif

#ifndef SEEK_SET
#define SEEK_SET    0
#endif

const char unz_copyright[] =
   " unzip 0.15 Copyright 1998 Gilles Vollant ";

/* unz_file_info_interntal contain internal info about a file in zipfile*/
typedef struct unz_file_info_internal_s
{
    uLong offset_curfile;/* relative offset of local header 4 bytes */
} unz_file_info_internal;


/* file_in_zip_read_info_s contain internal information about a file in zipfile,
    when reading and decompress it */
typedef struct
{
	char  *read_buffer;         /* internal buffer for compressed data */
	z_stream stream;            /* zLib stream structure for inflate */

	uLong pos_in_zipfile;       /* position in byte on the zipfile, for fseek*/
	uLong stream_initialised;   /* flag set if stream structure is initialised*/

	uLong offset_local_extrafield;/* offset of the local extra field */
	uInt  size_local_extrafield;/* size of the local extra field */
	uLong pos_local_extrafield;   /* position in the local extra field in read*/

	uLong crc32;                /* crc32 of all data uncompressed */
	uLong crc32_wait;           /* crc32 we must obtain after decompress all */
	uLong rest_read_compressed; /* number of byte to be decompressed */
	uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
	FILE* file;                 /* io structore of the zipfile */
	uLong compression_method;   /* compression method (0==store) */
	uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
} file_in_zip_read_info_s;


/* unz_s contain internal information about the zipfile
*/
typedef struct
{
	FILE* file;                 /* io structore of the zipfile */
	unz_global_info gi;       /* public global information */
	uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
	uLong num_file;             /* number of the current file in the zipfile*/
	uLong pos_in_central_dir;   /* pos of the current file in the central dir*/
	uLong current_file_ok;      /* flag about the usability of the current file*/
	uLong central_pos;          /* position of the beginning of the central dir*/

	uLong size_central_dir;     /* size of the central directory  */
	uLong offset_central_dir;   /* offset of start of central directory with
								   respect to the starting disk number */

	unz_file_info cur_file_info; /* public info about the current file in zip*/
	unz_file_info_internal cur_file_info_internal; /* private info about it*/
    file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
	                                    file if we are decompressing it */
} unz_s;


/* ===========================================================================
     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
   for end of file.
   IN assertion: the stream s has been sucessfully opened for reading.
*/


local int unzlocal_getByte(fin,pi)
	FILE *fin;
	int *pi;
{
    unsigned char c;
	int err = fread(&c, 1, 1, fin);
    if (err==1)
    {
        *pi = (int)c;
        return UNZ_OK;
    }
    else
    {
        if (ferror(fin)) 
            return UNZ_ERRNO;
        else
            return UNZ_EOF;
    }
}


/* ===========================================================================
   Reads a long in LSB order from the given gz_stream. Sets 
*/
local int unzlocal_getShort (fin,pX)
	FILE* fin;
    uLong *pX;
{
    uLong x ;
    int i;
    int err;

    err = unzlocal_getByte(fin,&i);
    x = (uLong)i;
    
    if (err==UNZ_OK)
        err = unzlocal_getByte(fin,&i);
    x += ((uLong)i)<<8;
   
    if (err==UNZ_OK)
        *pX = x;
    else
        *pX = 0;
    return err;
}

local int unzlocal_getLong (fin,pX)
	FILE* fin;
    uLong *pX;
{
    uLong x ;
    int i;
    int err;

    err = unzlocal_getByte(fin,&i);
    x = (uLong)i;
    
    if (err==UNZ_OK)
        err = unzlocal_getByte(fin,&i);
    x += ((uLong)i)<<8;

    if (err==UNZ_OK)
        err = unzlocal_getByte(fin,&i);
    x += ((uLong)i)<<16;

    if (err==UNZ_OK)
        err = unzlocal_getByte(fin,&i);
    x += ((uLong)i)<<24;
   
    if (err==UNZ_OK)
        *pX = x;
    else
        *pX = 0;
    return err;
}


/* My own strcmpi / strcasecmp */
local int strcmpcasenosensitive_internal (fileName1,fileName2)
	const char* fileName1;
	const char* fileName2;
{
	for (;;)
	{
		char c1=*(fileName1++);
		char c2=*(fileName2++);
		if ((c1>='a') && (c1<='z'))
			c1 -= 0x20;
		if ((c2>='a') && (c2<='z'))
			c2 -= 0x20;
		if (c1=='\0')
			return ((c2=='\0') ? 0 : -1);
		if (c2=='\0')
			return 1;
		if (c1<c2)
			return -1;
		if (c1>c2)
			return 1;
	}
}


#ifdef  CASESENSITIVITYDEFAULT_NO
#define CASESENSITIVITYDEFAULTVALUE 2
#else
#define CASESENSITIVITYDEFAULTVALUE 1
#endif

#ifndef STRCMPCASENOSENTIVEFUNCTION
#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
#endif

/* 
   Compare two filename (fileName1,fileName2).
   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
                                                                or strcasecmp)
   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
        (like 1 on Unix, 2 on Windows)

*/
extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
	const char* fileName1;
	const char* fileName2;
	int iCaseSensitivity;
{
	if (iCaseSensitivity==0)
		iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;

	if (iCaseSensitivity==1)
		return strcmp(fileName1,fileName2);

	return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
} 

#define BUFREADCOMMENT (0x400)

/*
  Locate the Central directory of a zipfile (at the end, just before
    the global comment)
*/
local uLong unzlocal_SearchCentralDir(fin)
	FILE *fin;
{
	unsigned char* buf;
	uLong uSizeFile;
	uLong uBackRead;
	uLong uMaxBack=0xffff; /* maximum size of global comment */
	uLong uPosFound=0;
	
	if (fseek(fin,0,SEEK_END) != 0)
		return 0;


	uSizeFile = ftell( fin );
	
	if (uMaxBack>uSizeFile)
		uMaxBack = uSizeFile;

	buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
	if (buf==NULL)
		return 0;

	uBackRead = 4;
	while (uBackRead<uMaxBack)
	{
		uLong uReadSize,uReadPos ;
		int i;
		if (uBackRead+BUFREADCOMMENT>uMaxBack) 
			uBackRead = uMaxBack;
		else
			uBackRead+=BUFREADCOMMENT;
		uReadPos = uSizeFile-uBackRead ;
		
		uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? 
                     (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
		if (fseek(fin,uReadPos,SEEK_SET)!=0)
			break;

		if (fread(buf,(uInt)uReadSize,1,fin)!=1)
			break;

                for (i=(int)uReadSize-3; (i--)>0;)
			if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && 
				((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
			{
				uPosFound = uReadPos+i;
				break;
			}

		if (uPosFound!=0)
			break;
	}
	TRYFREE(buf);
	return uPosFound;
}

/*
  Open a Zip file. path contain the full pathname (by example,
     on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer
	 "zlib/zlib109.zip".
	 If the zipfile cannot be opened (file don't exist or in not valid), the
	   return value is NULL.
     Else, the return value is a unzFile Handle, usable with other function
	   of this unzip package.
*/
extern unzFile ZEXPORT unzOpen (path)
	const char *path;
{
	unz_s us;
	unz_s *s;
	uLong central_pos,uL;
	FILE * fin ;

	uLong number_disk;          /* number of the current dist, used for 
								   spaning ZIP, unsupported, always 0*/
	uLong number_disk_with_CD;  /* number the the disk with central dir, used
								   for spaning ZIP, unsupported, always 0*/
	uLong number_entry_CD;      /* total number of entries in
	                               the central dir 
	                               (same than number_entry on nospan) */

	int err=UNZ_OK;

    if (unz_copyright[0]!=' ')
        return NULL;

    fin=fopen(path,"rb");
	if (fin==NULL)
		return NULL;

	central_pos = unzlocal_SearchCentralDir(fin);
	if (central_pos==0)
		err=UNZ_ERRNO;

	if (fseek(fin,central_pos,SEEK_SET)!=0)
		err=UNZ_ERRNO;

	/* the signature, already checked */
	if (unzlocal_getLong(fin,&uL)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* number of this disk */
	if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* number of the disk with the start of the central directory */
	if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* total number of entries in the central dir on this disk */
	if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* total number of entries in the central dir */
	if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK)
		err=UNZ_ERRNO;

	if ((number_entry_CD!=us.gi.number_entry) ||
		(number_disk_with_CD!=0) ||
		(number_disk!=0))
		err=UNZ_BADZIPFILE;

	/* size of the central directory */
	if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* offset of start of central directory with respect to the 
	      starting disk number */
	if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK)
		err=UNZ_ERRNO;

	/* zipfile comment length */
	if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK)
		err=UNZ_ERRNO;

	if ((central_pos<us.offset_central_dir+us.size_central_dir) && 
		(err==UNZ_OK))
		err=UNZ_BADZIPFILE;

	if (err!=UNZ_OK)
	{
		fclose(fin);
		return NULL;
	}

	us.file=fin;
	us.byte_before_the_zipfile = central_pos -
		                    (us.offset_central_dir+us.size_central_dir);
	us.central_pos = central_pos;
    us.pfile_in_zip_read = NULL;
	

	s=(unz_s*)ALLOC(sizeof(unz_s));
	*s=us;
	unzGoToFirstFile((unzFile)s);	
	return (unzFile)s;	

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久老虎| 精品一区二区三区视频| 26uuu久久综合| 日韩视频免费观看高清在线视频| 欧美三级乱人伦电影| 日本道色综合久久| 91久久国产最好的精华液| 日韩欧美的一区二区| 欧美成人一区二区三区| 精品国产一区久久| 亚洲资源在线观看| 午夜不卡在线视频| 久久se精品一区精品二区| 国产91丝袜在线18| 欧洲av一区二区嗯嗯嗯啊| 在线综合亚洲欧美在线视频| 精品国产91久久久久久久妲己| 亚洲最大成人网4388xx| 风流少妇一区二区| 欧美男同性恋视频网站| 欧美一区二区三区成人| 国产亚洲欧美在线| 一级女性全黄久久生活片免费| 国产精品一区二区视频| 欧美自拍丝袜亚洲| 中文字幕永久在线不卡| 日韩av一级电影| 成人黄色在线网站| 欧美久久久久久久久中文字幕| 久久久久久久av麻豆果冻| 一区二区三区国产精华| 99精品视频中文字幕| 91精品婷婷国产综合久久性色| 亚洲色图欧美偷拍| 国产一区二区在线电影| 欧美日韩一级视频| 亚洲福利视频一区| 风间由美一区二区三区在线观看| 久久久久久久久免费| 久久精品免费观看| 欧美r级在线观看| 狠狠狠色丁香婷婷综合激情| 在线一区二区三区做爰视频网站| 亚洲人成在线观看一区二区| 精品一区二区三区在线观看| www久久精品| 国产精品99久久久久久宅男| 久久精品视频在线免费观看| 成人午夜电影小说| 精品电影一区二区三区| 国产精品中文有码| 国产精品每日更新| 国内精品在线播放| 国产欧美一区二区三区沐欲| 日韩精品亚洲一区二区三区免费| jlzzjlzz欧美大全| 国产亚洲精品aa| 99在线热播精品免费| 麻豆传媒一区二区三区| 色噜噜狠狠成人网p站| 一区二区三区在线视频播放| 欧美群妇大交群中文字幕| 美女视频黄免费的久久| 久久精品男人天堂av| www.在线成人| 日韩黄色小视频| 久久精品视频一区二区| 日本韩国欧美在线| 麻豆精品在线视频| 综合电影一区二区三区| 欧美一级免费大片| 成人免费高清视频| 亚洲一区二区视频在线| 久久久一区二区三区捆绑**| 色偷偷一区二区三区| 亚洲免费电影在线| 欧美刺激午夜性久久久久久久| 波多野结衣中文一区| 天天色综合成人网| 亚洲国产精品av| 国产69精品久久久久777| 亚洲国产精品人人做人人爽| 久久久久久久久99精品| 在线免费视频一区二区| 国产一区999| 日韩精品一卡二卡三卡四卡无卡| 中文字幕色av一区二区三区| 欧美一级一级性生活免费录像| 99re成人精品视频| 国产一区二区三区免费观看| 一区二区三区视频在线看| 久久亚洲精品小早川怜子| 欧美三级电影在线看| 白白色 亚洲乱淫| 国产精品99精品久久免费| 免费在线观看精品| 精品少妇一区二区三区在线播放| 91视频www| 日韩av高清在线观看| 亚洲精品免费电影| 3d动漫精品啪啪1区2区免费| 色中色一区二区| 成人国产亚洲欧美成人综合网| 国产白丝精品91爽爽久久| 蜜臀a∨国产成人精品| 亚洲一卡二卡三卡四卡 | 蜜芽一区二区三区| 一区二区三区欧美日韩| 国产精品久久三区| 在线中文字幕一区二区| 91在线观看免费视频| 国产精品资源网站| 国产电影一区在线| 亚洲电影在线免费观看| 一区二区三区日韩欧美| 亚洲三级在线看| 亚洲精选免费视频| 一区二区三区视频在线观看| 亚洲欧美电影一区二区| 日韩毛片视频在线看| 国产精品国产三级国产专播品爱网| 欧美国产精品一区二区三区| 中文字幕乱码一区二区免费| 国产欧美一区二区精品性色超碰| 国产午夜三级一区二区三| 精品处破学生在线二十三| 久久综合色婷婷| 亚洲国产高清在线| 中文字幕一区二区三区乱码在线| 中文字幕日韩一区二区| 国产精品天天摸av网| 国产精品国产三级国产a| 亚洲欧美日韩中文播放 | 欧美伊人久久久久久久久影院 | 国产九九视频一区二区三区| 国产一区二区毛片| 成人午夜私人影院| 一本大道久久a久久精二百 | 樱桃国产成人精品视频| 亚洲在线成人精品| 另类人妖一区二区av| 国产尤物一区二区在线| 不卡的av在线| 在线成人av网站| 国产亚洲欧洲997久久综合| 亚洲日本在线看| 免费观看久久久4p| 国产成人精品综合在线观看| 色av综合在线| 日韩免费一区二区| 国产精品久久久久久久岛一牛影视| 亚洲精品精品亚洲| 日本最新不卡在线| 不卡一区二区中文字幕| 欧美日韩高清一区二区| 国产免费成人在线视频| 亚洲国产精品久久不卡毛片| 国产综合色在线视频区| 成人午夜视频网站| 国产色91在线| 亚洲成人精品影院| 亚洲福利电影网| 紧缚奴在线一区二区三区| a在线播放不卡| 日韩欧美一级二级| 亚洲视频在线一区| 久久国产福利国产秒拍| 色婷婷综合久久久中文一区二区| 日韩免费视频一区| 亚洲一区av在线| 丰满少妇久久久久久久| 欧美精品v日韩精品v韩国精品v| 久久奇米777| 热久久久久久久| 日本久久电影网| 国产日韩成人精品| 精品一区二区三区香蕉蜜桃| 欧美色图在线观看| 亚洲三级理论片| 成人免费视频一区| 久久久久久久久久久电影| 日韩精品欧美成人高清一区二区| 91一区一区三区| 国产精品久久久久久久久晋中| 久久99久久精品| 在线综合亚洲欧美在线视频| 亚洲黄色小说网站| 不卡一区二区三区四区| 国产日韩精品视频一区| 韩国女主播一区| 欧美tickling网站挠脚心| 日本视频在线一区| 欧美日韩久久一区| 亚洲成人在线免费| 色哟哟一区二区在线观看| 国产精品色哟哟| 99在线精品免费| 亚洲人成7777| 日本久久电影网| 一区二区三区 在线观看视频|