diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-11-02 22:08:43 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-11-02 22:08:43 +0100 |
| commit | 27cf5c81b238d763970e989d5b89ceee4da8c2d8 (patch) | |
| tree | e4ce3e08c93cf6733b0c48d526609ea2032c6220 /src | |
| parent | 323783bf49909bb4781a9979074d51b2d59672fd (diff) | |
| download | box64-27cf5c81b238d763970e989d5b89ceee4da8c2d8.tar.gz box64-27cf5c81b238d763970e989d5b89ceee4da8c2d8.zip | |
Better wrapping for libz inflate
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedlibztypes.h | 2 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibz.c | 9 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibz_private.h | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 3fa66c35..4f2dd774 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -2936,6 +2936,8 @@ wrappedlibz: - iFp: - deflateEnd - inflateEnd +- iFpi: + - inflate - iFppi: - inflateInit_ - iFpipi: diff --git a/src/wrapped/generated/wrappedlibztypes.h b/src/wrapped/generated/wrappedlibztypes.h index f3432c7c..e2c4742d 100644 --- a/src/wrapped/generated/wrappedlibztypes.h +++ b/src/wrapped/generated/wrappedlibztypes.h @@ -12,6 +12,7 @@ #endif typedef int64_t (*iFp_t)(void*); +typedef int64_t (*iFpi_t)(void*, int64_t); typedef int64_t (*iFppi_t)(void*, void*, int64_t); typedef int64_t (*iFpipi_t)(void*, int64_t, void*, int64_t); typedef int64_t (*iFpippi_t)(void*, int64_t, void*, void*, int64_t); @@ -20,6 +21,7 @@ typedef int64_t (*iFpiiiiipi_t)(void*, int64_t, int64_t, int64_t, int64_t, int64 #define SUPER() ADDED_FUNCTIONS() \ GO(deflateEnd, iFp_t) \ GO(inflateEnd, iFp_t) \ + GO(inflate, iFpi_t) \ GO(inflateInit_, iFppi_t) \ GO(deflateInit_, iFpipi_t) \ GO(inflateInit2_, iFpipi_t) \ diff --git a/src/wrapped/wrappedlibz.c b/src/wrapped/wrappedlibz.c index 02a1b00a..a6e5e3d3 100755 --- a/src/wrapped/wrappedlibz.c +++ b/src/wrapped/wrappedlibz.c @@ -173,6 +173,15 @@ EXPORT int my_deflateEnd(x64emu_t* emu, void* str) return r; } +EXPORT int my_inflate(x64emu_t* emu, void* str, int flush) +{ + libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2; + wrapper_stream_z(emu, str); + return my->inflate(str, flush); + //TODO: should unwrap the stream +} + + #define CUSTOM_INIT \ box64->zlib = lib; \ diff --git a/src/wrapped/wrappedlibz_private.h b/src/wrapped/wrappedlibz_private.h index 54b3725e..8934a310 100644 --- a/src/wrapped/wrappedlibz_private.h +++ b/src/wrapped/wrappedlibz_private.h @@ -61,7 +61,7 @@ GO(gztell64, lFp) GO(gzungetc, iFip) //GO(gzvprintf, iFppA) GO(gzwrite, iFppu) -GO(inflate, iFpi) +GOM(inflate, iFEpi) //GO(inflateBack, iFp@p@p) GO(inflateBackEnd, iFp) GOM(inflateBackInit_, iFEpippi) |