int ldns_buffer_printf(ldns_buffer *buffer, const char *format, ...);
void ldns_buffer_free(ldns_buffer *buffer);
void* ldns_buffer_export(ldns_buffer *buffer);
DESCRIPTION
ldns_buffer_new()
creates a new buffer with the specified capacity.
.br
capacity: the size (in bytes) to allocate for the buffer
.br
Returns the created buffer
ldns_buffer_new_frm_data()
creates a buffer with the specified data. The data IS copied
and MEMORY allocations are done. The buffer is not fixed and can
be resized using buffer_reserve().
.br
buffer: pointer to the buffer to put the data in
.br
data: the data to encapsulate in the buffer
.br
size: the size of the data
ldns_buffer_clear()
clears the buffer and make it ready for writing. The buffer's limit
is set to the capacity and the position is set to 0.
.br
buffer: the buffer to clear
ldns_buffer_printf()
prints to the buffer, increasing the capacity if required using
buffer_reserve(). The buffer's position is set to the terminating
\
\0'. Returns the number of characters written (not including the
terminating '\\0') or -1 on failure.
ldns_buffer_free()
frees the buffer.
.br
*buffer: the buffer to be freed
.br
Returns void
ldns_buffer_export()
Makes the buffer fixed and returns a pointer to the data. The
caller is responsible for free'ing the result.
.br
*buffer: the buffer to be exported
.br
Returns void
AUTHOR
The ldns team at NLnet Labs. Which consists out of
Jelte Jansen and Miek Gieben.