Rizin
unix-like reverse engineering framework and cli tools
zipint.h
Go to the documentation of this file.
1 #ifndef _HAD_ZIPINT_H
2 #define _HAD_ZIPINT_H
3 
4 /*
5  zipint.h -- internal declarations.
6  Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
7 
8  This file is part of libzip, a library to manipulate ZIP archives.
9  The authors can be contacted at <info@libzip.org>
10 
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.
35 */
36 
37 #include "config.h"
38 
39 #include "compat.h"
40 
41 #ifdef ZIP_ALLOCATE_BUFFER
42 #include <stdlib.h>
43 #endif
44 
45 #ifndef _ZIP_COMPILING_DEPRECATED
46 #define ZIP_DISABLE_DEPRECATED
47 #endif
48 
49 #include "zip.h"
50 
51 #define CENTRAL_MAGIC "PK\1\2"
52 #define LOCAL_MAGIC "PK\3\4"
53 #define EOCD_MAGIC "PK\5\6"
54 #define DATADES_MAGIC "PK\7\10"
55 #define EOCD64LOC_MAGIC "PK\6\7"
56 #define EOCD64_MAGIC "PK\6\6"
57 #define CDENTRYSIZE 46u
58 #define LENTRYSIZE 30
59 #define MAXCOMLEN 65536
60 #define MAXEXTLEN 65536
61 #define EOCDLEN 22
62 #define EOCD64LOCLEN 20
63 #define EOCD64LEN 56
64 #define CDBUFSIZE (MAXCOMLEN + EOCDLEN + EOCD64LOCLEN)
65 #define BUFSIZE 8192
66 #define EFZIP64SIZE 28
67 #define EF_WINZIP_AES_SIZE 7
68 #define MAX_DATA_DESCRIPTOR_LENGTH 24
69 
70 #define ZIP_CRYPTO_PKWARE_HEADERLEN 12
71 
72 #define ZIP_CM_REPLACED_DEFAULT (-2)
73 #define ZIP_CM_WINZIP_AES 99 /* Winzip AES encrypted */
74 
75 #define WINZIP_AES_PASSWORD_VERIFY_LENGTH 2
76 #define WINZIP_AES_MAX_HEADER_LENGTH (16 + WINZIP_AES_PASSWORD_VERIFY_LENGTH)
77 #define AES_BLOCK_SIZE 16
78 #define HMAC_LENGTH 10
79 #define SHA1_LENGTH 20
80 #define SALT_LENGTH(method) ((method) == ZIP_EM_AES_128 ? 8 : ((method) == ZIP_EM_AES_192 ? 12 : 16))
81 
82 #define ZIP_CM_IS_DEFAULT(x) ((x) == ZIP_CM_DEFAULT || (x) == ZIP_CM_REPLACED_DEFAULT)
83 #define ZIP_CM_ACTUAL(x) ((zip_uint16_t)(ZIP_CM_IS_DEFAULT(x) ? ZIP_CM_DEFLATE : (x)))
84 
85 #define ZIP_EF_UTF_8_COMMENT 0x6375
86 #define ZIP_EF_UTF_8_NAME 0x7075
87 #define ZIP_EF_WINZIP_AES 0x9901
88 #define ZIP_EF_ZIP64 0x0001
89 
90 #define ZIP_EF_IS_INTERNAL(id) ((id) == ZIP_EF_UTF_8_COMMENT || (id) == ZIP_EF_UTF_8_NAME || (id) == ZIP_EF_WINZIP_AES || (id) == ZIP_EF_ZIP64)
91 
92 /* according to unzip-6.0's zipinfo.c, this corresponds to a regular file with rw permissions for everyone */
93 #define ZIP_EXT_ATTRIB_DEFAULT (0100666u << 16)
94 /* according to unzip-6.0's zipinfo.c, this corresponds to a directory with rwx permissions for everyone */
95 #define ZIP_EXT_ATTRIB_DEFAULT_DIR (0040777u << 16)
96 
97 #define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS_ALLOWED_MASK 0x0836
98 
99 #define ZIP_MAX(a, b) ((a) > (b) ? (a) : (b))
100 #define ZIP_MIN(a, b) ((a) < (b) ? (a) : (b))
101 
102 /* This section contains API that won't materialize like this. It's
103  placed in the internal section, pending cleanup. */
104 
105 /* flags for compression and encryption sources */
106 
107 #define ZIP_CODEC_DECODE 0 /* decompress/decrypt (encode flag not set) */
108 #define ZIP_CODEC_ENCODE 1 /* compress/encrypt */
109 
110 typedef zip_source_t *(*zip_encryption_implementation)(zip_t *, zip_source_t *, zip_uint16_t, int, const char *);
111 
113 
114 /* clang-format off */
120 };
121 /* clang-format on */
123 
125  /* Return maximum compressed size for uncompressed data of given size. */
127 
128  /* called once to create new context */
129  void *(*allocate)(zip_uint16_t method, int compression_flags, zip_error_t *error);
130  /* called once to free context */
131  void (*deallocate)(void *ctx);
132 
133  /* get compression specific general purpose bitflags */
135  /* minimum version needed when using this algorithm */
137 
138  /* start processing */
139  bool (*start)(void *ctx, zip_stat_t *st, zip_file_attributes_t *attributes);
140  /* stop processing */
141  bool (*end)(void *ctx);
142 
143  /* provide new input data, remains valid until next call to input or end */
145 
146  /* all input data has been provided */
147  void (*end_of_input)(void *ctx);
148 
149  /* process input data, writing to data, which has room for length bytes, update length to number of bytes written */
151 };
153 
162 
164 
165 /* This API is not final yet, but we need it internally, so it's private for now. */
166 
168 
169 /* This section contains API that is of limited use until support for
170  user-supplied compression/encryption implementation is finished.
171  Thus we will keep it private for now. */
172 
174 zip_source_t *zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t cm, int compression_flags);
185 zip_source_t *zip_source_buffer_with_attributes(zip_t *za, const void *data, zip_uint64_t len, int freep, zip_file_attributes_t *attributes);
187 
188 /* error source for layered sources */
189 
191 
192 #define ZIP_DETAIL_ET_GLOBAL 0
193 #define ZIP_DETAIL_ET_ENTRY 1
194 
196  int type;
197  const char *description;
198 };
199 
200 extern const struct _zip_err_info _zip_err_str[];
201 extern const int _zip_err_str_count;
202 extern const struct _zip_err_info _zip_err_details[];
203 extern const int _zip_err_details_count;
204 
205 /* macros for libzip-internal errors */
206 #define MAX_DETAIL_INDEX 0x7fffff
207 #define MAKE_DETAIL_WITH_INDEX(error, index) ((((index) > MAX_DETAIL_INDEX) ? MAX_DETAIL_INDEX : (int)(index)) << 8 | (error))
208 #define GET_INDEX_FROM_DETAIL(error) (((error) >> 8) & MAX_DETAIL_INDEX)
209 #define GET_ERROR_FROM_DETAIL(error) ((error) & 0xff)
210 #define ADD_INDEX_TO_DETAIL(error, index) MAKE_DETAIL_WITH_INDEX(GET_ERROR_FROM_DETAIL(error), (index))
211 
212 /* error code for libzip-internal errors */
213 #define ZIP_ER_DETAIL_NO_DETAIL 0 /* G no detail */
214 #define ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD 1 /* G central directory overlaps EOCD, or there is space between them */
215 #define ZIP_ER_DETAIL_COMMENT_LENGTH_INVALID 2 /* G archive comment length incorrect */
216 #define ZIP_ER_DETAIL_CDIR_LENGTH_INVALID 3 /* G central directory length invalid */
217 #define ZIP_ER_DETAIL_CDIR_ENTRY_INVALID 4 /* E central header invalid */
218 #define ZIP_ER_DETAIL_CDIR_WRONG_ENTRIES_COUNT 5 /* G central directory count of entries is incorrect */
219 #define ZIP_ER_DETAIL_ENTRY_HEADER_MISMATCH 6 /* E local and central headers do not match */
220 #define ZIP_ER_DETAIL_EOCD_LENGTH_INVALID 7 /* G wrong EOCD length */
221 #define ZIP_ER_DETAIL_EOCD64_OVERLAPS_EOCD 8 /* G EOCD64 overlaps EOCD, or there is space between them */
222 #define ZIP_ER_DETAIL_EOCD64_WRONG_MAGIC 9 /* G EOCD64 magic incorrect */
223 #define ZIP_ER_DETAIL_EOCD64_MISMATCH 10 /* G EOCD64 and EOCD do not match */
224 #define ZIP_ER_DETAIL_CDIR_INVALID 11 /* G invalid value in central directory */
225 #define ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW 12 /* E variable size fields overflow header */
226 #define ZIP_ER_DETAIL_INVALID_UTF8_IN_FILENAME 13 /* E invalid UTF-8 in filename */
227 #define ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT 13 /* E invalid UTF-8 in comment */
228 #define ZIP_ER_DETAIL_INVALID_ZIP64_EF 14 /* E invalid Zip64 extra field */
229 #define ZIP_ER_DETAIL_INVALID_WINZIPAES_EF 14 /* E invalid WinZip AES extra field */
230 #define ZIP_ER_DETAIL_EF_TRAILING_GARBAGE 15 /* E garbage at end of extra fields */
231 #define ZIP_ER_DETAIL_INVALID_EF_LENGTH 16 /* E extra field length is invalid */
232 #define ZIP_ER_DETAIL_INVALID_FILE_LENGTH 17 /* E file length in header doesn't match actual file length */
233 
234 /* directory entry: general purpose bit flags */
235 
236 #define ZIP_GPBF_ENCRYPTED 0x0001u /* is encrypted */
237 #define ZIP_GPBF_DATA_DESCRIPTOR 0x0008u /* crc/size after file data */
238 #define ZIP_GPBF_STRONG_ENCRYPTION 0x0040u /* uses strong encryption */
239 #define ZIP_GPBF_ENCODING_UTF_8 0x0800u /* file name encoding is UTF-8 */
240 
241 
242 /* extra fields */
243 #define ZIP_EF_LOCAL ZIP_FL_LOCAL /* include in local header */
244 #define ZIP_EF_CENTRAL ZIP_FL_CENTRAL /* include in central directory */
245 #define ZIP_EF_BOTH (ZIP_EF_LOCAL | ZIP_EF_CENTRAL) /* include in both */
246 
247 #define ZIP_FL_FORCE_ZIP64 1024 /* force zip64 extra field (_zip_dirent_write) */
248 
249 #define ZIP_FL_ENCODING_ALL (ZIP_FL_ENC_GUESS | ZIP_FL_ENC_CP437 | ZIP_FL_ENC_UTF_8)
250 
251 
252 /* encoding type */
254  ZIP_ENCODING_UNKNOWN, /* not yet analyzed */
255  ZIP_ENCODING_ASCII, /* plain ASCII */
256  ZIP_ENCODING_UTF8_KNOWN, /* is UTF-8 */
257  ZIP_ENCODING_UTF8_GUESSED, /* possibly UTF-8 */
258  ZIP_ENCODING_CP437, /* Code Page 437 */
259  ZIP_ENCODING_ERROR /* should be UTF-8 but isn't */
260 };
261 
263 
264 struct zip_hash;
265 struct zip_progress;
266 
267 typedef struct zip_cdir zip_cdir_t;
268 typedef struct zip_dirent zip_dirent_t;
269 typedef struct zip_entry zip_entry_t;
270 typedef struct zip_extra_field zip_extra_field_t;
271 typedef struct zip_string zip_string_t;
272 typedef struct zip_buffer zip_buffer_t;
273 typedef struct zip_hash zip_hash_t;
274 typedef struct zip_progress zip_progress_t;
275 
276 /* zip archive, part of API */
277 
278 struct zip {
279  zip_source_t *src; /* data source for archive */
280  unsigned int open_flags; /* flags passed to zip_open */
281  zip_error_t error; /* error information */
282 
283  unsigned int flags; /* archive global flags */
284  unsigned int ch_flags; /* changed archive global flags */
285 
286  char *default_password; /* password used when no other supplied */
287 
288  zip_string_t *comment_orig; /* archive comment */
289  zip_string_t *comment_changes; /* changed archive comment */
290  bool comment_changed; /* whether archive comment was changed */
291 
292  zip_uint64_t nentry; /* number of entries */
293  zip_uint64_t nentry_alloc; /* number of entries allocated */
294  zip_entry_t *entry; /* entries */
295 
296  unsigned int nopen_source; /* number of open sources using archive */
297  unsigned int nopen_source_alloc; /* number of sources allocated */
298  zip_source_t **open_source; /* open sources using archive */
299 
300  zip_hash_t *names; /* hash table for name lookup */
301 
302  zip_progress_t *progress; /* progress callback for zip_close() */
303 };
304 
305 /* file in zip archive, part of API */
306 
307 struct zip_file {
308  zip_t *za; /* zip archive containing this file */
309  zip_error_t error; /* error information */
310  bool eof;
311  zip_source_t *src; /* data source */
312 };
313 
314 /* zip archive directory entry (central or local) */
315 
316 #define ZIP_DIRENT_COMP_METHOD 0x0001u
317 #define ZIP_DIRENT_FILENAME 0x0002u
318 #define ZIP_DIRENT_COMMENT 0x0004u
319 #define ZIP_DIRENT_EXTRA_FIELD 0x0008u
320 #define ZIP_DIRENT_ATTRIBUTES 0x0010u
321 #define ZIP_DIRENT_LAST_MOD 0x0020u
322 #define ZIP_DIRENT_ENCRYPTION_METHOD 0x0040u
323 #define ZIP_DIRENT_PASSWORD 0x0080u
324 #define ZIP_DIRENT_ALL ZIP_UINT32_MAX
325 
326 struct zip_dirent {
328  bool local_extra_fields_read; /* whether we already read in local header extra fields */
329  bool cloned; /* whether this instance is cloned, and thus shares non-changed strings */
330 
331  bool crc_valid; /* if CRC is valid (sometimes not for encrypted archives) */
332 
333  zip_uint16_t version_madeby; /* (c) version of creator */
334  zip_uint16_t version_needed; /* (cl) version needed to extract */
335  zip_uint16_t bitflags; /* (cl) general purpose bit flag */
336  zip_int32_t comp_method; /* (cl) compression method used (uint16 and ZIP_CM_DEFAULT (-1)) */
337  time_t last_mod; /* (cl) time of last modification */
338  zip_uint32_t crc; /* (cl) CRC-32 of uncompressed data */
339  zip_uint64_t comp_size; /* (cl) size of compressed data */
340  zip_uint64_t uncomp_size; /* (cl) size of uncompressed data */
341  zip_string_t *filename; /* (cl) file name (NUL-terminated) */
342  zip_extra_field_t *extra_fields; /* (cl) extra fields, parsed */
343  zip_string_t *comment; /* (c) file comment */
344  zip_uint32_t disk_number; /* (c) disk number start */
345  zip_uint16_t int_attrib; /* (c) internal file attributes */
346  zip_uint32_t ext_attrib; /* (c) external file attributes */
347  zip_uint64_t offset; /* (c) offset of local header */
348 
349  zip_uint16_t compression_level; /* level of compression to use (never valid in orig) */
350  zip_uint16_t encryption_method; /* encryption method, computed from other fields */
351  char *password; /* file specific encryption password */
352 };
353 
354 /* zip archive central directory */
355 
356 struct zip_cdir {
357  zip_entry_t *entry; /* directory entries */
358  zip_uint64_t nentry; /* number of entries */
359  zip_uint64_t nentry_alloc; /* number of entries allocated */
360 
361  zip_uint64_t size; /* size of central directory */
362  zip_uint64_t offset; /* offset of central directory in file */
363  zip_string_t *comment; /* zip archive comment */
364  bool is_zip64; /* central directory in zip64 format */
365 };
366 
369  zip_flags_t flags; /* in local/central header */
370  zip_uint16_t id; /* header id */
371  zip_uint16_t size; /* data size */
373 };
374 
376  ZIP_SOURCE_WRITE_CLOSED, /* write is not in progress */
377  ZIP_SOURCE_WRITE_OPEN, /* write is in progress */
378  ZIP_SOURCE_WRITE_FAILED, /* commit failed, only rollback allowed */
379  ZIP_SOURCE_WRITE_REMOVED /* file was removed */
380 };
382 
383 struct zip_source {
385  union {
388  } cb;
389  void *ud;
391  zip_int64_t supports; /* supported commands */
392  unsigned int open_count; /* number of times source was opened (directly or as lower layer) */
393  zip_source_write_state_t write_state; /* whether source is open for writing */
394  bool source_closed; /* set if source archive is closed */
395  zip_t *source_archive; /* zip archive we're reading from, NULL if not from archive */
396  unsigned int refcount;
397  bool eof; /* EOF reached */
398  bool had_read_error; /* a previous ZIP_SOURCE_READ reported an error */
399  zip_uint64_t bytes_read; /* for sources that don't support ZIP_SOURCE_TELL. */
400 };
401 
402 #define ZIP_SOURCE_IS_OPEN_READING(src) ((src)->open_count > 0)
403 #define ZIP_SOURCE_IS_OPEN_WRITING(src) ((src)->write_state == ZIP_SOURCE_WRITE_OPEN)
404 #define ZIP_SOURCE_IS_LAYERED(src) ((src)->src != NULL)
405 
406 /* entry in zip archive directory */
407 
408 struct zip_entry {
412  bool deleted;
413 };
414 
415 
416 /* file or archive comment, or filename */
417 
418 struct zip_string {
419  zip_uint8_t *raw; /* raw string */
420  zip_uint16_t length; /* length of raw string */
421  enum zip_encoding_type encoding; /* autorecognized encoding */
422  zip_uint8_t *converted; /* autoconverted string */
423  zip_uint32_t converted_length; /* length of converted */
424 };
425 
426 
427 /* byte array */
428 
429 /* For performance, we usually keep 8k byte arrays on the stack.
430  However, there are (embedded) systems with a stack size of 12k;
431  for those, use malloc()/free() */
432 
433 #ifdef ZIP_ALLOCATE_BUFFER
434 #define DEFINE_BYTE_ARRAY(buf, size) zip_uint8_t *buf
435 #define byte_array_init(buf, size) (((buf) = (zip_uint8_t *)malloc(size)) != NULL)
436 #define byte_array_fini(buf) (free(buf))
437 #else
438 #define DEFINE_BYTE_ARRAY(buf, size) zip_uint8_t buf[size]
439 #define byte_array_init(buf, size) (1)
440 #define byte_array_fini(buf) ((void)0)
441 #endif
442 
443 
444 /* bounds checked access to memory buffer */
445 
446 struct zip_buffer {
447  bool ok;
448  bool free_data;
449 
453 };
454 
455 /* which files to write in which order */
456 
457 struct zip_filelist {
459  /* TODO const char *name; */
460 };
461 
462 typedef struct zip_filelist zip_filelist_t;
463 
464 struct _zip_winzip_aes;
465 typedef struct _zip_winzip_aes zip_winzip_aes_t;
466 
469 };
470 typedef struct _zip_pkware_keys zip_pkware_keys_t;
471 
472 #define ZIP_MAX(a, b) ((a) > (b) ? (a) : (b))
473 #define ZIP_MIN(a, b) ((a) < (b) ? (a) : (b))
474 
475 #define ZIP_ENTRY_CHANGED(e, f) ((e)->changes && ((e)->changes->changed & (f)))
476 #define ZIP_ENTRY_DATA_CHANGED(x) ((x)->source != NULL)
477 #define ZIP_ENTRY_HAS_CHANGES(e) (ZIP_ENTRY_DATA_CHANGED(e) || (e)->deleted || ZIP_ENTRY_CHANGED((e), ZIP_DIRENT_ALL))
478 
479 #define ZIP_IS_RDONLY(za) ((za)->ch_flags & ZIP_AFL_RDONLY)
480 
481 
482 #ifdef HAVE_EXPLICIT_MEMSET
483 #define _zip_crypto_clear(b, l) explicit_memset((b), 0, (l))
484 #else
485 #ifdef HAVE_EXPLICIT_BZERO
486 #define _zip_crypto_clear(b, l) explicit_bzero((b), (l))
487 #else
488 #include <string.h>
489 #define _zip_crypto_clear(b, l) memset((b), 0, (l))
490 #endif
491 #endif
492 
493 
495 
510 int _zip_buffer_put(zip_buffer_t *buffer, const void *src, size_t length);
519 
520 void _zip_cdir_free(zip_cdir_t *);
521 bool _zip_cdir_grow(zip_cdir_t *cd, zip_uint64_t additional_entries, zip_error_t *error);
523 zip_int64_t _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors);
526 
535 void _zip_dirent_set_version_needed(zip_dirent_t *de, bool force_zip64);
538 
549 
552 
554 void _zip_error_get(const zip_error_t *, int *, int *);
555 
558 
560 
562 int _zip_file_fillbuf(void *, size_t, zip_file_t *);
565 
567 
570 
573 void _zip_hash_free(zip_hash_t *hash);
578 
579 int _zip_mkstempm(char *path, int mode, bool create_file);
580 
581 zip_t *_zip_open(zip_source_t *, unsigned int, zip_error_t *);
582 
583 void _zip_progress_end(zip_progress_t *progress);
584 void _zip_progress_free(zip_progress_t *progress);
585 int _zip_progress_start(zip_progress_t *progress);
586 int _zip_progress_subrange(zip_progress_t *progress, double start, double end);
587 int _zip_progress_update(zip_progress_t *progress, double value);
588 
589 /* this symbol is extern so it can be overridden for regression testing */
592 
599 
600 void _zip_set_open_error(int *zep, const zip_error_t *err, int ze);
601 
612 
614 int _zip_string_equal(const zip_string_t *a, const zip_string_t *b);
615 void _zip_string_free(zip_string_t *string);
620 int _zip_string_write(zip_t *za, const zip_string_t *string);
625 zip_winzip_aes_t *_zip_winzip_aes_new(const zip_uint8_t *password, zip_uint64_t password_length, const zip_uint8_t *salt, zip_uint16_t key_size, zip_uint8_t *password_verify, zip_error_t *error);
626 
632 
633 int _zip_changed(const zip_t *, zip_uint64_t *);
636 void *_zip_memdup(const void *, size_t, zip_error_t *);
639 
641 int _zip_set_name(zip_t *, zip_uint64_t, const char *, zip_flags_t);
643 int _zip_unchange(zip_t *, zip_uint64_t, int);
645 int _zip_write(zip_t *za, const void *data, zip_uint64_t length);
646 
647 #endif /* zipint.h */
size_t len
Definition: 6502dis.c:15
lzma_index ** i
Definition: index.h:629
lzma_index * src
Definition: index.h:567
static bool err
Definition: armass.c:435
static csh cd
Definition: asm_mips_cs.c:10
#define local
Definition: blast.c:36
const lzma_allocator const uint8_t * in
Definition: block.h:527
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
static int value
Definition: cmd_api.c:93
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:68
static static fork const void static count static fd const char const char static newpath const char static path const char path
Definition: sflib.h:35
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
Definition: sflib.h:133
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
Definition: sflib.h:118
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133
voidpf void uLong size
Definition: ioapi.h:138
voidpf uLong offset
Definition: ioapi.h:144
const char int mode
Definition: ioapi.h:137
voidpf void * buf
Definition: ioapi.h:138
#define ZIP_EXTERN
Definition: zip.h:54
enum zip_source_cmd zip_source_cmd_t
Definition: zip.h:241
zip_source_cmd
Definition: zip.h:219
zip_int64_t(* zip_source_callback)(void *_Nullable, void *_Nullable, zip_uint64_t, zip_source_cmd_t)
Definition: zip.h:349
zip_uint32_t zip_flags_t
Definition: zip.h:347
char * dst
Definition: lz4.h:724
string FILE
Definition: benchmark.py:21
static struct @218 keys[]
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
static int
Definition: sfsocketcall.h:114
int time_t
Definition: sftypes.h:66
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41
const char * description
Definition: zipint.h:197
zip_uint32_t key[3]
Definition: zipint.h:468
Definition: buffer.h:15
Definition: sftypes.h:48
Definition: zipcmp.c:69
Definition: z80asm.h:102
zip_uint64_t offset
Definition: zipint.h:452
zip_uint64_t size
Definition: zipint.h:451
bool ok
Definition: zipint.h:447
bool free_data
Definition: zipint.h:448
zip_uint8_t * data
Definition: zipint.h:450
zip_string_t * comment
Definition: zipint.h:363
zip_uint64_t size
Definition: zipint.h:361
zip_entry_t * entry
Definition: zipint.h:357
zip_uint64_t offset
Definition: zipint.h:362
zip_uint64_t nentry
Definition: zipint.h:358
zip_uint64_t nentry_alloc
Definition: zipint.h:359
bool is_zip64
Definition: zipint.h:364
bool(* start)(void *ctx, zip_stat_t *st, zip_file_attributes_t *attributes)
Definition: zipint.h:139
zip_uint8_t version_needed
Definition: zipint.h:136
zip_compression_status_t(* process)(void *ctx, zip_uint8_t *data, zip_uint64_t *length)
Definition: zipint.h:150
bool(* input)(void *ctx, zip_uint8_t *data, zip_uint64_t length)
Definition: zipint.h:144
void(* deallocate)(void *ctx)
Definition: zipint.h:131
bool(* end)(void *ctx)
Definition: zipint.h:141
zip_uint16_t(* general_purpose_bit_flags)(void *ctx)
Definition: zipint.h:134
void(* end_of_input)(void *ctx)
Definition: zipint.h:147
zip_uint64_t(* maximum_compressed_size)(zip_uint64_t uncompressed_size)
Definition: zipint.h:126
zip_uint32_t disk_number
Definition: zipint.h:344
zip_uint16_t bitflags
Definition: zipint.h:335
bool local_extra_fields_read
Definition: zipint.h:328
time_t last_mod
Definition: zipint.h:337
zip_uint64_t uncomp_size
Definition: zipint.h:340
zip_uint32_t crc
Definition: zipint.h:338
zip_uint16_t int_attrib
Definition: zipint.h:345
zip_uint64_t offset
Definition: zipint.h:347
char * password
Definition: zipint.h:351
bool cloned
Definition: zipint.h:329
zip_int32_t comp_method
Definition: zipint.h:336
zip_uint64_t comp_size
Definition: zipint.h:339
zip_uint16_t version_needed
Definition: zipint.h:334
zip_uint32_t changed
Definition: zipint.h:327
zip_uint32_t ext_attrib
Definition: zipint.h:346
zip_extra_field_t * extra_fields
Definition: zipint.h:342
zip_uint16_t encryption_method
Definition: zipint.h:350
bool crc_valid
Definition: zipint.h:331
zip_uint16_t version_madeby
Definition: zipint.h:333
zip_string_t * comment
Definition: zipint.h:343
zip_string_t * filename
Definition: zipint.h:341
zip_uint16_t compression_level
Definition: zipint.h:349
Definition: zipint.h:408
zip_dirent_t * orig
Definition: zipint.h:409
zip_source_t * source
Definition: zipint.h:411
zip_dirent_t * changes
Definition: zipint.h:410
bool deleted
Definition: zipint.h:412
Definition: zip.h:284
zip_uint8_t * data
Definition: zipint.h:372
zip_uint16_t size
Definition: zipint.h:371
zip_flags_t flags
Definition: zipint.h:369
zip_extra_field_t * next
Definition: zipint.h:368
zip_uint16_t id
Definition: zipint.h:370
bool eof
Definition: zipint.h:310
zip_t * za
Definition: zipint.h:308
zip_source_t * src
Definition: zipint.h:311
zip_error_t error
Definition: zipint.h:309
zip_uint64_t idx
Definition: zipint.h:458
unsigned int open_count
Definition: zipint.h:392
zip_source_t * src
Definition: zipint.h:384
unsigned int refcount
Definition: zipint.h:396
zip_source_layered_callback l
Definition: zipint.h:387
zip_error_t error
Definition: zipint.h:390
void * ud
Definition: zipint.h:389
bool eof
Definition: zipint.h:397
zip_source_write_state_t write_state
Definition: zipint.h:393
bool source_closed
Definition: zipint.h:394
bool had_read_error
Definition: zipint.h:398
zip_source_callback f
Definition: zipint.h:386
zip_t * source_archive
Definition: zipint.h:395
zip_uint64_t bytes_read
Definition: zipint.h:399
union zip_source::@410 cb
zip_int64_t supports
Definition: zipint.h:391
Definition: zip.h:300
zip_uint8_t * raw
Definition: zipint.h:419
enum zip_encoding_type encoding
Definition: zipint.h:421
zip_uint32_t converted_length
Definition: zipint.h:423
zip_uint8_t * converted
Definition: zipint.h:422
zip_uint16_t length
Definition: zipint.h:420
Definition: zipint.h:278
zip_source_t ** open_source
Definition: zipint.h:298
unsigned int flags
Definition: zipint.h:283
unsigned int ch_flags
Definition: zipint.h:284
zip_error_t error
Definition: zipint.h:281
zip_string_t * comment_changes
Definition: zipint.h:289
zip_source_t * src
Definition: zipint.h:279
unsigned int nopen_source
Definition: zipint.h:296
zip_entry_t * entry
Definition: zipint.h:294
zip_uint64_t nentry_alloc
Definition: zipint.h:293
zip_uint64_t nentry
Definition: zipint.h:292
unsigned int open_flags
Definition: zipint.h:280
zip_string_t * comment_orig
Definition: zipint.h:288
bool comment_changed
Definition: zipint.h:290
unsigned int nopen_source_alloc
Definition: zipint.h:297
zip_hash_t * names
Definition: zipint.h:300
char * default_password
Definition: zipint.h:286
zip_progress_t * progress
Definition: zipint.h:302
const char * command
Definition: main.c:7
uint64_t uncompressed_size
Definition: list.c:106
#define bool
Definition: sysdefs.h:146
void error(const char *msg)
Definition: untgz.c:593
static const char * cb[]
Definition: z80_tab.h:176
uint64_t zip_uint64_t
Definition: zipconf.h:39
uint32_t zip_uint32_t
Definition: zipconf.h:37
uint8_t zip_uint8_t
Definition: zipconf.h:33
int32_t zip_int32_t
Definition: zipconf.h:36
uint16_t zip_uint16_t
Definition: zipconf.h:35
int64_t zip_int64_t
Definition: zipconf.h:38
void _zip_entry_finalize(zip_entry_t *)
Definition: zip_entry.c:38
int _zip_file_extra_field_prepare_for_change(zip_t *, zip_uint64_t)
zip_dirent_t * _zip_get_dirent(zip_t *, zip_uint64_t, zip_flags_t, zip_error_t *)
Definition: zip_dirent.c:1064
int _zip_buffer_put_8(zip_buffer_t *buffer, zip_uint8_t i)
Definition: zip_buffer.c:283
int _zip_read(zip_source_t *src, zip_uint8_t *data, zip_uint64_t length, zip_error_t *error)
Definition: zip_io_util.c:40
zip_uint16_t _zip_ef_size(const zip_extra_field_t *, zip_flags_t)
zip_string_t * _zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, zip_error_t *error)
Definition: zip_string.c:121
zip_int64_t _zip_name_locate(zip_t *, const char *, zip_flags_t, zip_error_t *)
bool _zip_hash_revert(zip_hash_t *hash, zip_error_t *error)
Definition: zip_hash.c:369
zip_source_t *(* zip_encryption_implementation)(zip_t *, zip_source_t *, zip_uint16_t, int, const char *)
Definition: zipint.h:110
zip_dirent_t * _zip_dirent_new(void)
Definition: zip_dirent.c:305
zip_t * _zip_open(zip_source_t *, unsigned int, zip_error_t *)
Definition: zip_open.c:146
zip_encryption_implementation _zip_get_encryption_implementation(zip_uint16_t method, int operation)
void _zip_error_set_from_source(zip_error_t *, zip_source_t *)
Definition: zip_error.c:135
bool _zip_winzip_aes_encrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length)
zip_compression_algorithm_t * _zip_get_compression_algorithm(zip_int32_t method, bool compress)
zip_extra_field_t * _zip_ef_remove_internal(zip_extra_field_t *)
zip_string_t * _zip_read_string(zip_buffer_t *buffer, zip_source_t *src, zip_uint16_t length, bool nulp, zip_error_t *error)
Definition: zip_io_util.c:107
void _zip_dirent_free(zip_dirent_t *)
Definition: zip_dirent.c:258
zip_int64_t _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors)
Definition: zip_dirent.c:121
zip_compression_algorithm_t zip_algorithm_xz_compress
void _zip_cdir_free(zip_cdir_t *)
Definition: zip_dirent.c:49
const zip_uint8_t * _zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip_error_t *error)
Definition: zip_string.c:80
const zip_uint8_t * zip_get_extra_field_by_id(zip_t *, int, int, zip_uint16_t, int, zip_uint16_t *)
zip_source_write_state
Definition: zipint.h:375
@ ZIP_SOURCE_WRITE_CLOSED
Definition: zipint.h:376
@ ZIP_SOURCE_WRITE_OPEN
Definition: zipint.h:377
@ ZIP_SOURCE_WRITE_FAILED
Definition: zipint.h:378
@ ZIP_SOURCE_WRITE_REMOVED
Definition: zipint.h:379
zip_compression_algorithm_t zip_algorithm_deflate_decompress
int _zip_dirent_write(zip_t *za, zip_dirent_t *dirent, zip_flags_t flags)
Definition: zip_dirent.c:765
const struct _zip_err_info _zip_err_details[]
Definition: zip_err_str.c:53
zip_uint8_t * _zip_buffer_data(zip_buffer_t *buffer)
Definition: zip_buffer.c:40
void _zip_dirent_finalize(zip_dirent_t *)
Definition: zip_dirent.c:234
int _zip_progress_subrange(zip_progress_t *progress, double start, double end)
Definition: zip_progress.c:172
void _zip_entry_init(zip_entry_t *)
Definition: zip_entry.c:46
zip_source_t * zip_source_pkware_decode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *)
const zip_uint8_t * _zip_ef_get_by_id(const zip_extra_field_t *, zip_uint16_t *, zip_uint16_t, zip_uint16_t, zip_flags_t, zip_error_t *)
int _zip_read_at_offset(zip_source_t *src, zip_uint64_t offset, unsigned char *b, size_t length, zip_error_t *error)
zip_uint8_t * _zip_cp437_to_utf8(const zip_uint8_t *const, zip_uint32_t, zip_uint32_t *, zip_error_t *)
Definition: zip_utf-8.c:198
zip_int64_t _zip_hash_lookup(zip_hash_t *hash, const zip_uint8_t *name, zip_flags_t flags, zip_error_t *error)
Definition: zip_hash.c:312
zip_int64_t _zip_source_call(zip_source_t *src, void *data, zip_uint64_t length, zip_source_cmd_t command)
bool _zip_ef_parse(const zip_uint8_t *, zip_uint16_t, zip_flags_t, zip_extra_field_t **, zip_error_t *)
zip_source_t * zip_source_buffer_with_attributes_create(const void *data, zip_uint64_t len, int freep, zip_file_attributes_t *attributes, zip_error_t *error)
enum zip_compression_status zip_compression_status_t
Definition: zipint.h:122
enum zip_encoding_type _zip_guess_encoding(zip_string_t *, enum zip_encoding_type)
const struct _zip_err_info _zip_err_str[]
Definition: zip_err_str.c:15
void _zip_source_invalidate(zip_source_t *src)
int _zip_string_equal(const zip_string_t *a, const zip_string_t *b)
Definition: zip_string.c:55
zip_source_t * _zip_source_file_or_p(const char *, FILE *, zip_uint64_t, zip_int64_t, const zip_stat_t *, zip_error_t *error)
zip_extra_field_t * _zip_ef_clone(const zip_extra_field_t *, zip_error_t *)
void _zip_pkware_encrypt(zip_pkware_keys_t *keys, zip_uint8_t *out, const zip_uint8_t *in, zip_uint64_t len)
Definition: zip_pkware.c:72
zip_cdir_t * _zip_cdir_new(zip_uint64_t, zip_error_t *)
Definition: zip_dirent.c:64
zip_source_t * zip_source_winzip_aes_encode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *)
void _zip_progress_end(zip_progress_t *progress)
Definition: zip_progress.c:68
zip_uint32_t _zip_buffer_get_32(zip_buffer_t *buffer)
Definition: zip_buffer.c:92
int _zip_changed(const zip_t *, zip_uint64_t *)
Definition: zip_close.c:655
zip_uint8_t * _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp, zip_error_t *error)
Definition: zip_io_util.c:63
int _zip_mkstempm(char *path, int mode, bool create_file)
int _zip_write(zip_t *za, const void *data, zip_uint64_t length)
Definition: zip_io_util.c:121
zip_uint64_t _zip_buffer_left(zip_buffer_t *buffer)
Definition: zip_buffer.c:128
zip_compression_algorithm_t zip_algorithm_zstd_compress
zip_uint64_t _zip_buffer_read(zip_buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length)
Definition: zip_buffer.c:134
void _zip_pkware_keys_free(zip_pkware_keys_t *keys)
bool _zip_hash_delete(zip_hash_t *hash, const zip_uint8_t *key, zip_error_t *error)
Definition: zip_hash.c:264
zip_int64_t _zip_add_entry(zip_t *)
Definition: zip_add_entry.c:43
bool _zip_winzip_aes_finish(zip_winzip_aes_t *ctx, zip_uint8_t *hmac)
zip_uint32_t zip_random_uint32(void)
int _zip_buffer_put_16(zip_buffer_t *buffer, zip_uint16_t i)
Definition: zip_buffer.c:230
zip_les
Definition: zipint.h:190
@ ZIP_LES_NONE
Definition: zipint.h:190
@ ZIP_LES_INVAL
Definition: zipint.h:190
@ ZIP_LES_UPPER
Definition: zipint.h:190
@ ZIP_LES_LOWER
Definition: zipint.h:190
void _zip_unchange_data(zip_entry_t *)
zip_compression_algorithm_t zip_algorithm_bzip2_decompress
bool _zip_source_had_error(zip_source_t *)
zip_source_t * _zip_source_new(zip_error_t *error)
zip_uint64_t _zip_file_get_offset(const zip_t *, zip_uint64_t, zip_error_t *)
zip_uint64_t _zip_buffer_size(zip_buffer_t *buffer)
Definition: zip_buffer.c:322
enum zip_source_write_state zip_source_write_state_t
Definition: zipint.h:381
time_t _zip_d2u_time(zip_uint16_t, zip_uint16_t)
Definition: zip_dirent.c:1004
void _zip_dirent_init(zip_dirent_t *)
Definition: zip_dirent.c:268
zip_extra_field_t * _zip_ef_new(zip_uint16_t, zip_uint16_t, const zip_uint8_t *, zip_flags_t)
bool zip_source_accept_empty(zip_source_t *src)
int _zip_progress_start(zip_progress_t *progress)
Definition: zip_progress.c:151
zip_compression_algorithm_t zip_algorithm_deflate_compress
zip_compression_algorithm_t zip_algorithm_bzip2_compress
zip_source_t * zip_source_buffer_with_attributes(zip_t *za, const void *data, zip_uint64_t len, int freep, zip_file_attributes_t *attributes)
zip_buffer_t * _zip_buffer_new(zip_uint8_t *data, zip_uint64_t size)
Definition: zip_buffer.c:146
const char * _zip_get_name(zip_t *, zip_uint64_t, zip_flags_t, zip_error_t *)
Definition: zip_get_name.c:47
void _zip_ef_free(zip_extra_field_t *)
zip_source_t * _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, zip_error_t *error)
int _zip_stat_merge(zip_stat_t *dst, const zip_stat_t *src, zip_error_t *error)
Definition: zip_stat_init.c:54
zip_uint32_t _zip_string_crc32(const zip_string_t *string)
Definition: zip_string.c:42
void _zip_pkware_decrypt(zip_pkware_keys_t *keys, zip_uint8_t *out, const zip_uint8_t *in, zip_uint64_t len)
Definition: zip_pkware.c:95
void _zip_winzip_aes_free(zip_winzip_aes_t *ctx)
zip_source_t * zip_source_winzip_aes_decode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *)
zip_int64_t(* zip_source_layered_callback)(zip_source_t *, void *, void *, zip_uint64_t, enum zip_source_cmd)
Definition: zipint.h:173
void _zip_buffer_free(zip_buffer_t *buffer)
Definition: zip_buffer.c:46
ZIP_EXTERN bool zip_secure_random(zip_uint8_t *buffer, zip_uint16_t length)
zip_t * _zip_new(zip_error_t *)
Definition: zip_new.c:45
zip_buffer_t * _zip_buffer_new_from_source(zip_source_t *src, zip_uint64_t size, zip_uint8_t *buf, zip_error_t *error)
Definition: zip_buffer.c:174
bool _zip_buffer_ok(zip_buffer_t *buffer)
Definition: zip_buffer.c:198
void _zip_dirent_apply_attributes(zip_dirent_t *, zip_file_attributes_t *, bool, zip_uint32_t)
Definition: zip_dirent.c:1117
bool _zip_dirent_needs_zip64(const zip_dirent_t *, zip_flags_t)
Definition: zip_dirent.c:296
bool _zip_winzip_aes_decrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length)
void * _zip_memdup(const void *, size_t, zip_error_t *)
Definition: zip_memdup.c:41
zip_uint16_t _zip_buffer_get_16(zip_buffer_t *buffer)
Definition: zip_buffer.c:80
void _zip_deregister_source(zip_t *za, zip_source_t *src)
enum zip_encoding_type zip_encoding_type_t
Definition: zipint.h:262
void _zip_error_clear(zip_error_t *)
Definition: zip_error.c:92
zip_compression_algorithm_t zip_algorithm_zstd_decompress
void _zip_pkware_keys_reset(zip_pkware_keys_t *keys)
Definition: zip_pkware.c:64
int _zip_buffer_skip(zip_buffer_t *buffer, zip_uint64_t length)
Definition: zip_buffer.c:311
int _zip_buffer_put_64(zip_buffer_t *buffer, zip_uint64_t i)
Definition: zip_buffer.c:262
zip_compression_algorithm_t zip_algorithm_xz_decompress
const int _zip_err_details_count
Definition: zip_err_str.c:76
void _zip_set_open_error(int *zep, const zip_error_t *err, int ze)
Definition: zip_open.c:217
zip_compression_status
Definition: zipint.h:115
@ ZIP_COMPRESSION_NEED_DATA
Definition: zipint.h:119
@ ZIP_COMPRESSION_ERROR
Definition: zipint.h:118
@ ZIP_COMPRESSION_END
Definition: zipint.h:117
@ ZIP_COMPRESSION_OK
Definition: zipint.h:116
int _zip_local_header_read(zip_t *, int)
int _zip_read_local_ef(zip_t *, zip_uint64_t)
zip_source_t * zip_source_pkware_encode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *)
bool _zip_hash_reserve_capacity(zip_hash_t *hash, zip_uint64_t capacity, zip_error_t *error)
Definition: zip_hash.c:347
const zip_uint8_t * _zip_extract_extra_field_by_id(zip_error_t *, zip_uint16_t, int, const zip_uint8_t *, zip_uint16_t, zip_uint16_t *)
bool _zip_hash_add(zip_hash_t *hash, const zip_uint8_t *name, zip_uint64_t index, zip_flags_t flags, zip_error_t *error)
Definition: zip_hash.c:205
zip_hash_t * _zip_hash_new(zip_error_t *error)
Definition: zip_hash.c:167
zip_extra_field_t * _zip_ef_delete_by_id(zip_extra_field_t *, zip_uint16_t, zip_uint16_t, zip_flags_t)
bool _zip_buffer_eof(zip_buffer_t *buffer)
Definition: zip_buffer.c:60
zip_source_t * zip_source_crc_create(zip_source_t *, int, zip_error_t *error)
zip_int64_t _zip_file_replace(zip_t *, zip_uint64_t, const char *, zip_source_t *, zip_flags_t)
const int _zip_err_str_count
Definition: zip_err_str.c:51
int _zip_set_name(zip_t *, zip_uint64_t, const char *, zip_flags_t)
Definition: zip_set_name.c:42
zip_uint64_t _zip_buffer_get_64(zip_buffer_t *buffer)
Definition: zip_buffer.c:104
zip_uint64_t _zip_file_get_end(const zip_t *za, zip_uint64_t index, zip_error_t *error)
int _zip_string_write(zip_t *za, const zip_string_t *string)
Definition: zip_string.c:173
int zip_source_remove(zip_source_t *)
zip_source_t * zip_source_decompress(zip_t *za, zip_source_t *src, zip_int32_t cm)
int _zip_progress_update(zip_progress_t *progress, double value)
Definition: zip_progress.c:184
int _zip_ef_write(zip_t *za, const zip_extra_field_t *ef, zip_flags_t flags)
zip_source_t * _zip_source_zip_new(zip_t *, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_uint64_t, const char *, zip_error_t *error)
void _zip_hash_free(zip_hash_t *hash)
Definition: zip_hash.c:184
void _zip_error_copy(zip_error_t *dst, const zip_error_t *src)
Definition: zip_error.c:102
int _zip_buffer_put_32(zip_buffer_t *buffer, zip_uint32_t i)
Definition: zip_buffer.c:245
zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error)
Definition: zip_dirent.c:327
zip_int64_t zip_source_supports(zip_source_t *src)
int _zip_source_set_source_archive(zip_source_t *, zip_t *)
zip_uint8_t * _zip_buffer_peek(zip_buffer_t *buffer, zip_uint64_t length)
Definition: zip_buffer.c:204
void _zip_progress_free(zip_progress_t *progress)
Definition: zip_progress.c:74
zip_winzip_aes_t * _zip_winzip_aes_new(const zip_uint8_t *password, zip_uint64_t password_length, const zip_uint8_t *salt, zip_uint16_t key_size, zip_uint8_t *password_verify, zip_error_t *error)
zip_source_t * zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t cm, int compression_flags)
int _zip_file_fillbuf(void *, size_t, zip_file_t *)
bool _zip_cdir_grow(zip_cdir_t *cd, zip_uint64_t additional_entries, zip_error_t *error)
Definition: zip_dirent.c:88
zip_source_t * zip_source_layered(zip_t *, zip_source_t *, zip_source_layered_callback, void *)
zip_dirent_t * _zip_dirent_clone(const zip_dirent_t *)
Definition: zip_dirent.c:215
zip_uint16_t _zip_string_length(const zip_string_t *string)
Definition: zip_string.c:112
void _zip_dirent_set_version_needed(zip_dirent_t *de, bool force_zip64)
zip_uint8_t _zip_buffer_get_8(zip_buffer_t *buffer)
Definition: zip_buffer.c:116
zip_int32_t _zip_dirent_size(zip_source_t *src, zip_uint16_t, zip_error_t *)
Definition: zip_dirent.c:721
int _zip_unchange(zip_t *, zip_uint64_t, int)
Definition: zip_unchange.c:47
int _zip_register_source(zip_t *za, zip_source_t *src)
zip_uint64_t _zip_buffer_offset(zip_buffer_t *buffer)
Definition: zip_buffer.c:192
zip_extra_field_t * _zip_ef_merge(zip_extra_field_t *, zip_extra_field_t *)
void _zip_u2d_time(time_t, zip_uint16_t *, zip_uint16_t *)
Definition: zip_dirent.c:1090
void _zip_string_free(zip_string_t *string)
Definition: zip_string.c:69
void _zip_error_get(const zip_error_t *, int *, int *)
Definition: zip_error.c:113
bool _zip_source_eof(zip_source_t *)
zip_source_t * zip_source_layered_create(zip_source_t *src, zip_source_layered_callback cb, void *ud, zip_error_t *error)
zip_pkware_keys_t * _zip_pkware_keys_new(zip_error_t *error)
int _zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset)
Definition: zip_buffer.c:297
zip_encoding_type
Definition: zipint.h:253
@ ZIP_ENCODING_ERROR
Definition: zipint.h:259
@ ZIP_ENCODING_UTF8_GUESSED
Definition: zipint.h:257
@ ZIP_ENCODING_UTF8_KNOWN
Definition: zipint.h:256
@ ZIP_ENCODING_UNKNOWN
Definition: zipint.h:254
@ ZIP_ENCODING_CP437
Definition: zipint.h:258
@ ZIP_ENCODING_ASCII
Definition: zipint.h:255
int _zip_buffer_put(zip_buffer_t *buffer, const void *src, size_t length)
Definition: zip_buffer.c:217
zip_uint8_t * _zip_buffer_get(zip_buffer_t *buffer, zip_uint64_t length)
Definition: zip_buffer.c:66
zip_t * za
Definition: ziptool.c:79