libisdn
msgb_fifo.h
Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  *
00005  */
00006 #ifndef _MSGB_FIFO_H_
00007 #define _MSGB_FIFO_H_
00008 
00009 #include "dlist.h"
00010 
00011 struct msgb_fifo {
00012         int size;
00013         int nr_entries;
00014         struct dlist_head entries;
00015 };
00016 
00020 int msgb_fifo_init(struct msgb_fifo *fifo, const int size);
00021 
00025 struct msgb_fifo *msgb_fifo_alloc(const int size);
00026 
00030 int msgb_fifo_destroy(struct msgb_fifo *fifo);
00031 
00035 int msgb_fifo_size(const struct msgb_fifo *fifo);
00036 
00040 int msgb_fifo_empty(const struct msgb_fifo *fifo);
00041 
00045 int msgb_fifo_full(const struct msgb_fifo *fifo);
00046 
00050 int msgb_fifo_length(const struct msgb_fifo *fifo);
00051 
00055 int msgb_fifo_enqueue(struct msgb_fifo *fifo, struct msgb *msg);
00056 
00060 struct msgb *msgb_fifo_dequeue(struct msgb_fifo *fifo);
00061 
00062 #endif /* _MSGB_FIFO_H_ */