Macros | Functions
compression.c File Reference

Data compression and decompression. More...

Go to the source code of this file.

Macros

#define MAIN_ERR_PREFIX   "COMPR: "
 Message prefix for COMPRESSION module.
 
#define CMPR_DEBUG   0
 Print debug messages to stdout if nonzero.
 
#define CMPR_BUFSIZE   (size_t) 32768
 Size of internal data buffers. More...
 
#define CMPR_ZLIB_WINDOW_BITS   -15
 Window size for DEFLATE algorithm. More...
 
#define CMPR_ZLIB_MEM_LEVEL   9
 Memory usage for DEFLATE algorithm. More...
 
Flush options for TX direction of compressed data streams

The flags can be bitwise ORed together.

#define CMPR_FLUSH_NO   0
 
#define CMPR_FLUSH_YES   1
 
#define CMPR_FLUSH_END   2
 

Functions

posix_ssize_t cmpr_send (void *stream, const void *buf, size_t len)
 Send data. More...
 
int cmpr_flush (void *stream)
 Flush TX direction. More...
 
int cmpr_terminate (void *stream)
 Flush TX direction and terminate data stream. More...
 
posix_ssize_t cmpr_recv (void *stream, void *buf, size_t len, int peek)
 Receive data. More...
 
struct cmpr_stream * cmpr_stream_constructor (unsigned int alg, int sd, ssize_t(*tx_send)(int, const void *, size_t, int), ssize_t(*rx_recv)(int, void *, size_t, int))
 Compressed data stream object constructor. More...
 
void cmpr_stream_destructor (void *stream)
 Destroy compressed data stream object allocated by compression module. More...
 
int cmpr_init (void)
 Initialize compression module.
 
void cmpr_exit (void)
 Shutdown compress module.
 

Detailed Description

Data compression and decompression.

Copyright (c) 2015-2020 by the developers. See the LICENSE file for details.

If nothing else is specified, function return zero to indicate success and a negative value to indicate an error.

Definition in file compression.c.


Generated at 2024-04-27 using  doxygen