ReactOS 0.4.16-dev-2491-g3dc6630
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 "minizip/zip.h"
12#include "minizip/iowin32.h"
13#include <process.h>
14
16{
17 return crc32(0L, reinterpret_cast<const BYTE*>(name), strlen(name));
18}
19
21{
25
27 ret += L".zip";
28
29 UINT i = 2;
30 while (PathFileExistsW(ret))
31 {
33 str.Format(L" (%u).zip", i++);
34
35 ret = szPath;
36 ret += str;
37 }
38
39 return ret;
40}
41
43{
44 WCHAR szBaseName[MAX_PATH];
45 StringCbCopyW(szBaseName, sizeof(szBaseName), filename);
46 PathRemoveFileSpecW(szBaseName);
47 PathAddBackslashW(szBaseName);
48 return szBaseName;
49}
50
51static CStringA
53{
54 CStringW basenameI = basename, filenameI = filename;
55 basenameI.MakeUpper();
56 filenameI.MakeUpper();
57
59 if (filenameI.Find(basenameI) == 0)
60 ret = filename.Mid(basename.GetLength());
61 else
62 ret = filename;
63
64 ret.Replace(L'\\', L'/');
65
66 return CStringA(CW2AEX<MAX_PATH>(ret, nCodePage));
67}
68
69static BOOL
71{
72 FILETIME ft, ftLocal;
73 ZeroMemory(pzi, sizeof(*pzi));
74 if (GetFileTime(hFile, NULL, NULL, &ft))
75 {
76 SYSTEMTIME st;
77 FileTimeToLocalFileTime(&ft, &ftLocal);
78 FileTimeToSystemTime(&ftLocal, &st);
79 pzi->tmz_date.tm_sec = st.wSecond;
80 pzi->tmz_date.tm_min = st.wMinute;
81 pzi->tmz_date.tm_hour = st.wHour;
82 pzi->tmz_date.tm_mday = st.wDay;
83 pzi->tmz_date.tm_mon = st.wMonth - 1;
84 pzi->tmz_date.tm_year = st.wYear;
85 return TRUE;
86 }
87 return FALSE;
88}
89
90static void
92{
94 {
95 files.Add(item);
96 return;
97 }
98
100 StringCbCopyW(szPath, sizeof(szPath), item);
101 PathAppendW(szPath, L"*");
102
104 HANDLE hFind = FindFirstFileW(szPath, &find);
105 if (hFind == INVALID_HANDLE_VALUE)
106 return;
107
108 do
109 {
110 if (wcscmp(find.cFileName, L".") == 0 ||
111 wcscmp(find.cFileName, L"..") == 0)
112 {
113 continue;
114 }
115
116 StringCbCopyW(szPath, sizeof(szPath), item);
117 PathAppendW(szPath, find.cFileName);
118
119 if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
121 else
122 files.Add(szPath);
123 } while (FindNextFileW(hFind, &find));
124
125 FindClose(hFind);
126}
127
129{
133
134 unsigned JustDoIt();
135};
136
137CZipCreator* CZipCreator::DoCreate(PCWSTR pszExistingZip, PCWSTR pszTargetDir)
138{
139 CZipCreator* pCreator = new CZipCreator();
140 if (pszExistingZip)
141 pCreator->m_pimpl->m_ExistingZip = pszExistingZip;
142 if (pszTargetDir)
143 pCreator->m_pimpl->m_TargetDir = pszTargetDir;
144 return pCreator;
145}
146
148{
150}
151
153{
155 delete m_pimpl;
156}
157
158static unsigned __stdcall
160{
161 CZipCreator *pCreator = reinterpret_cast<CZipCreator *>(arg);
162 unsigned result = pCreator->m_pimpl->JustDoIt();
163
164 if (result == 0 && pCreator->m_pidlNotify)
166
167 return result;
168}
169
171{
172 unsigned tid = 0;
173 HANDLE hThread = reinterpret_cast<HANDLE>(
174 _beginthreadex(NULL, 0, create_zip_function, pCreator, 0, &tid));
175
176 if (hThread)
177 {
179 return TRUE;
180 }
181
182 DPRINT1("hThread == NULL\n");
183
186 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
187
188 delete pCreator;
189 return FALSE;
190}
191
193{
194 // canonicalize path
197
198 m_pimpl->m_items.Add(szPath);
199}
200
202{
208
210{
211 // TODO: Show progress.
212
213 CStringW strZipName;
214 INT appendMode;
216 {
217 strZipName = DoGetZipName(m_items[0]);
218 appendMode = APPEND_STATUS_CREATE;
219 }
220 else
221 {
222 strZipName = m_ExistingZip;
223 appendMode = APPEND_STATUS_ADDINZIP;
224 }
225
226 if (m_items.GetSize() <= 0)
227 {
228 DPRINT1("GetSize() <= 0\n");
229 return CZCERR_ZEROITEMS;
230 }
231
233 for (INT iItem = 0; iItem < m_items.GetSize(); ++iItem)
234 {
235 DoAddFilesFromItem(files, m_items[iItem]);
236 }
237
238 if (files.GetSize() <= 0)
239 {
240 DPRINT1("files.GetSize() <= 0\n");
241
243 CStringW strText;
244 strText.Format(IDS_NOFILES, static_cast<PCWSTR>(m_items[0]));
245 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
246
247 return CZCERR_NOFILES;
248 }
249
251 ZeroMemory(&ffunc, sizeof(ffunc));
253
254 zipFile zf = zipOpen2_64(strZipName, appendMode, NULL, &ffunc);
255 if (zf == 0)
256 {
257 DPRINT1("zf == 0\n");
258
259 int err = CZCERR_CREATE;
260
262 CStringW strText;
263 strText.Format(IDS_CANTCREATEZIP, static_cast<PCWSTR>(strZipName), err);
264 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
265
266 return err;
267 }
268
269 // TODO: password
270 const char *password = NULL;
271
272 // Use dwAllocationGranularity for file mapping
275 const ULONGLONG dwChunkSize = si.dwAllocationGranularity * 256;
276
277 // The loop for creating a ZIP file
278 CStringW strTarget, strBaseName = DoGetBaseName(m_items[0]);
279 UINT nCodePage = GetZipCodePage(FALSE);
280 INT err = ZIP_OK;
281 for (INT iFile = 0; iFile < files.GetSize() && err == ZIP_OK; ++iFile)
282 {
283 const CStringW& strFile = files[iFile];
284 zip_fileinfo zi;
285
286 // Open the file for storing it into a ZIP file
290 {
291 DPRINT1("Cannot open file '%S'\n", (PCWSTR)strFile);
293 break;
294 }
295
296 // Load the file time info
298
299 // Get the file size
300 LARGE_INTEGER fileSize;
301 if (!GetFileSizeEx(hFile, &fileSize))
302 {
303 DPRINT1("Cannot get file size '%S'\n", (PCWSTR)strFile);
306 break;
307 }
308
309 unsigned long crc = 0;
310 if (password)
311 {
312 // TODO: crc = ...;
313 }
314
315 // Get filename info
316 CStringA strNameInZip = DoGetNameInZip(strBaseName, strFile, nCodePage);
317 CStringA strNameInZipUTF8 = DoGetNameInZip(strBaseName, strFile, CP_UTF8);
318 if (!m_TargetDir.IsEmpty())
319 {
320 CStringA strTargetDir = CStringA(CW2AEX<MAX_PATH>(m_TargetDir, nCodePage));
321 strNameInZip = strTargetDir + strNameInZip;
322
324 strNameInZipUTF8 = strTargetDirUTF8 + strNameInZipUTF8;
325 }
326
327 // Prepare additional field (UTF-8 name)
328 CSimpleArray<BYTE> extraField;
329 if (nCodePage != CP_UTF8 && strNameInZip != strNameInZipUTF8)
330 {
331 // Header
332 WORD headerID = EF_UNIPATH, dataSize = 1 + 4 + strNameInZipUTF8.GetLength();
333 extraField.Add(headerID & 0xFF);
334 extraField.Add((headerID >> 8) & 0xFF);
335 extraField.Add(dataSize & 0xFF);
336 extraField.Add((dataSize >> 8) & 0xFF);
337 extraField.Add(1); // Version
338
339 // CRC32
340 DWORD nameCRC = CalculateNameCRC32(strNameInZip);
341 extraField.Add(nameCRC & 0xFF);
342 extraField.Add((nameCRC >> 8) & 0xFF);
343 extraField.Add((nameCRC >> 16) & 0xFF);
344 extraField.Add((nameCRC >> 24) & 0xFF);
345
346 // UTF-8 name
347 for (INT ich = 0; ich < strNameInZipUTF8.GetLength(); ++ich)
348 extraField.Add(strNameInZipUTF8[ich]);
349 }
350
351 // Add a new file entry into a ZIP file
352 err = zipOpenNewFileInZip4_64(zf, strNameInZip, &zi,
353 (extraField.GetSize() ? extraField.GetData() : NULL),
354 extraField.GetSize(), NULL, 0, NULL, Z_DEFLATED,
358 (nCodePage == CP_UTF8 ? MINIZIP_UTF8_FLAG : 0), 1);
359 if (err)
360 {
361 DPRINT1("zipOpenNewFileInZip3_64\n");
362 break;
363 }
364
365 if (fileSize.QuadPart > 0) // Not an empty file?
366 {
367 // Use a file mapping for quick file access and large file support
369 if (!hMapping)
370 {
371 DPRINT1("Cannot create file mapping\n");
374 break;
375 }
376
377 // The loop for reading and storing file contents
378 DWORD dwMapSize;
379 for (ULONGLONG offset = 0; offset < (ULONGLONG)fileSize.QuadPart && err == ZIP_OK;
380 offset += dwMapSize)
381 {
382 ULONGLONG dwDelta = fileSize.QuadPart - offset;
383 dwMapSize = (DWORD)min(dwChunkSize, dwDelta);
384 DWORD offsetLow = (DWORD)offset, offsetHigh = (DWORD)(offset >> 32);
385 PVOID pData = MapViewOfFile(hMapping, FILE_MAP_READ, offsetHigh, offsetLow,
386 dwMapSize);
387 if (!pData)
388 {
389 DPRINT1("Cannot map the view\n");
391 break;
392 }
393
394 err = zipWriteInFileInZip(zf, pData, dwMapSize);
396 }
397
398 CloseHandle(hMapping);
399 }
400
402
404 }
405
406 zipClose(zf, NULL);
407
408 if (err)
409 {
410 if (err && m_ExistingZip.IsEmpty())
411 DeleteFileW(strZipName);
412
414
415 CStringW strText;
416 if (err < 0)
417 strText.Format(IDS_CANTCREATEZIP, static_cast<PCWSTR>(strZipName), err);
418 else
419 strText.Format(IDS_CANTREADFILE, static_cast<PCWSTR>(strTarget));
420
421 MessageBoxW(NULL, strText, strTitle, MB_ICONERROR);
422 }
423 else
424 {
425 WCHAR szFullPath[MAX_PATH];
426 GetFullPathNameW(strZipName, _countof(szFullPath), szFullPath, NULL);
427
430 else
432 }
433
434 return err;
435}
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
static CStringW DoGetZipName(PCWSTR filename)
Definition: CZipCreator.cpp:20
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:52
static void DoAddFilesFromItem(CSimpleArray< CStringW > &files, PCWSTR item)
Definition: CZipCreator.cpp:91
static CStringW DoGetBaseName(PCWSTR filename)
Definition: CZipCreator.cpp:42
static DWORD CalculateNameCRC32(PCSTR name)
Definition: CZipCreator.cpp:15
static BOOL DoGetFileTimeInfo(HANDLE hFile, zip_fileinfo *pzi)
Definition: CZipCreator.cpp:70
#define EF_UNIPATH
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define DPRINT1
Definition: precomp.h:8
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:91
#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:880
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:1106
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
void WINAPI PathRemoveExtensionW(WCHAR *path)
Definition: path.c:1946
BOOL WINAPI PathRemoveFileSpecW(WCHAR *path)
Definition: path.c:1145
BOOL WINAPI PathFileExistsW(const WCHAR *path)
Definition: path.c:2607
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:1972
_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:1592
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729
return ret
Definition: mutex.c:146
#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
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
static WCHAR password[]
Definition: url.c:33
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
CAtlStringA CStringA
Definition: atlstr.h:131
unsigned int UINT
Definition: ndis.h:50
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
#define err(...)
const WCHAR * str
#define CP_UTF8
Definition: nls.h:20
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1910
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1909
#define SHCNE_CREATE
Definition: shlobj.h:1898
#define SHCNF_PATHW
Definition: shlobj.h:1933
#define SHCNF_IDLIST
Definition: shlobj.h:1929
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:904
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
const char * PCSTR
Definition: typedefs.h:52
uint64_t ULONGLONG
Definition: typedefs.h:67
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
void * arg
Definition: msvc.h:10
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
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