diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-09-22 14:59:40 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-09-25 06:49:49 +0300 |
commit | ead5c4c054863cbc82bd2c2a8ddb31860f9e51f7 (patch) | |
tree | 86e5599655c0187842fbb5ceddfff933afd44b5c /src/node_zlib.cc | |
parent | 0630da14159759dff8c2befdabaef359482b9b26 (diff) |
src: define zlib constants in node_zlib.cc
This is in order to avoid having two separate definitions
for `node_zlib_mode`.
PR-URL: https://github.com/nodejs/node/pull/23019
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src/node_zlib.cc')
-rw-r--r-- | src/node_zlib.cc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 288fbd7bcc9..d0cc54c9436 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -773,6 +773,59 @@ void Initialize(Local<Object> target, } } // anonymous namespace + +void DefineZlibConstants(Local<Object> target) { + NODE_DEFINE_CONSTANT(target, Z_NO_FLUSH); + NODE_DEFINE_CONSTANT(target, Z_PARTIAL_FLUSH); + NODE_DEFINE_CONSTANT(target, Z_SYNC_FLUSH); + NODE_DEFINE_CONSTANT(target, Z_FULL_FLUSH); + NODE_DEFINE_CONSTANT(target, Z_FINISH); + NODE_DEFINE_CONSTANT(target, Z_BLOCK); + + // return/error codes + NODE_DEFINE_CONSTANT(target, Z_OK); + NODE_DEFINE_CONSTANT(target, Z_STREAM_END); + NODE_DEFINE_CONSTANT(target, Z_NEED_DICT); + NODE_DEFINE_CONSTANT(target, Z_ERRNO); + NODE_DEFINE_CONSTANT(target, Z_STREAM_ERROR); + NODE_DEFINE_CONSTANT(target, Z_DATA_ERROR); + NODE_DEFINE_CONSTANT(target, Z_MEM_ERROR); + NODE_DEFINE_CONSTANT(target, Z_BUF_ERROR); + NODE_DEFINE_CONSTANT(target, Z_VERSION_ERROR); + + NODE_DEFINE_CONSTANT(target, Z_NO_COMPRESSION); + NODE_DEFINE_CONSTANT(target, Z_BEST_SPEED); + NODE_DEFINE_CONSTANT(target, Z_BEST_COMPRESSION); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_COMPRESSION); + NODE_DEFINE_CONSTANT(target, Z_FILTERED); + NODE_DEFINE_CONSTANT(target, Z_HUFFMAN_ONLY); + NODE_DEFINE_CONSTANT(target, Z_RLE); + NODE_DEFINE_CONSTANT(target, Z_FIXED); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_STRATEGY); + NODE_DEFINE_CONSTANT(target, ZLIB_VERNUM); + + NODE_DEFINE_CONSTANT(target, DEFLATE); + NODE_DEFINE_CONSTANT(target, INFLATE); + NODE_DEFINE_CONSTANT(target, GZIP); + NODE_DEFINE_CONSTANT(target, GUNZIP); + NODE_DEFINE_CONSTANT(target, DEFLATERAW); + NODE_DEFINE_CONSTANT(target, INFLATERAW); + NODE_DEFINE_CONSTANT(target, UNZIP); + + NODE_DEFINE_CONSTANT(target, Z_MIN_WINDOWBITS); + NODE_DEFINE_CONSTANT(target, Z_MAX_WINDOWBITS); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_WINDOWBITS); + NODE_DEFINE_CONSTANT(target, Z_MIN_CHUNK); + NODE_DEFINE_CONSTANT(target, Z_MAX_CHUNK); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_CHUNK); + NODE_DEFINE_CONSTANT(target, Z_MIN_MEMLEVEL); + NODE_DEFINE_CONSTANT(target, Z_MAX_MEMLEVEL); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_MEMLEVEL); + NODE_DEFINE_CONSTANT(target, Z_MIN_LEVEL); + NODE_DEFINE_CONSTANT(target, Z_MAX_LEVEL); + NODE_DEFINE_CONSTANT(target, Z_DEFAULT_LEVEL); +} + } // namespace node NODE_BUILTIN_MODULE_CONTEXT_AWARE(zlib, node::Initialize) |