chromium/third_party/libzip/src/lib/zip.h

#ifndef _HAD_ZIP_H
#define _HAD_ZIP_H

/*
  zip.h -- exported declarations.
  Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner

  This file is part of libzip, a library to manipulate ZIP archives.
  The authors can be contacted at <[email protected]>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.
  3. The names of the authors may not be used to endorse or promote
     products derived from this software without specific prior
     written permission.

  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef __cplusplus
extern "C" {
#if 0
} /* fix autoindent */
#endif
#endif

#include <zipconf.h>

#ifndef ZIP_EXTERN
#ifndef ZIP_STATIC
#ifdef _WIN32
#define ZIP_EXTERN
#elif defined(__GNUC__) && __GNUC__ >= 4
#define ZIP_EXTERN
#else
#define ZIP_EXTERN
#endif
#else
#define ZIP_EXTERN
#endif
#endif

#include <stdio.h>
#include <sys/types.h>
#include <time.h>

/* flags for zip_open */

#define ZIP_CREATE
#define ZIP_EXCL
#define ZIP_CHECKCONS
#define ZIP_TRUNCATE
#define ZIP_RDONLY

/* flags for zip_name_locate, zip_fopen, zip_stat, ... */

#define ZIP_FL_NOCASE
#define ZIP_FL_NODIR
#define ZIP_FL_COMPRESSED
#define ZIP_FL_UNCHANGED
#define ZIP_FL_RECOMPRESS
#define ZIP_FL_ENCRYPTED
#define ZIP_FL_ENC_GUESS
#define ZIP_FL_ENC_RAW
#define ZIP_FL_ENC_STRICT
#define ZIP_FL_LOCAL
#define ZIP_FL_CENTRAL
/*                           1024u    reserved for internal use */
#define ZIP_FL_ENC_UTF_8
#define ZIP_FL_ENC_CP437
#define ZIP_FL_OVERWRITE

/* archive global flags flags */

#define ZIP_AFL_RDONLY

/* create a new extra field */

#define ZIP_EXTRA_FIELD_ALL
#define ZIP_EXTRA_FIELD_NEW

/* libzip error codes */

#define ZIP_ER_OK
#define ZIP_ER_MULTIDISK
#define ZIP_ER_RENAME
#define ZIP_ER_CLOSE
#define ZIP_ER_SEEK
#define ZIP_ER_READ
#define ZIP_ER_WRITE
#define ZIP_ER_CRC
#define ZIP_ER_ZIPCLOSED
#define ZIP_ER_NOENT
#define ZIP_ER_EXISTS
#define ZIP_ER_OPEN
#define ZIP_ER_TMPOPEN
#define ZIP_ER_ZLIB
#define ZIP_ER_MEMORY
#define ZIP_ER_CHANGED
#define ZIP_ER_COMPNOTSUPP
#define ZIP_ER_EOF
#define ZIP_ER_INVAL
#define ZIP_ER_NOZIP
#define ZIP_ER_INTERNAL
#define ZIP_ER_INCONS
#define ZIP_ER_REMOVE
#define ZIP_ER_DELETED
#define ZIP_ER_ENCRNOTSUPP
#define ZIP_ER_RDONLY
#define ZIP_ER_NOPASSWD
#define ZIP_ER_WRONGPASSWD
#define ZIP_ER_OPNOTSUPP
#define ZIP_ER_INUSE
#define ZIP_ER_TELL
#define ZIP_ER_COMPRESSED_DATA
#define ZIP_ER_CANCELLED

/* type of system error value */

#define ZIP_ET_NONE
#define ZIP_ET_SYS
#define ZIP_ET_ZLIB

/* compression methods */

#define ZIP_CM_DEFAULT
#define ZIP_CM_STORE
#define ZIP_CM_SHRINK
#define ZIP_CM_REDUCE_1
#define ZIP_CM_REDUCE_2
#define ZIP_CM_REDUCE_3
#define ZIP_CM_REDUCE_4
#define ZIP_CM_IMPLODE
/* 7 - Reserved for Tokenizing compression algorithm */
#define ZIP_CM_DEFLATE
#define ZIP_CM_DEFLATE64
#define ZIP_CM_PKWARE_IMPLODE
/* 11 - Reserved by PKWARE */
#define ZIP_CM_BZIP2
/* 13 - Reserved by PKWARE */
#define ZIP_CM_LZMA
/* 15-17 - Reserved by PKWARE */
#define ZIP_CM_TERSE
#define ZIP_CM_LZ77
#define ZIP_CM_LZMA2
#define ZIP_CM_XZ
#define ZIP_CM_JPEG
#define ZIP_CM_WAVPACK
#define ZIP_CM_PPMD

