From d281213a4a04a61910a6c451d8f5c86e61416bb2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 11 Jul 2016 17:05:31 +0200 Subject: erts: Move all functions in docs to be in alphabetical order This commit only changes the order of functions and does some other rearrangements to that the diff with the next commit will be easier to follow. No content or XML tags are changed. --- erts/doc/src/zlib.xml | 429 +++++++++++++++++++++++++------------------------- 1 file changed, 216 insertions(+), 213 deletions(-) (limited to 'erts/doc/src/zlib.xml') diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index 861661043f..a3c94e4a7f 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -106,10 +106,36 @@ list_to_binary([Compressed|Last]) - - Open a stream and return a stream reference + + Calculate the adler checksum -

Open a zlib stream.

+

Calculate the Adler-32 checksum for Data.

+
+
+ + + Calculate the adler checksum + +

Update a running Adler-32 checksum for Data. + If Data is the empty binary or the empty iolist, this function returns + the required initial value for the checksum.

+
+Crc = lists:foldl(fun(Data,Crc0) ->
+                      zlib:adler32(Z, Crc0, Data),
+                  end, zlib:adler32(Z,<< >>), Datas)
+
+
+ + + Combine two Adler-32 checksums + +

Combine two Adler-32 checksums into one. For two binaries or iolists, + Data1 and Data2 with sizes of Size1 and + Size2, with Adler-32 checksums Adler1 and + Adler2. adler32_combine/4 returns the Adler + checksum of [Data1,Data2], requiring + only Adler1, Adler2, and Size2. +

@@ -119,6 +145,108 @@ list_to_binary([Compressed|Last])

Closes the stream referenced by Z.

+ + + Compress data with standard zlib functionality + +

Compress data (with zlib headers and checksum).

+
+
+ + + Get current CRC + +

Get the current calculated CRC checksum.

+
+
+ + + Calculate CRC + +

Calculate the CRC checksum for Data.

+
+
+ + + Calculate CRC + +

Update a running CRC checksum for Data. + If Data is the empty binary or the empty iolist, this function returns + the required initial value for the crc.

+
+Crc = lists:foldl(fun(Data,Crc0) ->
+                      zlib:crc32(Z, Crc0, Data),
+                  end, zlib:crc32(Z,<< >>), Datas)
+
+
+ + + Combine two CRC's + +

Combine two CRC checksums into one. For two binaries or iolists, + Data1 and Data2 with sizes of Size1 and + Size2, with CRC checksums CRC1 and + CRC2. crc32_combine/4 returns the CRC + checksum of [Data1,Data2], requiring + only CRC1, CRC2, and Size2. +

+
+
+ + + + Compress data + +

Same as deflate(Z, Data, none).

+
+
+ + + Compress data + +

deflate/3 compresses as much data as possible, and + stops when the input buffer becomes empty. It may introduce + some output latency (reading input without producing any + output) except when forced to flush.

+

If the parameter Flush is set to sync, all + pending output is flushed to the output buffer and the + output is aligned on a byte boundary, so that the + decompressor can get all input data available so far. + Flushing may degrade compression for some compression algorithms and so + it should be used only when necessary.

+

If Flush is set to full, all output is flushed as with + sync, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using full too often can seriously degrade + the compression.

+

If the parameter Flush is set to finish, + pending input is processed, pending output is flushed and + deflate/3 returns. Afterwards the only possible + operations on the stream are deflateReset/1 or deflateEnd/1.

+

Flush can be set to finish immediately after + deflateInit if all compression is to be done in one step.

+
+ 
+zlib:deflateInit(Z),
+B1 = zlib:deflate(Z,Data),
+B2 = zlib:deflate(Z,<< >>,finish),
+zlib:deflateEnd(Z),
+list_to_binary([B1,B2])
+
+
+ + + + End deflate session + +

End the deflate session and cleans all data used. + Note that this function will throw an data_error + exception if the last call to + deflate/3 was not called with Flush set to + finish.

+
+
+ Initialize a session for compression @@ -181,44 +309,32 @@ list_to_binary([Compressed|Last]) - - Compress data + + Dynamicly update deflate parameters -

Same as deflate(Z, Data, none).

+

