zipint.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. #ifndef _HAD_ZIPINT_H
  2. #define _HAD_ZIPINT_H
  3. /*
  4. zipint.h -- internal declarations.
  5. Copyright (C) 1999-2013 Dieter Baron and Thomas Klausner
  6. This file is part of libzip, a library to manipulate ZIP archives.
  7. The authors can be contacted at <[email protected]>
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions
  10. are met:
  11. 1. Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. 2. Redistributions in binary form must reproduce the above copyright
  14. notice, this list of conditions and the following disclaimer in
  15. the documentation and/or other materials provided with the
  16. distribution.
  17. 3. The names of the authors may not be used to endorse or promote
  18. products derived from this software without specific prior
  19. written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
  21. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
  24. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  26. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  28. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  30. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. /* to have *_MAX definitions for all types when compiling with g++ */
  33. #define __STDC_LIMIT_MACROS
  34. #include <zlib.h>
  35. #ifdef _WIN32
  36. #define ZIP_EXTERN
  37. //__declspec(dllexport)
  38. /* for dup(), close(), etc. */
  39. #include <io.h>
  40. #endif
  41. #ifndef _ZIP_COMPILING_DEPRECATED
  42. #define ZIP_DISABLE_DEPRECATED
  43. #endif
  44. #include "zip.h"
  45. #include "config.h"
  46. #ifdef HAVE_MOVEFILEEXA
  47. #include <windows.h>
  48. #define _zip_rename(s, t) (!MoveFileExA((s), (t), MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING))
  49. #else
  50. #define _zip_rename rename
  51. #endif
  52. #ifdef _WIN32
  53. #if defined(HAVE__CLOSE)
  54. #define close _close
  55. #endif
  56. #if defined(HAVE__DUP)
  57. #define dup _dup
  58. #endif
  59. /* crashes reported when using fdopen instead of _fdopen on Windows/Visual Studio 10/Win64 */
  60. #if defined(HAVE__FDOPEN)
  61. #define fdopen _fdopen
  62. #endif
  63. #if defined(HAVE__FILENO)
  64. #define fileno _fileno
  65. #endif
  66. /* Windows' open() doesn't understand Unix permissions */
  67. #if defined(HAVE__OPEN)
  68. #define open(a, b, c) _open((a), (b))
  69. #endif
  70. #if defined(HAVE__SNPRINTF)
  71. #define snprintf _snprintf
  72. #endif
  73. #if defined(HAVE__STRDUP) && !defined(HAVE_STRDUP)
  74. #define strdup _strdup
  75. #endif
  76. #endif
  77. #ifndef HAVE_FSEEKO
  78. #define fseeko(s, o, w) (fseek((s), (long int)(o), (w)))
  79. #endif
  80. #ifndef HAVE_FTELLO
  81. #define ftello(s) ((long)ftell((s)))
  82. #endif
  83. #ifndef HAVE_MKSTEMP
  84. int _zip_mkstemp(char *);
  85. #define mkstemp _zip_mkstemp
  86. #endif
  87. #ifdef _WIN32
  88. #if !defined(HAVE_STRCASECMP)
  89. #if defined(HAVE__STRICMP)
  90. #define strcasecmp _stricmp
  91. #endif
  92. #endif
  93. #endif
  94. #if SIZEOF_OFF_T == 8
  95. #define ZIP_OFF_MAX ZIP_INT64_MAX
  96. #elif SIZEOF_OFF_T == 4
  97. #define ZIP_OFF_MAX ZIP_INT32_MAX
  98. #elif SIZEOF_OFF_T == 2
  99. #define ZIP_OFF_MAX ZIP_INT16_MAX
  100. #else
  101. #error unsupported size of off_t
  102. #endif
  103. #ifndef SIZE_MAX
  104. #if SIZEOF_SIZE_T == 8
  105. #define SIZE_MAX ZIP_INT64_MAX
  106. #elif SIZEOF_SIZE_T == 4
  107. #define SIZE_MAX ZIP_INT32_MAX
  108. #elif SIZEOF_SIZE_T == 2
  109. #define SIZE_MAX ZIP_INT16_MAX
  110. #else
  111. #error unsupported size of size_t
  112. #endif
  113. #endif
  114. #define CENTRAL_MAGIC "PK\1\2"
  115. #define LOCAL_MAGIC "PK\3\4"
  116. #define EOCD_MAGIC "PK\5\6"
  117. #define DATADES_MAGIC "PK\7\8"
  118. #define EOCD64LOC_MAGIC "PK\6\7"
  119. #define EOCD64_MAGIC "PK\6\6"
  120. #define TORRENT_SIG "TORRENTZIPPED-"
  121. #define TORRENT_SIG_LEN 14
  122. #define TORRENT_CRC_LEN 8
  123. #define TORRENT_MEM_LEVEL 8
  124. #define CDENTRYSIZE 46u
  125. #define LENTRYSIZE 30
  126. #define MAXCOMLEN 65536
  127. #define MAXEXTLEN 65536
  128. #define EOCDLEN 22
  129. #define EOCD64LOCLEN 20
  130. #define EOCD64LEN 56
  131. #define CDBUFSIZE (MAXCOMLEN+EOCDLEN+EOCD64LOCLEN)
  132. #define BUFSIZE 8192
  133. #define ZIP_CM_REPLACED_DEFAULT (-2)
  134. #define ZIP_CM_IS_DEFAULT(x) ((x) == ZIP_CM_DEFAULT || (x) == ZIP_CM_REPLACED_DEFAULT)
  135. #define ZIP_EF_UTF_8_COMMENT 0x6375
  136. #define ZIP_EF_UTF_8_NAME 0x7075
  137. #define ZIP_EF_ZIP64 0x0001
  138. #define ZIP_EF_IS_INTERNAL(id) ((id) == ZIP_EF_UTF_8_COMMENT || (id) == ZIP_EF_UTF_8_NAME || (id) == ZIP_EF_ZIP64)
  139. /* according to unzip-6.0's zipinfo.c, this corresponds to a regular file with rw permissions for everyone */
  140. #define ZIP_EXT_ATTRIB_DEFAULT (0100666<<16)
  141. /* according to unzip-6.0's zipinfo.c, this corresponds to a directory with rwx permissions for everyone */
  142. #define ZIP_EXT_ATTRIB_DEFAULT_DIR (0040777<<16)
  143. /* This section contains API that won't materialize like this. It's
  144. placed in the internal section, pending cleanup. */
  145. typedef struct zip_source *(*zip_compression_implementation)(struct zip *,
  146. struct zip_source *,
  147. zip_int32_t, int);
  148. typedef struct zip_source *(*zip_encryption_implementation)(struct zip *,
  149. struct zip_source *,
  150. zip_uint16_t, int,
  151. const char *);
  152. zip_compression_implementation _zip_get_compression_implementation(zip_int32_t);
  153. zip_encryption_implementation _zip_get_encryption_implementation(zip_uint16_t);
  154. /* This API is not final yet, but we need it internally, so it's private for now. */
  155. const zip_uint8_t *zip_get_extra_field_by_id(struct zip *, int, int, zip_uint16_t, int, zip_uint16_t *);
  156. /* This section contains API that is of limited use until support for
  157. user-supplied compression/encryption implementation is finished.
  158. Thus we will keep it private for now. */
  159. typedef zip_int64_t (*zip_source_layered_callback)(struct zip_source *, void *,
  160. void *, zip_uint64_t,
  161. enum zip_source_cmd);
  162. void zip_source_close(struct zip_source *);
  163. struct zip_source *zip_source_crc(struct zip *, struct zip_source *,
  164. int);
  165. struct zip_source *zip_source_deflate(struct zip *,
  166. struct zip_source *,
  167. zip_int32_t, int);
  168. void zip_source_error(struct zip_source *, int *, int *);
  169. struct zip_source *zip_source_layered(struct zip *,
  170. struct zip_source *,
  171. zip_source_layered_callback,
  172. void *);
  173. int zip_source_open(struct zip_source *);
  174. struct zip_source *zip_source_pkware(struct zip *,
  175. struct zip_source *,
  176. zip_uint16_t, int,
  177. const char *);
  178. zip_int64_t zip_source_read(struct zip_source *, void *,
  179. zip_uint64_t);
  180. int zip_source_stat(struct zip_source *, struct zip_stat *);
  181. struct zip_source *zip_source_window(struct zip *, struct zip_source *,
  182. zip_uint64_t, zip_uint64_t);
  183. /* This function will probably remain private. It is not needed to
  184. implement compression/encryption routines. (We should probably
  185. rename it to _zip_source_pop.) */
  186. struct zip_source *zip_source_pop(struct zip_source *);
  187. /* error source for layered sources */
  188. enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL };
  189. /* directory entry: general purpose bit flags */
  190. #define ZIP_GPBF_ENCRYPTED 0x0001 /* is encrypted */
  191. #define ZIP_GPBF_DATA_DESCRIPTOR 0x0008 /* crc/size after file data */
  192. #define ZIP_GPBF_STRONG_ENCRYPTION 0x0040 /* uses strong encryption */
  193. #define ZIP_GPBF_ENCODING_UTF_8 0x0800 /* file name encoding is UTF-8 */
  194. /* extra fields */
  195. #define ZIP_EF_LOCAL ZIP_FL_LOCAL /* include in local header */
  196. #define ZIP_EF_CENTRAL ZIP_FL_CENTRAL /* include in central directory */
  197. #define ZIP_EF_BOTH (ZIP_EF_LOCAL|ZIP_EF_CENTRAL) /* include in both */
  198. #define ZIP_FL_FORCE_ZIP64 1024 /* force zip64 extra field (_zip_dirent_write) */
  199. #define ZIP_FL_ENCODING_ALL (ZIP_FL_ENC_GUESS|ZIP_FL_ENC_CP437|ZIP_FL_ENC_UTF_8)
  200. /* encoding type */
  201. enum zip_encoding_type {
  202. ZIP_ENCODING_UNKNOWN, /* not yet analyzed */
  203. ZIP_ENCODING_ASCII, /* plain ASCII */
  204. ZIP_ENCODING_UTF8_KNOWN, /* is UTF-8 */
  205. ZIP_ENCODING_UTF8_GUESSED, /* possibly UTF-8 */
  206. ZIP_ENCODING_CP437, /* Code Page 437 */
  207. ZIP_ENCODING_ERROR /* should be UTF-8 but isn't */
  208. };
  209. /* error information */
  210. struct zip_error {
  211. int zip_err; /* libzip error code (ZIP_ER_*) */
  212. int sys_err; /* copy of errno (E*) or zlib error code */
  213. char *str; /* string representation or NULL */
  214. };
  215. /* zip archive, part of API */
  216. struct zip {
  217. char *zn; /* file name */
  218. FILE *zp; /* file */
  219. unsigned int open_flags; /* flags passed to zip_open */
  220. struct zip_error error; /* error information */
  221. unsigned int flags; /* archive global flags */
  222. unsigned int ch_flags; /* changed archive global flags */
  223. char *default_password; /* password used when no other supplied */
  224. struct zip_string *comment_orig; /* archive comment */
  225. struct zip_string *comment_changes; /* changed archive comment */
  226. int comment_changed; /* whether archive comment was changed */
  227. zip_uint64_t nentry; /* number of entries */
  228. zip_uint64_t nentry_alloc; /* number of entries allocated */
  229. struct zip_entry *entry; /* entries */
  230. unsigned int nfile; /* number of opened files within archive */
  231. unsigned int nfile_alloc; /* number of files allocated */
  232. struct zip_file **file; /* opened files within archive */
  233. char *tempdir; /* custom temp dir (needed e.g. for OS X sandboxing) */
  234. };
  235. /* file in zip archive, part of API */
  236. struct zip_file {
  237. struct zip *za; /* zip archive containing this file */
  238. struct zip_error error; /* error information */
  239. int eof;
  240. struct zip_source *src; /* data source */
  241. };
  242. /* zip archive directory entry (central or local) */
  243. #define ZIP_DIRENT_COMP_METHOD 0x0001u
  244. #define ZIP_DIRENT_FILENAME 0x0002u
  245. #define ZIP_DIRENT_COMMENT 0x0004u
  246. #define ZIP_DIRENT_EXTRA_FIELD 0x0008u
  247. #define ZIP_DIRENT_ATTRIBUTES 0x0010u
  248. #define ZIP_DIRENT_ALL 0xffffu
  249. struct zip_dirent {
  250. zip_uint32_t changed;
  251. int local_extra_fields_read; /* whether we already read in local header extra fields */
  252. int cloned; /* whether this instance is cloned, and thus shares non-changed strings */
  253. zip_uint16_t version_madeby; /* (c) version of creator */
  254. zip_uint16_t version_needed; /* (cl) version needed to extract */
  255. zip_uint16_t bitflags; /* (cl) general purpose bit flag */
  256. zip_int32_t comp_method; /* (cl) compression method used (uint16 and ZIP_CM_DEFAULT (-1)) */
  257. time_t last_mod; /* (cl) time of last modification */
  258. zip_uint32_t crc; /* (cl) CRC-32 of uncompressed data */
  259. zip_uint64_t comp_size; /* (cl) size of compressed data */
  260. zip_uint64_t uncomp_size; /* (cl) size of uncompressed data */
  261. struct zip_string *filename; /* (cl) file name (NUL-terminated) */
  262. struct zip_extra_field *extra_fields; /* (cl) extra fields, parsed */
  263. struct zip_string *comment; /* (c) file comment */
  264. zip_uint32_t disk_number; /* (c) disk number start */
  265. zip_uint16_t int_attrib; /* (c) internal file attributes */
  266. zip_uint32_t ext_attrib; /* (c) external file attributes */
  267. zip_uint64_t offset; /* (c) offset of local header */
  268. };
  269. /* zip archive central directory */
  270. struct zip_cdir {
  271. struct zip_entry *entry; /* directory entries */
  272. zip_uint64_t nentry; /* number of entries */
  273. zip_uint64_t nentry_alloc; /* number of entries allocated */
  274. off_t size; /* size of central directory */
  275. off_t offset; /* offset of central directory in file */
  276. struct zip_string *comment; /* zip archive comment */
  277. };
  278. struct zip_extra_field {
  279. struct zip_extra_field *next;
  280. zip_flags_t flags; /* in local/central header */
  281. zip_uint16_t id; /* header id */
  282. zip_uint16_t size; /* data size */
  283. zip_uint8_t *data;
  284. };
  285. struct zip_source {
  286. struct zip_source *src;
  287. union {
  288. zip_source_callback f;
  289. zip_source_layered_callback l;
  290. } cb;
  291. void *ud;
  292. enum zip_les error_source;
  293. int is_open;
  294. };
  295. /* entry in zip archive directory */
  296. struct zip_entry {
  297. struct zip_dirent *orig;
  298. struct zip_dirent *changes;
  299. struct zip_source *source;
  300. int deleted;
  301. };
  302. /* file or archive comment, or filename */
  303. struct zip_string {
  304. zip_uint8_t *raw; /* raw string */
  305. zip_uint16_t length; /* length of raw string */
  306. enum zip_encoding_type encoding; /* autorecognized encoding */
  307. zip_uint8_t *converted; /* autoconverted string */
  308. zip_uint32_t converted_length; /* length of converted */
  309. };
  310. /* which files to write, and in which order (name is for torrentzip sorting) */
  311. struct zip_filelist {
  312. zip_uint64_t idx;
  313. const char *name;
  314. };
  315. extern const char * const _zip_err_str[];
  316. extern const int _zip_nerr_str;
  317. extern const int _zip_err_type[];
  318. #define ZIP_ENTRY_CHANGED(e, f) ((e)->changes && ((e)->changes->changed & (f)))
  319. #define ZIP_ENTRY_DATA_CHANGED(x) ((x)->source != NULL)
  320. #define ZIP_IS_RDONLY(za) ((za)->ch_flags & ZIP_AFL_RDONLY)
  321. zip_int64_t _zip_add_entry(struct zip *);
  322. int _zip_cdir_compute_crc(struct zip *, uLong *);
  323. void _zip_cdir_free(struct zip_cdir *);
  324. int _zip_cdir_grow(struct zip_cdir *, zip_uint64_t, struct zip_error *);
  325. struct zip_cdir *_zip_cdir_new(zip_uint64_t, struct zip_error *);
  326. zip_int64_t _zip_cdir_write(struct zip *, const struct zip_filelist *, zip_uint64_t, FILE *);
  327. struct zip_dirent *_zip_dirent_clone(const struct zip_dirent *);
  328. void _zip_dirent_free(struct zip_dirent *);
  329. void _zip_dirent_finalize(struct zip_dirent *);
  330. void _zip_dirent_init(struct zip_dirent *);
  331. int _zip_dirent_needs_zip64(const struct zip_dirent *, zip_flags_t);
  332. struct zip_dirent *_zip_dirent_new(void);
  333. int _zip_dirent_read(struct zip_dirent *, FILE *, const unsigned char **,
  334. zip_uint64_t *, int, struct zip_error *);
  335. zip_int32_t _zip_dirent_size(FILE *, zip_uint16_t, struct zip_error *);
  336. void _zip_dirent_torrent_normalize(struct zip_dirent *);
  337. int _zip_dirent_write(struct zip_dirent *, FILE *, zip_flags_t, struct zip_error *);
  338. struct zip_extra_field *_zip_ef_clone(const struct zip_extra_field *, struct zip_error *);
  339. struct zip_extra_field *_zip_ef_delete_by_id(struct zip_extra_field *, zip_uint16_t, zip_uint16_t, zip_flags_t);
  340. void _zip_ef_free(struct zip_extra_field *);
  341. const zip_uint8_t *_zip_ef_get_by_id(const struct zip_extra_field *, zip_uint16_t *, zip_uint16_t, zip_uint16_t, zip_flags_t, struct zip_error *);
  342. struct zip_extra_field *_zip_ef_merge(struct zip_extra_field *, struct zip_extra_field *);
  343. struct zip_extra_field *_zip_ef_new(zip_uint16_t, zip_uint16_t, const zip_uint8_t *, zip_flags_t);
  344. struct zip_extra_field *_zip_ef_parse(const zip_uint8_t *, zip_uint16_t, zip_flags_t, struct zip_error *);
  345. struct zip_extra_field *_zip_ef_remove_internal(struct zip_extra_field *);
  346. zip_uint16_t _zip_ef_size(const struct zip_extra_field *, zip_flags_t);
  347. void _zip_ef_write(const struct zip_extra_field *, zip_flags_t, FILE *);
  348. void _zip_entry_finalize(struct zip_entry *);
  349. void _zip_entry_init(struct zip_entry *);
  350. void _zip_error_clear(struct zip_error *);
  351. void _zip_error_copy(struct zip_error *, const struct zip_error *);
  352. void _zip_error_fini(struct zip_error *);
  353. void _zip_error_get(const struct zip_error *, int *, int *);
  354. void _zip_error_init(struct zip_error *);
  355. void _zip_error_set(struct zip_error *, int, int);
  356. void _zip_error_set_from_source(struct zip_error *, struct zip_source *);
  357. const char *_zip_error_strerror(struct zip_error *);
  358. const zip_uint8_t *_zip_extract_extra_field_by_id(struct zip_error *, zip_uint16_t, int, const zip_uint8_t *, zip_uint16_t, zip_uint16_t *);
  359. int _zip_file_extra_field_prepare_for_change(struct zip *, zip_uint64_t);
  360. int _zip_file_fillbuf(void *, size_t, struct zip_file *);
  361. zip_uint64_t _zip_file_get_offset(const struct zip *, zip_uint64_t, struct zip_error *);
  362. int _zip_filerange_crc(FILE *, off_t, off_t, uLong *, struct zip_error *);
  363. struct zip_dirent *_zip_get_dirent(struct zip *, zip_uint64_t, zip_flags_t, struct zip_error *);
  364. enum zip_encoding_type _zip_guess_encoding(struct zip_string *, enum zip_encoding_type);
  365. zip_uint8_t *_zip_cp437_to_utf8(const zip_uint8_t * const, zip_uint32_t,
  366. zip_uint32_t *, struct zip_error *error);
  367. struct zip *_zip_open(const char *, FILE *, unsigned int, int *);
  368. int _zip_read_local_ef(struct zip *, zip_uint64_t);
  369. struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *,
  370. zip_uint64_t, zip_int64_t, int,
  371. const struct zip_stat *);
  372. struct zip_source *_zip_source_new(struct zip *);
  373. struct zip_source *_zip_source_zip_new(struct zip *, struct zip *, zip_uint64_t, zip_flags_t,
  374. zip_uint64_t, zip_uint64_t, const char *);
  375. int _zip_string_equal(const struct zip_string *, const struct zip_string *);
  376. void _zip_string_free(struct zip_string *);
  377. zip_uint32_t _zip_string_crc32(const struct zip_string *);
  378. const zip_uint8_t *_zip_string_get(struct zip_string *, zip_uint32_t *, zip_flags_t, struct zip_error *);
  379. zip_uint16_t _zip_string_length(const struct zip_string *);
  380. struct zip_string *_zip_string_new(const zip_uint8_t *, zip_uint16_t, zip_flags_t, struct zip_error *);
  381. void _zip_string_write(const struct zip_string *, FILE *);
  382. int _zip_changed(const struct zip *, zip_uint64_t *);
  383. const char *_zip_get_name(struct zip *, zip_uint64_t, zip_flags_t, struct zip_error *);
  384. int _zip_local_header_read(struct zip *, int);
  385. void *_zip_memdup(const void *, size_t, struct zip_error *);
  386. zip_int64_t _zip_name_locate(struct zip *, const char *, zip_flags_t, struct zip_error *);
  387. struct zip *_zip_new(struct zip_error *);
  388. zip_uint16_t _zip_read2(const zip_uint8_t **);
  389. zip_uint32_t _zip_read4(const zip_uint8_t **);
  390. zip_uint64_t _zip_read8(const zip_uint8_t **);
  391. zip_uint8_t *_zip_read_data(const zip_uint8_t **, FILE *, size_t, int, struct zip_error *);
  392. zip_int64_t _zip_file_replace(struct zip *, zip_uint64_t, const char *, struct zip_source *, zip_flags_t);
  393. int _zip_set_name(struct zip *, zip_uint64_t, const char *, zip_flags_t);
  394. void _zip_u2d_time(time_t, zip_uint16_t *, zip_uint16_t *);
  395. int _zip_unchange(struct zip *, zip_uint64_t, int);
  396. void _zip_unchange_data(struct zip_entry *);
  397. void _zip_poke4(zip_uint32_t, zip_uint8_t **);
  398. void _zip_poke8(zip_uint64_t, zip_uint8_t **);
  399. void _zip_write2(zip_uint16_t, FILE *);
  400. void _zip_write4(zip_uint32_t, FILE *);
  401. void _zip_write8(zip_uint64_t, FILE *);
  402. #endif /* zipint.h */