int(*flush)(void*, unsigned int),
unsigned char *outbuf,
unsigned int *pos,
- void(*error_fn)(const char *x))
+ void(*error)(const char *x))
{
struct bunzip_data *bd;
int i = -1;
unsigned char *inbuf;
- set_error_fn(error_fn);
if (flush)
outbuf = malloc(BZIP2_IOBUF_SIZE);
#define INIT __init
#define INITDATA __initdata
-static void(*__initdata error)(const char *);
-#define set_error_fn(x) error = x;
-
#define malloc xmalloc_bytes
#define free xfree
uint32_t code;
uint32_t range;
uint32_t bound;
+ void (*error)(const char *);
};
{
rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE);
if (rc->buffer_size <= 0)
- error("unexpected EOF");
+ rc->error("unexpected EOF");
rc->ptr = rc->buffer;
rc->buffer_end = rc->buffer + rc->buffer_size;
}
int(*flush)(void*, unsigned int),
unsigned char *output,
unsigned int *posp,
- void(*error_fn)(const char *x)
+ void(*error)(const char *x)
)
{
struct lzma_header header;
unsigned char *inbuf;
int ret = -1;
- set_error_fn(error_fn);
+ rc.error = error;
if (buf)
inbuf = buf;
int (*fill) (void *, unsigned int),
int (*flush) (void *, unsigned int),
u8 *output, unsigned int *posp,
- void (*error_fn) (const char *x))
+ void (*error) (const char *x))
{
u8 skip = 0, r = 0;
u32 src_len, dst_len;
u8 *in_buf, *in_buf_save, *out_buf;
int ret = -1;
- set_error_fn(error_fn);
-
if (output) {
out_buf = output;
} else if (!flush) {
int (*fill)(void *dest, unsigned int size),
int (*flush)(void *src, unsigned int size),
unsigned char *out, unsigned int *in_used,
- void (*error_fn)(const char *x))
+ void (*error)(const char *x))
{
struct xz_buf b;
struct xz_dec *s;
enum xz_ret ret;
bool_t must_free_in = false;
- set_error_fn(error_fn);
-
xz_crc32_init();
if (in_used != NULL)