17 #define ENSURE_BYTES do { \
18 if (i_ptr >= i_end) { \
19 read = system->read(input, &inbuf[0], \
22 system->free(window); \
23 return (read < 0) ? MSPACK_ERR_READ \
26 i_ptr = &inbuf[0]; i_end = &inbuf[read]; \
30 #define WRITE_BYTE do { \
31 if (system->write(output, &window[pos], 1) != 1) { \
32 system->free(window); \
33 return MSPACK_ERR_WRITE; \
40 int input_buffer_size,
63 i_ptr = i_end = &
inbuf[0];
68 for (
i = 0x01;
i & 0xFF;
i <<= 1) {
79 len = (*i_ptr++ & 0x0F) + 3;
static unsigned invert(unsigned x)
unsigned char inbuf[SIZE]
return memset(p, 0, total)
int lzss_decompress(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int input_buffer_size, int mode)
void *(* alloc)(struct mspack_system *self, size_t bytes)
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
int read(izstream &zs, T *x, Items items)