/* encryption methods */

#define ZIP_EM_NONE
#define ZIP_EM_TRAD_PKWARE
#if 0                         /* Strong Encryption Header not parsed yet */
#define ZIP_EM_DES
#define ZIP_EM_RC2_OLD
#define ZIP_EM_3DES_168
#define ZIP_EM_3DES_112
#define ZIP_EM_PKZIP_AES_128
#define ZIP_EM_PKZIP_AES_192
#define ZIP_EM_PKZIP_AES_256
#define ZIP_EM_RC2
#define ZIP_EM_RC4
#endif
#define ZIP_EM_AES_128
#define ZIP_EM_AES_192
#define ZIP_EM_AES_256
#define ZIP_EM_UNKNOWN

#define ZIP_OPSYS_DOS
#define ZIP_OPSYS_AMIGA
#define ZIP_OPSYS_OPENVMS
#define ZIP_OPSYS_UNIX
#define ZIP_OPSYS_VM_CMS
#define ZIP_OPSYS_ATARI_ST
#define ZIP_OPSYS_OS_2
#define ZIP_OPSYS_MACINTOSH
#define ZIP_OPSYS_Z_SYSTEM
#define ZIP_OPSYS_CPM
#define ZIP_OPSYS_WINDOWS_NTFS
#define ZIP_OPSYS_MVS
#define ZIP_OPSYS_VSE
#define ZIP_OPSYS_ACORN_RISC
#define ZIP_OPSYS_VFAT
#define ZIP_OPSYS_ALTERNATE_MVS
#define ZIP_OPSYS_BEOS
#define ZIP_OPSYS_TANDEM
#define ZIP_OPSYS_OS_400
#define ZIP_OPSYS_OS_X

#define ZIP_OPSYS_DEFAULT

enum zip_source_cmd {};
zip_source_cmd_t;

#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)

/* clang-format off */

#define ZIP_SOURCE_SUPPORTS_READABLE

#define ZIP_SOURCE_SUPPORTS_SEEKABLE

#define ZIP_SOURCE_SUPPORTS_WRITABLE

/* clang-format on */

/* for use by sources */
struct zip_source_args_seek {};

zip_source_args_seek_t;
#define ZIP_SOURCE_GET_ARGS(type, data, len, error)

/* error information */
/* use zip_error_*() to access */
struct zip_error {};

#define ZIP_STAT_NAME
#define ZIP_STAT_INDEX
#define ZIP_STAT_SIZE
#define ZIP_STAT_COMP_SIZE
#define ZIP_STAT_MTIME
#define ZIP_STAT_CRC
#define ZIP_STAT_COMP_METHOD
#define ZIP_STAT_ENCRYPTION_METHOD
#define ZIP_STAT_FLAGS

struct zip_stat {};

struct zip_buffer_fragment {};

struct zip_file_attributes {};

#define ZIP_FILE_ATTRIBUTES_HOST_SYSTEM
#define ZIP_FILE_ATTRIBUTES_ASCII
#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED
#define ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS

struct zip;
struct zip_file;
struct zip_source;

zip_t;
zip_error_t;
zip_file_t;
zip_file_attributes_t;
zip_source_t;
zip_stat_t;
zip_buffer_fragment_t;

zip_flags_t;

zip_source_callback;
zip_progress_callback;
zip_cancel_callback;

#ifndef ZIP_DISABLE_DEPRECATED
zip_progress_callback_t;
ZIP_EXTERN void zip_register_progress_callback(
    zip_t* _Nonnull,
    zip_progress_callback_t _Nullable); /* use
                                           zip_register_progress_callback_with_state
                                         */

ZIP_EXTERN zip_int64_t zip_add(zip_t* _Nonnull,
                               const char* _Nonnull,
                               zip_source_t* _Nonnull); /* use zip_file_add */
