/***************************************************************************** fifo.h fifo data structure ******************************************************************************/ #define FIFO_SIZE 50 #define N_FIFOS 10 #define ALLOCATED 1 #define ERR_FIFOEMPTY -1 #define ERR_FIFOFULL -2 typedef struct fifo *fifoptr; typedef struct fifo{ int state ; int fifo_size; int read_idx; int write_idx; sema_t fullsem; sema_t emptysem; mutex_t fifomut; bufptr bufs[FIFO_SIZE]; } fifo_t; typedef struct fifotable *fifotabptr; typedef struct fifotable{ int state ; int curridx; fifoptr fifos[N_FIFOS]; } fifotab_t;