at v2.6.31-rc1 33 lines 1.1 kB view raw
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 9typedef 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/* Utility routine to detect the decompression method */ 30decompress_fn decompress_method(const unsigned char *inbuf, int len, 31 const char **name); 32 33#endif