ZIP_EXTERN zip_int64_t zip_add_dir(zip_t* _Nonnull,
                                   const char* _Nonnull); /* use zip_dir_add */
ZIP_EXTERN const char* _Nullable zip_get_file_comment(
    zip_t* _Nonnull,
    zip_uint64_t,
    int* _Nullable,
    int); /* use zip_file_get_comment */
ZIP_EXTERN int zip_get_num_files(
    zip_t* _Nonnull); /* use zip_get_num_entries instead */
ZIP_EXTERN int zip_rename(zip_t* _Nonnull,
                          zip_uint64_t,
                          const char* _Nonnull); /* use zip_file_rename */
ZIP_EXTERN int zip_replace(zip_t* _Nonnull,
                           zip_uint64_t,
                           zip_source_t* _Nonnull); /* use zip_file_replace */
ZIP_EXTERN int zip_set_file_comment(zip_t* _Nonnull,
                                    zip_uint64_t,
                                    const char* _Nullable,
                                    int);   /* use zip_file_set_comment */
ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */
ZIP_EXTERN void zip_error_get(
    zip_t* _Nonnull,
    int* _Nullable,
    int* _Nullable); /* use zip_get_error, zip_error_code_zip /
                        zip_error_code_system */
ZIP_EXTERN int zip_error_to_str(
    char* _Nonnull,
    zip_uint64_t,
    int,
    int); /* use zip_error_init_with_code / zip_error_strerror */
ZIP_EXTERN void zip_file_error_get(
    zip_file_t* _Nonnull,
    int* _Nullable,
    int* _Nullable); /* use zip_file_get_error, zip_error_code_zip /
                        zip_error_code_system */
#endif

ZIP_EXTERN int zip_close(zip_t* _Nonnull);
ZIP_EXTERN int zip_delete(zip_t* _Nonnull, zip_uint64_t);
ZIP_EXTERN zip_int64_t zip_dir_add(zip_t* _Nonnull,
                                   const char* _Nonnull,
                                   zip_flags_t);
ZIP_EXTERN void zip_discard(zip_t* _Nonnull);

ZIP_EXTERN zip_error_t* _Nonnull zip_get_error(zip_t* _Nonnull);
ZIP_EXTERN void zip_error_clear(zip_t* _Nonnull);
ZIP_EXTERN int zip_error_code_zip(const zip_error_t* _Nonnull);
ZIP_EXTERN int zip_error_code_system(const zip_error_t* _Nonnull);
ZIP_EXTERN void zip_error_fini(zip_error_t* _Nonnull);
ZIP_EXTERN void zip_error_init(zip_error_t* _Nonnull);
ZIP_EXTERN void zip_error_init_with_code(zip_error_t* _Nonnull, int);
ZIP_EXTERN void zip_error_set(zip_error_t* _Nullable, int, int);
ZIP_EXTERN const char* _Nonnull zip_error_strerror(zip_error_t* _Nonnull);
ZIP_EXTERN int zip_error_system_type(const zip_error_t* _Nonnull);
ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t* _Nonnull,
                                         void* _Nonnull,
                                         zip_uint64_t);

ZIP_EXTERN int zip_fclose(zip_file_t* _Nonnull);
ZIP_EXTERN zip_t* _Nullable zip_fdopen(int, int, int* _Nullable);
ZIP_EXTERN zip_int64_t zip_file_add(zip_t* _Nonnull,
                                    const char* _Nonnull,
                                    zip_source_t* _Nonnull,
                                    zip_flags_t);
ZIP_EXTERN void zip_file_attributes_init(zip_file_attributes_t* _Nonnull);
ZIP_EXTERN void zip_file_error_clear(zip_file_t* _Nonnull);
ZIP_EXTERN int zip_file_extra_field_delete(zip_t* _Nonnull,
                                           zip_uint64_t,
                                           zip_uint16_t,
                                           zip_flags_t);
ZIP_EXTERN int zip_file_extra_field_delete_by_id(zip_t* _Nonnull,
                                                 zip_uint64_t,
                                                 zip_uint16_t,
                                                 zip_uint16_t,
                                                 zip_flags_t);
