GNUnet  0.11.x
Data Fields
GNUNET_Buffer Struct Reference

Common buffer management functions. 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...
 

Detailed Description

Common buffer management functions.

Author
Florian Dold 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 39 of file gnunet_buffer_lib.h.

Field Documentation

◆ capacity

size_t GNUNET_Buffer::capacity

Capacity of the buffer.

Definition at line 44 of file gnunet_buffer_lib.h.

Referenced by GNUNET_buffer_ensure_remaining(), GNUNET_buffer_prealloc(), and GNUNET_buffer_write_vfstr().

◆ position

size_t GNUNET_Buffer::position

◆ mem

char* GNUNET_Buffer::mem

◆ warn_grow

int GNUNET_Buffer::warn_grow

Log a warning if the buffer is grown over its initially allocated capacity.

Definition at line 59 of file gnunet_buffer_lib.h.

Referenced by GNUNET_buffer_ensure_remaining(), and GNUNET_buffer_prealloc().


The documentation for this struct was generated from the following file: