63 #include <grass/config.h> 65 #include <grass/gis.h> 66 #include <grass/glocale.h> 75 int err, nbytes, buf_sz;
89 if (src_sz <= 0 || dst_sz <= 0) {
91 G_warning(_(
"Invalid source buffer size %d"), src_sz);
93 G_warning(_(
"Invalid destination buffer size %d"), dst_sz);
99 if (
NULL == (buf = (
unsigned char *)
100 G_calloc(buf_sz,
sizeof(
unsigned char))))
121 for (err = 0; err < nbytes; err++)
146 if (src_sz <= 0 || dst_sz <= 0) {
148 G_warning(_(
"Invalid source buffer size %d"), src_sz);
150 G_warning(_(
"Invalid destination buffer size %d"), dst_sz);
166 if (nbytes != dst_sz) {
168 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 LZ4_decompress_safe(const char *source, char *dest, int compressedSize, int maxDecompressedSize)
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)
int LZ4_compressBound(int isize)
void G_free(void *buf)
Free allocated memory.
void G_warning(const char *msg,...)
Print a warning message to stderr.