|
libsignal-protocol-c
master
|
#include <protobuf-c.h>

Public Attributes | |
| ProtobufCBuffer | base |
| size_t | alloced |
| size_t | len |
| uint8_t * | data |
| protobuf_c_boolean | must_free_data |
| ProtobufCAllocator * | allocator |
Simple buffer "subclass" of ProtobufCBuffer.
A ProtobufCBufferSimple object is declared on the stack and uses a scratch buffer provided by the user for the initial allocation. It performs exponential resizing, using dynamically allocated memory. A ProtobufCBufferSimple object can be created and used as follows:
buffer can now be used with protobuf_c_message_pack_to_buffer(). Once a message has been serialized to a ProtobufCBufferSimple object, the serialized data bytes can be accessed from the .data field.
To free the memory allocated by a ProtobufCBufferSimple object, if any, call PROTOBUF_C_BUFFER_SIMPLE_CLEAR() on the object, for example:
| ProtobufCAllocator* ProtobufCBufferSimple::allocator |
Allocator to use. May be NULL to indicate the system allocator.
| size_t ProtobufCBufferSimple::alloced |
Number of bytes allocated in data.
| ProtobufCBuffer ProtobufCBufferSimple::base |
"Base class".
| uint8_t* ProtobufCBufferSimple::data |
Data bytes.
| size_t ProtobufCBufferSimple::len |
Number of bytes currently stored in data.
| protobuf_c_boolean ProtobufCBufferSimple::must_free_data |
Whether data must be freed.