Compressed buffers.
More...
Go to the source code of this file.
Compressed buffers.
Definition in file zbuf.h.
nmsg_zbuf_t nmsg_zbuf_deflate_init |
( |
void |
| ) |
|
Initialize an nmsg_zbuf_t object for deflation.
- Returns
- Opaque pointer that is NULL on failure or non-NULL on success.
Definition at line 36 of file zbuf.c.
nmsg_zbuf_t nmsg_zbuf_inflate_init |
( |
void |
| ) |
|
Initialize an nmsg_zbuf_t object for inflation.
- Returns
- Opaque pointer that is NULL on failure or non-NULL on success.
Definition at line 59 of file zbuf.c.
void nmsg_zbuf_destroy |
( |
nmsg_zbuf_t * |
zb | ) |
|
Destroy all resources associated with an nmsg_zbuf_t object.
- Parameters
-
[in] | zb | pointer to nmsg_zbuf_t object. |
Definition at line 84 of file zbuf.c.
nmsg_res nmsg_zbuf_deflate |
( |
nmsg_zbuf_t |
zb, |
|
|
size_t |
len, |
|
|
u_char * |
buf, |
|
|
size_t * |
z_len, |
|
|
u_char * |
z_buf |
|
) |
| |
Deflate a buffer.
- Parameters
-
[in] | zb | nmsg_zbuf_t object initialized for deflation. |
[in] | len | length of buffer to compress. |
[in] | buf | buffer to compress. |
[out] | z_len | length of compressed buffer. |
[out] | z_buf | compressed buffer. Allocated by the caller and should be at least as large as 'buf'. |
- Returns
- nmsg_res_success
Definition at line 96 of file zbuf.c.
nmsg_res nmsg_zbuf_inflate |
( |
nmsg_zbuf_t |
zb, |
|
|
size_t |
z_len, |
|
|
u_char * |
z_buf, |
|
|
size_t * |
u_len, |
|
|
u_char ** |
u_buf |
|
) |
| |
Inflate a buffer.
- Parameters
-
[in] | zb | nmsg_zbuf_t object initialized for inflation. |
[in] | z_len | length of compressed buffer. |
[in] | z_buf | compressed buffer. |
[out] | u_len | length of uncompressed buffer. |
[out] | u_buf | pointer to uncompressed buffer. Should be freed by the caller with free(). |
- Returns
- nmsg_res_success
-
nmsg_res_memfail
-
nmsg_res_failure
Definition at line 120 of file zbuf.c.