15 uint16_t buffer_index;
29 init_buffer(uint16_t size)
32 data_buffer = (uint8_t*)malloc(size);
42 allocate_buffer(uint16_t size)
44 uint8_t* buffer =
NULL;
51 if (buffer_index + size < buffer_size) {
52 buffer = data_buffer + buffer_index;
60 copy_to_buffer(
void* data, uint16_t len)
62 uint8_t* buffer = allocate_buffer(len);
64 memcpy(buffer, data, len);
71 copy_text_to_buffer(
char* text)
73 uint8_t* buffer = allocate_buffer(strlen(text) + 1);
#define NULL
The null pointer.