From 283d735e2b7c8e2bc710cf7c646e184dd676f022 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 14 Jun 2012 22:17:39 -0700 Subject: [PATCH] doc: Include zlib constants --- doc/api/zlib.markdown | 79 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index a4c3a93ef34..66c92846029 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -103,15 +103,6 @@ tradeoffs involved in zlib usage. } }).listen(1337); -## Constants - - - -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 -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 - for more information on these. +See the description of `deflateInit2` and `inflateInit2` +at 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 + + + +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 + 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`