ZIP_EXTERN int zip_file_extra_field_set(zip_t* _Nonnull,
                                        zip_uint64_t,
                                        zip_uint16_t,
                                        zip_uint16_t,
                                        const zip_uint8_t* _Nullable,
                                        zip_uint16_t,
                                        zip_flags_t);
ZIP_EXTERN zip_int16_t zip_file_extra_fields_count(zip_t* _Nonnull,
                                                   zip_uint64_t,
                                                   zip_flags_t);
ZIP_EXTERN zip_int16_t zip_file_extra_fields_count_by_id(zip_t* _Nonnull,
                                                         zip_uint64_t,
                                                         zip_uint16_t,
                                                         zip_flags_t);
ZIP_EXTERN const zip_uint8_t* _Nullable zip_file_extra_field_get(
    zip_t* _Nonnull,
    zip_uint64_t,
    zip_uint16_t,
    zip_uint16_t* _Nullable,
    zip_uint16_t* _Nullable,
    zip_flags_t);
ZIP_EXTERN const zip_uint8_t* _Nullable zip_file_extra_field_get_by_id(
    zip_t* _Nonnull,
    zip_uint64_t,
    zip_uint16_t,
    zip_uint16_t,
    zip_uint16_t* _Nullable,
    zip_flags_t);
ZIP_EXTERN const char* _Nullable zip_file_get_comment(zip_t* _Nonnull,
                                                      zip_uint64_t,
                                                      zip_uint32_t* _Nullable,
                                                      zip_flags_t);
ZIP_EXTERN zip_error_t* _Nonnull zip_file_get_error(zip_file_t* _Nonnull);
ZIP_EXTERN int zip_file_get_external_attributes(zip_t* _Nonnull,
                                                zip_uint64_t,
                                                zip_flags_t,
                                                zip_uint8_t* _Nullable,
                                                zip_uint32_t* _Nullable);
ZIP_EXTERN int zip_file_rename(zip_t* _Nonnull,
                               zip_uint64_t,
                               const char* _Nonnull,
                               zip_flags_t);
ZIP_EXTERN int zip_file_replace(zip_t* _Nonnull,
                                zip_uint64_t,
                                zip_source_t* _Nonnull,
                                zip_flags_t);
ZIP_EXTERN int zip_file_set_comment(zip_t* _Nonnull,
                                    zip_uint64_t,
                                    const char* _Nullable,
                                    zip_uint16_t,
                                    zip_flags_t);
ZIP_EXTERN int zip_file_set_dostime(zip_t* _Nonnull,
                                    zip_uint64_t,
                                    zip_uint16_t,
                                    zip_uint16_t,
                                    zip_flags_t);
ZIP_EXTERN int zip_file_set_encryption(zip_t* _Nonnull,
                                       zip_uint64_t,
                                       zip_uint16_t,
                                       const char* _Nullable);
ZIP_EXTERN int zip_file_set_external_attributes(zip_t* _Nonnull,
                                                zip_uint64_t,
                                                zip_flags_t,
                                                zip_uint8_t,
                                                zip_uint32_t);
ZIP_EXTERN int zip_file_set_mtime(zip_t* _Nonnull,
                                  zip_uint64_t,
                                  time_t,
                                  zip_flags_t);
ZIP_EXTERN const char* _Nonnull zip_file_strerror(zip_file_t* _Nonnull);
ZIP_EXTERN zip_file_t* _Nullable zip_fopen(zip_t* _Nonnull,
                                           const char* _Nonnull,
                                           zip_flags_t);
ZIP_EXTERN zip_file_t* _Nullable zip_fopen_encrypted(zip_t* _Nonnull,
                                                     const char* _Nonnull,
                                                     zip_flags_t,
                                                     const char* _Nullable);
ZIP_EXTERN zip_file_t* _Nullable zip_fopen_index(zip_t* _Nonnull,
                                                 zip_uint64_t,
                                                 zip_flags_t);
ZIP_EXTERN zip_file_t* _Nullable zip_fopen_index_encrypted(
    zip_t* _Nonnull,
    zip_uint64_t,
    zip_flags_t,
    const char* _Nullable);