Dynamically update the compression level and compression + strategy. The interpretation of Level and + Strategy is as in deflateInit/6. This can be + used to switch between compression and straight copy of the + input data, or to switch to a different kind of input data + requiring a different strategy. If the compression level is + changed, the input available so far is compressed with the + old level (and may be flushed); the new level will take + effect only at the next call of deflate/3.

+

Before the call of deflateParams, the stream state must be set as for + a call of deflate/3, since the currently available input may have to + be compressed and flushed.

- - Compress data + + Reset the deflate session -

deflate/3 compresses as much data as possible, and - stops when the input buffer becomes empty. It may introduce - some output latency (reading input without producing any - output) except when forced to flush.

-

If the parameter Flush is set to sync, all - pending output is flushed to the output buffer and the - output is aligned on a byte boundary, so that the - decompressor can get all input data available so far. - Flushing may degrade compression for some compression algorithms and so - it should be used only when necessary.

-

If Flush is set to full, all output is flushed as with - sync, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using full too often can seriously degrade - the compression.

-

If the parameter Flush is set to finish, - pending input is processed, pending output is flushed and - deflate/3 returns. Afterwards the only possible - operations on the stream are deflateReset/1 or deflateEnd/1.

-

Flush can be set to finish immediately after - deflateInit if all compression is to be done in one step.

-
- 
-zlib:deflateInit(Z),
-B1 = zlib:deflate(Z,Data),
-B2 = zlib:deflate(Z,<< >>,finish),
-zlib:deflateEnd(Z),
-list_to_binary([B1,B2])
+

This function is equivalent to deflateEnd/1 + followed by deflateInit/[1|2|6], but does not free + and reallocate all the internal compression state. The + stream will keep the same compression level and any other + attributes.

@@ -236,66 +352,24 @@ list_to_binary([B1,B2]) - - Reset the deflate session - -

This function is equivalent to deflateEnd/1 - followed by deflateInit/[1|2|6], but does not free - and reallocate all the internal compression state. The - stream will keep the same compression level and any other - attributes.

-
-
- - - Dynamicly update deflate parameters - -

Dynamically update the compression level and compression - strategy. The interpretation of Level and - Strategy is as in deflateInit/6. This can be - used to switch between compression and straight copy of the - input data, or to switch to a different kind of input data - requiring a different strategy. If the compression level is - changed, the input available so far is compressed with the - old level (and may be flushed); the new level will take - effect only at the next call of deflate/3.

-

Before the call of deflateParams, the stream state must be set as for - a call of deflate/3, since the currently available input may have to - be compressed and flushed.

-
-
- - - End deflate session + + Get buffer size -

End the deflate session and cleans all data used. - Note that this function will throw an data_error - exception if the last call to - deflate/3 was not called with Flush set to - finish.

+

Get the size of intermediate buffer.

- - Initialize a session for decompression + + Uncompress data with gz header -

Initialize a zlib stream for decompression.

+

Uncompress data (with gz headers and checksum).

- - Initialize a session for decompression + + Compress data with gz header -

Initialize decompression session on zlib stream.

-

The WindowBits parameter is the base two logarithm - of the maximum window size (the size of the history buffer). - It should be in the range 8 through 15. - The default value is 15 if inflateInit/1 is used. - If a compressed stream with a larger window size is - given as input, inflate() will throw the data_error - exception. A negative WindowBits value makes zlib ignore the - zlib header (and checksum) from the stream. Note that the zlib - source mentions this only as a undocumented feature.

+

Compress data (with gz headers and checksum).

@@ -312,6 +386,16 @@ list_to_binary([B1,B2]) compressor.

+ + + Read next uncompressed chunk + +

Read next chunk of uncompressed data, initialized by + inflateChunk/2.

+

This function should be repeatedly called, while it returns + {more, Decompressed}.

+
+
Decompress data with limited output size @@ -350,13 +434,46 @@ loop(Z, Handler, Uncompressed) -> - - Read next uncompressed chunk + + End inflate session -

Read next chunk of uncompressed data, initialized by - inflateChunk/2.

-

This function should be repeatedly called, while it returns - {more, Decompressed}.

+

