00001 #ifndef FIFO_H 00002 #define FIFO_H 00003 00004 typedef struct fifo_queue { 00005 void **block; 00006 unsigned int size; 00007 unsigned int pull; 00008 unsigned int push; 00009 unsigned int fill; 00010 } FIFO_QUEUE; 00011 00012 #define _FIFO_BLK_LEN 512 00013 00014 #ifdef __cplusplus 00015 extern "C" { 00016 #endif 00017 00018 FIFO_QUEUE *FIFO_Create(void); 00019 int FIFO_Fill(FIFO_QUEUE *); 00020 int FIFO_Empty(FIFO_QUEUE *); 00021 void FIFO_EnQueue(FIFO_QUEUE *queue, void *elt); 00022 void FIFO_EnQueue_Front(FIFO_QUEUE *queue, void *elt); 00023 void *FIFO_Peek(FIFO_QUEUE *queue); 00024 void FIFO_Pop(FIFO_QUEUE *queue); 00025 void FIFO_DeQueue(FIFO_QUEUE *queue, void **element); 00026 void FIFO_Enumerate(FIFO_QUEUE *queue, void ***element); 00027 void FIFO_Destroy(FIFO_QUEUE *queue); 00028 00029 #ifdef __cplusplus 00030 } 00031 #endif 00032 00033 #endif