GNUnet 0.22.1
GNUNET_Buffer Struct Reference

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...
 

Detailed Description

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.

Field Documentation

◆ capacity

size_t GNUNET_Buffer::capacity

◆ position

◆ mem

◆ warn_grow

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().


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