diff options
author | dartraiden <wowemuh@gmail.com> | 2023-01-03 17:36:24 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2023-01-03 17:36:24 +0300 |
commit | d91e3838c0d434910b5604871a30dc12d977b69e (patch) | |
tree | 40c23fb0f11fb98e440266e7ed855f497fd201b6 | |
parent | a22ea8438a61248c6d618ca3702c67142eca17d7 (diff) |
zlib: pick up Miranda-specific commits
-rw-r--r-- | libs/zlib/res/zlib.rc | 2 | ||||
-rw-r--r-- | libs/zlib/src/ioapi.c | 26 | ||||
-rw-r--r-- | libs/zlib/src/ioapi.h | 2 | ||||
-rw-r--r-- | libs/zlib/src/iowin32.c | 4 | ||||
-rw-r--r-- | libs/zlib/src/zlib.def | 21 | ||||
-rw-r--r-- | libs/zlib/src/zlib.h | 10 | ||||
-rw-r--r-- | libs/zlib/src/zutil.c | 8 |
7 files changed, 47 insertions, 26 deletions
diff --git a/libs/zlib/res/zlib.rc b/libs/zlib/res/zlib.rc index 03a00aab2c..ffa19e27f4 100644 --- a/libs/zlib/res/zlib.rc +++ b/libs/zlib/res/zlib.rc @@ -1,5 +1,5 @@ #include <winver.h>
-#include "../zlib.h"
+#include "..\src\zlib.h"
#ifdef GCC_WINDRES
VS_VERSION_INFO VERSIONINFO
diff --git a/libs/zlib/src/ioapi.c b/libs/zlib/src/ioapi.c index 8698d61365..8fcdcbfcb3 100644 --- a/libs/zlib/src/ioapi.c +++ b/libs/zlib/src/ioapi.c @@ -34,7 +34,7 @@ voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
else
{
- return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
+ return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const wchar_t*)filename,mode);
}
}
@@ -84,7 +84,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
+static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const wchar_t* filename, int mode));
static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
@@ -92,41 +92,41 @@ static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPO static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
-static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
+static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const wchar_t* filename, int mode)
{
FILE* file = NULL;
- const char* mode_fopen = NULL;
+ const wchar_t* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
+ mode_fopen = L"rb";
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
+ mode_fopen = L"r+b";
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
+ mode_fopen = L"wb";
if ((filename!=NULL) && (mode_fopen != NULL))
- file = fopen(filename, mode_fopen);
+ file = _wfopen(filename, mode_fopen);
return file;
}
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
{
FILE* file = NULL;
- const char* mode_fopen = NULL;
+ const wchar_t* mode_fopen = NULL;
(void)opaque;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
+ mode_fopen = L"rb";
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
+ mode_fopen = L"r+b";
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
+ mode_fopen = L"wb";
if ((filename!=NULL) && (mode_fopen != NULL))
- file = FOPEN_FUNC((const char*)filename, mode_fopen);
+ file = _wfopen((const wchar_t*)filename, mode_fopen);
return file;
}
diff --git a/libs/zlib/src/ioapi.h b/libs/zlib/src/ioapi.h index 205f6a4c95..9a246334b5 100644 --- a/libs/zlib/src/ioapi.h +++ b/libs/zlib/src/ioapi.h @@ -134,7 +134,7 @@ extern "C" { -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
+typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const wchar_t* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
diff --git a/libs/zlib/src/iowin32.c b/libs/zlib/src/iowin32.c index c890ffff55..245c51e0e8 100644 --- a/libs/zlib/src/iowin32.c +++ b/libs/zlib/src/iowin32.c @@ -38,7 +38,7 @@ #endif
#endif
-voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
+voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const wchar_t* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
@@ -171,7 +171,7 @@ voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int }
-voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode)
+voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const wchar_t* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
diff --git a/libs/zlib/src/zlib.def b/libs/zlib/src/zlib.def index 53c80115fc..e30ca90b22 100644 --- a/libs/zlib/src/zlib.def +++ b/libs/zlib/src/zlib.def @@ -1,4 +1,5 @@ ; zlib data compression library
+LIBRARY zlib.mir
EXPORTS
; basic functions
zlibVersion
@@ -95,3 +96,23 @@ EXPORTS inflateResetKeep
deflateResetKeep
gzopen_w
+; minizip functions
+ zipOpen2
+ zipOpenNewFileInZip4_64
+ zipWriteInFileInZip
+ zipCloseFileInZip
+ zipClose
+ unzOpen2
+ unzClose
+ unzGoToNextFile
+ unzGetCurrentFileInfo
+ unzOpenCurrentFilePassword
+ unzCloseCurrentFile
+ unzReadCurrentFile
+ fill_win32_filefunc
+ unzGetCurrentFileInfo64
+ unzOpenCurrentFile
+ fill_fopen64_filefunc
+ unzOpen2_64
+ zipOpen2_64
+ zipOpenNewFileInZip
diff --git a/libs/zlib/src/zlib.h b/libs/zlib/src/zlib.h index e9104e9239..cafee857d1 100644 --- a/libs/zlib/src/zlib.h +++ b/libs/zlib/src/zlib.h @@ -1808,18 +1808,18 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, ZLIB_VERSION, (int)sizeof(z_stream))
#else
# define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
# define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
# define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
- (int)sizeof(z_stream))
+ sizeof(z_stream))
# define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, (int)sizeof(z_stream))
+ ZLIB_VERSION, sizeof(z_stream))
#endif
#ifndef Z_SOLO
diff --git a/libs/zlib/src/zutil.c b/libs/zlib/src/zutil.c index 8dc23aa4e1..e741b263bb 100644 --- a/libs/zlib/src/zutil.c +++ b/libs/zlib/src/zutil.c @@ -34,25 +34,25 @@ uLong ZEXPORT zlibCompileFlags() uLong flags;
flags = 0;
- switch ((int)(sizeof(uInt))) {
+ switch (sizeof(uInt)) {
case 2: break;
case 4: flags += 1; break;
case 8: flags += 2; break;
default: flags += 3;
}
- switch ((int)(sizeof(uLong))) {
+ switch (sizeof(uLong)) {
case 2: break;
case 4: flags += 1 << 2; break;
case 8: flags += 2 << 2; break;
default: flags += 3 << 2;
}
- switch ((int)(sizeof(voidpf))) {
+ switch (sizeof(voidpf)) {
case 2: break;
case 4: flags += 1 << 4; break;
case 8: flags += 2 << 4; break;
default: flags += 3 << 4;
}
- switch ((int)(sizeof(z_off_t))) {
+ switch (sizeof(z_off_t)) {
case 2: break;
case 4: flags += 1 << 6; break;
case 8: flags += 2 << 6; break;
|