DTS Application Library
0.2.3
Application library containing referenced objects and interfaces to common libraries
|
Simplified implementation of zlib functions. More...
Files | |
file | zlib.c |
Simplified implementation of zlib functions. | |
Data Structures | |
struct | zobj |
Zlib buffer used for compression and decompression. More... | |
Functions | |
struct zobj * | zcompress (uint8_t *buff, uint16_t len, uint8_t level) |
Allocate a buffer and return it with compressed data. More... | |
void | zuncompress (struct zobj *buff, uint8_t *obuff) |
Uncompress zobj buffer to buffer. More... | |
int | is_gzip (uint8_t *buf, int buf_size) |
check a buffer if it contains gzip magic More... | |
uint8_t * | gzinflatebuf (uint8_t *buf_in, int buf_size, uint32_t *len) |
Ungzip a buffer. More... | |
Simplified implementation of zlib functions.
uint8_t* gzinflatebuf | ( | uint8_t * | buf_in, |
int | buf_size, | ||
uint32_t * | len | ||
) |
Ungzip a buffer.
buf_in | Buffer to inflate. |
buf_size | Size of buf_in buffer. |
len | Pointer that will contain the uncompressed data length. |
Definition at line 101 of file zlib.c.
Referenced by curl_ungzip().
int is_gzip | ( | uint8_t * | buf, |
int | buf_size | ||
) |
check a buffer if it contains gzip magic
buf | buffer to check. |
buf_size | buffer len it must be more than 4. |
Definition at line 85 of file zlib.c.
Referenced by curl_ungzip().
struct zobj* zcompress | ( | uint8_t * | buff, |
uint16_t | len, | ||
uint8_t | level | ||
) |
Allocate a buffer and return it with compressed data.
buff | Buffer to compress. |
len | Length of the buffer. |
level | Compression level. |
Definition at line 47 of file zlib.c.
References zobj::buff, objalloc(), zobj::olen, and zobj::zlen.
void zuncompress | ( | struct zobj * | buff, |
uint8_t * | obuff | ||
) |
Uncompress zobj buffer to buffer.
buff | Compressed buffer to uncompress. |
obuff | Buffer to uncompress too. |
Definition at line 71 of file zlib.c.
References zobj::buff, zobj::olen, and zobj::zlen.