End the inflate session and cleans all data used. Note + that this function will throw a data_error exception + if no end of stream was found (meaning that not all data + has been uncompressed).

+
+
+ + + Initialize a session for decompression + +

Initialize a zlib stream for decompression.

+
+
+ + + Initialize a session for decompression + +

Initialize decompression session on zlib stream.

+

The WindowBits parameter is the base two logarithm + of the maximum window size (the size of the history buffer). + It should be in the range 8 through 15. + The default value is 15 if inflateInit/1 is used. + If a compressed stream with a larger window size is + given as input, inflate() will throw the data_error + exception. A negative WindowBits value makes zlib ignore the + zlib header (and checksum) from the stream. Note that the zlib + source mentions this only as a undocumented feature.

+
+
+ + + >Reset the inflate session + +

This function is equivalent to inflateEnd/1 followed + by inflateInit/1, but does not free and reallocate all + the internal decompression state. The stream will keep + attributes that may have been set by inflateInit/[1|2].

@@ -384,23 +501,10 @@ unpack(Z, Compressed, Dict) -> - - >Reset the inflate session - -

This function is equivalent to inflateEnd/1 followed - by inflateInit/1, but does not free and reallocate all - the internal decompression state. The stream will keep - attributes that may have been set by inflateInit/[1|2].

-
-
- - - End inflate session + + Open a stream and return a stream reference -

End the inflate session and cleans all data used. Note - that this function will throw a data_error exception - if no end of stream was found (meaning that not all data - has been uncompressed).

+

Open a zlib stream.

@@ -410,93 +514,6 @@ unpack(Z, Compressed, Dict) ->

Sets the intermediate buffer size.

- - - Get buffer size - -

Get the size of intermediate buffer.

-
-
- - - Get current CRC - -

Get the current calculated CRC checksum.

-
-
- - - Calculate CRC - -

Calculate the CRC checksum for Data.

-
-
- - - Calculate CRC - -

Update a running CRC checksum for Data. - If Data is the empty binary or the empty iolist, this function returns - the required initial value for the crc.

-
-Crc = lists:foldl(fun(Data,Crc0) ->
-                      zlib:crc32(Z, Crc0, Data),
-                  end, zlib:crc32(Z,<< >>), Datas)
-
-
- - - Combine two CRC's - -

Combine two CRC checksums into one. For two binaries or iolists, - Data1 and Data2 with sizes of Size1 and - Size2, with CRC checksums CRC1 and - CRC2. crc32_combine/4 returns the CRC - checksum of [Data1,Data2], requiring - only CRC1, CRC2, and Size2. -

-
-
- - - Calculate the adler checksum - -

Calculate the Adler-32 checksum for Data.

-
-
- - - Calculate the adler checksum - -

Update a running Adler-32 checksum for Data. - If Data is the empty binary or the empty iolist, this function returns - the required initial value for the checksum.

-
-Crc = lists:foldl(fun(Data,Crc0) ->
-                      zlib:adler32(Z, Crc0, Data),
-                  end, zlib:adler32(Z,<< >>), Datas)
-
-
- - - Combine two Adler-32 checksums - -

Combine two Adler-32 checksums into one. For two binaries or iolists, - Data1 and Data2 with sizes of Size1 and - Size2, with Adler-32 checksums Adler1 and - Adler2. adler32_combine/4 returns the Adler - checksum of [Data1,Data2], requiring - only Adler1, Adler2, and Size2. -

-
-
- - - Compress data with standard zlib functionality - -

Compress data (with zlib headers and checksum).

-
-
Uncompress data with standard zlib functionality @@ -504,13 +521,6 @@ Crc = lists:foldl(fun(Data,Crc0) ->

Uncompress data (with zlib headers and checksum).

- - - Compress data without the zlib headers - -

Compress data (without zlib headers and checksum).

-
-
Uncompress data without the zlib headers @@ -519,17 +529,10 @@ Crc = lists:foldl(fun(Data,Crc0) -> - - Compress data with gz header - -

Compress data (with gz headers and checksum).

-
-
- - - Uncompress data with gz header + + Compress data without the zlib headers -

Uncompress data (with gz headers and checksum).

+

Compress data (without zlib headers and checksum).

-- cgit v1.2.3