VDELTA(3)

NAME
vdelta - data differencing and compression

SYNOPSIS

DESCRIPTION
These functions embody an algorithm for determining a compressed form of the difference between two byte streams, and for applying that difference to a byte stream.

Vddelta computes a transformation (encoded as the byte stream delta) that maps the source byte stream source to the target byte stream target. If the source stream is empty (source is NULL or source->size is non-positive), vddelta acts like a compression routine. Vddelta returns the length of the transformation byte stream.

Vdupdate applies a transformation delta generated by vddelta to the source byte stream source and emits the target byte stream target. Vdupdate returns the length of the target byte stream.

Vdsqueeze compresses the string target of length n and outputs the compressed data to the string delta. Vdsqueeze returns the length of the compressed data.

Vdexpand decompresses compressed data in delta into the target area which is of size n. Vdexpand returns the length of the decompressed data.

The handling of data for a data stream is defined by a discipline structure of type Vddisc_t. This type contains the following members:

size defines the length of the respective data stream.

data, if not NULL, is an array that either contains
    the entire data for a read stream or is large enough to store the entire generated data. For example, in the vddelta call, target->size defines the length of the target stream. In this case, if target->data is not NULL, it is assumed to contain all of the target data (therefore, target->readf is not required.)

points to a function that reads at most n bytes
    into buf from position offset in the byte stream specified by the as described above, and returns the number of bytes actually read, or -1 on error. The argument disc is the containing discipline structure.

is identical to readf except that it writes rather than reads bytes.

Void_t is #defined as void if possible, otherwise char.

DIAGNOSTICS
Vddelta, vdupdate, vdsqueeze and vdexpand return -1 on error.

AUTHORS
Kiem-Phong Vo, kpv@research.att.com, AT&T Bell Laboratories
David G. Korn, dgk@research.att.com, AT&T Bell Laboratories