pelib
2.0.0
|
Go to the source code of this file.
Defines | |
#define | state(elem) PELIB_CONCAT_3(cfifo_, elem, _state) |
#define | is_in_content(elem) PELIB_CONCAT_2(is_in_content_, elem) |
#define | continuous_read_length(elem) PELIB_CONCAT_2(continuous_read_length_, elem) |
#define | continuous_write_length(elem) PELIB_CONCAT_2(continuous_write_length_, elem) |
#define | CFIFO_EMPTY "[]" |
#define | CFIFO_SEPARATOR ":" |
#define | CFIFO_BEGIN "[" |
#define | CFIFO_END "]" |
#define | debug(var) printf("[%s:%s:%d] %s = \"%s\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define | debug_addr(var) printf("[%s:%s:%d] %s = \"%p\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define | debug_int(var) printf("[%s:%s:%d] %s = \"%d\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define | debug_size_t(var) printf("[%s:%s:%d] %s = \"%zu\"\n", __FILE__, __FUNCTION__, __LINE__, #var, (size_t)(var)); fflush(NULL) |
Typedefs | |
typedef enum state | state_t |
Enumerations | |
enum | state { NORMAL, REVERSE, EMPTY, FULL } |
Functions | |
int | pelib_alloc_buffer (cfifo_t(CFIFO_T)) |
cfifo_t (CFIFO_T) | |
int | pelib_init (cfifo_t(CFIFO_T)) |
int | pelib_free (cfifo_t(CFIFO_T)) |
int | pelib_free_struct (cfifo_t(CFIFO_T)) |
int | pelib_free_buffer (cfifo_t(CFIFO_T)) |
FILE * | pelib_printf (cfifo_t(CFIFO_T)) |
FILE * | pelib_printf_detail (cfifo_t(CFIFO_T)) |
char * | pelib_string (cfifo_t(CFIFO_T)) |
char * | pelib_string_detail (cfifo_t(CFIFO_T)) |
int pelib_cfifo_push() | CFIFO_T (cfifo_t(CFIFO_T)*fifo, CFIFO_T elem) |
CFIFO_T *pelib_cfifo_peekaddr() | CFIFO_T (cfifo_t(CFIFO_T)*fifo, size_t offset, size_t *num, CFIFO_T **addr) |
CFIFO_T *pelib_cfifo_writeaddr() | CFIFO_T (cfifo_t(CFIFO_T)*fifo, size_t *num, CFIFO_T **addr) |
size_t pelib_cfifo_pushmem() | CFIFO_T (cfifo_t(CFIFO_T)*fifo, CFIFO_T *mem, size_t num) |
size_t pelib_cfifo_peekmem() | CFIFO_T (cfifo_t(CFIFO_T)*fifo, CFIFO_T *mem, size_t num, size_t offset) |
size_t pelib_cfifo_popfifo() | CFIFO_T (cfifo_t(CFIFO_T)*src, cfifo_t(CFIFO_T)*tgt, size_t num) |
#define CFIFO_BEGIN "[" |
#define CFIFO_EMPTY "[]" |
#define CFIFO_SEPARATOR ":" |
#define continuous_read_length | ( | elem | ) | PELIB_CONCAT_2(continuous_read_length_, elem) |
#define continuous_write_length | ( | elem | ) | PELIB_CONCAT_2(continuous_write_length_, elem) |
#define debug | ( | var | ) | printf("[%s:%s:%d] %s = \"%s\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define debug_addr | ( | var | ) | printf("[%s:%s:%d] %s = \"%p\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define debug_int | ( | var | ) | printf("[%s:%s:%d] %s = \"%d\"\n", __FILE__, __FUNCTION__, __LINE__, #var, var); fflush(NULL) |
#define debug_size_t | ( | var | ) | printf("[%s:%s:%d] %s = \"%zu\"\n", __FILE__, __FUNCTION__, __LINE__, #var, (size_t)(var)); fflush(NULL) |
#define is_in_content | ( | elem | ) | PELIB_CONCAT_2(is_in_content_, elem) |
#define state | ( | elem | ) | PELIB_CONCAT_3(cfifo_, elem, _state) |
CFIFO_T* pelib_cfifo_peekaddr() CFIFO_T | ( | cfifo_t(CFIFO_T)* | , |
size_t | offset, | ||
size_t * | num, | ||
CFIFO_T ** | remaining | ||
) |
Returns an address that contains elements to be read. If num is not NULL and if there is at least one element available, writes the number of elements available in address pointer by num. If no element is available, returns NULL and writes nothing in other parameters. Note that *num may take a lower value than pelib_cfifo_length() if pelib_cfifo_length() >= 2. In this case, if remaining is not null, then remaining is set to point to the the rest of the data; otherwise it is set to NULL.
Returns an address that can hold new elements. If num is not NULL and if there is at least one memory element available, writes the number of additional elements the fifo can store in address pointer by num. If no memory is available, returns NULL and writes nothing in other parameters. Note that *num may take a lower value than pelib_cifo_capacity() - pelib_cfifo_length(). In this case and if remaining is non-null, remaining points to the extra memory buffer. Otherwise, it is set to NULL.
Pushes all n elements stored in some memory address and update
Address | of the first element to be pushed |
n | Number of elements to push |
Pops n elements and copy them into memory pointed by addr and update the fifo head element
addr | Address where the first element popped is written |
n | Number of elements to pop |
FILE* pelib_printf | ( | cfifo_t(CFIFO_T) | ) |
FILE* pelib_printf_detail | ( | cfifo_t(CFIFO_T) | ) |
char* pelib_string | ( | cfifo_t(CFIFO_T) | ) |
char* pelib_string_detail | ( | cfifo_t(CFIFO_T) | ) |