| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
#ifndef _zip12_H |
| 40 |
#define _zip12_H |
| 41 |
|
| 42 |
#ifdef __cplusplus |
| 43 |
extern "C" { |
| 44 |
#endif |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
#ifndef _ZLIB_H |
| 49 |
#include "zlib.h" |
| 50 |
#endif |
| 51 |
|
| 52 |
#ifndef _ZLIBIOAPI_H |
| 53 |
#include "ioapi.h" |
| 54 |
#endif |
| 55 |
|
| 56 |
#ifdef HAVE_BZIP2 |
| 57 |
#include "bzlib.h" |
| 58 |
#endif |
| 59 |
|
| 60 |
#define Z_BZIP2ED 12 |
| 61 |
|
| 62 |
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) |
| 63 |
|
| 64 |
|
| 65 |
typedef struct TagzipFile__ { int unused; } zipFile__; |
| 66 |
typedef zipFile__ *zipFile; |
| 67 |
#else |
| 68 |
typedef voidp zipFile; |
| 69 |
#endif |
| 70 |
|
| 71 |
extern const char zip_copyright[]; |
| 72 |
|
| 73 |
#define ZIP_OK (0) |
| 74 |
#define ZIP_EOF (0) |
| 75 |
#define ZIP_ERRNO (Z_ERRNO) |
| 76 |
#define ZIP_PARAMERROR (-102) |
| 77 |
#define ZIP_BADZIPFILE (-103) |
| 78 |
#define ZIP_INTERNALERROR (-104) |
| 79 |
|
| 80 |
#ifndef DEF_MEM_LEVEL |
| 81 |
# if MAX_MEM_LEVEL >= 8 |
| 82 |
# define DEF_MEM_LEVEL 8 |
| 83 |
# else |
| 84 |
# define DEF_MEM_LEVEL MAX_MEM_LEVEL |
| 85 |
# endif |
| 86 |
#endif |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
typedef struct tm_zip_s |
| 91 |
{ |
| 92 |
int tm_sec; |
| 93 |
int tm_min; |
| 94 |
int tm_hour; |
| 95 |
int tm_mday; |
| 96 |
int tm_mon; |
| 97 |
int tm_year; |
| 98 |
} tm_zip; |
| 99 |
|
| 100 |
typedef struct |
| 101 |
{ |
| 102 |
tm_zip tmz_date; |
| 103 |
uLong dosDate; |
| 104 |
|
| 105 |
|
| 106 |
uLong internal_fa; |
| 107 |
uLong external_fa; |
| 108 |
} zip_fileinfo; |
| 109 |
|
| 110 |
typedef const char* zipcharpc; |
| 111 |
|
| 112 |
|
| 113 |
#define APPEND_STATUS_CREATE (0) |
| 114 |
#define APPEND_STATUS_CREATEAFTER (1) |
| 115 |
#define APPEND_STATUS_ADDINZIP (2) |
| 116 |
|
| 117 |
extern zipFile ZEXPORT zipOpen(const char *pathname, int append); |
| 118 |
extern zipFile ZEXPORT zipOpen64(const void *pathname, int append); |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
extern zipFile ZEXPORT zipOpen2(const char *pathname, |
| 139 |
int append, |
| 140 |
zipcharpc* globalcomment, |
| 141 |
zlib_filefunc_def* pzlib_filefunc_def); |
| 142 |
|
| 143 |
extern zipFile ZEXPORT zipOpen2_64(const void *pathname, |
| 144 |
int append, |
| 145 |
zipcharpc* globalcomment, |
| 146 |
zlib_filefunc64_def* pzlib_filefunc_def); |
| 147 |
|
| 148 |
extern zipFile ZEXPORT zipOpen3(const void *pathname, |
| 149 |
int append, |
| 150 |
zipcharpc* globalcomment, |
| 151 |
zlib_filefunc64_32_def* pzlib_filefunc64_32_def); |
| 152 |
|
| 153 |
extern int ZEXPORT zipOpenNewFileInZip(zipFile file, |
| 154 |
const char* filename, |
| 155 |
const zip_fileinfo* zipfi, |
| 156 |
const void* extrafield_local, |
| 157 |
uInt size_extrafield_local, |
| 158 |
const void* extrafield_global, |
| 159 |
uInt size_extrafield_global, |
| 160 |
const char* comment, |
| 161 |
int method, |
| 162 |
int level); |
| 163 |
|
| 164 |
extern int ZEXPORT zipOpenNewFileInZip64(zipFile file, |
| 165 |
const char* filename, |
| 166 |
const zip_fileinfo* zipfi, |
| 167 |
const void* extrafield_local, |
| 168 |
uInt size_extrafield_local, |
| 169 |
const void* extrafield_global, |
| 170 |
uInt size_extrafield_global, |
| 171 |
const char* comment, |
| 172 |
int method, |
| 173 |
int level, |
| 174 |
int zip64); |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, |
| 194 |
const char* filename, |
| 195 |
const zip_fileinfo* zipfi, |
| 196 |
const void* extrafield_local, |
| 197 |
uInt size_extrafield_local, |
| 198 |
const void* extrafield_global, |
| 199 |
uInt size_extrafield_global, |
| 200 |
const char* comment, |
| 201 |
int method, |
| 202 |
int level, |
| 203 |
int raw); |
| 204 |
|
| 205 |
|
| 206 |
extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, |
| 207 |
const char* filename, |
| 208 |
const zip_fileinfo* zipfi, |
| 209 |
const void* extrafield_local, |
| 210 |
uInt size_extrafield_local, |
| 211 |
const void* extrafield_global, |
| 212 |
uInt size_extrafield_global, |
| 213 |
const char* comment, |
| 214 |
int method, |
| 215 |
int level, |
| 216 |
int raw, |
| 217 |
int zip64); |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, |
| 223 |
const char* filename, |
| 224 |
const zip_fileinfo* zipfi, |
| 225 |
const void* extrafield_local, |
| 226 |
uInt size_extrafield_local, |
| 227 |
const void* extrafield_global, |
| 228 |
uInt size_extrafield_global, |
| 229 |
const char* comment, |
| 230 |
int method, |
| 231 |
int level, |
| 232 |
int raw, |
| 233 |
int windowBits, |
| 234 |
int memLevel, |
| 235 |
int strategy, |
| 236 |
const char* password, |
| 237 |
uLong crcForCrypting); |
| 238 |
|
| 239 |
extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, |
| 240 |
const char* filename, |
| 241 |
const zip_fileinfo* zipfi, |
| 242 |
const void* extrafield_local, |
| 243 |
uInt size_extrafield_local, |
| 244 |
const void* extrafield_global, |
| 245 |
uInt size_extrafield_global, |
| 246 |
const char* comment, |
| 247 |
int method, |
| 248 |
int level, |
| 249 |
int raw, |
| 250 |
int windowBits, |
| 251 |
int memLevel, |
| 252 |
int strategy, |
| 253 |
const char* password, |
| 254 |
uLong crcForCrypting, |
| 255 |
int zip64); |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, |
| 265 |
const char* filename, |
| 266 |
const zip_fileinfo* zipfi, |
| 267 |
const void* extrafield_local, |
| 268 |
uInt size_extrafield_local, |
| 269 |
const void* extrafield_global, |
| 270 |
uInt size_extrafield_global, |
| 271 |
const char* comment, |
| 272 |
int method, |
| 273 |
int level, |
| 274 |
int raw, |
| 275 |
int windowBits, |
| 276 |
int memLevel, |
| 277 |
int strategy, |
| 278 |
const char* password, |
| 279 |
uLong crcForCrypting, |
| 280 |
uLong versionMadeBy, |
| 281 |
uLong flagBase); |
| 282 |
|
| 283 |
|
| 284 |
extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, |
| 285 |
const char* filename, |
| 286 |
const zip_fileinfo* zipfi, |
| 287 |
const void* extrafield_local, |
| 288 |
uInt size_extrafield_local, |
| 289 |
const void* extrafield_global, |
| 290 |
uInt size_extrafield_global, |
| 291 |
const char* comment, |
| 292 |
int method, |
| 293 |
int level, |
| 294 |
int raw, |
| 295 |
int windowBits, |
| 296 |
int memLevel, |
| 297 |
int strategy, |
| 298 |
const char* password, |
| 299 |
uLong crcForCrypting, |
| 300 |
uLong versionMadeBy, |
| 301 |
uLong flagBase, |
| 302 |
int zip64); |
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
extern int ZEXPORT zipWriteInFileInZip(zipFile file, |
| 311 |
const void* buf, |
| 312 |
unsigned len); |
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
extern int ZEXPORT zipCloseFileInZip(zipFile file); |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
extern int ZEXPORT zipCloseFileInZipRaw(zipFile file, |
| 323 |
uLong uncompressed_size, |
| 324 |
uLong crc32); |
| 325 |
|
| 326 |
extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, |
| 327 |
ZPOS64_T uncompressed_size, |
| 328 |
uLong crc32); |
| 329 |
|
| 330 |
extern int ZEXPORT zipAlreadyThere(zipFile file, |
| 331 |
char const* name); |
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
extern int ZEXPORT zipClose(zipFile file, |
| 343 |
const char* global_comment); |
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader); |
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
#ifdef __cplusplus |
| 368 |
} |
| 369 |
#endif |
| 370 |
|
| 371 |
#endif |