Implementation of different types of FIFO
Implementation of different types of FIFO
The Linked List based FIFO implements the following API:
llfifo_t *llfifo_create(int capacity);
int llfifo_enqueue(llfifo_t *fifo, void *element);
void *llfifo_dequeue(llfifo_t *fifo);
int llfifo_length(llfifo_t *fifo);
int llfifo_capacity(llfifo_t *fifo);
void llfifo_destroy(llfifo_t *fifo);
The Circular Buffer based FIFO implements the following API:
size_t cbfifo_enqueue(void *buf, size_t nbyte);
size_t cbfifo_dequeue(void *buf, size_t nbyte);
size_t cbfifo_length();
size_t cbfifo_capacity();