| 1 | /* zip.c -- Backwards compatible zip interface |
| 2 | part of the minizip-ng project |
| 3 | |
| 4 | Copyright (C) Nathan Moinvaziri |
| 5 | https://github.com/zlib-ng/minizip-ng |
| 6 | Copyright (C) 1998-2010 Gilles Vollant |
| 7 | https://www.winimage.com/zLibDll/minizip.html |
| 8 | |
| 9 | This program is distributed under the terms of the same license as zlib. |
| 10 | See the accompanying LICENSE file for the full text of the license. |
| 11 | */ |
| 12 | |
| 13 | #include "mz.h"cxx . . $ `<file>/mz.h`/ |
| 14 | #include "mz_os.h"cxx . . $ `<file>/mz_os.h`/ |
| 15 | #include "mz_strm.h"cxx . . $ `<file>/mz_strm.h`/ |
| 16 | #include "mz_strm_os.h"cxx . . $ `<file>/mz_strm_os.h`/ |
| 17 | #include "mz_zip.h"cxx . . $ `<file>/mz_zip.h`/ |
| 18 | |
| 19 | #include "zip.h"cxx . . $ `<file>/compat/zip.h`/ |
| 20 | |
| 21 | /***************************************************************************/ |
| 22 | |
| 23 | typedef struct mz_zip_compat_scxx . . $ mz_zip_compat_s# { |
| 24 | void *streamcxx . . $ mz_zip_compat_s#stream.; |
| 25 | void *handlecxx . . $ mz_zip_compat_s#handle.; |
| 26 | } mz_zip_compatcxx . . $ mz_zip_compat#; |
| 27 | |
| 28 | /***************************************************************************/ |
| 29 | |
| 30 | static int32_tcxx . . $ int32_t# zipConvertAppendToStreamModecxx . . $ zipConvertAppendToStreamMode(7864480464b09eea).(int append) { |
| 31 | int32_tcxx . . $ int32_t# mode = MZ_OPEN_MODE_WRITEcxx . . $ `mz.h:51:9`!; |
| 32 | switch (append) { |
| 33 | case APPEND_STATUS_CREATEcxx . . $ `compat/zip.h:94:9`!: |
| 34 | mode |= MZ_OPEN_MODE_CREATEcxx . . $ `mz.h:54:9`!; |
| 35 | break; |
| 36 | case APPEND_STATUS_CREATEAFTERcxx . . $ `compat/zip.h:95:9`!: |
| 37 | mode |= MZ_OPEN_MODE_CREATEcxx . . $ `mz.h:54:9`! | MZ_OPEN_MODE_APPENDcxx . . $ `mz.h:53:9`!; |
| 38 | break; |
| 39 | case APPEND_STATUS_ADDINZIPcxx . . $ `compat/zip.h:96:9`!: |
| 40 | mode |= MZ_OPEN_MODE_READcxx . . $ `mz.h:50:9`! | MZ_OPEN_MODE_APPENDcxx . . $ `mz.h:53:9`!; |
| 41 | break; |
| 42 | } |
| 43 | return mode; |
| 44 | } |
| 45 | |
| 46 | zipFilecxx . . $ zipFile# zipOpencxx . . $ zipOpen(fb9ec0bb113f3da8).(const char *path, int append) { |
| 47 | return zipOpen2cxx . . $ zipOpen2(8ffb402732c6b63f).(path, append, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 48 | } |
| 49 | |
| 50 | zipFilecxx . . $ zipFile# zipOpen64cxx . . $ zipOpen64(9e54ad7ae2b3e1ba).(const void *path, int append) { |
| 51 | return zipOpen2cxx . . $ zipOpen2(8ffb402732c6b63f).(path, append, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 52 | } |
| 53 | |
| 54 | zipFilecxx . . $ zipFile# zipOpen2cxx . . $ zipOpen2(8ffb402732c6b63f).(const char *path, int append, zipcharpccxx . . $ zipcharpc# *globalcomment, zlib_filefunc_defcxx . . $ zlib_filefunc_def# *pzlib_filefunc_def) { |
| 55 | zipFilecxx . . $ zipFile# zip = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 56 | int32_tcxx . . $ int32_t# mode = zipConvertAppendToStreamModecxx . . $ zipConvertAppendToStreamMode(7864480464b09eea).(append); |
| 57 | void *stream = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 58 | |
| 59 | if (pzlib_filefunc_def) { |
| 60 | if (pzlib_filefunc_def->zopen_filecxx . . $ zlib_filefunc_def_s#zopen_file.) { |
| 61 | stream = mz_stream_ioapi_createcxx . . $ mz_stream_ioapi_create(50c7df7de5344ebb).(); |
| 62 | if (!stream) |
| 63 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 64 | mz_stream_ioapi_set_filefunccxx . . $ mz_stream_ioapi_set_filefunc(c7baa3b6b19787c2).(stream, pzlib_filefunc_def); |
| 65 | } else if (pzlib_filefunc_def->opaquecxx . . $ zlib_filefunc_def_s#opaque.) { |
| 66 | stream = mz_stream_createcxx . . $ mz_stream_create(f660b63577525b91).((mz_stream_vtblcxx . . $ mz_stream_vtbl# *)pzlib_filefunc_def->opaquecxx . . $ zlib_filefunc_def_s#opaque.); |
| 67 | if (!stream) |
| 68 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | if (!stream) { |
| 73 | stream = mz_stream_os_createcxx . . $ mz_stream_os_create(50c7df7de5344ebb).(); |
| 74 | if (!stream) |
| 75 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 76 | } |
| 77 | |
| 78 | if (mz_stream_opencxx . . $ mz_stream_open(7083a8984c0735e8).(stream, path, mode) != MZ_OKcxx . . $ `mz.h:21:9`!) { |
| 79 | mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(&stream); |
| 80 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 81 | } |
| 82 | |
| 83 | zip = zipOpen_MZcxx . . $ zipOpen_MZ(d0e8f2556fab45).(stream, append, globalcomment); |
| 84 | |
| 85 | if (!zip) { |
| 86 | mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(&stream); |
| 87 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 88 | } |
| 89 | |
| 90 | return zip; |
| 91 | } |
| 92 | |
| 93 | zipFilecxx . . $ zipFile# zipOpen2_64cxx . . $ zipOpen2_64(72f84b7f97b125d9).(const void *path, int append, zipcharpccxx . . $ zipcharpc# *globalcomment, zlib_filefunc64_defcxx . . $ zlib_filefunc64_def# *pzlib_filefunc_def) { |
| 94 | zipFilecxx . . $ zipFile# zip = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 95 | int32_tcxx . . $ int32_t# mode = zipConvertAppendToStreamModecxx . . $ zipConvertAppendToStreamMode(7864480464b09eea).(append); |
| 96 | void *stream = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 97 | |
| 98 | if (pzlib_filefunc_def) { |
| 99 | if (pzlib_filefunc_def->zopen64_filecxx . . $ zlib_filefunc64_def_s#zopen64_file.) { |
| 100 | stream = mz_stream_ioapi_createcxx . . $ mz_stream_ioapi_create(50c7df7de5344ebb).(); |
| 101 | if (!stream) |
| 102 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 103 | mz_stream_ioapi_set_filefunc64cxx . . $ mz_stream_ioapi_set_filefunc64(ca0c56fe0832fb26).(stream, pzlib_filefunc_def); |
| 104 | } else if (pzlib_filefunc_def->opaquecxx . . $ zlib_filefunc64_def_s#opaque.) { |
| 105 | stream = mz_stream_createcxx . . $ mz_stream_create(f660b63577525b91).((mz_stream_vtblcxx . . $ mz_stream_vtbl# *)pzlib_filefunc_def->opaquecxx . . $ zlib_filefunc64_def_s#opaque.); |
| 106 | if (!stream) |
| 107 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | if (!stream) { |
| 112 | stream = mz_stream_os_createcxx . . $ mz_stream_os_create(50c7df7de5344ebb).(); |
| 113 | if (!stream) |
| 114 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 115 | } |
| 116 | |
| 117 | if (mz_stream_opencxx . . $ mz_stream_open(7083a8984c0735e8).(stream, path, mode) != MZ_OKcxx . . $ `mz.h:21:9`!) { |
| 118 | mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(&stream); |
| 119 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 120 | } |
| 121 | |
| 122 | zip = zipOpen_MZcxx . . $ zipOpen_MZ(d0e8f2556fab45).(stream, append, globalcomment); |
| 123 | |
| 124 | if (!zip) { |
| 125 | mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(&stream); |
| 126 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 127 | } |
| 128 | |
| 129 | return zip; |
| 130 | } |
| 131 | |
| 132 | zipFilecxx . . $ zipFile# zipOpen_MZcxx . . $ zipOpen_MZ(d0e8f2556fab45).(void *stream, int append, zipcharpccxx . . $ zipcharpc# *globalcomment) { |
| 133 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 134 | int32_tcxx . . $ int32_t# err = MZ_OKcxx . . $ `mz.h:21:9`!; |
| 135 | int32_tcxx . . $ int32_t# mode = zipConvertAppendToStreamModecxx . . $ zipConvertAppendToStreamMode(7864480464b09eea).(append); |
| 136 | void *handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 137 | |
| 138 | handle = mz_zip_createcxx . . $ mz_zip_create(50c7df7de5344ebb).(); |
| 139 | if (!handle) |
| 140 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 141 | |
| 142 | err = mz_zip_opencxx . . $ mz_zip_open(8bc41909eac9e5d8).(handle, stream, mode); |
| 143 | |
| 144 | if (err != MZ_OKcxx . . $ `mz.h:21:9`!) { |
| 145 | mz_zip_deletecxx . . $ mz_zip_delete(539e082cf00e1f43).(&handle); |
| 146 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 147 | } |
| 148 | |
| 149 | if (globalcomment) |
| 150 | mz_zip_get_commentcxx . . $ mz_zip_get_comment(1160c33587cf46c5).(handle, globalcomment); |
| 151 | |
| 152 | compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(mz_zip_compatcxx . . $ mz_zip_compat#)); |
| 153 | if (compat) { |
| 154 | compat->handlecxx . . $ mz_zip_compat_s#handle. = handle; |
| 155 | compat->streamcxx . . $ mz_zip_compat_s#stream. = stream; |
| 156 | } else { |
| 157 | mz_zip_deletecxx . . $ mz_zip_delete(539e082cf00e1f43).(&handle); |
| 158 | } |
| 159 | |
| 160 | return (zipFilecxx . . $ zipFile#)compat; |
| 161 | } |
| 162 | |
| 163 | void *zipGetHandle_MZcxx . . $ zipGetHandle_MZ(9f162e79bfc6c74).(zipFilecxx . . $ zipFile# file) { |
| 164 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 165 | if (!compat) |
| 166 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 167 | return compat->handlecxx . . $ mz_zip_compat_s#handle.; |
| 168 | } |
| 169 | |
| 170 | void *zipGetStream_MZcxx . . $ zipGetStream_MZ(9f162e79bfc6c74).(zipFilecxx . . $ zipFile# file) { |
| 171 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 172 | if (!compat) |
| 173 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 174 | return (void *)compat->streamcxx . . $ mz_zip_compat_s#stream.; |
| 175 | } |
| 176 | |
| 177 | static time_tcxx . . $ time_t# zipConvertZipDateToTimecxx . . $ zipConvertZipDateToTime(f84b9be8c299d068).(tm_zipcxx . . $ tm_zip# tmz_date) { |
| 178 | struct tmcxx . . $ tm# tm_date; |
| 179 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&tm_date, 0, sizeof(struct tmcxx . . $ tm#)); |
| 180 | memcpycxx . . $ memcpy(cc817cb175f282d).(&tm_date, &tmz_date, sizeof(tm_zipcxx . . $ tm_zip#)); |
| 181 | tm_date.tm_yearcxx . . $ tm#tm_year. -= 1900; |
| 182 | tm_date.tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 183 | return mz_zip_tm_to_time_tcxx . . $ mz_zip_tm_to_time_t(237c3516b2cfac2c).(&tm_date); |
| 184 | } |
| 185 | |
| 186 | int zipOpenNewFileInZip5cxx . . $ zipOpenNewFileInZip5(e5e9e32606423d18).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 187 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, uint16_tcxx . . $ uint16_t# size_extrafield_global, |
| 188 | const char *comment, int compression_method, int level, int raw, int windowBits, int memLevel, |
| 189 | int strategy, const char *password, unsigned long crc_for_crypting, |
| 190 | unsigned long version_madeby, unsigned long flag_base, int zip64) { |
| 191 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 192 | mz_zip_filecxx . . $ mz_zip_file# file_info; |
| 193 | |
| 194 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(strategy); |
| 195 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(memLevel); |
| 196 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(windowBits); |
| 197 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(size_extrafield_local); |
| 198 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(extrafield_local); |
| 199 | MZ_UNUSEDcxx . . $ `mz.h:147:9`!(crc_for_crypting); |
| 200 | |
| 201 | if (!compat) |
| 202 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 203 | |
| 204 | /* The filename and comment length must fit in 16 bits. */ |
| 205 | if (filename && strlencxx . . $ strlen(751346f8406fd082).(filename) > 0xffff) |
| 206 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 207 | if (comment && strlencxx . . $ strlen(751346f8406fd082).(comment) > 0xffff) |
| 208 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 209 | |
| 210 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&file_info, 0, sizeof(file_info)); |
| 211 | |
| 212 | if (zipfi) { |
| 213 | if (zipfi->mz_dos_datecxx . . $ `compat/zip.h:80:11`! != 0) |
| 214 | file_info.modified_datecxx . . $ mz_zip_file_s#modified_date. = mz_zip_dosdate_to_time_tcxx . . $ mz_zip_dosdate_to_time_t(f7e21917e59627ec).(zipfi->mz_dos_datecxx . . $ `compat/zip.h:80:11`!); |
| 215 | else |
| 216 | file_info.modified_datecxx . . $ mz_zip_file_s#modified_date. = zipConvertZipDateToTimecxx . . $ zipConvertZipDateToTime(f84b9be8c299d068).(zipfi->tmz_datecxx . . $ $anonymous_type_ea0a60d7a3367c8a_0#tmz_date.); |
| 217 | |
| 218 | file_info.external_facxx . . $ mz_zip_file_s#external_fa. = (uint32_tcxx . . $ uint32_t#)zipfi->external_facxx . . $ $anonymous_type_ea0a60d7a3367c8a_0#external_fa.; |
| 219 | file_info.internal_facxx . . $ mz_zip_file_s#internal_fa. = (uint16_tcxx . . $ uint16_t#)zipfi->internal_facxx . . $ $anonymous_type_ea0a60d7a3367c8a_0#internal_fa.; |
| 220 | } |
| 221 | |
| 222 | if (!filename) |
| 223 | filename = "-"; |
| 224 | |
| 225 | file_info.compression_methodcxx . . $ mz_zip_file_s#compression_method. = (uint16_tcxx . . $ uint16_t#)compression_method; |
| 226 | file_info.filenamecxx . . $ mz_zip_file_s#filename. = filename; |
| 227 | /* file_info.extrafield_local = extrafield_local; */ |
| 228 | /* file_info.extrafield_local_size = size_extrafield_local; */ |
| 229 | file_info.extrafieldcxx . . $ mz_zip_file_s#extrafield. = extrafield_global; |
| 230 | file_info.extrafield_sizecxx . . $ mz_zip_file_s#extrafield_size. = size_extrafield_global; |
| 231 | file_info.version_madebycxx . . $ mz_zip_file_s#version_madeby. = (uint16_tcxx . . $ uint16_t#)version_madeby; |
| 232 | file_info.commentcxx . . $ mz_zip_file_s#comment. = comment; |
| 233 | if (file_info.commentcxx . . $ mz_zip_file_s#comment.) |
| 234 | file_info.comment_sizecxx . . $ mz_zip_file_s#comment_size. = (uint16_tcxx . . $ uint16_t#)strlencxx . . $ strlen(751346f8406fd082).(file_info.commentcxx . . $ mz_zip_file_s#comment.); |
| 235 | file_info.flagcxx . . $ mz_zip_file_s#flag. = (uint16_tcxx . . $ uint16_t#)flag_base; |
| 236 | if (zip64) |
| 237 | file_info.zip64cxx . . $ mz_zip_file_s#zip64. = MZ_ZIP64_FORCEcxx . . $ `mz.h:98:9`!; |
| 238 | else |
| 239 | file_info.zip64cxx . . $ mz_zip_file_s#zip64. = MZ_ZIP64_DISABLEcxx . . $ `mz.h:99:9`!; |
| 240 | #ifdef HAVE_WZAEScxx . . $ `<built-in>:416:9`! |
| 241 | if (password || (raw && (file_info.flagcxx . . $ mz_zip_file_s#flag. & MZ_ZIP_FLAG_ENCRYPTEDcxx . . $ `mz.h:77:9`!))) |
| 242 | file_info.aes_versioncxx . . $ mz_zip_file_s#aes_version. = MZ_AES_VERSIONcxx . . $ `mz.h:113:9`!; |
| 243 | #endif |
| 244 | |
| 245 | return mz_zip_entry_write_opencxx . . $ mz_zip_entry_write_open(20cb44e2e54ec293).(compat->handlecxx . . $ mz_zip_compat_s#handle., &file_info, (int16_tcxx . . $ int16_t#)level, (uint8_tcxx . . $ uint8_t#)raw, password); |
| 246 | } |
| 247 | |
| 248 | int zipOpenNewFileInZip4_64cxx . . $ zipOpenNewFileInZip4_64(e5e9e32606423d18).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 249 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, |
| 250 | uint16_tcxx . . $ uint16_t# size_extrafield_global, const char *comment, int compression_method, int level, |
| 251 | int raw, int windowBits, int memLevel, int strategy, const char *password, |
| 252 | unsigned long crc_for_crypting, unsigned long version_madeby, unsigned long flag_base, |
| 253 | int zip64) { |
| 254 | return zipOpenNewFileInZip5cxx . . $ zipOpenNewFileInZip5(e5e9e32606423d18).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 255 | size_extrafield_global, comment, compression_method, level, raw, windowBits, memLevel, |
| 256 | strategy, password, crc_for_crypting, version_madeby, flag_base, zip64); |
| 257 | } |
| 258 | |
| 259 | int zipOpenNewFileInZip4cxx . . $ zipOpenNewFileInZip4(2f19661c10ce5227).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 260 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, uint16_tcxx . . $ uint16_t# size_extrafield_global, |
| 261 | const char *comment, int compression_method, int level, int raw, int windowBits, int memLevel, |
| 262 | int strategy, const char *password, unsigned long crc_for_crypting, |
| 263 | unsigned long version_madeby, unsigned long flag_base) { |
| 264 | return zipOpenNewFileInZip4_64cxx . . $ zipOpenNewFileInZip4_64(e5e9e32606423d18).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 265 | size_extrafield_global, comment, compression_method, level, raw, windowBits, |
| 266 | memLevel, strategy, password, crc_for_crypting, version_madeby, flag_base, 0); |
| 267 | } |
| 268 | |
| 269 | int zipOpenNewFileInZip3cxx . . $ zipOpenNewFileInZip3(ceaa5c8479839d6f).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 270 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, uint16_tcxx . . $ uint16_t# size_extrafield_global, |
| 271 | const char *comment, int compression_method, int level, int raw, int windowBits, int memLevel, |
| 272 | int strategy, const char *password, unsigned long crc_for_crypting) { |
| 273 | return zipOpenNewFileInZip3_64cxx . . $ zipOpenNewFileInZip3_64(37ff6970dcefa137).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 274 | size_extrafield_global, comment, compression_method, level, raw, windowBits, |
| 275 | memLevel, strategy, password, crc_for_crypting, 0); |
| 276 | } |
| 277 | |
| 278 | int zipOpenNewFileInZip3_64cxx . . $ zipOpenNewFileInZip3_64(37ff6970dcefa137).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 279 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, |
| 280 | uint16_tcxx . . $ uint16_t# size_extrafield_global, const char *comment, int compression_method, int level, |
| 281 | int raw, int windowBits, int memLevel, int strategy, const char *password, |
| 282 | unsigned long crc_for_crypting, int zip64) { |
| 283 | return zipOpenNewFileInZip4_64cxx . . $ zipOpenNewFileInZip4_64(e5e9e32606423d18).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 284 | size_extrafield_global, comment, compression_method, level, raw, windowBits, |
| 285 | memLevel, strategy, password, crc_for_crypting, MZ_VERSION_MADEBYcxx . . $ `mz_os.h:40:9`!, 0, zip64); |
| 286 | } |
| 287 | |
| 288 | int zipOpenNewFileInZip2cxx . . $ zipOpenNewFileInZip2(4e6789aa9dccef91).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 289 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, uint16_tcxx . . $ uint16_t# size_extrafield_global, |
| 290 | const char *comment, int compression_method, int level, int raw) { |
| 291 | return zipOpenNewFileInZip3_64cxx . . $ zipOpenNewFileInZip3_64(37ff6970dcefa137).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 292 | size_extrafield_global, comment, compression_method, level, raw, 0, 0, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0, |
| 293 | 0); |
| 294 | } |
| 295 | |
| 296 | int zipOpenNewFileInZip2_64cxx . . $ zipOpenNewFileInZip2_64(42bd67f73cb48adc).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 297 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, |
| 298 | uint16_tcxx . . $ uint16_t# size_extrafield_global, const char *comment, int compression_method, int level, |
| 299 | int raw, int zip64) { |
| 300 | return zipOpenNewFileInZip3_64cxx . . $ zipOpenNewFileInZip3_64(37ff6970dcefa137).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 301 | size_extrafield_global, comment, compression_method, level, raw, 0, 0, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0, |
| 302 | zip64); |
| 303 | } |
| 304 | |
| 305 | int zipOpenNewFileInZipcxx . . $ zipOpenNewFileInZip(7ef2ad9b3db8144).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 306 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, uint16_tcxx . . $ uint16_t# size_extrafield_global, |
| 307 | const char *comment, int compression_method, int level) { |
| 308 | return zipOpenNewFileInZip_64cxx . . $ zipOpenNewFileInZip_64(4e6789aa9dccef91).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 309 | size_extrafield_global, comment, compression_method, level, 0); |
| 310 | } |
| 311 | |
| 312 | int zipOpenNewFileInZip64cxx . . $ zipOpenNewFileInZip64(4e6789aa9dccef91).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 313 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, |
| 314 | uint16_tcxx . . $ uint16_t# size_extrafield_global, const char *comment, int compression_method, int level, |
| 315 | int zip64) { |
| 316 | return zipOpenNewFileInZip2_64cxx . . $ zipOpenNewFileInZip2_64(42bd67f73cb48adc).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 317 | size_extrafield_global, comment, compression_method, level, 0, zip64); |
| 318 | } |
| 319 | |
| 320 | int zipOpenNewFileInZip_64cxx . . $ zipOpenNewFileInZip_64(4e6789aa9dccef91).(zipFilecxx . . $ zipFile# file, const char *filename, const zip_fileinfocxx . . $ zip_fileinfo# *zipfi, const void *extrafield_local, |
| 321 | uint16_tcxx . . $ uint16_t# size_extrafield_local, const void *extrafield_global, |
| 322 | uint16_tcxx . . $ uint16_t# size_extrafield_global, const char *comment, int compression_method, int level, |
| 323 | int zip64) { |
| 324 | return zipOpenNewFileInZip2_64cxx . . $ zipOpenNewFileInZip2_64(42bd67f73cb48adc).(file, filename, zipfi, extrafield_local, size_extrafield_local, extrafield_global, |
| 325 | size_extrafield_global, comment, compression_method, level, 0, zip64); |
| 326 | } |
| 327 | |
| 328 | int zipWriteInFileInZipcxx . . $ zipWriteInFileInZip(45733b120b1d036c).(zipFilecxx . . $ zipFile# file, const void *buf, uint32_tcxx . . $ uint32_t# len) { |
| 329 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 330 | int32_tcxx . . $ int32_t# written = 0; |
| 331 | if (!compat || len >= INT32_MAXcxx . . $ `<external>/3415975807581488833/stdint.h:112:10`!) |
| 332 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 333 | written = mz_zip_entry_writecxx . . $ mz_zip_entry_write(91e54fd90adbb21).(compat->handlecxx . . $ mz_zip_compat_s#handle., buf, (int32_tcxx . . $ int32_t#)len); |
| 334 | if ((written < 0) || ((uint32_tcxx . . $ uint32_t#)written != len)) |
| 335 | return ZIP_ERRNOcxx . . $ `compat/zip.h:51:9`!; |
| 336 | return ZIP_OKcxx . . $ `compat/zip.h:49:9`!; |
| 337 | } |
| 338 | |
| 339 | int zipCloseFileInZipRawcxx . . $ zipCloseFileInZipRaw(9a5c82343a5ae9bc).(zipFilecxx . . $ zipFile# file, unsigned long uncompressed_size, unsigned long crc32) { |
| 340 | return zipCloseFileInZipRaw64cxx . . $ zipCloseFileInZipRaw64(9a5c82343a5ae9bc).(file, uncompressed_size, crc32); |
| 341 | } |
| 342 | |
| 343 | int zipCloseFileInZipRaw64cxx . . $ zipCloseFileInZipRaw64(9a5c82343a5ae9bc).(zipFilecxx . . $ zipFile# file, uint64_tcxx . . $ uint64_t# uncompressed_size, unsigned long crc32) { |
| 344 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 345 | if (!compat) |
| 346 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 347 | return mz_zip_entry_close_rawcxx . . $ mz_zip_entry_close_raw(85007a28ff75c5e5).(compat->handlecxx . . $ mz_zip_compat_s#handle., (int64_tcxx . . $ int64_t#)uncompressed_size, (uint32_tcxx . . $ uint32_t#)crc32); |
| 348 | } |
| 349 | |
| 350 | int zipCloseFileInZipcxx . . $ zipCloseFileInZip(dedf1e9b1c614a07).(zipFilecxx . . $ zipFile# file) { |
| 351 | return zipCloseFileInZip64cxx . . $ zipCloseFileInZip64(dedf1e9b1c614a07).(file); |
| 352 | } |
| 353 | |
| 354 | int zipCloseFileInZip64cxx . . $ zipCloseFileInZip64(dedf1e9b1c614a07).(zipFilecxx . . $ zipFile# file) { |
| 355 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 356 | if (!compat) |
| 357 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 358 | return mz_zip_entry_closecxx . . $ mz_zip_entry_close(dedf1e9b1c614a07).(compat->handlecxx . . $ mz_zip_compat_s#handle.); |
| 359 | } |
| 360 | |
| 361 | int zipClosecxx . . $ zipClose(f53b6be6549e6d95).(zipFilecxx . . $ zipFile# file, const char *global_comment) { |
| 362 | return zipClose_64cxx . . $ zipClose_64(f53b6be6549e6d95).(file, global_comment); |
| 363 | } |
| 364 | |
| 365 | int zipClose_64cxx . . $ zipClose_64(f53b6be6549e6d95).(zipFilecxx . . $ zipFile# file, const char *global_comment) { |
| 366 | return zipClose2_64cxx . . $ zipClose2_64(3f12c0a817aecbd3).(file, global_comment, MZ_VERSION_MADEBYcxx . . $ `mz_os.h:40:9`!); |
| 367 | } |
| 368 | |
| 369 | int zipClose2_64cxx . . $ zipClose2_64(3f12c0a817aecbd3).(zipFilecxx . . $ zipFile# file, const char *global_comment, uint16_tcxx . . $ uint16_t# version_madeby) { |
| 370 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 371 | int32_tcxx . . $ int32_t# err = MZ_OKcxx . . $ `mz.h:21:9`!; |
| 372 | |
| 373 | if (compat->handlecxx . . $ mz_zip_compat_s#handle.) |
| 374 | err = zipClose2_MZcxx . . $ zipClose2_MZ(3f12c0a817aecbd3).(file, global_comment, version_madeby); |
| 375 | |
| 376 | if (compat->streamcxx . . $ mz_zip_compat_s#stream.) { |
| 377 | mz_stream_closecxx . . $ mz_stream_close(dedf1e9b1c614a07).(compat->streamcxx . . $ mz_zip_compat_s#stream.); |
| 378 | mz_stream_deletecxx . . $ mz_stream_delete(539e082cf00e1f43).(&compat->streamcxx . . $ mz_zip_compat_s#stream.); |
| 379 | } |
| 380 | |
| 381 | freecxx . . $ free(5d22bdacc48458e8).(compat); |
| 382 | |
| 383 | return err; |
| 384 | } |
| 385 | |
| 386 | /* Only closes the zip handle, does not close the stream */ |
| 387 | int zipClose_MZcxx . . $ zipClose_MZ(f53b6be6549e6d95).(zipFilecxx . . $ zipFile# file, const char *global_comment) { |
| 388 | return zipClose2_MZcxx . . $ zipClose2_MZ(3f12c0a817aecbd3).(file, global_comment, MZ_VERSION_MADEBYcxx . . $ `mz_os.h:40:9`!); |
| 389 | } |
| 390 | |
| 391 | /* Only closes the zip handle, does not close the stream */ |
| 392 | int zipClose2_MZcxx . . $ zipClose2_MZ(3f12c0a817aecbd3).(zipFilecxx . . $ zipFile# file, const char *global_comment, uint16_tcxx . . $ uint16_t# version_madeby) { |
| 393 | mz_zip_compatcxx . . $ mz_zip_compat# *compat = (mz_zip_compatcxx . . $ mz_zip_compat# *)file; |
| 394 | int32_tcxx . . $ int32_t# err = MZ_OKcxx . . $ `mz.h:21:9`!; |
| 395 | |
| 396 | if (!compat) |
| 397 | return ZIP_PARAMERRORcxx . . $ `compat/zip.h:52:9`!; |
| 398 | if (!compat->handlecxx . . $ mz_zip_compat_s#handle.) |
| 399 | return err; |
| 400 | |
| 401 | if (global_comment) |
| 402 | mz_zip_set_commentcxx . . $ mz_zip_set_comment(f53b6be6549e6d95).(compat->handlecxx . . $ mz_zip_compat_s#handle., global_comment); |
| 403 | |
| 404 | mz_zip_set_version_madebycxx . . $ mz_zip_set_version_madeby(f805ef7ae580f896).(compat->handlecxx . . $ mz_zip_compat_s#handle., version_madeby); |
| 405 | err = mz_zip_closecxx . . $ mz_zip_close(dedf1e9b1c614a07).(compat->handlecxx . . $ mz_zip_compat_s#handle.); |
| 406 | mz_zip_deletecxx . . $ mz_zip_delete(539e082cf00e1f43).(&compat->handlecxx . . $ mz_zip_compat_s#handle.); |
| 407 | |
| 408 | return err; |
| 409 | } |