ReactOS 0.4.17-dev-966-gf06eace
CZipCreator.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Zip Shell Extension
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Create a zip file
5 * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
6 * Copyright 2019-2026 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
9#include "precomp.h"
10#include "atlsimpcoll.h"
11#include <process.h>
12
14{
15 return crc32(0L, reinterpret_cast<const BYTE*>(name), strlen(name));
16}
17
19{
23
25 ret += L".zip";
26
27 UINT i = 2;
28 while (PathFileExistsW(ret))
29 {
31 str.Format(L" (%u).zip", i++);
32
33 ret = szPath;
34 ret += str;
35 }
36
37 return ret;
38}
39
41{
42 WCHAR szBaseName[MAX_PATH];
43 StringCbCopyW(szBaseName, sizeof(szBaseName), filename);
44 PathRemoveFileSpecW(szBaseName);
45 PathAddBackslashW(szBaseName);
46 return szBaseName;
47}
48
49static CStringA
51{
52 CStringW basenameI = basename, filenameI = filename;
53 basenameI.MakeUpper();
54 filenameI.MakeUpper();
55
57 if (filenameI.Find(basenameI) == 0)
58 ret = filename.Mid(basename.GetLength());
59 else
60 ret = filename;
61
62 ret.Replace(L'\\', L'/');
63
64 return CStringA(CW2AEX<MAX_PATH>(ret, nCodePage));
65}
66
67static BOOL
69{
70 FILETIME ft, ftLocal;
71 ZeroMemory(pzi, sizeof(*pzi));
72 if (GetFileTime(hFile, NULL, NULL, &ft))
73 {
74 SYSTEMTIME st;
75 FileTimeToLocalFileTime(&ft, &ftLocal);
76 FileTimeToSystemTime(&ftLocal, &st);
77 pzi->tmz_date.tm_sec = st.wSecond;
78 pzi->tmz_date.tm_min = st.wMinute;
79 pzi->tmz_date.tm_hour = st.wHour;
80 pzi->tmz_date.tm_mday = st.wDay;
81 pzi->tmz_date.tm_mon = st.wMonth - 1;
82 pzi->tmz_date.tm_year = st.wYear;
83 return TRUE;
84 }
85 return FALSE;
86}
87
88static void
90{
92 {
93 files.Add(item);
94 return;
95 }
96
99 PathAppendW(szPath, L"*");
100
102 HANDLE hFind = FindFirstFileW(szPath, &find);
103 if (hFind == INVALID_HANDLE_VALUE)
104 return;
105
106 do
107 {
108 if (wcscmp(find.cFileName, L".") == 0 ||
109 wcscmp(find.cFileName, L"..") == 0)
110 {
111 continue;
112 }
113
114 StringCbCopyW(szPath, sizeof(szPath), item);
115 PathAppendW(szPath, find.cFileName);
116
117 if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
119 else
120 files.Add(szPath);
121 } while (FindNextFileW(hFind, &find));
122
123 FindClose(hFind);
124}
125
127{
131
132 unsigned JustDoIt();
133};
134
135CZipCreator* CZipCreator::DoCreate(PCWSTR pszExistingZip, PCWSTR pszTargetDir)
136{
137 CZipCreator* pCreator = new CZipCreator();
138 if (pszExistingZip)
139 pCreator->m_pimpl->m_ExistingZip = pszExistingZip;
140 if (pszTargetDir)
141 pCreator->m_pimpl->m_TargetDir = pszTargetDir;
142 return pCreator;
143}
144
146{
148}
149
151{
153 delete m_pimpl;
154}
155
156static unsigned __stdcall
158{
159 CZipCreator *pCreator = reinterpret_cast<CZipCreator *>(arg);
160 unsigned result = pCreator->m_pimpl->JustDoIt();
161
162 if (result == 0 && pCreator->m_pidlNotify)
164
165 return result;
166}
167
169{
170 unsigned tid = 0;
171 HANDLE hThread = reinterpret_cast<HANDLE>(
172 _beginthreadex(NULL, 0, create_zip_function, pCreator, 0, &tid));
173
174 if (hThread)
175 {
177 return TRUE;
178 }
179
180 DPRINT1("hThread == NULL\n");
181
184 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
185
186 delete pCreator;
187 return FALSE;
188}
189
191{
192 // canonicalize path
195
196 m_pimpl->m_items.Add(szPath);
197}
198
200{
206
208{
209 // TODO: Show progress.
210
211 CStringW strZipName;
212 INT appendMode;
214 {
215 strZipName = DoGetZipName(m_items[0]);
216 appendMode = APPEND_STATUS_CREATE;
217 }
218 else
219 {
220 strZipName = m_ExistingZip;
221 appendMode = APPEND_STATUS_ADDINZIP;
222 }
223
224 if (m_items.GetSize() <= 0)
225 {
226 DPRINT1("GetSize() <= 0\n");
227 return CZCERR_ZEROITEMS;
228 }
229
231 for (INT iItem = 0; iItem < m_items.GetSize(); ++iItem)
232 {
233 DoAddFilesFromItem(files, m_items[iItem]);
234 }
235
236 if (files.GetSize() <= 0)
237 {
238 DPRINT1("files.GetSize() <= 0\n");
239
241 CStringW strText;
242 strText.Format(IDS_NOFILES, static_cast<PCWSTR>(m_items[0]));
243 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
244
245 return CZCERR_NOFILES;
246 }
247
249 ZeroMemory(&ffunc, sizeof(ffunc));
251
252 zipFile zf = zipOpen2_64(strZipName, appendMode, NULL, &ffunc);
253 if (zf == 0)
254 {
255 DPRINT1("zf == 0\n");
256
257 int err = CZCERR_CREATE;
258
260 CStringW strText;
261 strText.Format(IDS_CANTCREATEZIP, static_cast<PCWSTR>(strZipName), err);
262 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
263
264 return err;
265 }
266
267 // TODO: password
268 const char *password = NULL;
269
270 // Use dwAllocationGranularity for file mapping
273 const ULONGLONG dwChunkSize = si.dwAllocationGranularity * 256;
274
275 // The loop for creating a ZIP file
276 CStringW strTarget, strBaseName = DoGetBaseName(m_items[0]);
277 UINT nCodePage = GetZipCodePage(FALSE);
278 INT err = ZIP_OK;
279 for (INT iFile = 0; iFile < files.GetSize() && err == ZIP_OK; ++iFile)
280 {
281 const CStringW& strFile = files[iFile];
282 zip_fileinfo zi;
283
284 // Open the file for storing it into a ZIP file
288 {
289 DPRINT1("Cannot open file '%S'\n", (PCWSTR)strFile);
291 break;
292 }
293
294 // Load the file time info
296
297 // Get the file size
298 LARGE_INTEGER fileSize;
299 if (!GetFileSizeEx(hFile, &fileSize))
300 {
301 DPRINT1("Cannot get file size '%S'\n", (PCWSTR)strFile);
304 break;
305 }
306
307 unsigned long crc = 0;
308 if (password)
309 {
310 // TODO: crc = ...;
311 }
312
313 // Get filename info
314 CStringA strNameInZip = DoGetNameInZip(strBaseName, strFile, nCodePage);
315 CStringA strNameInZipUTF8 = DoGetNameInZip(strBaseName, strFile, CP_UTF8);
316 if (!m_TargetDir.IsEmpty())
317 {
318 CStringA strTargetDir = CStringA(CW2AEX<MAX_PATH>(m_TargetDir, nCodePage));
319 strNameInZip = strTargetDir + strNameInZip;
320
322 strNameInZipUTF8 = strTargetDirUTF8 + strNameInZipUTF8;
323 }
324
325 // Prepare additional field (UTF-8 name)
326 CSimpleArray<BYTE> extraField;
327 if (nCodePage != CP_UTF8 && strNameInZip != strNameInZipUTF8)
328 {
329 // Header
330 WORD headerID = EF_UNIPATH, dataSize = 1 + 4 + strNameInZipUTF8.GetLength();
331 extraField.Add(headerID & 0xFF);
332 extraField.Add((headerID >> 8) & 0xFF);
333 extraField.Add(dataSize & 0xFF);
334 extraField.Add((dataSize >> 8) & 0xFF);
335 extraField.Add(1); // Version
336
337 // CRC32
338 DWORD nameCRC = CalculateNameCRC32(strNameInZip);
339 extraField.Add(nameCRC & 0xFF);
340 extraField.Add((nameCRC >> 8) & 0xFF);
341 extraField.Add((nameCRC >> 16) & 0xFF);
342 extraField.Add((nameCRC >> 24) & 0xFF);
343
344 // UTF-8 name
345 for (INT ich = 0; ich < strNameInZipUTF8.GetLength(); ++ich)
346 extraField.Add(strNameInZipUTF8[ich]);
347 }
348
349 // Add a new file entry into a ZIP file
350 err = zipOpenNewFileInZip4_64(zf, strNameInZip, &zi,
351 (extraField.GetSize() ? extraField.GetData() : NULL),
352 extraField.GetSize(), NULL, 0, NULL, Z_DEFLATED,
356 (nCodePage == CP_UTF8 ? MINIZIP_UTF8_FLAG : 0), 1);
357 if (err)
358 {
359 DPRINT1("zipOpenNewFileInZip3_64\n");
360 break;
361 }
362
363 if (fileSize.QuadPart > 0) // Not an empty file?
364 {
365 // Use a file mapping for quick file access and large file support
367 if (!hMapping)
368 {
369 DPRINT1("Cannot create file mapping\n");
372 break;
373 }
374
375 // The loop for reading and storing file contents
376 DWORD dwMapSize;
377 for (ULONGLONG offset = 0; offset < (ULONGLONG)fileSize.QuadPart && err == ZIP_OK;
378 offset += dwMapSize)
379 {
380 ULONGLONG dwDelta = fileSize.QuadPart - offset;
381 dwMapSize = (DWORD)min(dwChunkSize, dwDelta);
382 DWORD offsetLow = (DWORD)offset, offsetHigh = (DWORD)(offset >> 32);
383 PVOID pData = MapViewOfFile(hMapping, FILE_MAP_READ, offsetHigh, offsetLow,
384 dwMapSize);
385 if (!pData)
386 {
387 DPRINT1("Cannot map the view\n");
389 break;
390 }
391
392 err = zipWriteInFileInZip(zf, pData, dwMapSize);
394 }
395
396 CloseHandle(hMapping);
397 }
398
400
402 }
403
404 zipClose(zf, NULL);
405
406 if (err)
407 {
408 if (err && m_ExistingZip.IsEmpty())
409 DeleteFileW(strZipName);
410
412
413 CStringW strText;
414 if (err < 0)
415 strText.Format(IDS_CANTCREATEZIP, static_cast<PCWSTR>(strZipName), err);
416 else
417 strText.Format(IDS_CANTREADFILE, static_cast<PCWSTR>(strTarget));
418
419 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
420 }
421 else
422 {
423 WCHAR szFullPath[MAX_PATH];
424 GetFullPathNameW(strZipName, _countof(szFullPath), szFullPath, NULL);
425
428 else
430 }
431
432 return err;
433}
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
static CStringW DoGetZipName(PCWSTR filename)
Definition: CZipCreator.cpp:18
CZC_ERROR
@ CZCERR_NOFILES
@ CZCERR_ZEROITEMS
@ CZCERR_READ
@ CZCERR_CREATE
static unsigned __stdcall create_zip_function(void *arg)
static CStringA DoGetNameInZip(const CStringW &basename, const CStringW &filename, UINT nCodePage)
Definition: CZipCreator.cpp:50
static void DoAddFilesFromItem(CSimpleArray< CStringW > &files, PCWSTR item)
Definition: CZipCreator.cpp:89
static CStringW DoGetBaseName(PCWSTR filename)
Definition: CZipCreator.cpp:40
static DWORD CalculateNameCRC32(PCSTR name)
Definition: CZipCreator.cpp:13
static BOOL DoGetFileTimeInfo(HANDLE hFile, zip_fileinfo *pzi)
Definition: CZipCreator.cpp:68
#define EF_UNIPATH
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define DPRINT1
Definition: precomp.h:8
static UCHAR password[]
Definition: bcrypt.c:520
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
int GetLength() const noexcept
Definition: atlsimpstr.h:362
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
CStringT & MakeUpper()
Definition: cstringt.h:685
static BOOL runThread(CZipCreator *pCreator)
static CZipCreator * DoCreate(PCWSTR pszExistingZip=NULL, PCWSTR pszTargetDir=NULL)
struct CZipCreatorImpl * m_pimpl
Definition: CZipCreator.hpp:16
CComHeapPtr< ITEMIDLIST > m_pidlNotify
Definition: CZipCreator.hpp:17
virtual ~CZipCreator()
virtual void DoAddItem(PCWSTR pszFile)
static TAGID TAGID find
Definition: db.cpp:156
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MINIZIP_COMPATIBLE_VERSION
Definition: precomp.h:41
UINT GetZipCodePage(BOOL bUnZip)
Definition: zipfldr.cpp:88
#define MINIZIP_UTF8_FLAG
Definition: precomp.h:43
#define IDS_CANTCREATEZIP
Definition: resource.h:50
#define IDS_ERRORTITLE
Definition: resource.h:47
#define IDS_CANTSTARTTHREAD
Definition: resource.h:48
#define IDS_CANTREADFILE
Definition: resource.h:51
#define IDS_NOFILES
Definition: resource.h:49
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define GetFileSizeEx
Definition: compat.h:757
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
#define crc32(crc, buf, len)
Definition: inflate.c:1081
#define Z_DEFLATED
Definition: zlib.h:146
#define Z_DEFAULT_STRATEGY
Definition: zlib.h:137
#define MAX_WBITS
Definition: zlib.h:151
#define Z_DEFAULT_COMPRESSION
Definition: zlib.h:130
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:881
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:183
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:216
void WINAPI PathRemoveExtensionW(WCHAR *path)
Definition: path.c:1922
BOOL WINAPI PathRemoveFileSpecW(WCHAR *path)
Definition: path.c:1121
BOOL WINAPI PathFileExistsW(const WCHAR *path)
Definition: path.c:2583
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
#define __stdcall
Definition: corecrt.h:120
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
_ACRTIMP uintptr_t __cdecl _beginthreadex(void *, unsigned int, _beginthreadex_start_routine_t, void *, unsigned int, unsigned int *)
Definition: thread.c:207
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:669
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DEF_MEM_LEVEL
Definition: zutil.h:53
GLintptr offset
Definition: glext.h:5920
GLenum GLsizei dataSize
Definition: glext.h:11123
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
static TfClientId tid
const char * filename
Definition: ioapi.h:137
void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def)
Definition: iowin32.c:457
#define ZeroMemory
Definition: minwinbase.h:31
#define FILE_FLAG_SEQUENTIAL_SCAN
Definition: disk.h:43
LPCWSTR szPath
Definition: env.c:37
static SYSTEM_INFO si
Definition: virtual.c:39
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
CAtlStringA CStringA
Definition: atlstr.h:131
HANDLE hThread
Definition: wizard.c:28
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define DWORD
Definition: nt_native.h:44
#define PathAddBackslashW
Definition: pathcch.h:302
#define PathAppendW
Definition: pathcch.h:310
short WCHAR
Definition: pedump.c:58
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:798
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define err(...)
const WCHAR * str
#define CP_UTF8
Definition: nls.h:20
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1920
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1919
#define SHCNE_CREATE
Definition: shlobj.h:1908
#define SHCNF_PATHW
Definition: shlobj.h:1943
#define SHCNF_IDLIST
Definition: shlobj.h:1939
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
CStringW m_ExistingZip
unsigned JustDoIt()
CStringW m_TargetDir
CSimpleArray< CStringW > m_items
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
DWORD dwAllocationGranularity
Definition: winbase.h:902
Definition: name.c:39
int tm_hour
Definition: zip.h:93
int tm_min
Definition: zip.h:92
int tm_sec
Definition: zip.h:91
int tm_mon
Definition: zip.h:95
int tm_year
Definition: zip.h:96
int tm_mday
Definition: zip.h:94
tm_zip tmz_date
Definition: zip.h:101
#define new(TYPE, numElems)
Definition: treelist.c:54
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint64_t ULONGLONG
Definition: typedefs.h:67
const char * PCSTR
Definition: typedefs.h:52
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
void * arg
Definition: msvc.h:10
unsigned char BYTE
Definition: xxhash.c:193
int ZEXPORT zipClose(zipFile file, const char *global_comment)
Definition: zip.c:1883
int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64)
Definition: zip.c:1061
zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
Definition: zip.c:938
int ZEXPORT zipWriteInFileInZip(zipFile file, const void *buf, unsigned int len)
Definition: zip.c:1408
int ZEXPORT zipCloseFileInZip(zipFile file)
Definition: zip.c:1751
#define APPEND_STATUS_ADDINZIP
Definition: zip.h:114
#define ZIP_OK
Definition: zip.h:72
#define APPEND_STATUS_CREATE
Definition: zip.h:112
voidp zipFile
Definition: zip.h:69