91#define G_COMPRESSED_NO (unsigned char)'0'
92#define G_COMPRESSED_YES (unsigned char)'1'
140 G_warning(
_(
"Request for unsupported compressor"));
247 if (dst ==
NULL || nbytes <= 0) {
249 G_warning(
_(
"No destination buffer allocated"));
251 G_warning(
_(
"Invalid destination buffer size %d"), nbytes);
302 G_warning(
"Read error: We're not at the start of a row");
322 unsigned char *dst, compressed;
325 if (src ==
NULL || nbytes < 0) {
329 G_warning(
_(
"Invalid source buffer size %d"), nbytes);
347 if (
err > 0 &&
err < nbytes) {
351 if (
write(fd, &compressed, 1) != 1) {
353 G_warning(
_(
"Unable to write compression flag"));
363 G_warning(
_(
"Unable to write %d bytes: nothing written"),
375 if (
write(fd, &compressed, 1) != 1) {
377 G_warning(
_(
"Unable to write compression flag"));
387 G_warning(
_(
"Unable to write %d bytes: nothing written"),
390 G_warning(
_(
"Unable to write %d bytes: %s"), nbytes,
410 if (src ==
NULL || nbytes < 0)
415 if (
write(fd, &compressed, 1) != 1) {
416 G_warning(
_(
"Unable to write compression flag"));
431 G_warning(
_(
"Unable to write %d bytes: nothing written"), nbytes);
433 G_warning(
_(
"Unable to write %d bytes: %s"), nbytes,
AMI_err name(char **stream_name)
int G_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz, int number)
char * G_compressor_name(int number)
int G_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz, int number)
int G_write_compressed(int fd, unsigned char *src, int nbytes, int number)
int G_default_compressor(void)
int G_write_uncompressed(int fd, const unsigned char *src, int nbytes)
int G_read_compressed(int fd, int rbytes, unsigned char *dst, int nbytes, int number)
int G_no_compress(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
int G_compressor_number(char *name)
int G_check_compressor(int number)
int G_no_compress_bound(int src_sz)
int G_no_expand(unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
int G_compress_bound(int src_sz, int number)
struct compressor_list compressor[]
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)