81 int err, nbytes, buf_sz;
95 if (src_sz <= 0 || dst_sz <= 0) {
97 G_warning(
_(
"Invalid source buffer size %d"), src_sz);
99 G_warning(
_(
"Invalid destination buffer size %d"), dst_sz);
106 if (buf_sz > dst_sz) {
108 "G_lz4_compress(): programmer error, destination is too small");
110 (buf = (
unsigned char *)
G_calloc(buf_sz,
sizeof(
unsigned char))))
161 if (src_sz <= 0 || dst_sz <= 0) {
163 G_warning(
_(
"Invalid source buffer size %d"), src_sz);
165 G_warning(
_(
"Invalid destination buffer size %d"), dst_sz);
181 if (nbytes != dst_sz) {
183 G_warning(
_(
"Got uncompressed size %d, expected %d"), (
int)nbytes,
int G_lz4_compress(unsigned char *src, int src_sz, unsigned char *dst, int 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.
void G_warning(const char *,...) __attribute__((format(printf
int LZ4_compressBound(int isize)
int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity)
LZ4_FORCE_O2 int LZ4_decompress_safe(const char *source, char *dest, int compressedSize, int maxDecompressedSize)
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)