GNUnet  0.20.0
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

Capacity of the buffer.

Definition at line 52 of file gnunet_buffer_lib.h.

◆ position

size_t GNUNET_Buffer::position

Current write position.

Definition at line 57 of file gnunet_buffer_lib.h.

◆ mem

char* GNUNET_Buffer::mem

Backing memory.

Definition at line 62 of file gnunet_buffer_lib.h.

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


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