![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <zlib.h>
#include "zip.h"
#include <errno.h>
#include "crypt.h"
Go to the source code of this file.
Classes | |
struct | linkedlist_datablock_internal_s |
struct | linkedlist_data_s |
struct | curfile64_info |
struct | zip64_internal |
Macros | |
#define | local static |
#define | VERSIONMADEBY (0x0) /* platform depedent */ |
#define | Z_BUFSIZE (64*1024) |
#define | Z_MAXFILENAMEINZIP (256) |
#define | ALLOC(size) (malloc(size)) |
#define | TRYFREE(p) {if (p) free(p);} |
#define | MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32)) |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | SEEK_SET 0 |
#define | SIZEDATA_INDATABLOCK (4096-(4*4)) |
#define | LOCALHEADERMAGIC (0x04034b50) |
#define | CENTRALHEADERMAGIC (0x02014b50) |
#define | ENDHEADERMAGIC (0x06054b50) |
#define | ZIP64ENDHEADERMAGIC (0x6064b50) |
#define | ZIP64ENDLOCHEADERMAGIC (0x7064b50) |
#define | FLAG_LOCALHEADER_OFFSET (0x06) |
#define | CRC_LOCALHEADER_OFFSET (0x0e) |
#define | SIZECENTRALHEADER (0x2e) /* 46 */ |
#define | INCLUDECRYPTINGCODE_IFCRYPTALLOWED |
#define | BUFREADCOMMENT (0x400) |
Typedefs | |
typedef struct linkedlist_datablock_internal_s | linkedlist_datablock_internal |
typedef struct linkedlist_data_s | linkedlist_data |
Functions | |
static linkedlist_datablock_internal * | allocate_new_datablock () |
static void | free_datablock (linkedlist_datablock_internal *ldi) |
static void | init_linkedlist (linkedlist_data *ll) |
static void | free_linkedlist (linkedlist_data *ll) |
static int | add_data_in_datablock (linkedlist_data *ll, const void *buf, uLong len) |
static int zip64local_putValue | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)) |
static int | zip64local_putValue (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) |
static void zip64local_putValue_inmemory | OF ((void *dest, ZPOS64_T x, int nbByte)) |
static void | zip64local_putValue_inmemory (void *dest, ZPOS64_T x, int nbByte) |
static uLong | zip64local_TmzDateToDosDate (const tm_zip *ptm) |
static int zip64local_getByte | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)) |
static int | zip64local_getByte (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi) |
static int zip64local_getShort | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)) |
static int | zip64local_getShort (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX) |
static int | zip64local_getLong (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX) |
static int zip64local_getLong64 | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)) |
static int | zip64local_getLong64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) |
static ZPOS64_T zip64local_SearchCentralDir | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)) |
static ZPOS64_T | zip64local_SearchCentralDir (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream) |
static ZPOS64_T | zip64local_SearchCentralDir64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream) |
int | LoadCentralDirectoryRecord (zip64_internal *pziinit) |
zipFile ZEXPORT | zipOpen3 (const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_32_def *pzlib_filefunc64_32_def) |
zipFile ZEXPORT | zipOpen2 (const char *pathname, int append, zipcharpc *globalcomment, zlib_filefunc_def *pzlib_filefunc32_def) |
zipFile ZEXPORT | zipOpen2_64 (const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_def *pzlib_filefunc_def) |
zipFile ZEXPORT | zipOpen (const char *pathname, int append) |
zipFile ZEXPORT | zipOpen64 (const void *pathname, int append) |
int | Write_LocalFileHeader (zip64_internal *zi, const char *filename, uInt size_extrafield_local, const void *extrafield_local) |
int ZEXPORT | zipOpenNewFileInZip4_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64) |
int ZEXPORT | zipOpenNewFileInZip4 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase) |
int ZEXPORT | zipOpenNewFileInZip3 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting) |
int ZEXPORT | zipOpenNewFileInZip3_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, int zip64) |
int ZEXPORT | zipOpenNewFileInZip2 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw) |
int ZEXPORT | zipOpenNewFileInZip2_64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int zip64) |
int ZEXPORT | zipOpenNewFileInZip64 (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int zip64) |
int ZEXPORT | zipOpenNewFileInZip (zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level) |
static int | zip64FlushWriteBuffer (zip64_internal *zi) |
int ZEXPORT | zipWriteInFileInZip (zipFile file, const void *buf, unsigned int len) |
int ZEXPORT | zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) |
int ZEXPORT | zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) |
int ZEXPORT | zipCloseFileInZip (zipFile file) |
int | Write_Zip64EndOfCentralDirectoryLocator (zip64_internal *zi, ZPOS64_T zip64eocd_pos_inzip) |
int | Write_Zip64EndOfCentralDirectoryRecord (zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) |
int | Write_EndOfCentralDirectoryRecord (zip64_internal *zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) |
int | Write_GlobalComment (zip64_internal *zi, const char *global_comment) |
int ZEXPORT | zipClose (zipFile file, const char *global_comment) |
int ZEXPORT | zipRemoveExtraInfoBlock (char *pData, int *dataLen, short sHeader) |
Variables | |
const char | zip_copyright [] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll" |
typedef struct linkedlist_data_s linkedlist_data |
typedef struct linkedlist_datablock_internal_s linkedlist_datablock_internal |
|
static |
|
static |
|
static |
|
static |
|
static |
int LoadCentralDirectoryRecord | ( | zip64_internal * | pziinit | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int Write_EndOfCentralDirectoryRecord | ( | zip64_internal * | zi, |
uLong | size_centraldir, | ||
ZPOS64_T | centraldir_pos_inzip | ||
) |
int Write_GlobalComment | ( | zip64_internal * | zi, |
const char * | global_comment | ||
) |
int Write_LocalFileHeader | ( | zip64_internal * | zi, |
const char * | filename, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_local | ||
) |
int Write_Zip64EndOfCentralDirectoryLocator | ( | zip64_internal * | zi, |
ZPOS64_T | zip64eocd_pos_inzip | ||
) |
int Write_Zip64EndOfCentralDirectoryRecord | ( | zip64_internal * | zi, |
uLong | size_centraldir, | ||
ZPOS64_T | centraldir_pos_inzip | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int ZEXPORT zipClose | ( | zipFile | file, |
const char * | global_comment | ||
) |
int ZEXPORT zipCloseFileInZipRaw | ( | zipFile | file, |
uLong | uncompressed_size, | ||
uLong | crc32 | ||
) |
zipFile ZEXPORT zipOpen2 | ( | const char * | pathname, |
int | append, | ||
zipcharpc * | globalcomment, | ||
zlib_filefunc_def * | pzlib_filefunc32_def | ||
) |
zipFile ZEXPORT zipOpen2_64 | ( | const void * | pathname, |
int | append, | ||
zipcharpc * | globalcomment, | ||
zlib_filefunc64_def * | pzlib_filefunc_def | ||
) |
zipFile ZEXPORT zipOpen3 | ( | const void * | pathname, |
int | append, | ||
zipcharpc * | globalcomment, | ||
zlib_filefunc64_32_def * | pzlib_filefunc64_32_def | ||
) |
zipFile ZEXPORT zipOpen64 | ( | const void * | pathname, |
int | append | ||
) |
int ZEXPORT zipOpenNewFileInZip | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level | ||
) |
int ZEXPORT zipOpenNewFileInZip2 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw | ||
) |
int ZEXPORT zipOpenNewFileInZip2_64 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw, | ||
int | zip64 | ||
) |
int ZEXPORT zipOpenNewFileInZip3 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw, | ||
int | windowBits, | ||
int | memLevel, | ||
int | strategy, | ||
const char * | password, | ||
uLong | crcForCrypting | ||
) |
int ZEXPORT zipOpenNewFileInZip3_64 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw, | ||
int | windowBits, | ||
int | memLevel, | ||
int | strategy, | ||
const char * | password, | ||
uLong | crcForCrypting, | ||
int | zip64 | ||
) |
int ZEXPORT zipOpenNewFileInZip4 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw, | ||
int | windowBits, | ||
int | memLevel, | ||
int | strategy, | ||
const char * | password, | ||
uLong | crcForCrypting, | ||
uLong | versionMadeBy, | ||
uLong | flagBase | ||
) |
int ZEXPORT zipOpenNewFileInZip4_64 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | raw, | ||
int | windowBits, | ||
int | memLevel, | ||
int | strategy, | ||
const char * | password, | ||
uLong | crcForCrypting, | ||
uLong | versionMadeBy, | ||
uLong | flagBase, | ||
int | zip64 | ||
) |
int ZEXPORT zipOpenNewFileInZip64 | ( | zipFile | file, |
const char * | filename, | ||
const zip_fileinfo * | zipfi, | ||
const void * | extrafield_local, | ||
uInt | size_extrafield_local, | ||
const void * | extrafield_global, | ||
uInt | size_extrafield_global, | ||
const char * | comment, | ||
int | method, | ||
int | level, | ||
int | zip64 | ||
) |
int ZEXPORT zipRemoveExtraInfoBlock | ( | char * | pData, |
int * | dataLen, | ||
short | sHeader | ||
) |
int ZEXPORT zipWriteInFileInZip | ( | zipFile | file, |
const void * | buf, | ||
unsigned int | len | ||
) |