void SOPC_Buffer_Delete(SOPC_Buffer *buffer)
Deallocate buffer and its data bytes content (Clear + deallocate pointer)
void SOPC_Buffer_Reset(SOPC_Buffer *buffer)
Reset length, position and data bytes to zero value of an allocated buffer.
uint32_t SOPC_Buffer_Remaining(SOPC_Buffer *buffer)
Returns the remaining number of unread bytes in the buffer.
SOPC_Buffer * SOPC_Buffer_Attach(uint8_t *data, uint32_t size)
Wraps a raw memory area into an SOPC_Buffer.
SOPC_ReturnStatus SOPC_Buffer_PrintCString(SOPC_Buffer *buf, const char *value)
SOPC_ReturnStatus SOPC_Buffer_PrintFloatDouble(SOPC_Buffer *buf, const double value)
Print the value into the buffer data bytes from the buffer position (adapting buffer position and len...
SOPC_ReturnStatus SOPC_Buffer_ResetAfterPosition(SOPC_Buffer *buffer, uint32_t position)
reset data bytes after position (>=) to zero and set buffer position and length to given position
SOPC_ReturnStatus SOPC_Buffer_ReadFile(const char *path, SOPC_Buffer **buf)
Reads the contents of a file into a SOPC_Buffer.
SOPC_Buffer * SOPC_Buffer_Create(uint32_t size)
Allocate a buffer and its data bytes of the given definitive size and returns it.
void SOPC_Buffer_Clear(SOPC_Buffer *buffer)
Deallocate buffer data bytes content.
SOPC_Buffer * SOPC_Buffer_CreateResizable(uint32_t initial_size, uint32_t maximum_size)
Allocate a resizable buffer and its initial and maximum data bytes.
SOPC_ReturnStatus SOPC_Buffer_Write(SOPC_Buffer *buffer, const uint8_t *data_src, uint32_t count)
Write the given bytes into the buffer data bytes from the buffer position (adapting buffer position a...
SOPC_ReturnStatus SOPC_Buffer_PrintU32(SOPC_Buffer *buf, const uint32_t value)
Print the value into the buffer data bytes from the buffer position (adapting buffer position and len...
SOPC_ReturnStatus SOPC_Buffer_Copy(SOPC_Buffer *dest, SOPC_Buffer *src)
Copy the data bytes and properties from the source buffer to the destination buffer.
SOPC_ReturnStatus SOPC_Buffer_PrintI32(SOPC_Buffer *buf, const int32_t value)
Print the value into the buffer data bytes from the buffer position (adapting buffer position and len...
SOPC_ReturnStatus SOPC_Buffer_SetPosition(SOPC_Buffer *buffer, uint32_t position)
Set buffer to the given position.
SOPC_ReturnStatus SOPC_Buffer_CopyWithLength(SOPC_Buffer *dest, SOPC_Buffer *src, uint32_t limitedLength)
Copy the data bytes and properties for the given length from the source buffer to the destination buf...
int64_t SOPC_Buffer_ReadFrom(SOPC_Buffer *buffer, SOPC_Buffer *src, uint32_t n)
Reads n bytes from src into buffer.
SOPC_ReturnStatus SOPC_Buffer_GetPosition(SOPC_Buffer *buffer, uint32_t *position)
Get buffer current position.
SOPC_ReturnStatus SOPC_Buffer_Read(uint8_t *data_dest, SOPC_Buffer *buffer, uint32_t count)
Read the given bytes of the buffer data bytes from the buffer position (adapting buffer position to n...
SOPC_ReturnStatus SOPC_Buffer_SetDataLength(SOPC_Buffer *buffer, uint32_t length)
Set buffer to the given length.
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
Bytes buffer structure.
Definition sopc_buffer.h:38
uint32_t position
Definition sopc_buffer.h:42
uint8_t * data
Definition sopc_buffer.h:44
uint32_t current_size
Definition sopc_buffer.h:40
uint32_t length
Definition sopc_buffer.h:43
uint32_t initial_size
Definition sopc_buffer.h:39
uint32_t maximum_size
Definition sopc_buffer.h:41