summaryrefslogtreecommitdiff
path: root/lzx.h
blob: ff78f5d57aa95c4bd9f69cfe92784852b506367d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * lzx.h: LZX encoder for Windows CHM files.
 */

struct LZXEncodedFile {
    unsigned char *data;
    size_t data_len;

    size_t *reset_byte_offsets;
    size_t n_resets;
};

/*
 * Produce an LZX-compressed encoding of an input data block. Return
 * it, along with a list of byte offsets where the data stream is
 * realigned to a 16-bit boundary because one of realign_interval and
 * reset_interval has run out.
 *
 * The output structure and its fields 'data' and 'reset_byte_offsets'
 * are all dynamically allocated, and need freeing by the receiver
 * when finished with.
 */
struct LZXEncodedFile *lzx(const void *data, int len,
                           int realign_interval, int reset_interval);