#include <ldns/ldns.h>
ldns_buffers can contain arbitrary information, per octet. You can write
to the current end of a buffer, read from the current position, and
access any data within it.
Example use of buffers is in the source code of \ref host2str.c
struct ldns_struct_buffer
{
The current position used for reading/writing:
size_t _position;
The read/write limit:
size_t _limit;
The amount of data the buffer can contain:
size_t _capacity;
The data contained in the buffer:
uint8_t *_data;
If the buffer is fixed it cannot be resized:
unsigned _fixed : 1;
/** The current state of the buffer. If writing to the buffer fails
* for any reason, this value is changed. This way, you can perform
* multiple writes in sequence and check for success afterwards. */
ldns_status _status;
};
typedef struct ldns_struct_buffer ldns_buffer;
Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.