ZIP_EXTERN zip_int64_t zip_fread(zip_file_t* _Nonnull,
                                 void* _Nonnull,
                                 zip_uint64_t);
ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t* _Nonnull, zip_int64_t, int);
ZIP_EXTERN zip_int64_t zip_ftell(zip_file_t* _Nonnull);
ZIP_EXTERN const char* _Nullable zip_get_archive_comment(zip_t* _Nonnull,
                                                         int* _Nullable,
                                                         zip_flags_t);
ZIP_EXTERN int zip_get_archive_flag(zip_t* _Nonnull, zip_flags_t, zip_flags_t);
ZIP_EXTERN const char* _Nullable zip_get_name(zip_t* _Nonnull,
                                              zip_uint64_t,
                                              zip_flags_t);
ZIP_EXTERN zip_int64_t zip_get_num_entries(zip_t* _Nonnull, zip_flags_t);
ZIP_EXTERN const char* _Nonnull zip_libzip_version(void);
ZIP_EXTERN zip_int64_t zip_name_locate(zip_t* _Nonnull,
                                       const char* _Nonnull,
                                       zip_flags_t);
ZIP_EXTERN zip_t* _Nullable zip_open(const char* _Nonnull, int, int* _Nullable);
ZIP_EXTERN zip_t* _Nullable zip_open_from_source(zip_source_t* _Nonnull,
                                                 int,
                                                 zip_error_t* _Nullable);
ZIP_EXTERN int zip_register_progress_callback_with_state(
    zip_t* _Nonnull,
    double,
    zip_progress_callback _Nullable,
    void (*_Nullable)(void* _Nullable),
    void* _Nullable);
ZIP_EXTERN int zip_register_cancel_callback_with_state(
    zip_t* _Nonnull,
    zip_cancel_callback _Nullable,
    void (*_Nullable)(void* _Nullable),
    void* _Nullable);
ZIP_EXTERN int zip_set_archive_comment(zip_t* _Nonnull,
                                       const char* _Nullable,
                                       zip_uint16_t);
ZIP_EXTERN int zip_set_archive_flag(zip_t* _Nonnull, zip_flags_t, int);
ZIP_EXTERN int zip_set_default_password(zip_t* _Nonnull, const char* _Nullable);
ZIP_EXTERN int zip_set_file_compression(zip_t* _Nonnull,
                                        zip_uint64_t,
                                        zip_int32_t,
                                        zip_uint32_t);
ZIP_EXTERN int zip_source_begin_write(zip_source_t* _Nonnull);
ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t* _Nonnull,
                                              zip_uint64_t);
ZIP_EXTERN zip_source_t* _Nullable zip_source_buffer(zip_t* _Nonnull,
                                                     const void* _Nullable,
                                                     zip_uint64_t,
                                                     int);
ZIP_EXTERN zip_source_t* _Nullable zip_source_buffer_create(
    const void* _Nullable,
    zip_uint64_t,
    int,
    zip_error_t* _Nullable);
ZIP_EXTERN zip_source_t* _Nullable zip_source_buffer_fragment(
    zip_t* _Nonnull,
    const zip_buffer_fragment_t* _Nonnull,
    zip_uint64_t,
    int);
ZIP_EXTERN zip_source_t* _Nullable zip_source_buffer_fragment_create(
    const zip_buffer_fragment_t* _Nullable,
    zip_uint64_t,
    int,
    zip_error_t* _Nullable);
ZIP_EXTERN int zip_source_close(zip_source_t* _Nonnull);
ZIP_EXTERN int zip_source_commit_write(zip_source_t* _Nonnull);
ZIP_EXTERN zip_error_t* _Nonnull zip_source_error(zip_source_t* _Nonnull);
ZIP_EXTERN zip_source_t* _Nullable zip_source_file(zip_t* _Nonnull,
                                                   const char* _Nonnull,
                                                   zip_uint64_t,
                                                   zip_int64_t);
ZIP_EXTERN zip_source_t* _Nullable zip_source_file_create(
    const char* _Nonnull,
    zip_uint64_t,
    zip_int64_t,
    zip_error_t* _Nullable);
ZIP_EXTERN zip_source_t* _Nullable zip_source_filep(zip_t* _Nonnull,
                                                    FILE* _Nonnull,
                                                    zip_uint64_t,
                                                    zip_int64_t);
ZIP_EXTERN zip_source_t* _Nullable zip_source_filep_create(
    FILE* _Nonnull,
    zip_uint64_t,
    zip_int64_t,
    zip_error_t* _Nullable);
