Compile fixes for CZipOutputStream, link deflate code

This commit is contained in:
Phillip Stephens 2022-12-05 21:41:21 -08:00
parent 529c359935
commit f163fb3fd5
6 changed files with 11 additions and 5 deletions

View File

@ -41,7 +41,8 @@
"oscache.h": "c", "oscache.h": "c",
"stdlib.h": "c", "stdlib.h": "c",
"musyx_priv.h": "c", "musyx_priv.h": "c",
"gxenum.h": "c" "gxenum.h": "c",
"trees.h": "c"
}, },
"files.autoSave": "onFocusChange", "files.autoSave": "onFocusChange",
"files.insertFinalNewline": true, "files.insertFinalNewline": true,

View File

@ -624,12 +624,14 @@ LIBS = [
"host": True, "host": True,
"objects": [ "objects": [
["Kyoto/zlib/adler32", True], ["Kyoto/zlib/adler32", True],
["Kyoto/zlib/deflate", True],
["Kyoto/zlib/infblock", True], ["Kyoto/zlib/infblock", True],
["Kyoto/zlib/infcodes", True], ["Kyoto/zlib/infcodes", True],
["Kyoto/zlib/inffast", True], ["Kyoto/zlib/inffast", True],
["Kyoto/zlib/inflate", True], ["Kyoto/zlib/inflate", True],
["Kyoto/zlib/inftrees", True], ["Kyoto/zlib/inftrees", True],
["Kyoto/zlib/infutil", True], ["Kyoto/zlib/infutil", True],
["Kyoto/zlib/trees", True],
["Kyoto/zlib/zutil", True], ["Kyoto/zlib/zutil", True],
], ],
}, },

View File

@ -16,6 +16,8 @@ public:
void Finish(); void Finish();
bool Process(bool v); bool Process(bool v);
void Write(const void* ptr, size_t len); void Write(const void* ptr, size_t len);
int GetCompressedBytesWritten() { return mCompressedBytesWritten; }
private: private:
COutputStream* mOutput; COutputStream* mOutput;
int mCompressedBytesWritten; int mCompressedBytesWritten;

View File

@ -3,6 +3,7 @@
#include "rstl/math.hpp" #include "rstl/math.hpp"
#include "Kyoto/Streams/CZipSupport.hpp" #include "Kyoto/Streams/CZipSupport.hpp"
#include "Kyoto/Alloc/CMemory.hpp"
CZipOutputStream::CZipOutputStream(COutputStream* out, int level) CZipOutputStream::CZipOutputStream(COutputStream* out, int level)
: COutputStream(1024) : COutputStream(1024)
@ -13,7 +14,7 @@ CZipOutputStream::CZipOutputStream(COutputStream* out, int level)
mZStream->zalloc = CZipSupport::Alloc; mZStream->zalloc = CZipSupport::Alloc;
mZStream->zfree = CZipSupport::Free; mZStream->zfree = CZipSupport::Free;
mZStream->opaque = nullptr; mZStream->opaque = nullptr;
int useLevel = 9; int useLevel = 9;
if (level < 10) { if (level < 10) {
useLevel = level; useLevel = level;

View File

@ -49,7 +49,7 @@
/* @(#) $Id$ */ /* @(#) $Id$ */
#include "deflate.h" #include "zlib/deflate.h"
const char deflate_copyright[] = const char deflate_copyright[] =
" deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly "; " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";

View File

@ -33,7 +33,7 @@
/* #define GEN_TREES_H */ /* #define GEN_TREES_H */
#include "deflate.h" #include "zlib/deflate.h"
#ifdef DEBUG #ifdef DEBUG
# include <ctype.h> # include <ctype.h>
@ -115,7 +115,7 @@ local int base_dist[D_CODES];
/* First normalized distance for each code (0 = distance of 1) */ /* First normalized distance for each code (0 = distance of 1) */
#else #else
# include "trees.h" # include "zlib/trees.h"
#endif /* GEN_TREES_H */ #endif /* GEN_TREES_H */
struct static_tree_desc_s { struct static_tree_desc_s {