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. window specifies the largest amount of data that will be processed at one time. Typically, larger values decrease the size of the transformation and increase the time needed to calculate it. A non-positive value for window indicates that vddelta should pick some value at its convenience. 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.

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
Both vddelta and vdupdate return -1 on error.

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