|
mdcore
0.1.5
|
#include "../config.h"#include <stdlib.h>#include <stdio.h>#include <pthread.h>#include <math.h>#include <float.h>#include <string.h>#include <limits.h>#include "cycle.h"#include "errs.h"#include "fifo.h"Defines | |
| #define | error(id) ( fifo_err = errs_register( id , fifo_err_msg[-(id)] , __LINE__ , __FUNCTION__ , __FILE__ ) ) |
Functions | |
| int | fifo_push_nb (struct fifo *f, int e) |
| Add an element to the fifo, non-blocking. | |
| int | fifo_pop_nb (struct fifo *f, int *e) |
| Remove an element from the fifo, non-blocking. | |
| int | fifo_push (struct fifo *f, int e) |
| Add an element to the fifo, blocking. | |
| int | fifo_pop (struct fifo *f, int *e) |
| Remove an element from the fifo, blocking. | |
| int | fifo_init (struct fifo *f, int size) |
| Initialize the given fifo. | |
Variables | |
| int | fifo_err = fifo_err_ok |
| char * | fifo_err_msg [6] |
| #define error | ( | id | ) | ( fifo_err = errs_register( id , fifo_err_msg[-(id)] , __LINE__ , __FUNCTION__ , __FILE__ ) ) |
Initialize the given fifo.
| f | The fifo |
| size | The number of entries |
| int fifo_pop_nb | ( | struct fifo * | f, |
| int * | e | ||
| ) |
| int fifo_push_nb | ( | struct fifo * | f, |
| int | e | ||
| ) |
| int fifo_err = fifo_err_ok |
The ID of the last error.
| char* fifo_err_msg[6] |
{
"Nothing bad happened.",
"An unexpected NULL pointer was encountered.",
"A call to malloc failed, probably due to insufficient memory.",
"A call to a pthread routine failed.",
"Tried to push onto a full FIFO-queue." ,
"Tried to pop from an empty FIFO-queue."
}
1.7.6.1