Dynamic first in first out positive integer queue implementation. More...
#include <errno.h>
#include <malloc.h>
#include <mem.h>
#include "dynamic_fifo.h"
Defines | |
#define | DYN_FIFO_MAGIC_VALUE 0x58627659 |
Internal magic value for a consistency check. | |
#define | NEXT_INDEX(fifo, index) (((index) + 1) % ((fifo)->size + 1)) |
Returns the next queue index. | |
Functions | |
int | dyn_fifo_is_valid (dyn_fifo_ref fifo) |
Checks if the queue is valid. | |
int | dyn_fifo_initialize (dyn_fifo_ref fifo, int size) |
Initializes the dynamic queue. | |
int | dyn_fifo_push (dyn_fifo_ref fifo, int value, int max_size) |
Appends a new item to the queue end. | |
int | dyn_fifo_pop (dyn_fifo_ref fifo) |
Returns and excludes the first item in the queue. | |
int | dyn_fifo_value (dyn_fifo_ref fifo) |
Returns and keeps the first item in the queue. | |
int | dyn_fifo_destroy (dyn_fifo_ref fifo) |
Clears and destroys the queue. |
Dynamic first in first out positive integer queue implementation.