nmsg 1.1.2
Functions
zbuf.h File Reference

Compressed buffers. More...

Go to the source code of this file.

Functions

nmsg_zbuf_t nmsg_zbuf_deflate_init (void)
 Initialize an nmsg_zbuf_t object for deflation.
 
nmsg_zbuf_t nmsg_zbuf_inflate_init (void)
 Initialize an nmsg_zbuf_t object for inflation.
 
void nmsg_zbuf_destroy (nmsg_zbuf_t *zb)
 Destroy all resources associated with an nmsg_zbuf_t object.
 
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.
 
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.
 

Detailed Description

Compressed buffers.

Definition in file zbuf.h.

Function Documentation

◆ nmsg_zbuf_deflate_init()

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.

◆ nmsg_zbuf_inflate_init()

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.

◆ nmsg_zbuf_destroy()

void nmsg_zbuf_destroy ( nmsg_zbuf_t *  zb)

Destroy all resources associated with an nmsg_zbuf_t object.

Parameters
[in]zbpointer to nmsg_zbuf_t object.

◆ nmsg_zbuf_deflate()

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]zbnmsg_zbuf_t object initialized for deflation.
[in]lenlength of buffer to compress.
[in]bufbuffer to compress.
[out]z_lenlength of compressed buffer.
[out]z_bufcompressed buffer. Allocated by the caller and should be at least as large as 'buf'.
Returns
nmsg_res_success

◆ nmsg_zbuf_inflate()

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]zbnmsg_zbuf_t object initialized for inflation.
[in]z_lenlength of compressed buffer.
[in]z_bufcompressed buffer.
[out]u_lenlength of uncompressed buffer.
[out]u_bufpointer to uncompressed buffer. Should be freed by the caller with free().
Returns
nmsg_res_success
nmsg_res_memfail
nmsg_res_failure