Dynamically growing buffer. More...
#include <gnunet_buffer_lib.h>
Data Fields | |
size_t | capacity |
Capacity of the buffer. More... | |
size_t | position |
Current write position. More... | |
char * | mem |
Backing memory. More... | |
int | warn_grow |
Log a warning if the buffer is grown over its initially allocated capacity. More... | |
Dynamically growing buffer.
Can be used to construct strings and other objects with dynamic size.
This structure should, in most cases, be stack-allocated and zero-initialized, like:
struct GNUNET_Buffer my_buffer = { 0 };
Definition at line 47 of file gnunet_buffer_lib.h.
size_t GNUNET_Buffer::capacity |
Capacity of the buffer.
Definition at line 52 of file gnunet_buffer_lib.h.
Referenced by GNUNET_buffer_ensure_remaining(), GNUNET_buffer_prealloc(), GNUNET_buffer_write_data_encoded(), and GNUNET_buffer_write_vfstr().
size_t GNUNET_Buffer::position |
Current write position.
Definition at line 57 of file gnunet_buffer_lib.h.
Referenced by GNUNET_buffer_ensure_remaining(), GNUNET_buffer_prealloc(), GNUNET_buffer_reap(), GNUNET_buffer_reap_str(), GNUNET_buffer_write(), GNUNET_buffer_write_data_encoded(), GNUNET_buffer_write_path(), and GNUNET_buffer_write_vfstr().
char* GNUNET_Buffer::mem |
Backing memory.
Definition at line 62 of file gnunet_buffer_lib.h.
Referenced by GNUNET_buffer_clear(), GNUNET_buffer_ensure_remaining(), GNUNET_buffer_prealloc(), GNUNET_buffer_reap(), GNUNET_buffer_reap_str(), GNUNET_buffer_write(), GNUNET_buffer_write_data_encoded(), GNUNET_buffer_write_path(), and GNUNET_buffer_write_vfstr().
int GNUNET_Buffer::warn_grow |
Log a warning if the buffer is grown over its initially allocated capacity.
Definition at line 67 of file gnunet_buffer_lib.h.
Referenced by GNUNET_buffer_ensure_remaining(), and GNUNET_buffer_prealloc().