]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - include/linux/decompress/generic.h
bzip2/lzma: library support for gzip, bzip2 and lzma decompression
[mirror_ubuntu-artful-kernel.git] / include / linux / decompress / generic.h
1 #ifndef DECOMPRESS_GENERIC_H
2 #define DECOMPRESS_GENERIC_H
3
4 /* Minimal chunksize to be read.
5 *Bzip2 prefers at least 4096
6 *Lzma prefers 0x10000 */
7 #define COMPR_IOBUF_SIZE 4096
8
9 typedef int (*decompress_fn) (unsigned char *inbuf, int len,
10 int(*fill)(void*, unsigned int),
11 int(*writebb)(void*, unsigned int),
12 unsigned char *output,
13 int *posp,
14 void(*error)(char *x));
15
16 /* inbuf - input buffer
17 *len - len of pre-read data in inbuf
18 *fill - function to fill inbuf if empty
19 *writebb - function to write out outbug
20 *posp - if non-null, input position (number of bytes read) will be
21 * returned here
22 *
23 *If len != 0, the inbuf is initialized (with as much data), and fill
24 *should not be called
25 *If len = 0, the inbuf is allocated, but empty. Its size is IOBUF_SIZE
26 *fill should be called (repeatedly...) to read data, at most IOBUF_SIZE
27 */
28
29
30 #endif