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

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

?? unzip.c

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? 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一区二区三区免费野_久草精品视频
免费看日韩精品| 国产尤物一区二区在线| 久久综合久久综合久久综合| 丁香五精品蜜臀久久久久99网站 | 国产精品激情偷乱一区二区∴| 在线看日韩精品电影| 国产99久久久久久免费看农村| 天天av天天翘天天综合网色鬼国产| 国产精品欧美精品| 日韩欧美成人激情| 欧美写真视频网站| 成人激情黄色小说| 国产在线一区二区| 青青青伊人色综合久久| 一区二区日韩av| 中文字幕一区二区三| 欧美精品一区二区三区高清aⅴ | 欧美大片在线观看| 欧美伦理电影网| 欧美图区在线视频| 色婷婷精品久久二区二区蜜臀av| 成人中文字幕合集| 国产一区高清在线| 国内精品在线播放| 美女视频网站久久| 日本网站在线观看一区二区三区 | 日本一区二区视频在线观看| 欧美变态tickling挠脚心| 欧美精品xxxxbbbb| 欧美二区三区的天堂| 欧美日韩一级视频| 欧美最猛黑人xxxxx猛交| 99久久精品免费看国产免费软件| 国产99久久久国产精品潘金| 国产麻豆成人精品| 国产精品一区2区| 国产乱一区二区| 国产老女人精品毛片久久| 久久精品噜噜噜成人av农村| 精油按摩中文字幕久久| 激情综合色综合久久综合| 久久精品国产**网站演员| 久久不见久久见免费视频1| 九九国产精品视频| 国产成人精品免费| 波多野结衣视频一区| 99精品国产热久久91蜜凸| 99久久99精品久久久久久| 91美女片黄在线观看91美女| 在线精品视频免费播放| 欧美日韩精品一二三区| 欧美一区二区三区在线观看视频| 日韩一区二区麻豆国产| 欧美精品一区二区三区久久久| 久久精品视频一区二区| 国产精品麻豆欧美日韩ww| 中文字幕日韩一区二区| 亚洲永久免费av| 日韩在线一区二区三区| 精品在线亚洲视频| 成人一区二区三区中文字幕| www.欧美.com| 欧美揉bbbbb揉bbbbb| 欧美成人精品高清在线播放| 国产欧美综合色| 亚洲国产成人精品视频| 免费成人在线视频观看| 国产成人高清在线| 在线观看免费视频综合| 欧美不卡一区二区三区四区| 国产精品久久影院| 日本在线播放一区二区三区| 国产麻豆成人传媒免费观看| 99re热视频这里只精品| 欧美一区二区三区视频免费播放| 久久网站最新地址| 一区二区三区四区蜜桃| 久久精品免费看| 色婷婷av一区| 日韩久久精品一区| **性色生活片久久毛片| 日本aⅴ精品一区二区三区 | 国产精品一二三区在线| 色综合av在线| 日韩欧美你懂的| 综合久久久久久久| 国产在线看一区| 精品视频在线免费看| 中文字幕成人在线观看| 日韩专区一卡二卡| www.激情成人| 久久久久久久免费视频了| 亚洲成人先锋电影| 97精品久久久久中文字幕 | 欧美群妇大交群中文字幕| 久久网站热最新地址| 性做久久久久久久免费看| 国产suv一区二区三区88区| 在线播放中文字幕一区| 怡红院av一区二区三区| 国产东北露脸精品视频| 91精品国产高清一区二区三区| 国产精品福利一区二区| 国产伦精品一区二区三区视频青涩| 欧洲生活片亚洲生活在线观看| 欧美激情一区二区三区四区| 人人超碰91尤物精品国产| 91黄色免费观看| 国产精品成人在线观看| 国产精品一区二区免费不卡| 日韩一区二区在线观看视频| 亚洲不卡av一区二区三区| 91丨九色丨蝌蚪富婆spa| 国产午夜亚洲精品不卡 | 91麻豆国产自产在线观看| 久久综合久久综合亚洲| 免费成人av在线播放| 欧美日韩视频在线观看一区二区三区| 亚洲欧洲日本在线| 成人国产精品免费观看| 欧美国产一区二区| 成人性生交大片免费看中文 | 亚洲欧美激情一区二区| 国产福利不卡视频| 国产三级一区二区| 国产精品一色哟哟哟| 国产亚洲精品精华液| 国产乱码精品一区二区三区五月婷| 精品三级av在线| 韩国成人福利片在线播放| 欧美电视剧免费全集观看 | 色就色 综合激情| 亚洲精品水蜜桃| 色狠狠色狠狠综合| 亚洲毛片av在线| 在线视频一区二区三区| 一区二区三区日韩精品| 色天天综合久久久久综合片| 亚洲狠狠丁香婷婷综合久久久| 色综合天天性综合| 亚洲一区二区三区免费视频| 欧美三级三级三级| 日韩精品电影在线观看| 欧美成人精精品一区二区频| 国产在线国偷精品产拍免费yy| 久久你懂得1024| 99久久精品国产导航| 亚洲精品videosex极品| 欧美日韩一区小说| 免费看日韩精品| 国产婷婷色一区二区三区四区| 成人做爰69片免费看网站| 亚洲免费看黄网站| 欧美老年两性高潮| 精品系列免费在线观看| 国产目拍亚洲精品99久久精品| 97se亚洲国产综合在线| 亚洲国产sm捆绑调教视频| 欧美久久久一区| 久久精工是国产品牌吗| 欧美国产一区二区在线观看| 色哟哟日韩精品| 麻豆成人久久精品二区三区红 | 久久99精品国产麻豆不卡| 久久九九99视频| 色94色欧美sute亚洲13| 免费观看一级特黄欧美大片| 国产欧美一区二区三区鸳鸯浴 | 香蕉久久一区二区不卡无毒影院| 日韩欧美在线不卡| 91麻豆免费看片| 欧美aaaaaa午夜精品| 欧美国产精品久久| 欧美日本在线观看| 国产成人午夜电影网| 午夜精品久久久久久久久| 国产亚洲短视频| 欧美日韩久久一区| 成人在线综合网| 免费人成精品欧美精品 | 五月激情丁香一区二区三区| 久久久久久9999| 在线成人午夜影院| voyeur盗摄精品| 久久精品国产99久久6| 一区二区三区国产| 久久久久久久久久美女| 欧美一a一片一级一片| 风间由美一区二区三区在线观看| 亚洲国产欧美日韩另类综合| 国产欧美一二三区| 91精品国产入口| 色系网站成人免费| 高清视频一区二区| 日本女优在线视频一区二区| 亚洲男人天堂av| 欧美极品aⅴ影院| 精品国产91乱码一区二区三区 | 国产69精品一区二区亚洲孕妇| 亚洲va国产天堂va久久en|