38 #include <sys/types.h>
55 for (
i = 0;
i <
cd->nentry;
i++)
73 cd->nentry =
cd->nentry_alloc = 0;
74 cd->size =
cd->offset = 0;
92 if (additional_entries == 0) {
96 new_alloc =
cd->nentry_alloc + additional_entries;
98 if (new_alloc < additional_entries || new_alloc >
SIZE_MAX /
sizeof(*(
cd->entry))) {
108 cd->entry = new_entry;
110 for (
i =
cd->nentry;
i < new_alloc;
i++) {
114 cd->nentry =
cd->nentry_alloc = new_alloc;
139 for (
i = 0;
i < survivors;
i++) {
222 memcpy(tde, sde,
sizeof(*sde));
611 if (
ef ==
NULL || ef_len < 5 ||
ef[0] != 1) {
626 if (ef_str !=
NULL) {
653 if (
ef ==
NULL || ef_len < 7) {
739 for (
i = 0;
i < (
local ? 2 : 3);
i++) {
772 bool is_really_zip64;
816 if (ef_buffer ==
NULL) {
860 if (ef_buffer ==
NULL) {
1007 memset(&tm, 0,
sizeof(tm));
1012 tm.tm_year = ((ddate >> 9) & 127) + 1980 - 1900;
1013 tm.tm_mon = ((ddate >> 5) & 15) - 1;
1014 tm.tm_mday = ddate & 31;
1016 tm.tm_hour = (dtime >> 11) & 31;
1017 tm.tm_min = (dtime >> 5) & 63;
1018 tm.tm_sec = (dtime << 1) & 62;
1093 #ifdef HAVE_LOCALTIME_R
1095 tpm = localtime_r(&intime, &tm);
1097 tpm = localtime(&intime);
1101 *ddate = (1 << 5) + 1;
1105 if (tpm->tm_year < 80) {
1109 *ddate = (
zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday);
1110 *dtime = (
zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1));
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
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
#define ZIP_FILE_ATTRIBUTES_ASCII
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
#define ZIP_FILE_ATTRIBUTES_HOST_SYSTEM
#define ZIP_EM_TRAD_PKWARE
#define ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES
ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int)
#define ZIP_ER_ENCRNOTSUPP
ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *_Nonnull)
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS
#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED
ZIP_EXTERN int zip_error_code_zip(const zip_error_t *_Nonnull)
#define ZIP_OPSYS_DEFAULT
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
static struct sockaddr static addrlen static backlog const void static flags void flags
bool local_extra_fields_read
zip_uint16_t version_needed
zip_extra_field_t * extra_fields
zip_uint16_t encryption_method
zip_uint16_t version_madeby
zip_uint16_t compression_level
zip_uint16_t general_purpose_bit_mask
zip_uint16_t general_purpose_bit_flags
zip_uint8_t version_needed
zip_uint32_t external_file_attributes
zip_string_t * comment_changes
zip_string_t * comment_orig
void error(const char *msg)
int _zip_buffer_put_8(zip_buffer_t *buffer, zip_uint8_t i)
zip_uint8_t * _zip_buffer_data(zip_buffer_t *buffer)
zip_uint32_t _zip_buffer_get_32(zip_buffer_t *buffer)
zip_uint64_t _zip_buffer_left(zip_buffer_t *buffer)
int _zip_buffer_put_16(zip_buffer_t *buffer, zip_uint16_t i)
zip_buffer_t * _zip_buffer_new(zip_uint8_t *data, zip_uint64_t size)
void _zip_buffer_free(zip_buffer_t *buffer)
zip_buffer_t * _zip_buffer_new_from_source(zip_source_t *src, zip_uint64_t size, zip_uint8_t *buf, zip_error_t *error)
bool _zip_buffer_ok(zip_buffer_t *buffer)
zip_uint16_t _zip_buffer_get_16(zip_buffer_t *buffer)
int _zip_buffer_skip(zip_buffer_t *buffer, zip_uint64_t length)
int _zip_buffer_put_64(zip_buffer_t *buffer, zip_uint64_t i)
bool _zip_buffer_eof(zip_buffer_t *buffer)
zip_uint64_t _zip_buffer_get_64(zip_buffer_t *buffer)
int _zip_buffer_put_32(zip_buffer_t *buffer, zip_uint32_t i)
zip_uint8_t _zip_buffer_get_8(zip_buffer_t *buffer)
zip_uint64_t _zip_buffer_offset(zip_buffer_t *buffer)
int _zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset)
int _zip_buffer_put(zip_buffer_t *buffer, const void *src, size_t length)
zip_uint8_t * _zip_buffer_get(zip_buffer_t *buffer, zip_uint64_t length)
zip_dirent_t * _zip_dirent_new(void)
zip_int64_t _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors)
zip_dirent_t * _zip_dirent_clone(const zip_dirent_t *sde)
void _zip_cdir_free(zip_cdir_t *cd)
void _zip_dirent_apply_attributes(zip_dirent_t *de, zip_file_attributes_t *attributes, bool force_zip64, zip_uint32_t changed)
void _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate)
static bool _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error)
int _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags)
zip_dirent_t * _zip_get_dirent(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *error)
static zip_extra_field_t * _zip_ef_utf8(zip_uint16_t, zip_string_t *, zip_error_t *)
zip_int32_t _zip_dirent_size(zip_source_t *src, zip_uint16_t flags, zip_error_t *error)
void _zip_dirent_init(zip_dirent_t *de)
void _zip_dirent_finalize(zip_dirent_t *zde)
zip_cdir_t * _zip_cdir_new(zip_uint64_t nentry, zip_error_t *error)
zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error)
void _zip_dirent_free(zip_dirent_t *zde)
bool _zip_cdir_grow(zip_cdir_t *cd, zip_uint64_t additional_entries, zip_error_t *error)
static zip_string_t * _zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str)
bool _zip_dirent_needs_zip64(const zip_dirent_t *de, zip_flags_t flags)
time_t _zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate)
void _zip_entry_init(zip_entry_t *e)
void _zip_entry_finalize(zip_entry_t *e)
void _zip_error_set_from_source(zip_error_t *err, zip_source_t *src)
zip_uint8_t * _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp, zip_error_t *error)
int _zip_write(zip_t *za, const void *data, zip_uint64_t length)
zip_string_t * _zip_read_string(zip_buffer_t *buffer, zip_source_t *src, zip_uint16_t len, bool nulp, zip_error_t *error)
zip_uint32_t _zip_string_crc32(const zip_string_t *s)
zip_string_t * _zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, zip_error_t *error)
void _zip_string_free(zip_string_t *s)
const zip_uint8_t * _zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip_error_t *error)
int _zip_string_write(zip_t *za, const zip_string_t *s)
zip_uint16_t _zip_string_length(const zip_string_t *s)
zip_encoding_type_t _zip_guess_encoding(zip_string_t *str, zip_encoding_type_t expected_encoding)
#define ZIP_DIRENT_ATTRIBUTES
#define ZIP_DIRENT_PASSWORD
#define ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT
#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS_ALLOWED_MASK
#define ZIP_EF_WINZIP_AES
#define ZIP_FL_FORCE_ZIP64
#define ZIP_DIRENT_EXTRA_FIELD
#define ZIP_ER_DETAIL_INVALID_ZIP64_EF
#define ZIP_EF_UTF_8_NAME
#define ZIP_DIRENT_FILENAME
#define ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW
#define ZIP_GPBF_ENCODING_UTF_8
enum zip_encoding_type zip_encoding_type_t
#define ZIP_GPBF_STRONG_ENCRYPTION
#define EF_WINZIP_AES_SIZE
#define ZIP_EXT_ATTRIB_DEFAULT
#define _zip_crypto_clear(b, l)
#define ZIP_EF_UTF_8_COMMENT
#define ZIP_ER_DETAIL_INVALID_UTF8_IN_FILENAME
#define ZIP_DIRENT_COMMENT
#define ZIP_ER_DETAIL_INVALID_WINZIPAES_EF
#define ZIP_CM_WINZIP_AES
#define ZIP_GPBF_ENCRYPTED
@ ZIP_ENCODING_UTF8_KNOWN