"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/libzip/zip.h" (10 Oct 2018, 22690 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "zip.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.21_Source_vs_1.22_Source.

    1 #ifndef _HAD_ZIP_H
    2 #define _HAD_ZIP_H
    3 
    4 /*
    5   zip.h -- exported declarations.
    6   Copyright (C) 1999-2017 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 <libzip@nih.at>
   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 
   38 #ifdef __cplusplus
   39 extern "C" {
   40 #if 0
   41 } /* fix autoindent */
   42 #endif
   43 #endif
   44 
   45 #include <zipconf.h>
   46 
   47 #ifndef ZIP_EXTERN
   48 #ifndef ZIP_STATIC
   49 #ifdef _WIN32
   50 #define ZIP_EXTERN __declspec(dllimport)
   51 #elif defined(__GNUC__) && __GNUC__ >= 4
   52 #define ZIP_EXTERN __attribute__((visibility("default")))
   53 #else
   54 #define ZIP_EXTERN
   55 #endif
   56 #else
   57 #define ZIP_EXTERN
   58 #endif
   59 #endif
   60 
   61 #include <stdio.h>
   62 #include <sys/types.h>
   63 #include <time.h>
   64 
   65 /* flags for zip_open */
   66 
   67 #define ZIP_CREATE 1
   68 #define ZIP_EXCL 2
   69 #define ZIP_CHECKCONS 4
   70 #define ZIP_TRUNCATE 8
   71 #define ZIP_RDONLY 16
   72 
   73 
   74 /* flags for zip_name_locate, zip_fopen, zip_stat, ... */
   75 
   76 #define ZIP_FL_NOCASE 1u       /* ignore case on name lookup */
   77 #define ZIP_FL_NODIR 2u        /* ignore directory component */
   78 #define ZIP_FL_COMPRESSED 4u   /* read compressed data */
   79 #define ZIP_FL_UNCHANGED 8u    /* use original data, ignoring changes */
   80 #define ZIP_FL_RECOMPRESS 16u  /* force recompression of data */
   81 #define ZIP_FL_ENCRYPTED 32u   /* read encrypted data (implies ZIP_FL_COMPRESSED) */
   82 #define ZIP_FL_ENC_GUESS 0u    /* guess string encoding (is default) */
   83 #define ZIP_FL_ENC_RAW 64u     /* get unmodified string */
   84 #define ZIP_FL_ENC_STRICT 128u /* follow specification strictly */
   85 #define ZIP_FL_LOCAL 256u      /* in local header */
   86 #define ZIP_FL_CENTRAL 512u    /* in central directory */
   87 /*                           1024u    reserved for internal use */
   88 #define ZIP_FL_ENC_UTF_8 2048u /* string is UTF-8 encoded */
   89 #define ZIP_FL_ENC_CP437 4096u /* string is CP437 encoded */
   90 #define ZIP_FL_OVERWRITE 8192u /* zip_file_add: if file with name exists, overwrite (replace) it */
   91 
   92 /* archive global flags flags */
   93 
   94 #define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */
   95 
   96 
   97 /* create a new extra field */
   98 
   99 #define ZIP_EXTRA_FIELD_ALL ZIP_UINT16_MAX
  100 #define ZIP_EXTRA_FIELD_NEW ZIP_UINT16_MAX
  101 
  102 
  103 /* libzip error codes */
  104 
  105 #define ZIP_ER_OK 0               /* N No error */
  106 #define ZIP_ER_MULTIDISK 1        /* N Multi-disk zip archives not supported */
  107 #define ZIP_ER_RENAME 2           /* S Renaming temporary file failed */
  108 #define ZIP_ER_CLOSE 3            /* S Closing zip archive failed */
  109 #define ZIP_ER_SEEK 4             /* S Seek error */
  110 #define ZIP_ER_READ 5             /* S Read error */
  111 #define ZIP_ER_WRITE 6            /* S Write error */
  112 #define ZIP_ER_CRC 7              /* N CRC error */
  113 #define ZIP_ER_ZIPCLOSED 8        /* N Containing zip archive was closed */
  114 #define ZIP_ER_NOENT 9            /* N No such file */
  115 #define ZIP_ER_EXISTS 10          /* N File already exists */
  116 #define ZIP_ER_OPEN 11            /* S Can't open file */
  117 #define ZIP_ER_TMPOPEN 12         /* S Failure to create temporary file */
  118 #define ZIP_ER_ZLIB 13            /* Z Zlib error */
  119 #define ZIP_ER_MEMORY 14          /* N Malloc failure */
  120 #define ZIP_ER_CHANGED 15         /* N Entry has been changed */
  121 #define ZIP_ER_COMPNOTSUPP 16     /* N Compression method not supported */
  122 #define ZIP_ER_EOF 17             /* N Premature end of file */
  123 #define ZIP_ER_INVAL 18           /* N Invalid argument */
  124 #define ZIP_ER_NOZIP 19           /* N Not a zip archive */
  125 #define ZIP_ER_INTERNAL 20        /* N Internal error */
  126 #define ZIP_ER_INCONS 21          /* N Zip archive inconsistent */
  127 #define ZIP_ER_REMOVE 22          /* S Can't remove file */
  128 #define ZIP_ER_DELETED 23         /* N Entry has been deleted */
  129 #define ZIP_ER_ENCRNOTSUPP 24     /* N Encryption method not supported */
  130 #define ZIP_ER_RDONLY 25          /* N Read-only archive */
  131 #define ZIP_ER_NOPASSWD 26        /* N No password provided */
  132 #define ZIP_ER_WRONGPASSWD 27     /* N Wrong password provided */
  133 #define ZIP_ER_OPNOTSUPP 28       /* N Operation not supported */
  134 #define ZIP_ER_INUSE 29           /* N Resource still in use */
  135 #define ZIP_ER_TELL 30            /* S Tell error */
  136 #define ZIP_ER_COMPRESSED_DATA 31 /* N Compressed data invalid */
  137 
  138 /* type of system error value */
  139 
  140 #define ZIP_ET_NONE 0 /* sys_err unused */
  141 #define ZIP_ET_SYS 1  /* sys_err is errno */
  142 #define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */
  143 
  144 /* compression methods */
  145 
  146 #define ZIP_CM_DEFAULT -1 /* better of deflate or store */
  147 #define ZIP_CM_STORE 0    /* stored (uncompressed) */
  148 #define ZIP_CM_SHRINK 1   /* shrunk */
  149 #define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */
  150 #define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */
  151 #define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */
  152 #define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */
  153 #define ZIP_CM_IMPLODE 6  /* imploded */
  154 /* 7 - Reserved for Tokenizing compression algorithm */
  155 #define ZIP_CM_DEFLATE 8         /* deflated */
  156 #define ZIP_CM_DEFLATE64 9       /* deflate64 */
  157 #define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */
  158 /* 11 - Reserved by PKWARE */
  159 #define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */
  160 /* 13 - Reserved by PKWARE */
  161 #define ZIP_CM_LZMA 14 /* LZMA (EFS) */
  162 /* 15-17 - Reserved by PKWARE */
  163 #define ZIP_CM_TERSE 18   /* compressed using IBM TERSE (new) */
  164 #define ZIP_CM_LZ77 19    /* IBM LZ77 z Architecture (PFS) */
  165 #define ZIP_CM_XZ 95      /* XZ compressed data */
  166 #define ZIP_CM_JPEG 96    /* Compressed Jpeg data */
  167 #define ZIP_CM_WAVPACK 97 /* WavPack compressed data */
  168 #define ZIP_CM_PPMD 98    /* PPMd version I, Rev 1 */
  169 
  170 /* encryption methods */
  171 
  172 #define ZIP_EM_NONE 0         /* not encrypted */
  173 #define ZIP_EM_TRAD_PKWARE 1  /* traditional PKWARE encryption */
  174 #if 0                         /* Strong Encryption Header not parsed yet */
  175 #define ZIP_EM_DES 0x6601     /* strong encryption: DES */
  176 #define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */
  177 #define ZIP_EM_3DES_168 0x6603
  178 #define ZIP_EM_3DES_112 0x6609
  179 #define ZIP_EM_PKZIP_AES_128 0x660e
  180 #define ZIP_EM_PKZIP_AES_192 0x660f
  181 #define ZIP_EM_PKZIP_AES_256 0x6610
  182 #define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */
  183 #define ZIP_EM_RC4 0x6801
  184 #endif
  185 #define ZIP_EM_AES_128 0x0101 /* Winzip AES encryption */
  186 #define ZIP_EM_AES_192 0x0102
  187 #define ZIP_EM_AES_256 0x0103
  188 #define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */
  189 
  190 #define ZIP_OPSYS_DOS 0x00u
  191 #define ZIP_OPSYS_AMIGA 0x01u
  192 #define ZIP_OPSYS_OPENVMS 0x02u
  193 #define ZIP_OPSYS_UNIX 0x03u
  194 #define ZIP_OPSYS_VM_CMS 0x04u
  195 #define ZIP_OPSYS_ATARI_ST 0x05u
  196 #define ZIP_OPSYS_OS_2 0x06u
  197 #define ZIP_OPSYS_MACINTOSH 0x07u
  198 #define ZIP_OPSYS_Z_SYSTEM 0x08u
  199 #define ZIP_OPSYS_CPM 0x09u
  200 #define ZIP_OPSYS_WINDOWS_NTFS 0x0au
  201 #define ZIP_OPSYS_MVS 0x0bu
  202 #define ZIP_OPSYS_VSE 0x0cu
  203 #define ZIP_OPSYS_ACORN_RISC 0x0du
  204 #define ZIP_OPSYS_VFAT 0x0eu
  205 #define ZIP_OPSYS_ALTERNATE_MVS 0x0fu
  206 #define ZIP_OPSYS_BEOS 0x10u
  207 #define ZIP_OPSYS_TANDEM 0x11u
  208 #define ZIP_OPSYS_OS_400 0x12u
  209 #define ZIP_OPSYS_OS_X 0x13u
  210 
  211 #define ZIP_OPSYS_DEFAULT ZIP_OPSYS_UNIX
  212 
  213 
  214 enum zip_source_cmd {
  215     ZIP_SOURCE_OPEN,                  /* prepare for reading */
  216     ZIP_SOURCE_READ,                  /* read data */
  217     ZIP_SOURCE_CLOSE,                 /* reading is done */
  218     ZIP_SOURCE_STAT,                  /* get meta information */
  219     ZIP_SOURCE_ERROR,                 /* get error information */
  220     ZIP_SOURCE_FREE,                  /* cleanup and free resources */
  221     ZIP_SOURCE_SEEK,                  /* set position for reading */
  222     ZIP_SOURCE_TELL,                  /* get read position */
  223     ZIP_SOURCE_BEGIN_WRITE,           /* prepare for writing */
  224     ZIP_SOURCE_COMMIT_WRITE,          /* writing is done */
  225     ZIP_SOURCE_ROLLBACK_WRITE,        /* discard written changes */
  226     ZIP_SOURCE_WRITE,                 /* write data */
  227     ZIP_SOURCE_SEEK_WRITE,            /* set position for writing */
  228     ZIP_SOURCE_TELL_WRITE,            /* get write position */
  229     ZIP_SOURCE_SUPPORTS,              /* check whether source supports command */
  230     ZIP_SOURCE_REMOVE,                /* remove file */
  231     ZIP_SOURCE_GET_COMPRESSION_FLAGS, /* get compression flags, internal only */
  232     ZIP_SOURCE_BEGIN_WRITE_CLONING    /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */
  233 };
  234 typedef enum zip_source_cmd zip_source_cmd_t;
  235 
  236 #define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd))
  237 
  238 // clang-format off
  239 
  240 #define ZIP_SOURCE_SUPPORTS_READABLE    (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \
  241                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_READ) \
  242                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_CLOSE) \
  243                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_STAT) \
  244                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ERROR) \
  245                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_FREE))
  246 
  247 #define ZIP_SOURCE_SUPPORTS_SEEKABLE    (ZIP_SOURCE_SUPPORTS_READABLE \
  248                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK) \
  249                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL) \
  250                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SUPPORTS))
  251 
  252 #define ZIP_SOURCE_SUPPORTS_WRITABLE    (ZIP_SOURCE_SUPPORTS_SEEKABLE \
  253                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE) \
  254                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_COMMIT_WRITE) \
  255                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ROLLBACK_WRITE) \
  256                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_WRITE) \
  257                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK_WRITE) \
  258                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL_WRITE) \
  259                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_REMOVE))
  260 
  261 // clang-format on
  262 
  263 /* for use by sources */
  264 struct zip_source_args_seek {
  265     zip_int64_t offset;
  266     int whence;
  267 };
  268 
  269 typedef struct zip_source_args_seek zip_source_args_seek_t;
  270 #define ZIP_SOURCE_GET_ARGS(type, data, len, error) ((len) < sizeof(type) ? zip_error_set((error), ZIP_ER_INVAL, 0), (type *)NULL : (type *)(data))
  271 
  272 
  273 /* error information */
  274 /* use zip_error_*() to access */
  275 struct zip_error {
  276     int zip_err; /* libzip error code (ZIP_ER_*) */
  277     int sys_err; /* copy of errno (E*) or zlib error code */
  278     char *str;   /* string representation or NULL */
  279 };
  280 
  281 #define ZIP_STAT_NAME 0x0001u
  282 #define ZIP_STAT_INDEX 0x0002u
  283 #define ZIP_STAT_SIZE 0x0004u
  284 #define ZIP_STAT_COMP_SIZE 0x0008u
  285 #define ZIP_STAT_MTIME 0x0010u
  286 #define ZIP_STAT_CRC 0x0020u
  287 #define ZIP_STAT_COMP_METHOD 0x0040u
  288 #define ZIP_STAT_ENCRYPTION_METHOD 0x0080u
  289 #define ZIP_STAT_FLAGS 0x0100u
  290 
  291 struct zip_stat {
  292     zip_uint64_t valid;             /* which fields have valid values */
  293     const char *name;               /* name of the file */
  294     zip_uint64_t index;             /* index within archive */
  295     zip_uint64_t size;              /* size of file (uncompressed) */
  296     zip_uint64_t comp_size;         /* size of file (compressed) */
  297     time_t mtime;                   /* modification time */
  298     zip_uint32_t crc;               /* crc of file data */
  299     zip_uint16_t comp_method;       /* compression method used */
  300     zip_uint16_t encryption_method; /* encryption method used */
  301     zip_uint32_t flags;             /* reserved for future use */
  302 };
  303 
  304 struct zip_buffer_fragment {
  305     zip_uint8_t *data;
  306     zip_uint64_t length;
  307 };
  308 
  309 struct zip;
  310 struct zip_file;
  311 struct zip_source;
  312 
  313 typedef struct zip zip_t;
  314 typedef struct zip_error zip_error_t;
  315 typedef struct zip_file zip_file_t;
  316 typedef struct zip_source zip_source_t;
  317 typedef struct zip_stat zip_stat_t;
  318 typedef struct zip_buffer_fragment zip_buffer_fragment_t;
  319 
  320 typedef zip_uint32_t zip_flags_t;
  321 
  322 typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, zip_source_cmd_t);
  323 typedef void (*zip_progress_callback)(zip_t *, double, void *);
  324 
  325 #ifndef ZIP_DISABLE_DEPRECATED
  326 typedef void (*zip_progress_callback_t)(double);
  327 ZIP_EXTERN void zip_register_progress_callback(zip_t *, zip_progress_callback_t); /* use zip_register_progress_callback_with_state */
  328 
  329 ZIP_EXTERN zip_int64_t zip_add(zip_t *, const char *, zip_source_t *);          /* use zip_file_add */
  330 ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *, const char *);                      /* use zip_dir_add */
  331 ZIP_EXTERN const char *zip_get_file_comment(zip_t *, zip_uint64_t, int *, int); /* use zip_file_get_comment */
  332 ZIP_EXTERN int zip_get_num_files(zip_t *);                                      /* use zip_get_num_entries instead */
  333 ZIP_EXTERN int zip_rename(zip_t *, zip_uint64_t, const char *);                 /* use zip_file_rename */
  334 ZIP_EXTERN int zip_replace(zip_t *, zip_uint64_t, zip_source_t *);              /* use zip_file_replace */
  335 ZIP_EXTERN int zip_set_file_comment(zip_t *, zip_uint64_t, const char *, int);  /* use zip_file_set_comment */
  336 ZIP_EXTERN int zip_error_get_sys_type(int);                                     /* use zip_error_system_type */
  337 ZIP_EXTERN void zip_error_get(zip_t *, int *, int *);                           /* use zip_get_error, zip_error_code_zip / zip_error_code_system */
  338 ZIP_EXTERN int zip_error_to_str(char *, zip_uint64_t, int, int);                /* use zip_error_init_with_code / zip_error_strerror */
  339 ZIP_EXTERN void zip_file_error_get(zip_file_t *, int *, int *);                 /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */
  340 #endif
  341 
  342 ZIP_EXTERN int zip_close(zip_t *);
  343 ZIP_EXTERN int zip_delete(zip_t *, zip_uint64_t);
  344 ZIP_EXTERN zip_int64_t zip_dir_add(zip_t *, const char *, zip_flags_t);
  345 ZIP_EXTERN void zip_discard(zip_t *);
  346 
  347 ZIP_EXTERN zip_error_t *zip_get_error(zip_t *);
  348 ZIP_EXTERN void zip_error_clear(zip_t *);
  349 ZIP_EXTERN int zip_error_code_zip(const zip_error_t *);
  350 ZIP_EXTERN int zip_error_code_system(const zip_error_t *);
  351 ZIP_EXTERN void zip_error_fini(zip_error_t *);
  352 ZIP_EXTERN void zip_error_init(zip_error_t *);
  353 ZIP_EXTERN void zip_error_init_with_code(zip_error_t *, int);
  354 ZIP_EXTERN void zip_error_set(zip_error_t *, int, int);
  355 ZIP_EXTERN const char *zip_error_strerror(zip_error_t *);
  356 ZIP_EXTERN int zip_error_system_type(const zip_error_t *);
  357 ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *, void *, zip_uint64_t);
  358 
  359 ZIP_EXTERN int zip_fclose(zip_file_t *);
  360 ZIP_EXTERN zip_t *zip_fdopen(int, int, int *);
  361 ZIP_EXTERN zip_int64_t zip_file_add(zip_t *, const char *, zip_source_t *, zip_flags_t);
  362 ZIP_EXTERN void zip_file_error_clear(zip_file_t *);
  363 ZIP_EXTERN int zip_file_extra_field_delete(zip_t *, zip_uint64_t, zip_uint16_t, zip_flags_t);
  364 ZIP_EXTERN int zip_file_extra_field_delete_by_id(zip_t *, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t);
  365 ZIP_EXTERN int zip_file_extra_field_set(zip_t *, zip_uint64_t, zip_uint16_t, zip_uint16_t, const zip_uint8_t *, zip_uint16_t, zip_flags_t);
  366 ZIP_EXTERN zip_int16_t zip_file_extra_fields_count(zip_t *, zip_uint64_t, zip_flags_t);
  367 ZIP_EXTERN zip_int16_t zip_file_extra_fields_count_by_id(zip_t *, zip_uint64_t, zip_uint16_t, zip_flags_t);
  368 ZIP_EXTERN const zip_uint8_t *zip_file_extra_field_get(zip_t *, zip_uint64_t, zip_uint16_t, zip_uint16_t *, zip_uint16_t *, zip_flags_t);
  369 ZIP_EXTERN const zip_uint8_t *zip_file_extra_field_get_by_id(zip_t *, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_uint16_t *, zip_flags_t);
  370 ZIP_EXTERN const char *zip_file_get_comment(zip_t *, zip_uint64_t, zip_uint32_t *, zip_flags_t);
  371 ZIP_EXTERN zip_error_t *zip_file_get_error(zip_file_t *);
  372 ZIP_EXTERN int zip_file_get_external_attributes(zip_t *, zip_uint64_t, zip_flags_t, zip_uint8_t *, zip_uint32_t *);
  373 ZIP_EXTERN int zip_file_rename(zip_t *, zip_uint64_t, const char *, zip_flags_t);
  374 ZIP_EXTERN int zip_file_replace(zip_t *, zip_uint64_t, zip_source_t *, zip_flags_t);
  375 ZIP_EXTERN int zip_file_set_comment(zip_t *, zip_uint64_t, const char *, zip_uint16_t, zip_flags_t);
  376 ZIP_EXTERN int zip_file_set_encryption(zip_t *, zip_uint64_t, zip_uint16_t, const char *);
  377 ZIP_EXTERN int zip_file_set_external_attributes(zip_t *, zip_uint64_t, zip_flags_t, zip_uint8_t, zip_uint32_t);
  378 ZIP_EXTERN int zip_file_set_mtime(zip_t *, zip_uint64_t, time_t, zip_flags_t);
  379 ZIP_EXTERN const char *zip_file_strerror(zip_file_t *);
  380 ZIP_EXTERN zip_file_t *zip_fopen(zip_t *, const char *, zip_flags_t);
  381 ZIP_EXTERN zip_file_t *zip_fopen_encrypted(zip_t *, const char *, zip_flags_t, const char *);
  382 ZIP_EXTERN zip_file_t *zip_fopen_index(zip_t *, zip_uint64_t, zip_flags_t);
  383 ZIP_EXTERN zip_file_t *zip_fopen_index_encrypted(zip_t *, zip_uint64_t, zip_flags_t, const char *);
  384 ZIP_EXTERN zip_int64_t zip_fread(zip_file_t *, void *, zip_uint64_t);
  385 ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t *, zip_int64_t, int);
  386 ZIP_EXTERN zip_int64_t zip_ftell(zip_file_t *);
  387 ZIP_EXTERN const char *zip_get_archive_comment(zip_t *, int *, zip_flags_t);
  388 ZIP_EXTERN int zip_get_archive_flag(zip_t *, zip_flags_t, zip_flags_t);
  389 ZIP_EXTERN const char *zip_get_name(zip_t *, zip_uint64_t, zip_flags_t);
  390 ZIP_EXTERN zip_int64_t zip_get_num_entries(zip_t *, zip_flags_t);
  391 ZIP_EXTERN const char *zip_libzip_version(void);
  392 ZIP_EXTERN zip_int64_t zip_name_locate(zip_t *, const char *, zip_flags_t);
  393 ZIP_EXTERN zip_t *zip_open(const char *, int, int *);
  394 ZIP_EXTERN zip_t *zip_open_from_source(zip_source_t *, int, zip_error_t *);
  395 ZIP_EXTERN int zip_register_progress_callback_with_state(zip_t *, double, zip_progress_callback, void (*)(void *), void *);
  396 ZIP_EXTERN int zip_set_archive_comment(zip_t *, const char *, zip_uint16_t);
  397 ZIP_EXTERN int zip_set_archive_flag(zip_t *, zip_flags_t, int);
  398 ZIP_EXTERN int zip_set_default_password(zip_t *, const char *);
  399 ZIP_EXTERN int zip_set_file_compression(zip_t *, zip_uint64_t, zip_int32_t, zip_uint32_t);
  400 ZIP_EXTERN int zip_source_begin_write(zip_source_t *);
  401 ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *, zip_uint64_t);
  402 ZIP_EXTERN zip_source_t *zip_source_buffer(zip_t *, const void *, zip_uint64_t, int);
  403 ZIP_EXTERN zip_source_t *zip_source_buffer_create(const void *, zip_uint64_t, int, zip_error_t *);
  404 ZIP_EXTERN zip_source_t *zip_source_buffer_fragment(zip_t *, const zip_buffer_fragment_t *, zip_uint64_t, int);
  405 ZIP_EXTERN zip_source_t *zip_source_buffer_fragment_create(const zip_buffer_fragment_t *, zip_uint64_t, int, zip_error_t *);
  406 ZIP_EXTERN int zip_source_close(zip_source_t *);
  407 ZIP_EXTERN int zip_source_commit_write(zip_source_t *);
  408 ZIP_EXTERN zip_error_t *zip_source_error(zip_source_t *);
  409 ZIP_EXTERN zip_source_t *zip_source_file(zip_t *, const char *, zip_uint64_t, zip_int64_t);
  410 ZIP_EXTERN zip_source_t *zip_source_file_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *);
  411 ZIP_EXTERN zip_source_t *zip_source_filep(zip_t *, FILE *, zip_uint64_t, zip_int64_t);
  412 ZIP_EXTERN zip_source_t *zip_source_filep_create(FILE *, zip_uint64_t, zip_int64_t, zip_error_t *);
  413 ZIP_EXTERN void zip_source_free(zip_source_t *);
  414 ZIP_EXTERN zip_source_t *zip_source_function(zip_t *, zip_source_callback, void *);
  415 ZIP_EXTERN zip_source_t *zip_source_function_create(zip_source_callback, void *, zip_error_t *);
  416 ZIP_EXTERN int zip_source_is_deleted(zip_source_t *);
  417 ZIP_EXTERN void zip_source_keep(zip_source_t *);
  418 ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...);
  419 ZIP_EXTERN int zip_source_open(zip_source_t *);
  420 ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *, void *, zip_uint64_t);
  421 ZIP_EXTERN void zip_source_rollback_write(zip_source_t *);
  422 ZIP_EXTERN int zip_source_seek(zip_source_t *, zip_int64_t, int);
  423 ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t, zip_uint64_t, void *, zip_uint64_t, zip_error_t *);
  424 ZIP_EXTERN int zip_source_seek_write(zip_source_t *, zip_int64_t, int);
  425 ZIP_EXTERN int zip_source_stat(zip_source_t *, zip_stat_t *);
  426 ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t *);
  427 ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *);
  428 #ifdef _WIN32
  429 ZIP_EXTERN zip_source_t *zip_source_win32a(zip_t *, const char *, zip_uint64_t, zip_int64_t);
  430 ZIP_EXTERN zip_source_t *zip_source_win32a_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *);
  431 ZIP_EXTERN zip_source_t *zip_source_win32handle(zip_t *, void *, zip_uint64_t, zip_int64_t);
  432 ZIP_EXTERN zip_source_t *zip_source_win32handle_create(void *, zip_uint64_t, zip_int64_t, zip_error_t *);
  433 ZIP_EXTERN zip_source_t *zip_source_win32w(zip_t *, const wchar_t *, zip_uint64_t, zip_int64_t);
  434 ZIP_EXTERN zip_source_t *zip_source_win32w_create(const wchar_t *, zip_uint64_t, zip_int64_t, zip_error_t *);
  435 #endif
  436 ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t *, const void *, zip_uint64_t);
  437 ZIP_EXTERN zip_source_t *zip_source_zip(zip_t *, zip_t *, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t);
  438 ZIP_EXTERN int zip_stat(zip_t *, const char *, zip_flags_t, zip_stat_t *);
  439 ZIP_EXTERN int zip_stat_index(zip_t *, zip_uint64_t, zip_flags_t, zip_stat_t *);
  440 ZIP_EXTERN void zip_stat_init(zip_stat_t *);
  441 ZIP_EXTERN const char *zip_strerror(zip_t *);
  442 ZIP_EXTERN int zip_unchange(zip_t *, zip_uint64_t);
  443 ZIP_EXTERN int zip_unchange_all(zip_t *);
  444 ZIP_EXTERN int zip_unchange_archive(zip_t *);
  445 
  446 #ifdef __cplusplus
  447 }
  448 #endif
  449 
  450 #endif /* _HAD_ZIP_H */