/* unzip.c -- IO for uncompress .zip files using zlib
Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
------------------------------------------------------------------------------------
Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of
compatibility with older software. The following is from the original crypt.c.
Code woven in by Terry Thorsen 1/2003.
Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2000-Apr-09 or later
(the contents of which are also included in zip.h) for terms of use.
If, for some reason, all these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h]
The encryption/decryption parts of this source code (as opposed to the
non-echoing password parts) were originally written in Europe. The
whole source package can be freely distributed, including from the USA.
(Prior to January 2000, re-export from the US was a violation of US law.)
This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities).
------------------------------------------------------------------------------------
Changes in unzip.c
2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos
2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz*
2007-2008 - Even Rouault - Remove old C style function prototypes
2007-2008 - Even Rouault - Add unzip support for ZIP64
Copyright (C) 2007-2008 Even Rouault
Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again).
Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G
should only read the compressed/uncompressed size from the Zip64 format if
the size from normal header was 0xFFFFFFFF
Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant
Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required)
Patch created by Daniel Borca
Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer
Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef NOUNCRYPT
#define NOUNCRYPT
#endif
#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
namespace cocos2d {
#ifndef local
# define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */
#ifndef CASESENSITIVITYDEFAULT_NO
# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES)
# define CASESENSITIVITYDEFAULT_NO
# endif
#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)
const char unz_copyright[] =
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
/* unz_file_info_interntal contain internal info about a file in zipfile*/
typedef struct unz_file_info64_internal_s
{
ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */
} unz_file_info64_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 */
#ifdef HAVE_BZIP2
bz_stream bstream; /* bzLib stream structure for bziped */
#endif
ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
uLong stream_initialised; /* flag set if stream structure is initialised*/
ZPOS64_T offset_local_extrafield;/* offset of the local extra field */
uInt size_local_extrafield;/* size of the local extra field */
ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/
ZPOS64_T total_out_64;
uLong crc32; /* crc32 of all data uncompressed */
uLong crc32_wait; /* crc32 we must obtain after decompress all */
ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */
ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/
zlib_filefunc64_32_def z_filefunc;
voidpf filestream; /* io structore of the zipfile */
uLong compression_method; /* compression method (0==store) */
ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
int raw;
} file_in_zip64_read_info_s;
/* unz64_s contain internal information about the zipfile
*/
typedef struct
{
zlib_filefunc64_32_def z_filefunc;
int is64bitOpenFunction;
voidpf filestream; /* io structore of the zipfile */
unz_global_info64 gi; /* public global information */
ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
ZPOS64_T num_file; /* number of the current file in the zipfile*/
ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/
ZPOS64_T current_file_ok; /* flag about the usability of the current file*/
ZPOS64_T central_pos; /* position of the beginning of the central dir*/
ZPOS64_T size_central_dir; /* size of the central directory */
ZPOS64_T offset_central_dir; /* offset of start of central directory with
respect to the starting disk number */
unz_file_info64 cur_file_info; /* public info about the current file in zip*/
unz_file_info64_internal cur_file_info_internal; /* private info about it*/
file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current
file if we are decompressing it */
int encrypted;
int isZip64;
# ifndef NOUNCRYPT
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
const unsigned long* pcrc_32_tab;
# endif
} unz64_s;
#ifndef NOUNCRYPT
#include "crypt.h"
#endif
/* ===========================================================================
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 unz64local_getByte OF((
const zlib_filefunc64_32_def* pzlib_filefunc_def,
voidpf filestream,
int *pi));
local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)
{
unsigned char c;
int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
if (err==1)
{
*pi = (int)c;
return UNZ_OK;
}
else
{
if (
没有合适的资源?快使用搜索试试~ 我知道了~
C++ oc 互相调用
共613个文件
h:147个
cpp:90个
mm:16个
5星 · 超过95%的资源 需积分: 48 166 下载量 143 浏览量
2013-10-27
16:18:26
上传
评论
收藏 2.19MB ZIP 举报
温馨提示
简单的c++ oc互相调用 cocos2d-x游戏开发会用到
资源推荐
资源详情
资源评论
收起资源包目录
C++ oc 互相调用 (613个子文件)
00b1b4b09cde20540ac447b1b1c449989157ed 1KB
00e9cbf76361220c6d918985a9f1dba045c2d3 5KB
032f38be1769f0164cde10bfda90949a63b9ce 194B
03332b5555ed45332bf1d19314104203f6ffdc 751B
033d0747efcb7a86bd56d1f8676b3ba86b3b25 2KB
048fe950bdeaefbf1aeedfb181af409877a426 186B
06b86ad98ac64ca7c9ecbd6ace6cc30f82f1e8 177B
0747a261d15e9920a7ed9842b167f4034b8664 2KB
099e7e33444e5876b139527ac62c707c046653 96B
09d47d61068b63194ba80109149cbac2149dcb 2KB
0bd6daadb16309724ee95ebcdf653a64d418f0 2KB
0c24a6420681dada563484c5c83d5030e5349a 1KB
0c2edd28f865895bb03232d1eb1bf6ffdeb3bb 764B
0c794b5f8e0a5c8c479bdaebfc7aeef0514603 7KB
0c7b3ca17f86349d8cda71a479d2a68bd796b1 1KB
0d4d69be2cba44791e699f44b502133e00f5b6 209B
0df8eb16273c2c48eb21264403747f63c27dc5 3KB
10322294b17d58da88875008f8cb1cfc0d7272 2KB
1048af5ad79df328eb755da6ad33daeb69178d 685B
1203fb9adff35cb25f107a7e15dc38981646e6 1KB
12510d97c0444415b20e5688154ff34279dcca 2KB
1296e0fc75d1371634609dafc3af2ac3685bb1 2KB
12d72e5d851309f8b1308ad9833e1ec12570ca 84B
153b1fe3fae78bfa65cb6d3e97fdcdf843ccfb 1KB
15cf27e6fa19537a2028391a5527dabf237106 911B
163bc17e1c35f7fdab275e6eee3b277ab5ccea 6KB
16e84f4589bff818d22a6c502011fe18ef5e76 935B
16e99f4f9fdf2d5d05d4d5c5152185fa2a456d 928B
1803417a70918f9b45bff6f9ab01e028f36c98 1KB
18ff5ae03ebc5e47e8d2a34b7d072fa07590d2 993B
196db222bf1489863daac268222794d37ba109 766B
1c69e1f566e54102264023ca7341ecdb3606e0 2KB
1eb2c4742124a8d2e72865a9292a018ea51b38 2KB
1f11ac5a51218dd39a9c7626980af5c1247bb3 285B
1fe9c7cc66e9058329b6ea6660a63d473a49e9 2KB
200224ba947b31c72af4cf3e8710661bfb3ebd 1KB
21d7bfa5e750250eaa3ce1062ef9a8028fc21d 363B
2329b3cef8af944c8bcc00289b2411cf8168f3 2KB
24eedaa009dd644ba3cd2db38f51b3ef662f71 3KB
25a197bc4555374e82f81bd328fee2266e8d6b 1KB
2639c6e99988b669f2fc92d04d5c393c235fb9 85B
26a9a1fc3c69562297357698292a0e48f65219 1KB
26c2460eb69ff4deca3d4555ec3c556dc44abf 2KB
275bdac84f064f9e8de819cbd89837a6c8bc18 2KB
277e84e40781681b8f2a3661bce70005d03cad 1KB
29cc32d600f75474304e680f325dfebc336b13 2KB
29f3cc744f6a41134ded8eae6ff32a08759927 9KB
2a7439292cf039cb54d3afaeb6b24381412da9 8KB
2aaf08a3baa16453123172c9f12f9042463210 2KB
2cd1577a495ed745e2370e4b19e47ac7d7f83b 5KB
2d779e9cac4bf3a8a1a6a858f8c4f2b12ce9f7 2KB
2ef3c2176e10f3fdf79f0ef5c7841990f4f5f8 2KB
2eff7d55964ac58c7893fcb3a2f4eca59dbbff 149B
2f8b924f73f5e85bedbdcfd9c9f2f60a0f9c2b 83B
306ea016c084399517ee53878442393883d949 1KB
30a162207520729481ca2d83f908f67371c72d 2KB
3256383e07f76e0736d47ae364389f6d2e9724 2KB
3268e1d17d7eab6d41c377a39e0711578a4aea 4KB
3276a8bad36abb75c4d8de499d6a0e957f6f50 2KB
32d6d458e153b1958d6f382b36fd0859a3aa66 5KB
333612986bb9b1b47daab35d4d30b9550b877b 3KB
35e598951547a8558098038a9a3f6068cc5d0d 2KB
368944446aaa2bc991e2ad820b848b2275f186 1KB
372f92dd90c5540d78034a7db3e36ea11fefca 906B
37e4391d12f934c03acea15fa194a1fdabe3f8 2KB
38262230ed3d167b85654d6fbde7020e205048 2KB
389fcd06b6a05835f81f338053841aa6a87acc 1KB
3a358ee8148859987133f59d7714b78bc6c16a 2KB
3b13aaefcba3ec3c69701f75f3ea591f2acb71 2KB
3b2daea152021f662054818c650c0828261826 2KB
3c9edd635e3e8ab4e7eb1c9898c3937702b98e 101B
3dd54eba6f0bcf7cd92a091278f09274131ad3 2KB
3f28972bef7303e6806c9d6e6031bef525a360 3KB
402d19080d838a1eb900b3fed67572219849c9 7KB
4576b9eed582bb7afd2e801943f34ce2c27e32 914B
466ec0baada57ac60cf68d92574ca9c167cadb 1KB
48adeb0eaaf5d5861261bf21c4048642b654a5 5KB
492c1cf510271c1a0bd66755fcdc637907cc48 3KB
4a176df055c159eacf5e86f77eae2f68acd233 374B
4a7b6171b271f48d47db227a7c49b2fa7a0614 1KB
4accc0e78e30add4b0bee81fd3a80bd5eb4696 1KB
4d51737c0d4610fcee38d30b0fe066f353a9f3 1KB
4da52a3e9557e7738198d23a8b6f60cd07e86b 3KB
4ee144b1ec50ff42332fd971868ae9c0af6329 170B
4f6cd92e5497801aa627a29acc34c0fdd28e8d 4KB
4fbd01e5efa3822d975a3020d2d29c7fea5801 233B
5401da055d41ca22712f70dcb0da89fc47a6ba 1KB
551902de05c126816c9c7abfd132039e70b213 2KB
56146e2e6c4cd72af052e6b1fea860e613f261 3KB
570035f91841fcdbeecc9cde04ec41236ba4db 2KB
57a13b584b1d2e9ff18cb502a520497b3eceb1 6KB
58980b21ed727be66d984d233e55cd67c57959 2KB
59439d9dc9acece6c2931f018b3e3248e2fc77 76B
5a72eddfd9bc086bcb96dd8ff5e8fc524d7710 1KB
5aef515c2a63281f7ceacb8e3a44d8720c6e97 931B
5b15c8d212083ed6fd73d664d15fa2f0c7452c 3KB
5b533f2f3cadde574b7b6bd3be5111aefbd499 1KB
5d74b373b12a1f29558b61c613a2fdd95c839a 2KB
5f12c59b789710d5126de1e4ce2e74756dfe23 2KB
5f6a7561455c5af9005921e7b3768e0ee22c5c 2KB
共 613 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
fenghen777
- 粉丝: 5
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页