54 #define IN_LEN (128*1024ul) 55 #define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3) 65 #define HEAP_ALLOC(var,size) \ 66 lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ] 75 int main(
int argc,
char *argv[])
82 if (argc < 0 && argv == NULL)
85 printf(
"\nLZO real-time data compression library (v%s, %s).\n",
87 printf(
"Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
95 printf(
"internal error - lzo_init() failed !!!\n");
96 printf(
"(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
113 printf(
"compressed %lu bytes into %lu bytes\n",
114 (
unsigned long) in_len, (
unsigned long) out_len);
118 printf(
"internal error - compression failed: %d\n", r);
122 if (out_len >= in_len)
124 printf(
"This block contains incompressible data.\n");
133 if (r ==
LZO_E_OK && new_len == in_len)
134 printf(
"decompressed %lu bytes back into %lu bytes\n",
135 (
unsigned long) out_len, (
unsigned long) in_len);
139 printf(
"internal error - decompression failed: %d\n", r);
143 printf(
"\nminiLZO simple compression test passed.\n");
#define HEAP_ALLOC(var, size)
lzo1x_decompress(const lzo_bytep src, lzo_uint src_len, lzo_bytep dst, lzo_uintp dst_len, lzo_voidp wrkmem)
lzo1x_1_compress(const lzo_bytep src, lzo_uint src_len, lzo_bytep dst, lzo_uintp dst_len, lzo_voidp wrkmem)
#define LZO1X_1_MEM_COMPRESS
lzo_memset(lzo_voidp buf, int c, lzo_uint len)
int main(int argc, char *argv[])
lzo_uint lzo_bytep lzo_uintp lzo_voidp wrkmem