#include <stddef.h>
#include <stdbool.h>
#include "tlcllists.h"
Go to the source code of this file.
◆ circ_buf_inf_create()
circ_buf_inf_t * circ_buf_inf_create |
( |
const char * |
end_pattern | ) |
|
create a circular buffer
- Parameters
-
end_pattern | the pattern of the end that says we can write to another |
- Returns
- a circular buffer
◆ circ_buf_inf_destroy()
void circ_buf_inf_destroy |
( |
circ_buf_inf_t * |
buffer | ) |
|
destroy a circular buffer
- Parameters
-
buffer | the circular buffer |
◆ circ_buf_inf_is_empty()
bool circ_buf_inf_is_empty |
( |
circ_buf_inf_t * |
buffer | ) |
|
check if circular buffer is empty
- Parameters
-
buffer | the circular buffer |
- Returns
- true if empty; false otherwise
◆ circ_buf_inf_is_read_ready()
bool circ_buf_inf_is_read_ready |
( |
circ_buf_inf_t * |
buffer | ) |
|
check if circular buffer is ready to read (=> end_pattern
'ed)
- Parameters
-
buffer | the circular buffer |
- Returns
- true if ready; false otherwise
◆ circ_buf_inf_read()
char * circ_buf_inf_read |
( |
circ_buf_inf_t * |
buffer | ) |
|
read a char* from the circular buffer
- Parameters
-
buffer | the circular buffer |
- Returns
- a char* (malloc'ed); NULL if empty or not
end_pattern
'ed
◆ circ_buf_inf_read_multiple()
char * circ_buf_inf_read_multiple |
( |
circ_buf_inf_t * |
buffer | ) |
|
read a char* from the circular buffer until last end_pattern
- Parameters
-
buffer | the circular buffer |
- Returns
- a char* (malloc'ed); NULL if empty or not
end_pattern
'ed
◆ circ_buf_inf_write()
void circ_buf_inf_write |
( |
circ_buf_inf_t * |
buffer, |
|
|
const char * |
str |
|
) |
| |
add a char* to the circular buffer
- Parameters
-
buffer | the circular buffer |
str | the char* to add (it will be strdup'ed) |