mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
example/mzcat: support zlib
This commit is contained in:
1 parent
e8ec21976c
commit
2b4e8ce6a2
2 files changed
+17
No files matched your search
@@ -25,6 +25,7 @@ Supported compression formats:
|
||||
- gzip
|
||||
- lzma
|
||||
- xz
|
||||
- zlib
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
@@ -56,6 +57,7 @@ Supported compression formats:
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
// code simply isn't compiled.
|
||||
#define WUFFS_CONFIG__MODULES
|
||||
#define WUFFS_CONFIG__MODULE__ADLER32
|
||||
#define WUFFS_CONFIG__MODULE__BASE
|
||||
#define WUFFS_CONFIG__MODULE__BZIP2
|
||||
#define WUFFS_CONFIG__MODULE__CRC32
|
||||
@@ -65,6 +67,7 @@ Supported compression formats:
|
||||
#define WUFFS_CONFIG__MODULE__LZMA
|
||||
#define WUFFS_CONFIG__MODULE__SHA256
|
||||
#define WUFFS_CONFIG__MODULE__XZ
|
||||
#define WUFFS_CONFIG__MODULE__ZLIB
|
||||
|
||||
// If building this program in an environment that doesn't easily accommodate
|
||||
// relative includes, you can use the script/inline-c-relative-includes.go
|
||||
@@ -106,6 +109,7 @@ union {
|
||||
wuffs_gzip__decoder gzip;
|
||||
wuffs_lzma__decoder lzma;
|
||||
wuffs_xz__decoder xz;
|
||||
wuffs_zlib__decoder zlib;
|
||||
} g_potential_decoders;
|
||||
|
||||
// ----
|
||||
@@ -196,6 +200,15 @@ initialize_io_transformer(uint8_t input_first_byte) {
|
||||
&g_potential_decoders.lzma);
|
||||
break;
|
||||
|
||||
case 0x78:
|
||||
status = wuffs_zlib__decoder__initialize(
|
||||
&g_potential_decoders.zlib, sizeof g_potential_decoders.zlib,
|
||||
WUFFS_VERSION, WUFFS_INITIALIZE__DEFAULT_OPTIONS);
|
||||
io_transformer =
|
||||
wuffs_zlib__decoder__upcast_as__wuffs_base__io_transformer(
|
||||
&g_potential_decoders.zlib);
|
||||
break;
|
||||
|
||||
case 0xFD:
|
||||
status = wuffs_xz__decoder__initialize(
|
||||
&g_potential_decoders.xz, sizeof g_potential_decoders.xz,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Generated by script/print-mzcat-checksums.sh
|
||||
OK. 29058c73 test/data/256.bytes.bz2
|
||||
OK. 29058c73 test/data/256.bytes.gz
|
||||
OK. 2b581525 test/data/DCI-P3-D65.icc.zlib
|
||||
OK. 6ddef9db test/data/abraca.txt.bz2
|
||||
OK. b19df306 test/data/archive.tar.bz2
|
||||
OK. b19df306 test/data/archive.tar.gz
|
||||
@@ -10,11 +11,14 @@ OK. acef87f1 test/data/enwik5.lzma
|
||||
OK. acef87f1 test/data/enwik5.xz
|
||||
OK. 3db2cdc6 test/data/midsummer.txt.bz2
|
||||
OK. 3db2cdc6 test/data/midsummer.txt.gz
|
||||
OK. 3db2cdc6 test/data/midsummer.txt.zlib
|
||||
OK. 519e8b87 test/data/pi.txt.bz2
|
||||
OK. 519e8b87 test/data/pi.txt.gz
|
||||
OK. 519e8b87 test/data/pi.txt.zlib
|
||||
OK. abe507ef test/data/romeo.txt.bz2
|
||||
OK. abe507ef test/data/romeo.txt.delta1.xz
|
||||
OK. abe507ef test/data/romeo.txt.gz
|
||||
OK. abe507ef test/data/romeo.txt.litonlylzma
|
||||
OK. abe507ef test/data/romeo.txt.lzma
|
||||
OK. abe507ef test/data/romeo.txt.xz
|
||||
OK. abe507ef test/data/romeo.txt.zlib
|
||||
Reference in new issue
Block a user