Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_buffer Struct Reference

A sol_buffer is a dynamic array, that can be resized if needed. More...

#include <sol-buffer.h>

Data Fields

size_t capacity
 Buffer capacity in bytes. More...
 
void * data
 Buffer data. More...
 
enum sol_buffer_flags flags
 Buffer flags. More...
 
size_t used
 Used size in bytes. More...
 

Detailed Description

A sol_buffer is a dynamic array, that can be resized if needed.

It grows exponentially but also supports setting a specific size.

Useful to reduce the noise of handling realloc/size-variable manually.

See also sol_arena if you are allocating multiple pieces of data that will be deallocated twice.

Examples:
/src/samples/bluetooth/browse.c, /src/samples/bluetooth/heartbeat.c, /src/samples/coap/iotivity-test-client.c, /src/samples/coap/simple-client.c, /src/samples/coap/simple-server.c, /src/samples/common/uart.c, /src/samples/crypto/message-digest.c, /src/samples/crypto/sha256sum.c, /src/samples/design_patterns/stream_sample.c, /src/samples/http/download.c, /src/samples/http/server-sse.c, /src/samples/http/server.c, /src/samples/iio+network/iio-gyroscope-console-and-mqtt-publish.c, /src/samples/mqtt/mqtt-publish.c, /src/samples/network/echo-client.c, and /src/samples/network/echo-server.c.

Field Documentation

size_t sol_buffer::capacity
void* sol_buffer::data
enum sol_buffer_flags sol_buffer::flags
size_t sol_buffer::used

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