83 int err, nbytes, buf_sz;
97 if (src_sz <= 0 || dst_sz <= 0) {
99 G_warning(
_(
"Invalid source buffer size %d"), src_sz);
101 G_warning(
_(
"Invalid destination buffer size %d"), dst_sz);
108 if (buf_sz > dst_sz) {
109 G_warning(
"G_lz4_compress(): programmer error, destination is too small");
110 if (
NULL == (buf = (
unsigned char *)
111 G_calloc(buf_sz,
sizeof(
unsigned char))))
138 for (err = 0; err < nbytes; err++)
164 if (src_sz <= 0 || dst_sz <= 0) {
166 G_warning(
_(
"Invalid source buffer size %d"), src_sz);
168 G_warning(
_(
"Invalid destination buffer size %d"), dst_sz);
184 if (nbytes != dst_sz) {
186 G_warning(
_(
"Got uncompressed size %d, expected %d"), (
int)nbytes, dst_sz);
int G_lz4_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
int G_lz4_compress_bound(int src_sz)
void G_free(void *)
Free allocated memory.
int LZ4_compress_default(const char *source, char *dest, int inputSize, int maxOutputSize)
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)
int G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
LZ4_FORCE_O2_GCC_PPC64LE int LZ4_decompress_safe(const char *source, char *dest, int compressedSize, int maxDecompressedSize)
void G_warning(const char *,...) __attribute__((format(printf
int LZ4_compressBound(int isize)