35 #if defined(ENABLE_LZO)
45 lzo_compress_init(
struct compress_context *compctx)
49 compctx->wu.lzo.wmem_size = LZO_WORKSPACE;
51 int lzo_status = lzo_init();
52 if (lzo_status != LZO_E_OK)
54 msg(
M_FATAL,
"Cannot initialize LZO compression library (lzo_init() returns %d)", lzo_status);
56 compctx->wu.lzo.wmem = (lzo_voidp) malloc(compctx->wu.lzo.wmem_size);
61 lzo_compress_uninit(
struct compress_context *compctx)
63 free(compctx->wu.lzo.wmem);
64 compctx->wu.lzo.wmem = NULL;
69 struct compress_context *compctx,
73 *header = NO_COMPRESS_BYTE;
78 struct compress_context *compctx,
95 if (c == LZO_COMPRESS_BYTE)
98 err = LZO_DECOMPRESS(
BPTR(buf),
BLEN(buf),
BPTR(&work), &zlen,
99 compctx->wu.lzo.wmem);
111 compctx->pre_decompress += buf->
len;
112 compctx->post_decompress += work.
len;
116 else if (c == NO_COMPRESS_BYTE)
127 const struct compress_alg lzo_alg = {