Coconut Framework
beta
|
Define CNBuffer data structure. More...
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | CNBuffer |
Write buffer to store variable-sized continuous data. More... | |
Functions | |
static size_t | CNCalcSizeOfBuffer (size_t size) |
Calc memory size of CNBuffer. More... | |
static void | CNInitBuffer (struct CNBuffer *dst) |
Initialize CNBuffer object. More... | |
static void | CNDestroyBuffer (struct CNBuffer *dst) |
Destroy the context of CNBuffer. More... | |
static void | CNResetBuffer (struct CNBuffer *dst) |
Make the buffer empty. More... | |
static void * | CNDetachDataFromBuffer (struct CNBuffer *dst) |
Detach context from the buffer. More... | |
static size_t | CNSizeOfBuffer (const struct CNBuffer *src) |
Get the size of valid data in CNBuffer. More... | |
static const void * | CNContextOfBuffer (const struct CNBuffer *src) |
Get the context of CNBuffer. More... | |
static void | CNPutBytesToBuffer (struct CNBuffer *dst, size_t srcsize, const void *srcptr) |
Write byte data into the buffer. More... | |
Define CNBuffer data structure.
|
inlinestatic |
Calc memory size of CNBuffer.
size | Source data size |
Referenced by CNInitBuffer(), and CNPutBytesToBuffer().
|
inlinestatic |
Initialize CNBuffer object.
dst | Destination buffer object |
References CNCalcSizeOfBuffer(), CNBuffer::context, CNBuffer::currentSize, and CNBuffer::writePosition.
|
inlinestatic |
Destroy the context of CNBuffer.
dst | Destination buffer object |
References CNBuffer::context.
|
inlinestatic |
|
inlinestatic |
Detach context from the buffer.
dst | Destination buffer |
References CNBuffer::context, CNBuffer::currentSize, and CNBuffer::writePosition.
|
inlinestatic |
Get the size of valid data in CNBuffer.
src | Source buffer |
References CNBuffer::writePosition.
|
inlinestatic |
Get the context of CNBuffer.
src | Source buffer |
References CNBuffer::context.
|
inlinestatic |
Write byte data into the buffer.
dst | Destination buffer |
srcsize | Size of source data |
srcptr | Pointer of source data |
References CNCalcSizeOfBuffer(), CNBuffer::context, CNBuffer::currentSize, and CNBuffer::writePosition.
Referenced by CNPutFixedStringToText(), and CNPutUTF8StringToText().