ZIP_EXTERN void zip_source_free(zip_source_t* _Nullable);
ZIP_EXTERN zip_source_t* _Nullable zip_source_function(
    zip_t* _Nonnull,
    zip_source_callback _Nonnull,
    void* _Nullable);
ZIP_EXTERN zip_source_t* _Nullable zip_source_function_create(
    zip_source_callback _Nonnull,
    void* _Nullable,
    zip_error_t* _Nullable);
ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t* _Nonnull,
                                              zip_file_attributes_t* _Nonnull);
ZIP_EXTERN int zip_source_is_deleted(zip_source_t* _Nonnull);
ZIP_EXTERN void zip_source_keep(zip_source_t* _Nonnull);
ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...);
ZIP_EXTERN int zip_source_open(zip_source_t* _Nonnull);
ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t* _Nonnull,
                                       void* _Nonnull,
                                       zip_uint64_t);
ZIP_EXTERN void zip_source_rollback_write(zip_source_t* _Nonnull);
ZIP_EXTERN int zip_source_seek(zip_source_t* _Nonnull, zip_int64_t, int);
ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t,
                                                      zip_uint64_t,
                                                      void* _Nonnull,
                                                      zip_uint64_t,
                                                      zip_error_t* _Nullable);
ZIP_EXTERN int zip_source_seek_write(zip_source_t* _Nonnull, zip_int64_t, int);
ZIP_EXTERN int zip_source_stat(zip_source_t* _Nonnull, zip_stat_t* _Nonnull);
ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t* _Nonnull);
ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t* _Nonnull);
#ifdef _WIN32
ZIP_EXTERN zip_source_t* zip_source_win32a(zip_t*,
                                           const char*,
                                           zip_uint64_t,
                                           zip_int64_t);
ZIP_EXTERN zip_source_t* zip_source_win32a_create(const char*,
                                                  zip_uint64_t,
                                                  zip_int64_t,
                                                  zip_error_t*);
ZIP_EXTERN zip_source_t* zip_source_win32handle(zip_t*,
                                                void*,
                                                zip_uint64_t,
                                                zip_int64_t);
ZIP_EXTERN zip_source_t* zip_source_win32handle_create(void*,
                                                       zip_uint64_t,
                                                       zip_int64_t,
                                                       zip_error_t*);
ZIP_EXTERN zip_source_t* zip_source_win32w(zip_t*,
                                           const wchar_t*,
                                           zip_uint64_t,
                                           zip_int64_t);
ZIP_EXTERN zip_source_t* zip_source_win32w_create(const wchar_t*,
                                                  zip_uint64_t,
                                                  zip_int64_t,
                                                  zip_error_t*);
#endif
ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t* _Nonnull,
                                        const void* _Nullable,
                                        zip_uint64_t);
ZIP_EXTERN zip_source_t* _Nullable zip_source_zip(zip_t* _Nonnull,
                                                  zip_t* _Nonnull,
                                                  zip_uint64_t,
                                                  zip_flags_t,
                                                  zip_uint64_t,
                                                  zip_int64_t);
ZIP_EXTERN int zip_stat(zip_t* _Nonnull,
                        const char* _Nonnull,
                        zip_flags_t,
                        zip_stat_t* _Nonnull);
ZIP_EXTERN int zip_stat_index(zip_t* _Nonnull,
                              zip_uint64_t,
                              zip_flags_t,
                              zip_stat_t* _Nonnull);
ZIP_EXTERN void zip_stat_init(zip_stat_t* _Nonnull);
ZIP_EXTERN const char* _Nonnull zip_strerror(zip_t* _Nonnull);
ZIP_EXTERN int zip_unchange(zip_t* _Nonnull, zip_uint64_t);
ZIP_EXTERN int zip_unchange_all(zip_t* _Nonnull);
ZIP_EXTERN int zip_unchange_archive(zip_t* _Nonnull);
ZIP_EXTERN int zip_compression_method_supported(zip_int32_t method,
                                                int compress);
ZIP_EXTERN int zip_encryption_method_supported(zip_uint16_t method, int encode);

#ifdef __cplusplus
}
#endif

#endif /* _HAD_ZIP_H */