GRASS GIS 7 Programmer's Manual  7.4.2(2018)-exported
compress.c File Reference
#include <grass/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "compress.h"
Include dependency graph for compress.c:

Go to the source code of this file.

Macros

#define G_COMPRESSED_NO   (unsigned char)'0'
 
#define G_COMPRESSED_YES   (unsigned char)'1'
 

Functions

int G_compressor_number (char *name)
 
char * G_compressor_name (int number)
 
int G_check_compressor (int number)
 
int G_no_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
 
int G_no_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz)
 
int G_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz, int number)
 
int G_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz, int number)
 
int G_read_compressed (int fd, int rbytes, unsigned char *dst, int nbytes, int number)
 
int G_write_compressed (int fd, unsigned char *src, int nbytes, int number)
 
int G_write_uncompressed (int fd, const unsigned char *src, int nbytes)
 

Macro Definition Documentation

◆ G_COMPRESSED_NO

#define G_COMPRESSED_NO   (unsigned char)'0'

Definition at line 93 of file compress.c.

Referenced by G_read_compressed().

◆ G_COMPRESSED_YES

#define G_COMPRESSED_YES   (unsigned char)'1'

Definition at line 94 of file compress.c.

Referenced by G_read_compressed().

Function Documentation

◆ G_check_compressor()

int G_check_compressor ( int  number)

Definition at line 129 of file compress.c.

◆ G_compress()

int G_compress ( unsigned char *  src,
int  src_sz,
unsigned char *  dst,
int  dst_sz,
int  number 
)

Definition at line 189 of file compress.c.

◆ G_compressor_name()

char* G_compressor_name ( int  number)

Definition at line 117 of file compress.c.

◆ G_compressor_number()

int G_compressor_number ( char *  name)

Definition at line 99 of file compress.c.

References compressor, G_strcasecmp(), and compressor_list::name.

◆ G_expand()

int G_expand ( unsigned char *  src,
int  src_sz,
unsigned char *  dst,
int  dst_sz,
int  number 
)

Definition at line 204 of file compress.c.

Referenced by G_read_compressed().

◆ G_no_compress()

int G_no_compress ( unsigned char *  src,
int  src_sz,
unsigned char *  dst,
int  dst_sz 
)

Definition at line 140 of file compress.c.

◆ G_no_expand()

int G_no_expand ( unsigned char *  src,
int  src_sz,
unsigned char *  dst,
int  dst_sz 
)

Definition at line 162 of file compress.c.

◆ G_read_compressed()

int G_read_compressed ( int  fd,
int  rbytes,
unsigned char *  dst,
int  nbytes,
int  number 
)

Definition at line 215 of file compress.c.

References b, err(), G_COMPRESSED_NO, G_COMPRESSED_YES, G_expand(), G_free(), G_warning(), and NULL.

◆ G_write_compressed()

int G_write_compressed ( int  fd,
unsigned char *  src,
int  nbytes,
int  number 
)

Definition at line 294 of file compress.c.

◆ G_write_uncompressed()

int G_write_uncompressed ( int  fd,
const unsigned char *  src,
int  nbytes 
)

Definition at line 379 of file compress.c.