Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: Include zlib constants
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 15, 2012
1 parent e72addc commit 283d735
Showing 1 changed file with 68 additions and 11 deletions.
79 changes: 68 additions & 11 deletions doc/api/zlib.markdown
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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`

0 comments on commit 283d735

Please sign in to comment.