00001 #ifndef __FIFO_H
00002 #define __FIFO_H
00003 #include <pthread.h>
00004
00005 typedef struct {
00006 char **buf;
00007 int qsize;
00008 long head, tail;
00009 int full, empty;
00010 int flush;
00011 pthread_mutex_t *mut;
00012 pthread_cond_t *notFull, *notEmpty;
00013 } queue_t;
00014
00015 int fifomain(int qsize, int (*pfunc)(char **buf), int (*cfunc)(char *buf));
00016 queue_t *queueInit(int qsize);
00017 int queueDelete(queue_t *q);
00018 int queueAdd(queue_t *q, char *in);
00019 int queueDel(queue_t *q, char **out);
00020 int queueCork(queue_t *q);
00021 #endif