This file documents BZTCL version 0.6.0 a TCL binding to the BZip2 library. This package is distributed under a modified BSD license.
BZTCL provides access to the BZip2 compression and decompression
functionalities, as long as the capability to read and write files in
the .bz2
format, the one used by bzip2
.
TCL API
C API
Appendices
This file documents BZTCL version 0.6.0 a TCL binding to the
BZip2 library. BZTCL provides access to the BZip2 compression and
decompression functionalities, as long as the capability to read and
write files in the .bz2
format, the one used by the
bzip2
command line utility.
BZTCL has been tested with BZip2 version 1.0.2. To compile BZTCL
the library (libbz2.so.1.0.2
on UNIX-like systems) and
the header file (bzlib.h
) must be installed.
BZTCL depends on TCLMORE: another extension to the TCL language. A version of TCLMORE must be installed on the system to use BZTCL; TCLMORE should be available on the Net from the same site of BZTCL. Version 0.7 is required.
BZTCL provides a single command [bzlib]
in the interpreter in
which the bzlib
package is loaded. To load the package:
package require bzlib
or:
package require bzlib 0.6.0
The C API of BZTCL provides the same functionalities of the
TCL commands at the C level. We can access the functions including
the installed header file bztcl.h
.
bzlib compress data ?options? | Command |
Compresses the data stored in data, returns the compressed
data. The data is treated as a ByteArray object.
Recognised options are (options are optional):
|
bzlib decompress data ?options? | Command |
Uncompresses the ByteArray representation of data.
Supported options (options are optional):
|
Compress and uncompress a chunk of data:
package require bzlib set size [string length $data] set zipped [bzlib compress $data] set unzipped [bzlib decompress $zipped -size $size]
.bz2
formatThe BZTCL interface to files is similar to the standard TCL interface for files.
.bz2
file:
set channel [bzlib open source.bz2 RDONLY] fconfigure $channel -translation binary -encoding binary set data [read $channel] close $channel
set channel [bzlib open source.bz2 RDONLY] fconfigure $channel -translation binary -encoding binary while { ! [eof $channel] } { # read 4k of uncompressed data set data [read $channel 4096] # process data ... } close $channel
.bz2
file:
set channel [bzlib open source.bz WRONLY] fconfigure $channel -translation binary -encoding binary puts -nonewline $channel $data close $channel
set src [open filename.ext RDONLY] fconfigure $src -translation binary -encoding binary set dst [bzlib open filename.ext.bz2 WRONLY] fconfigure $dst -translation binary -encoding binary fcopy $src $dst close $src close $dst
bzlib open fileName mode ?options? | Command |
Opens a .bz2 file for reading or writing. mode
can be RDONLY or WRONLY .
Supported options:
In writing mode: if the file already exists, it is truncated to zero length. Returns the file identifier string, which matches the pattern
|
All the built-in TCL commands acting on channels can be used to operate on the BZTCL channels.
BZTCL allows the compression and decompression of streams of data. We can read or write data from or to a channel and compress/decompress it; this works by stacking upon the channel a transformation layer.
Streams are used to send data from one software entity to another; the
concept of TCL transformation has to be interpreted as a way to
process all the data flowing between the two entities, not only chunks
of it: if we need to send compressed data in chunks intermixed with
normal bytes, we have to use the [bzlib compress]
and
[bzlib decompress]
commands, not the transformation.
A stacked transformation can be detached with the [more unstack]
command, provided by TCLMORE.
set channel [acquire_a_writable_channel] fconfigure $channel -encoding binary -translation binary bzlib stream $channel WRONLY -output compress puts -nonewline $channel [get_some_data] flush $channel fconfigure $channel -finish output close $channel
set channel [acquire_a_readable_channel] fconfigure $channel -encoding binary -translation binary bzlib stream $channel RDONLY -input decompress set data [read $channel] fconfigure $channel -finish input append data [read $channel] close $channel
set channel [acquire_a_writable_channel] fconfigure $channel -encoding binary -translation binary bzlib stream $channel WRONLY -output compress while { [string length [set chunk [get_next_chunk_or_nil]]] } { puts -nonewline $channel $chunk flush $channel fconfigure $channel -flush output } fconfigure $channel -finish output close $channel
set channel [acquire_a_readable_channel] fconfigure $channel -encoding binary -translation binary \ -blocking no bzlib stream $channel RDONLY -input decompress while { ! [eof $channel] } { # optional flush fconfigure $channel -flush input append data [read $channel 4096] } fconfigure $channel -finish input append data [read $channel] close $channel
bzlib stream channel mode ?option ...? | Command |
Stacks a transformation upon an already existent
channel. mode can be RDONLY , WRONLY or
RDWR , and must be compatible with the open mode of channel.
Both the directions can be in compress or decompress mode, even both in
compress or both in decompress mode.
|
Description of supported options follows.
-input compress
-input decompress
-output compress
-output decompress
-blockSize INTEGER
-workFactor INTEGER
[bzlib compress]
(Compress and Decompress for details).
-small
[bzlib decompress]
(Compress and Decompress for details).
A stacked transformation accepts the following configuration options
through [fconfigure]
.
-flush input
-flush output
For output streams: this causes as much data as possible to be flushed
from the internal context to the output buffer and sent to the
underlying channel, we should invoke [flush $channel]
before
this.
For input streams: this causes as much data as possible to be flushed
from the internal context to the output buffer and to be available for
reading; no new data is read from the underlying channel.
-finish input
-finish output
For input streams: this causes all the data stored in the internal stream context to be available for reading; after this: no more data can be read from the underlying channel until the transformation is unstacked. No data is read from the underlying channel.
For output streams: all the data is flushed to the output buffer as if
[flush $channel]
has been invoked, and an attempt is made to
write all of it to the underlying channel; after this: no data can be
written to the transformation.
-bufferSize SIZE
-bufferDelta NUMBER
NUMBER
free bytes,
it is reallocated enlarging it by NUMBER
bytes. When the buffer
has at least a number of unused bytes equal to two times NUMBER
,
the buffer is restricted, leaving at least NUMBER
bytes free.
The following options are available in read-only mode to query the state of the channel.
-endOfInputStream
-endOfOutputStream
[fconfigure]
is true if the stream is in
decompression mode and the end of stream has been detected; this means
that the stream will no more process data: it is locked until we unstack
the transformation. In this state we can read data from the internal
context of the stream until all of it has been consumed. Some
unprocessed data may have been read from the underlying channel: it is
lost.
bzlib info version | Command |
Returns a string describing the BZip2 library version. |
bzlib info isWorkFactor value | Command |
Returns true if value is valid as work factor, and so it can be used as argument to the commands. |
bzlib info isBlockSize value | Command |
Returns true if value is valid as block size, and so it can be used as argument to the commands. |
In case of errors, the BZTCL commands set the ::errorCode
variable to LOGIC
or RUNTIME
. LOGIC
is for errors
caused by misuse of the interface or invalid arguments; a well debugged
script should never raise a LOGIC
error. RUNTIME
is for
"things that may happen", like errors writing files.
Bztcl_File | Opaque Pointer Typedef |
A reference to a channel descriptor. |
Bztcl_Stream | Opaque Pointer Typedef |
A reference to a compression or decompression filter. |
Bztcl_Config | Struct Pointer |
Configuration values. Fields description follows.
|
BZTCL_DEFAULT_CONFIG | Macro |
Defaults for Bztcl_Config .
|
More_Block | Struct Typedef |
Type of input and output memory blocks used as source and destination
for write and read operations on buffers. It is declared by
TCLMORE. Fields description follows.
|
More_BytePtr | Macro |
Macro that represents a pointer to byte type. It is declared by TCLMORE. |
When functions need to return an error, they return an error descriptor
of type More_Error
. This type is handled with functions provided
by TCLMORE (See Error Reporting, for details).
If the returned value is NULL
the function completed
successfully.
File and stream functions will store in the integer error specific field
of the error descriptor an appropriate (more or less) value of
errno
.
More_Error Bztcl_CompressObj (srcObj, cfg, dstObjVar) | Function |
Compresses data stored in a Tcl_Obj . The source buffer is the
ByteArray representation of the source object. Arguments
description follows.
The new object with the compressed data will have reference counter set to zero. |
More_Error Bztcl_UncompressObj (srcObj, cfg, size, dstObjVar) | Function |
Decompresses data in a Tcl_Obj .
The uncompress function of BZip2 has no way to predict the size of the
uncompressed data: if the caller can guess a good value (for example
because during compression the size has been recorded somewhere) it can
pass it in Arguments description follows.
The new object with the uncompressed data will have the reference counter set to zero. |
Tcl_Channel Bztcl_MakeChannel (Bztcl_File descriptor) | Function |
Creates a new channel interface to an already created file descriptor. BZip2 separates the interface for readable files from the one for writable files. This function handles this automatically inspecting the state of the descriptor. Returns the channel token. |
More_Error Bztcl_Open (fileName, openMode, tokenVar) | Function |
Opens a .bz2 file. Actually, this function opens only the file
using the standard C stream function; the BZ stream will be opened at
the first write or read operation.
Returns |
More_Error Bztcl_Close (Bztcl_File token) | Function |
Closes a file. Returns NULL or an error descriptor. It's safe
to invoke this function multiple times for an already closed BZTCL
descriptor: this is to allow the invoking function to retry to close the
FILE stream.
|
More_Error Bztcl_ReadObj (Bztcl_File token, int number, Tcl_Obj ** objVar) | Function |
Uncompresses data from a file into a Tcl_Obj , seen as a byte
array. The file must have been opened for reading. number is the
number of bytes to read. Returns NULL or an error descriptor.
|
More_Error Bztcl_Read (Bztcl_File token, More_Block * blockPtr) | Function |
Reads a data from a file and stores the uncompressed data in a memory
block. If end-of-stream is reached, the EOF status is
recorded in the file descriptor (so that it can be retrieved with
Bztcl_Eof() ) and the function returns no error. Returns
NULL or an error descriptor.
blockPtr is a pointer to the target block. Before the call the length field must hold the number of bytes to read. After the call, the length field holds the number of byte actually read. |
More_Error Bztcl_WriteObj (Bztcl_File token, Tcl_Obj * srcObj) | Function |
Compresses data in a Tcl_Obj , seen as a byte array, and writes it
in a file. The file must have been opened for writing. Returns
NULL or an error descriptor.
|
More_Error Bztcl_Write (Bztcl_File token, More_Block block) | Function |
Writes a block of data into a file. Returns NULL or an error
descriptor.
|
int Bztcl_Eof (Bztcl_File token) | Function |
Queries the state of the descriptor to see if an EOF happened on the last read operation. Returns true or false. |
int Bztcl_GetHandle (Bztcl_File token) | Function |
Returns the file handle. |
void Bztcl_SetSmall (Bztcl_File token, int small) | Function |
Configures a new "small" mode for a file descriptor, it must be one or
zero (Compress Functions for details). This function must be used
only to configure a readable descriptor prior to the first invocation to
Bztcl_Read() , else it will have no effect.
|
void Bztcl_SetWorkFactor (Bztcl_File token, int workFactor) | Function |
Configures a new work factor value for a file descriptor. This function
must be used only to configure a writable descriptor prior to the first
invocation to Bztcl_Write() , else it will have no effect.
|
void Bztcl_SetBlockSize (Bztcl_File token, int blockSize) | Function |
Configures a new block size value for a file descriptor. This function
must be used only to configure a descriptor prior to the first call to
Bztcl_Write() .
|
int Bztcl_GetSmall (Bztcl_File token) | Function |
Returns the current small model: one or zero. |
int Bztcl_GetWorkFactor (Bztcl_File token) | Function |
Returns the current value of the work factor. |
int Bztcl_GetBlockSize (Bztcl_File token) | Function |
Return the current value of the block size. |
int Bztcl_ReadableFile (Bztcl_File token) | Function |
Returns true if the file is readable. |
int Bztcl_WritableFile (Bztcl_File token) | Function |
Returns true if the file is writable. |
To understand how this module works we first have to learn how TCLMORE implements the transformation interface (See Stream transformation, for details).
The BZip2 stream interface functions define and manage the internal compression or decompression context, BZTCL handles the output buffer and manages memory allocation.
Bztcl_Stream token; More_Block buffer, input, output; More_Error error; Bztcl_Config config; int compress, numberOfBytesUsed; compress = ...; /* fill "config" */ error = Bztcl_StreamInit(&token, compress, &config); if (error) { ... } More_BlockAlloc(buffer, 4096*32); for (input = buffer, fill_a_block_with_data(&input); input.len; input = buffer, fill_a_block_with_data(&input)) { error = Bztcl_StreamWrite(token, &input); if (error) { goto Error; /* example: corrupted data */ } if (input.len) { /* Some data was not absorbed: it is still in "buffer", referenced by "input", so do something with it. For compression streams: this has to be considered an error so: goto Error. This should never happen anyway. For decompression streams: the end of stream was found. This is not an exception: it is normal operation when we read data from a source that supplies the stream and other data after it. */ break; } output = Bztcl_StreamOutput(token); if (output.len) { numberOfBytesUsed = use_the_processed_data(output); Bztcl_StreamRead(token, numberOfBytesUsed); } } error = Bztcl_StreamFinish(token); if (error) { ... } output = Bztcl_StreamOutput(token); use_the_processed_data(output); Error: More_BlockFree(buffer); Bztcl_StreamFinal(token);
All the stream memory is managed with the ckalloc()
,
ckrealloc()
and ckfree()
functions.
In case of error the functions return an error descriptor of type
More_Error
; this type is declared by TCLMORE. The only thing
to do after an error is to call the finalisation function to release all
the resources.
The integer data error-specific field of the error descriptor is set to
an appropriate (more or less) errno
value. This is to allow the
use of the stream functions with the transformation layer implemented by
TCLMORE; errno
codes are poor information but this is what the
TCL channel interface offers. In the future an -error
option
for [fconfigure]
may be implemented, somewhat like the one
offered by [socket]
.
More_Error Bztcl_StreamInit (tokenVar, compress, config) | Function |
Initialises a (de)compression stream. Memory is completely managed by
BZTCL.
Returns |
void Bztcl_StreamFinal (Bztcl_Stream token) | Function |
Releases all the resources. This function may be used to abort a stream,
at any instant, or to clean up after the stream has been finished.
Remark: this function is a wrapper for: |
More_Error Bztcl_StreamWrite (Bztcl_Stream token, More_Block *blockPtr) | Function |
Writes data into a stream. blockPtr must reference a variable
referencing the input block: its pointer field must reference a block of
memory, its length field must be the number of bytes to write into the
stream from the block.
For compression streams: all the data will be absorbed, the block structure will be cleared to zero. For decompression streams:
If end-of-stream is detected the block is updated to reference the
portion of data that has not been processed: before:
end of stream v |---------------------------------------| ^ blockPtr->ptr ......................................... blockPtr->len after:
end of stream v |---------------------------------------| ^ blockPtr->ptr .................... blockPtr->len Returns |
More_Block Bztcl_StreamOutput (Bztcl_Stream token) | Function |
Accesses the output buffer. This function is meant to be used just
before Bztcl_StreamRead() . Returns a block representing the
output buffer; it may reference a NULL buffer.
|
void Bztcl_StreamRead (Bztcl_Stream token, int number) | Function |
Declares that a number of bytes has been read from the output buffer. Shifts the unread data to the beginning of the output buffer. Possibly restricts the output buffer. |
More_Error Bztcl_StreamFlush (Bztcl_Stream token) | Function |
Flushes as much data as possible from the internal context. It is
required if we need to send data somewhere quickly, and usually it is
not used. Its use is discouraged because it slows down the operations
and may degrade the compression ratio. After the flush operation has
been carried out, new data may have been added to the output
buffer, and so it can be read. Returns NULL or an error
descriptor.
|
More_Error Bztcl_StreamFinish (Bztcl_Stream token) | Function |
For compression streams: flushes data from the internal context to the
output buffer, marking it as end of stream.
For decompression streams: flushes data from the internal context until the end of stream is found; this works only if we have written all the data into the stream, else a "corrupted data" error is raised. After a call to this function data is available with
|
The dimension of the output buffer can be configured after the stream
has been initialised: the buffer is allocated only at the first
invocation to Bztcl_StreamWrite()
.
Repeated invocations to the write function will enlarge the buffer if
the unused space is less than a configurable hysteresis value. The
formula used to compute the new size follows.
newSize = oldSize + oldSize % hysteresis + hysteresis;
The size will always be a multiple of the hysteresis value, and after reallocation there always be a number of unused bytes greater or equal to the hysteresis value. Invocations to the write function will never shrink the buffer.
Invocations to Bztcl_StreamRead()
may reallocate the buffer,
shrinking it. The reallocation will take place if the number of unused
bytes is greater than twice the configured hysteresis value. The formula
used to compute the new size follows.
newSize = usedSpace + usedSpace % hysteresis + hysteresis;
The default value for both the size and hysteresis is 4096*4.
void Bztcl_StreamSetBufferSize (Bztcl_Stream token, int size) | Function |
Selects a new size for the output buffer.
If the buffer is not allocated: size will be its initial size. If the buffer is allocated at the time of the call and the number of used bytes is less than size: the buffer is reallocated to the new size. |
void Bztcl_StreamSetBufferHysteresis (Bztcl_Stream token, int hysteresis) | Function |
Selects a new hysteresis for the reallocation of the buffer. |
int Bztcl_StreamGetBufferSize (Bztcl_Stream token) | Function |
Returns the current buffer size. |
int Bztcl_StreamGetBufferHysteresis (Bztcl_Stream token) | Function |
Returns the current hysteresis value. |
int Bztcl_StreamBufferAllocated (Bztcl_Stream token) | Function |
Returns true if the buffer is allocated. |
int Bztcl_StreamGetWorkFactor (Bztcl_Stream token) | Function |
Returns the configured work factor. |
int Bztcl_StreamGetBlockSize (Bztcl_Stream token) | Function |
Returns the configured block size. |
int Bztcl_StreamGetSmall (Bztcl_Stream token) | Function |
Returns the configured small memory mode. |
int Bztcl_StreamFinished (Bztcl_Stream token) | Function |
Returns true if the stream has been finished: explicitly with
Bztcl_StreamFinish() or because the end of stream was detected
in a write or flush operation.
|
The stream transformation can be stacked upon an existing channel. To
remove it use Tcl_UnstackChannel()
.
Tcl_Channel Bztcl_MakeTransform (input, output, subChannel) | Function |
Creates a new channel interface to already created stream descriptors.
The transformation is stacked upon an existing channel. Arguments
description follows.
Returns the transformation's channel token. |
The transformation module is implemented by TCLMORE.
Bztcl_MakeTransform()
is a wrapper for
More_MakeStreamTransform()
(See Public interface, for details).
The source code file is generic/stream.c
. This module is
composed by four elements.
BZ2_
).
Data is absorbed registering into the context a reference to a block of
data supplied by the user of the module, and extracted from it
registering a reference to unused space in the output buffer. The
processing functions of BZLIB will transfer the data. There must
always be an output block to which send data; an input block must be
present when processing data in normal mode, while when flushing or
finishing a context input data must not be present.
The driver instances are statically allocated, have no version field and the logic used to select and call them is hard-coded: there is no plan to split the stream module to allow plugging in of other drivers.
The functions offered by the BZLIB interface are three for
compression and three for decompression: initialisation, finalisation,
processing; the processing functions can be invoked requesting different
operations: common processing, flushing, finishing. The driver functions
are four: initialisation, finalisation, writing, flushing.
Reading data from the stream does not involve usage of the drivers: it is an operation that acts upon the output buffer only.
An effort was attempted to split completely the output buffer submodule
from the rest: the result was that the synchronisation required between
the buffer and the internal context nearly doubled the size of the code
for some operations, so the idea was abandoned by the author. In the
end, the output buffer functions are just wrappers for
ckalloc()
and ckrealloc()
.
Bztcl_
. Basically: they are
wrappers for the driver functions; at initialisation time a driver is
selected and its functions are invoked through the pointers in it.
Stream | Struct Typedef |
The basic data structure used to handle the stream, in it are allocated
the internal context and output buffer instances.
The first argument to most of the functions in the module is a pointer to a structure of this type. This is the case of the opaque pointer used as first argument for the public interface functions. |
Driver | Struct Typedef |
It is the table of function pointers used to provide a common interface for both compression and decompression. |
Each driver function has its own type declaration, to make it easy to declare the prototypes.
It is straightforward: a Stream
data structure is allocated and
initialised with default values; the configuration values are stored in
it along with a reference to the selected driver: compression or
decompression. The initialisation function of the driver is invoked to
prepare the internal context. The output buffer is not allocated: this
will be done at the first write operation.
Steps: the input block supplied by the user is registered in the context; the processing function of BZLIB is invoked multiple times in normal mode until all the data has been absorbed; the input block is unregistered.
Invoking the processing function multiple times is required because, after each call, the output buffer may be full but some unread data may still be in the input block; the buffer is checked prior to each invocation to make sure that room is available.
This operation attempts to extract data from the internal context, without processing new data.
It is not clear from the BZLIB documentation if the decompression accumulates data in an internal context or not; when the decompression function does not append new data to the output buffer, the operation is considered carried out.
Data still in the internal context is processed and appended to the output buffer. The processing function of BZLIB is invoked in finish mode until all data has been flushed.
When a stream is finished: the event is recorded in the descriptor, so that no other operation will be performed on it.
void OutputBufferEnlarge (Stream * stream) | Function |
If the buffer has not been allocated yet: allocates it with the
configured size. Else, if required, enlarge the allocated data block.
When the number of unused bytes in the buffer is less than the configured hysteresis value, the block is reallocated. The new size is a multiple of the hysteresis value, and it is such that at least a number of bytes equal to the hysteresis value is unused. This function is invoked before processing data through the stream. A reference to the unused space is registered in the context of the stream. |
void OutputBufferShrink (Stream * stream) | Function |
Shrinks the output buffer to reduce memory usage. If the number of
unused bytes is at least twice the configured hysteresis value, the
block is reallocated. The new size is computed in the same way as when
the block is enlarged.
This function is invoked after data has been read from the output buffer. |
void * AllocFunc (void *opaque, int number, int size) | Function |
Memory allocator used by the BZip2 library to manage its internal
context. It is a wrapper for ckalloc() .
|
void FreeFunc (void * opaque, void * block) | Function |
Memory releaser used by the BZip2 library to manage its internal
context. It is a wrapper for ckfree() .
|
int Bztcl_IsBlockSize (int blockSize) | Function |
Validates an integer that is candidate to be used as compression block size. It must be a number between 1 and 9 inclusive and it expresses the block size in units of 100 kilobytes. Returns true if the value is correct, else returns false. |
int Bztcl_IsWorkFactor (int workFactor) | Function |
Validates an integer that is candidate to be used as work factor. The work factor controls how the compression phase behaves when presented with the worst case. It must be an integer in the range 0-250 inclusive; 0 is interpreted as 30: the default value, good in most cases. Returns true if the value is valid, else returns false. |
int Bztcl_GetBlockSizeFromObj (interp, obj, blockSizeVar) | Function |
Extracts a valid block size from an object. default is an
acceptable string value for the input object: it means 3.
Arguments description follows.
Returns |
int Bztcl_GetWorkFactorFromObj (interp, obj, workFactorVar) | Function |
Extracts a valid BZip2 work factor from an object. default is an
acceptable string value for the input object: it means 30.
Arguments description follows.
Returns |
CONST char * Bztcl_Version (void) | Function |
Returns a pointer to the string representing the BZip2 version. |
The stub mechanism allows us to dynamically link a client extension to a version of BZTCL and to use it with future versions, without recompiling, as long as the future versions do not change the interface.
To do this we link our client extension with the BZTCL's stub library
(an object file whose name is something like libbztclstub...
) and
compile our code with the symbol USE_BZTCL_STUB
defined. Our
client library's initialisation function must contain the following
code:
#include "bztcl.h" ... int Client_Init (...) { ... #ifdef USE_BZTCL_STUB if (Bztcl_InitStub(interp, "0.5", 0) == NULL) { return TCL_ERROR; } #endif ... }
where 0.5
is the version of BZTCL that the client library is
supposed to use.
From the BZip2 README file:
bzip2-1.0.2 is distributed under a BSD-style license. ...To the best of my knowledge, bzip2 does not use any patented algorithms. However, I do not have the resources available to carry out a full patent search. Therefore I cannot give any guarantee of the above statement. ...
I hope you find bzip2 useful. Feel free to contact me at jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments.
At least for the time being, bzip2's "home" is (or can be reached via) http://sources.redhat.com/bzip2.
Julian Seward Cambridge, UK (and what a great town this is!)
BZTCL was written by Marco Maggi.
Copyright © 2002, 2003, 2004 Marco Maggi.
The author hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply.
IN NO EVENT SHALL THE AUTHOR OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHOR HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHOR AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
This document is copyright © 2002, 2003, 2004 by Marco Maggi.
Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
AllocFunc
: Stream Functions Internals
bzlib compress
: Compress and Decompress
bzlib decompress
: Compress and Decompress
bzlib info isBlockSize
: Misc Commands
bzlib info isWorkFactor
: Misc Commands
bzlib info version
: Misc Commands
bzlib open
: BZ Files
bzlib stream
: BZ Streams
Bztcl_Close
: File Functions
Bztcl_CompressObj
: Compress Functions
Bztcl_Config
: Data Types
BZTCL_DEFAULT_CONFIG
: Data Types
Bztcl_Eof
: File Functions
Bztcl_File
: Data Types
Bztcl_GetBlockSize
: File Functions
Bztcl_GetBlockSizeFromObj
: Misc Functions
Bztcl_GetHandle
: File Functions
Bztcl_GetSmall
: File Functions
Bztcl_GetWorkFactor
: File Functions
Bztcl_GetWorkFactorFromObj
: Misc Functions
Bztcl_IsBlockSize
: Misc Functions
Bztcl_IsWorkFactor
: Misc Functions
Bztcl_MakeChannel
: File Functions
Bztcl_MakeTransform
: Stream Functions Transformation
Bztcl_Open
: File Functions
Bztcl_Read
: File Functions
Bztcl_ReadableFile
: File Functions
Bztcl_ReadObj
: File Functions
Bztcl_SetBlockSize
: File Functions
Bztcl_SetSmall
: File Functions
Bztcl_SetWorkFactor
: File Functions
Bztcl_Stream
: Data Types
Bztcl_StreamBufferAllocated
: Stream Functions Interface Output Buffer
Bztcl_StreamFinal
: Stream Functions Interface Init and Final
Bztcl_StreamFinish
: Stream Functions Interface Flush and Finish
Bztcl_StreamFinished
: Stream Functions Interface Inspection
Bztcl_StreamFlush
: Stream Functions Interface Flush and Finish
Bztcl_StreamGetBlockSize
: Stream Functions Interface Inspection
Bztcl_StreamGetBufferHysteresis
: Stream Functions Interface Output Buffer
Bztcl_StreamGetBufferSize
: Stream Functions Interface Output Buffer
Bztcl_StreamGetSmall
: Stream Functions Interface Inspection
Bztcl_StreamGetWorkFactor
: Stream Functions Interface Inspection
Bztcl_StreamInit
: Stream Functions Interface Init and Final
Bztcl_StreamOutput
: Stream Functions Interface Reading
Bztcl_StreamRead
: Stream Functions Interface Reading
Bztcl_StreamSetBufferHysteresis
: Stream Functions Interface Output Buffer
Bztcl_StreamSetBufferSize
: Stream Functions Interface Output Buffer
Bztcl_StreamWrite
: Stream Functions Interface Writing
Bztcl_UncompressObj
: Compress Functions
Bztcl_Version
: Misc Functions
Bztcl_WritableFile
: File Functions
Bztcl_Write
: File Functions
Bztcl_WriteObj
: File Functions
Driver
: Stream Functions Internals
FreeFunc
: Stream Functions Internals
More_Block
: Data Types
More_BytePtr
: Data Types
OutputBufferEnlarge
: Stream Functions Internals
OutputBufferShrink
: Stream Functions Internals
Stream
: Stream Functions Internals
.bz2
format