Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 1 | #ifndef _HAD_ZIP_H |
| 2 | #define _HAD_ZIP_H |
| 3 | |
Dieter Baron | bbb6369 | 1999-07-26 22:04:20 +0000 | [diff] [blame] | 4 | /* |
| 5 | zip.h -- exported declarations. |
Dieter Baron | 63e12d1 | 2009-01-25 23:26:36 +0100 | [diff] [blame] | 6 | Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner |
Dieter Baron | bbb6369 | 1999-07-26 22:04:20 +0000 | [diff] [blame] | 7 | |
Dieter Baron | dd9afca | 2003-10-02 14:13:37 +0000 | [diff] [blame] | 8 | This file is part of libzip, a library to manipulate ZIP archives. |
Dieter Baron | b86c433 | 2007-11-07 14:35:13 +0100 | [diff] [blame] | 9 | The authors can be contacted at <libzip@nih.at> |
Dieter Baron | bbb6369 | 1999-07-26 22:04:20 +0000 | [diff] [blame] | 10 | |
Dieter Baron | dd9afca | 2003-10-02 14:13:37 +0000 | [diff] [blame] | 11 | Redistribution and use in source and binary forms, with or without |
| 12 | modification, are permitted provided that the following conditions |
| 13 | are met: |
| 14 | 1. Redistributions of source code must retain the above copyright |
| 15 | notice, this list of conditions and the following disclaimer. |
| 16 | 2. Redistributions in binary form must reproduce the above copyright |
| 17 | notice, this list of conditions and the following disclaimer in |
| 18 | the documentation and/or other materials provided with the |
| 19 | distribution. |
| 20 | 3. The names of the authors may not be used to endorse or promote |
| 21 | products derived from this software without specific prior |
| 22 | written permission. |
| 23 | |
| 24 | THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS |
| 25 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 27 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 30 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 32 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 33 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 34 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Dieter Baron | bbb6369 | 1999-07-26 22:04:20 +0000 | [diff] [blame] | 35 | */ |
| 36 | |
| 37 | |
| 38 | |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 39 | #ifndef ZIP_EXTERN |
| 40 | #ifdef _MSC_VER |
| 41 | #define ZIP_EXTERN __declspec(dllexport) |
| 42 | #else |
| 43 | #define ZIP_EXTERN |
| 44 | #endif |
| 45 | #endif |
| 46 | |
Dieter Baron | 08f2851 | 2005-07-14 14:08:11 +0000 | [diff] [blame] | 47 | #ifdef __cplusplus |
| 48 | extern "C" { |
| 49 | #endif |
| 50 | |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 51 | #include <zipconf.h> |
| 52 | |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 53 | #include <sys/types.h> |
| 54 | #include <stdio.h> |
Thomas Klausner | 01b2a3c | 1999-07-27 20:35:58 +0000 | [diff] [blame] | 55 | #include <time.h> |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 56 | |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 57 | /* flags for zip_open */ |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 58 | |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 59 | #define ZIP_CREATE 1 |
| 60 | #define ZIP_EXCL 2 |
| 61 | #define ZIP_CHECKCONS 4 |
| 62 | |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 63 | |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 64 | /* flags for zip_name_locate, zip_fopen, zip_stat, ... */ |
| 65 | |
| 66 | #define ZIP_FL_NOCASE 1 /* ignore case on name lookup */ |
| 67 | #define ZIP_FL_NODIR 2 /* ignore directory component */ |
Thomas Klausner | d0147e9 | 2004-11-17 21:55:17 +0000 | [diff] [blame] | 68 | #define ZIP_FL_COMPRESSED 4 /* read compressed data */ |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 69 | #define ZIP_FL_UNCHANGED 8 /* use original data, ignoring changes */ |
Dieter Baron | 28ee020 | 2008-05-30 12:58:53 +0200 | [diff] [blame] | 70 | #define ZIP_FL_RECOMPRESS 16 /* force recompression of data */ |
Dieter Baron | ae53a57 | 2009-01-26 23:03:31 +0100 | [diff] [blame] | 71 | #define ZIP_FL_ENCRYPTED 32 /* read encrypted data |
| 72 | (implies ZIP_FL_COMPRESSED) */ |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 73 | |
Dieter Baron | 416df86 | 2008-05-14 14:56:13 +0200 | [diff] [blame] | 74 | /* archive global flags flags */ |
| 75 | |
| 76 | #define ZIP_AFL_TORRENT 1 /* torrent zipped */ |
Dieter Baron | ae53a57 | 2009-01-26 23:03:31 +0100 | [diff] [blame] | 77 | #define ZIP_AFL_RDONLY 2 /* read only -- cannot be cleared */ |
Dieter Baron | 416df86 | 2008-05-14 14:56:13 +0200 | [diff] [blame] | 78 | |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 79 | |
| 80 | /* flags for compression and encryption sources */ |
| 81 | |
| 82 | #define ZIP_CODEC_ENCODE 1 /* compress/encrypt */ |
| 83 | |
| 84 | |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 85 | /* libzip error codes */ |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 86 | |
Thomas Klausner | d0147e9 | 2004-11-17 21:55:17 +0000 | [diff] [blame] | 87 | #define ZIP_ER_OK 0 /* N No error */ |
| 88 | #define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */ |
| 89 | #define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */ |
| 90 | #define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */ |
| 91 | #define ZIP_ER_SEEK 4 /* S Seek error */ |
| 92 | #define ZIP_ER_READ 5 /* S Read error */ |
| 93 | #define ZIP_ER_WRITE 6 /* S Write error */ |
| 94 | #define ZIP_ER_CRC 7 /* N CRC error */ |
| 95 | #define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */ |
| 96 | #define ZIP_ER_NOENT 9 /* N No such file */ |
| 97 | #define ZIP_ER_EXISTS 10 /* N File already exists */ |
| 98 | #define ZIP_ER_OPEN 11 /* S Can't open file */ |
| 99 | #define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */ |
| 100 | #define ZIP_ER_ZLIB 13 /* Z Zlib error */ |
| 101 | #define ZIP_ER_MEMORY 14 /* N Malloc failure */ |
| 102 | #define ZIP_ER_CHANGED 15 /* N Entry has been changed */ |
| 103 | #define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */ |
| 104 | #define ZIP_ER_EOF 17 /* N Premature EOF */ |
| 105 | #define ZIP_ER_INVAL 18 /* N Invalid argument */ |
| 106 | #define ZIP_ER_NOZIP 19 /* N Not a zip archive */ |
| 107 | #define ZIP_ER_INTERNAL 20 /* N Internal error */ |
| 108 | #define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */ |
| 109 | #define ZIP_ER_REMOVE 22 /* S Can't remove file */ |
Dieter Baron | ca7d39a | 2005-01-20 21:00:29 +0000 | [diff] [blame] | 110 | #define ZIP_ER_DELETED 23 /* N Entry has been deleted */ |
Dieter Baron | 63e12d1 | 2009-01-25 23:26:36 +0100 | [diff] [blame] | 111 | #define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ |
Dieter Baron | ae53a57 | 2009-01-26 23:03:31 +0100 | [diff] [blame] | 112 | #define ZIP_ER_RDONLY 25 /* N Read-only archive */ |
| 113 | #define ZIP_ER_NOPASSWD 26 /* N No password provided */ |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 114 | #define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 115 | |
| 116 | /* type of system error value */ |
| 117 | |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 118 | #define ZIP_ET_NONE 0 /* sys_err unused */ |
| 119 | #define ZIP_ET_SYS 1 /* sys_err is errno */ |
Thomas Klausner | d0147e9 | 2004-11-17 21:55:17 +0000 | [diff] [blame] | 120 | #define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 121 | |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 122 | /* compression methods */ |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 123 | |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 124 | #define ZIP_CM_DEFAULT -1 /* better of deflate or store */ |
| 125 | #define ZIP_CM_STORE 0 /* stored (uncompressed) */ |
| 126 | #define ZIP_CM_SHRINK 1 /* shrunk */ |
| 127 | #define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */ |
| 128 | #define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */ |
| 129 | #define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */ |
| 130 | #define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */ |
| 131 | #define ZIP_CM_IMPLODE 6 /* imploded */ |
Thomas Klausner | e21b065 | 2004-11-17 21:59:00 +0000 | [diff] [blame] | 132 | /* 7 - Reserved for Tokenizing compression algorithm */ |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 133 | #define ZIP_CM_DEFLATE 8 /* deflated */ |
| 134 | #define ZIP_CM_DEFLATE64 9 /* deflate64 */ |
| 135 | #define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */ |
Thomas Klausner | c3ed804 | 2005-09-06 23:44:25 +0000 | [diff] [blame] | 136 | /* 11 - Reserved by PKWARE */ |
| 137 | #define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */ |
Dieter Baron | 62e54ee | 2007-11-08 16:00:25 +0100 | [diff] [blame] | 138 | /* 13 - Reserved by PKWARE */ |
| 139 | #define ZIP_CM_LZMA 14 /* LZMA (EFS) */ |
| 140 | /* 15-17 - Reserved by PKWARE */ |
| 141 | #define ZIP_CM_TERSE 18 /* compressed using IBM TERSE (new) */ |
| 142 | #define ZIP_CM_LZ77 19 /* IBM LZ77 z Architecture (PFS) */ |
| 143 | #define ZIP_CM_WAVPACK 97 /* WavPack compressed data */ |
| 144 | #define ZIP_CM_PPMD 98 /* PPMd version I, Rev 1 */ |
Thomas Klausner | 42dd7b7 | 1999-07-25 20:32:18 +0000 | [diff] [blame] | 145 | |
Dieter Baron | 45b1075 | 2006-04-24 14:04:19 +0000 | [diff] [blame] | 146 | /* encryption methods */ |
| 147 | |
| 148 | #define ZIP_EM_NONE 0 /* not encrypted */ |
| 149 | #define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */ |
| 150 | #if 0 /* Strong Encryption Header not parsed yet */ |
| 151 | #define ZIP_EM_DES 0x6601 /* strong encryption: DES */ |
| 152 | #define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */ |
| 153 | #define ZIP_EM_3DES_168 0x6603 |
| 154 | #define ZIP_EM_3DES_112 0x6609 |
| 155 | #define ZIP_EM_AES_128 0x660e |
| 156 | #define ZIP_EM_AES_192 0x660f |
| 157 | #define ZIP_EM_AES_256 0x6610 |
| 158 | #define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */ |
| 159 | #define ZIP_EM_RC4 0x6801 |
| 160 | #endif |
| 161 | #define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */ |
| 162 | |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 163 | |
| 164 | |
Dieter Baron | 35bf0fd | 2004-12-22 16:32:01 +0000 | [diff] [blame] | 165 | enum zip_source_cmd { |
| 166 | ZIP_SOURCE_OPEN, /* prepare for reading */ |
| 167 | ZIP_SOURCE_READ, /* read data */ |
| 168 | ZIP_SOURCE_CLOSE, /* reading is done */ |
| 169 | ZIP_SOURCE_STAT, /* get meta information */ |
| 170 | ZIP_SOURCE_ERROR, /* get error information */ |
| 171 | ZIP_SOURCE_FREE /* cleanup and free resources */ |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 172 | }; |
| 173 | |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 174 | struct zip_stat { |
| 175 | const char *name; /* name of the file */ |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 176 | zip_uint64_t index; /* index within archive */ |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 177 | zip_uint32_t crc; /* crc of file data */ |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 178 | time_t mtime; /* modification time */ |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 179 | zip_uint64_t size; /* size of file (uncompressed) */ |
| 180 | zip_uint64_t comp_size; /* size of file (compressed) */ |
| 181 | zip_uint16_t comp_method; /* compression method used */ |
| 182 | zip_uint16_t encryption_method; /* encryption method used */ |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 183 | }; |
| 184 | |
| 185 | struct zip; |
| 186 | struct zip_file; |
Thomas Klausner | ef9a02f | 2004-11-18 15:06:20 +0000 | [diff] [blame] | 187 | struct zip_source; |
Dieter Baron | e3f91ef | 2003-10-06 02:50:14 +0000 | [diff] [blame] | 188 | |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 189 | typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, |
| 190 | enum zip_source_cmd); |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 191 | typedef struct zip_source *(*zip_compression_implementation)(struct zip *, |
| 192 | struct zip_source *, |
| 193 | zip_uint16_t, int); |
| 194 | typedef struct zip_source *(*zip_encryption_implementation)(struct zip *, |
| 195 | struct zip_source *, |
| 196 | zip_uint16_t, int, |
| 197 | const char *); |
| 198 | |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 199 | |
| 200 | |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 201 | ZIP_EXTERN zip_int64_t zip_add(struct zip *, const char *, struct zip_source *); |
| 202 | ZIP_EXTERN zip_int64_t zip_add_dir(struct zip *, const char *); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 203 | ZIP_EXTERN int zip_close(struct zip *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 204 | ZIP_EXTERN int zip_delete(struct zip *, zip_uint64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 205 | ZIP_EXTERN void zip_error_clear(struct zip *); |
| 206 | ZIP_EXTERN void zip_error_get(struct zip *, int *, int *); |
| 207 | ZIP_EXTERN int zip_error_get_sys_type(int); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 208 | ZIP_EXTERN int zip_error_to_str(char *, zip_uint64_t, int, int); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 209 | ZIP_EXTERN int zip_fclose(struct zip_file *); |
Dieter Baron | ae53a57 | 2009-01-26 23:03:31 +0100 | [diff] [blame] | 210 | ZIP_EXTERN struct zip *zip_fdopen(int, int, int *); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 211 | ZIP_EXTERN void zip_file_error_clear(struct zip_file *); |
| 212 | ZIP_EXTERN void zip_file_error_get(struct zip_file *, int *, int *); |
| 213 | ZIP_EXTERN const char *zip_file_strerror(struct zip_file *); |
| 214 | ZIP_EXTERN struct zip_file *zip_fopen(struct zip *, const char *, int); |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 215 | ZIP_EXTERN struct zip_file *zip_fopen_encrypted(struct zip *, const char *, |
| 216 | int, const char *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 217 | ZIP_EXTERN struct zip_file *zip_fopen_index(struct zip *, zip_uint64_t, int); |
| 218 | ZIP_EXTERN struct zip_file *zip_fopen_index_encrypted(struct zip *, |
| 219 | zip_uint64_t, int, |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 220 | const char *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 221 | ZIP_EXTERN zip_int64_t zip_fread(struct zip_file *, void *, zip_uint64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 222 | ZIP_EXTERN const char *zip_get_archive_comment(struct zip *, int *, int); |
Dieter Baron | 416df86 | 2008-05-14 14:56:13 +0200 | [diff] [blame] | 223 | ZIP_EXTERN int zip_get_archive_flag(struct zip *, int, int); |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 224 | ZIP_EXTERN zip_compression_implementation zip_get_compression_implementation( |
| 225 | zip_uint16_t); |
| 226 | ZIP_EXTERN zip_encryption_implementation zip_get_encryption_implementation( |
| 227 | zip_uint16_t); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 228 | ZIP_EXTERN const char *zip_get_file_comment(struct zip *, zip_uint64_t, |
| 229 | int *, int); |
| 230 | ZIP_EXTERN const char *zip_get_name(struct zip *, zip_uint64_t, int); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 231 | ZIP_EXTERN int zip_get_num_files(struct zip *); |
| 232 | ZIP_EXTERN int zip_name_locate(struct zip *, const char *, int); |
| 233 | ZIP_EXTERN struct zip *zip_open(const char *, int, int *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 234 | ZIP_EXTERN int zip_rename(struct zip *, zip_uint64_t, const char *); |
| 235 | ZIP_EXTERN int zip_replace(struct zip *, zip_uint64_t, struct zip_source *); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 236 | ZIP_EXTERN int zip_set_archive_comment(struct zip *, const char *, int); |
Dieter Baron | 416df86 | 2008-05-14 14:56:13 +0200 | [diff] [blame] | 237 | ZIP_EXTERN int zip_set_archive_flag(struct zip *, int, int); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 238 | ZIP_EXTERN int zip_set_file_comment(struct zip *, zip_uint64_t, |
| 239 | const char *, int); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 240 | ZIP_EXTERN struct zip_source *zip_source_buffer(struct zip *, const void *, |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 241 | zip_uint64_t, int); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 242 | ZIP_EXTERN zip_int64_t zip_source_call(struct zip_source *, void *, |
| 243 | zip_uint64_t, enum zip_source_cmd); |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 244 | ZIP_EXTERN struct zip_source *zip_source_deflate(struct zip *, |
| 245 | struct zip_source *, |
| 246 | zip_uint16_t, int); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 247 | ZIP_EXTERN struct zip_source *zip_source_file(struct zip *, const char *, |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 248 | zip_uint64_t, zip_int64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 249 | ZIP_EXTERN struct zip_source *zip_source_filep(struct zip *, FILE *, |
Dieter Baron | c65abed | 2008-08-01 17:04:17 +0200 | [diff] [blame] | 250 | zip_uint64_t, zip_int64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 251 | ZIP_EXTERN void zip_source_free(struct zip_source *); |
| 252 | ZIP_EXTERN struct zip_source *zip_source_function(struct zip *, |
| 253 | zip_source_callback, void *); |
Dieter Baron | 2f3f11c | 2009-02-14 18:58:01 +0100 | [diff] [blame] | 254 | ZIP_EXTERN struct zip_source *zip_source_pkware(struct zip *, |
| 255 | struct zip_source *, |
| 256 | zip_uint16_t, int, |
| 257 | const char *); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 258 | ZIP_EXTERN struct zip_source *zip_source_zip(struct zip *, struct zip *, |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 259 | zip_uint64_t, int, |
| 260 | zip_uint64_t, zip_int64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 261 | ZIP_EXTERN int zip_stat(struct zip *, const char *, int, struct zip_stat *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 262 | ZIP_EXTERN int zip_stat_index(struct zip *, zip_uint64_t, int, |
| 263 | struct zip_stat *); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 264 | ZIP_EXTERN void zip_stat_init(struct zip_stat *); |
| 265 | ZIP_EXTERN const char *zip_strerror(struct zip *); |
Dieter Baron | cb1379d | 2009-03-10 14:46:51 +0100 | [diff] [blame] | 266 | ZIP_EXTERN int zip_unchange(struct zip *, zip_uint64_t); |
Dieter Baron | 8bc1276 | 2007-08-22 13:39:13 +0200 | [diff] [blame] | 267 | ZIP_EXTERN int zip_unchange_all(struct zip *); |
| 268 | ZIP_EXTERN int zip_unchange_archive(struct zip *); |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 269 | |
Dieter Baron | 08f2851 | 2005-07-14 14:08:11 +0000 | [diff] [blame] | 270 | #ifdef __cplusplus |
| 271 | } |
| 272 | #endif |
| 273 | |
Dieter Baron | 2d6db59 | 1999-07-25 18:26:20 +0000 | [diff] [blame] | 274 | #endif /* _HAD_ZIP_H */ |