summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-06-26 13:52:10 +1000
committerDamien George <damien@micropython.org>2023-07-21 19:32:40 +1000
commit3533924c36ae85ce6e8bf8598dd71cf16bbdb10b (patch)
treedc40843b8b4528878a6d55c931e43bc3152f3c93 /py
parente6c290c3d145de81e23f406c84359860c4d6e632 (diff)
extmod/moddeflate: Add deflate module providing the DeflateIO class.
This provides similar functionality to the former zlib.DecompIO and especially CPython's gzip.GzipFile for both compression and decompression. This class can be used directly, and also can be used from Python to implement (via io.BytesIO) zlib.decompress and zlib.compress, as well as gzip.GzipFile. Enable/disable this on all ports/boards that zlib was previously configured for. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py')
-rw-r--r--py/mpconfig.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 122d0a70f..e6f1531ce 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1555,6 +1555,16 @@ typedef double mp_float_t;
#define MICROPY_PY_UCTYPES_NATIVE_C_TYPES (1)
#endif
+// Whether to provide "deflate" module (decompression-only by default)
+#ifndef MICROPY_PY_DEFLATE
+#define MICROPY_PY_DEFLATE (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
+#endif
+
+// Whether to provide compression support in "deflate" module
+#ifndef MICROPY_PY_DEFLATE_COMPRESS
+#define MICROPY_PY_DEFLATE_COMPRESS (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_FULL_FEATURES)
+#endif
+
#ifndef MICROPY_PY_JSON
#define MICROPY_PY_JSON (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif
@@ -1629,7 +1639,7 @@ typedef double mp_float_t;
#define MICROPY_PY_BINASCII (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif
-// Depends on MICROPY_PY_ZLIB
+// Depends on MICROPY_PY_DEFLATE
#ifndef MICROPY_PY_BINASCII_CRC32
#define MICROPY_PY_BINASCII_CRC32 (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif