diff options
author | isaacs <i@izs.me> | 2012-06-14 22:17:39 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-06-14 22:17:39 -0700 |
commit | 283d735e2b7c8e2bc710cf7c646e184dd676f022 (patch) | |
tree | 67a24ca11e9bafefddf49a20006b38532ff62f22 /doc | |
parent | e72addcf8e72e6a32a7561588aa3d73b30defc7b (diff) | |
download | node-new-283d735e2b7c8e2bc710cf7c646e184dd676f022.tar.gz |
doc: Include zlib constants
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/zlib.markdown | 79 |
1 files changed, 68 insertions, 11 deletions
diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index a4c3a93ef3..66c9284602 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -103,15 +103,6 @@ tradeoffs involved in zlib usage. } }).listen(1337); -## Constants - -<!--type=misc--> - -All of the constants defined in zlib.h are also defined on -`require('zlib')`. They are described in more detail in the zlib -documentation. See <http://zlib.net/manual.html#Constants> -for more details. - ## zlib.createGzip([options]) Returns a new [Gzip](#zlib_class_zlib_gzip) object with an @@ -232,8 +223,8 @@ relevant when compressing, and are ignored by the decompression classes. * strategy (compression only) * dictionary (deflate/inflate only, empty dictionary by default) -See the description of `deflateInit2` and `inflateInit2` at -<http://zlib.net/manual.html#Advanced> for more information on these. +See the description of `deflateInit2` and `inflateInit2` +at <http://zlib.net/manual.html#Advanced> for more information on these. ## Memory Usage Tuning @@ -274,3 +265,69 @@ In general, greater memory usage options will mean that node has to make fewer calls to zlib, since it'll be able to process more data in a single `write` operation. So, this is another factor that affects the speed, at the cost of memory usage. + +## Constants + +<!--type=misc--> + +All of the constants defined in zlib.h are also defined on +`require('zlib')`. +In the normal course of operations, you will not need to ever set any of +these. They are documented here so that their presence is not +surprising. This section is taken almost directly from the [zlib +documentation](http://zlib.net/manual.html#Constants). See +<http://zlib.net/manual.html#Constants> for more details. + +Allowed flush values. + +* `zlib.Z_NO_FLUSH` +* `zlib.Z_PARTIAL_FLUSH` +* `zlib.Z_SYNC_FLUSH` +* `zlib.Z_FULL_FLUSH` +* `zlib.Z_FINISH` +* `zlib.Z_BLOCK` +* `zlib.Z_TREES` + +Return codes for the compression/decompression functions. Negative +values are errors, positive values are used for special but normal +events. + +* `zlib.Z_OK` +* `zlib.Z_STREAM_END` +* `zlib.Z_NEED_DICT` +* `zlib.Z_ERRNO` +* `zlib.Z_STREAM_ERROR` +* `zlib.Z_DATA_ERROR` +* `zlib.Z_MEM_ERROR` +* `zlib.Z_BUF_ERROR` +* `zlib.Z_VERSION_ERROR` + +Compression levels. + +* `zlib.Z_NO_COMPRESSION` +* `zlib.Z_BEST_SPEED` +* `zlib.Z_BEST_COMPRESSION` +* `zlib.Z_DEFAULT_COMPRESSION` + +Compression strategy. + +* `zlib.Z_FILTERED` +* `zlib.Z_HUFFMAN_ONLY` +* `zlib.Z_RLE` +* `zlib.Z_FIXED` +* `zlib.Z_DEFAULT_STRATEGY` + +Possible values of the data_type field. + +* `zlib.Z_BINARY` +* `zlib.Z_TEXT` +* `zlib.Z_ASCII` +* `zlib.Z_UNKNOWN` + +The deflate compression method (the only one supported in this version). + +* `zlib.Z_DEFLATED` + +For initializing zalloc, zfree, opaque. + +* `zlib.Z_NULL` |