#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <time.h>
#include "zlib.h"
#include "zip.h"
#ifdef STDC
# include <stddef.h>
#endif
#ifdef NO_ERRNO_H
extern int errno;
#else
# include <errno.h>
#endif
#ifndef local
#define local …
#endif
#ifndef VERSIONMADEBY
#define VERSIONMADEBY …
#endif
#ifndef Z_BUFSIZE
#define Z_BUFSIZE …
#endif
#ifndef Z_MAXFILENAMEINZIP
#define Z_MAXFILENAMEINZIP …
#endif
#ifndef ALLOC
#define ALLOC(size) …
#endif
#define MAKEULONG64(a, b) …
#ifndef SEEK_CUR
#define SEEK_CUR …
#endif
#ifndef SEEK_END
#define SEEK_END …
#endif
#ifndef SEEK_SET
#define SEEK_SET …
#endif
#ifndef DEF_MEM_LEVEL
#if MAX_MEM_LEVEL >= 8
#define DEF_MEM_LEVEL …
#else
#define DEF_MEM_LEVEL …
#endif
#endif
const char zip_copyright[] = …;
#define SIZEDATA_INDATABLOCK …
#define LOCALHEADERMAGIC …
#define CENTRALHEADERMAGIC …
#define ENDHEADERMAGIC …
#define ZIP64ENDHEADERMAGIC …
#define ZIP64ENDLOCHEADERMAGIC …
#define FLAG_LOCALHEADER_OFFSET …
#define CRC_LOCALHEADER_OFFSET …
#define SIZECENTRALHEADER …
linkedlist_datablock_internal;
linkedlist_data;
curfile64_info;
zip64_internal;
#ifndef NOCRYPT
#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#include "crypt.h"
#endif
local linkedlist_datablock_internal* allocate_new_datablock(void) { … }
local void free_datablock(linkedlist_datablock_internal* ldi) { … }
local void init_linkedlist(linkedlist_data* ll) { … }
local void free_linkedlist(linkedlist_data* ll) { … }
local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) { … }
#ifndef NO_ADDFILEINEXISTINGZIP
local int zip64local_putValue(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) { … }
local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) { … }
local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) { … }
local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int* pi) { … }
local int zip64local_getShort(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { … }
local int zip64local_getLong(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { … }
local int zip64local_getLong64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) { … }
#ifndef BUFREADCOMMENT
#define BUFREADCOMMENT …
#endif
local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) { … }
local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) { … }
local int LoadCentralDirectoryRecord(zip64_internal* pziinit) { … }
#endif
extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) { … }
extern zipFile ZEXPORT zipOpen2(const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) { … }
extern zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) { … }
extern zipFile ZEXPORT zipOpen(const char* pathname, int append) { … }
extern zipFile ZEXPORT zipOpen64(const void* pathname, int append) { … }
local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
extern 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) { … }
local int zip64FlushWriteBuffer(zip64_internal* zi) { … }
extern int ZEXPORT zipWriteInFileInZip(zipFile file, const void* buf, unsigned int len) { … }
extern int ZEXPORT zipCloseFileInZipRaw(zipFile file, uLong uncompressed_size, uLong crc32) { … }
extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_size, uLong crc32) { … }
extern int ZEXPORT zipCloseFileInZip(zipFile file) { … }
local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) { … }
local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { … }
local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { … }
local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) { … }
extern int ZEXPORT zipClose(zipFile file, const char* global_comment) { … }
extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader) { … }