From 6ca781b8a38474ab428d5fcb3b489dfe3e974334 Mon Sep 17 00:00:00 2001 From: bustico Date: Fri, 21 Mar 2008 09:03:34 +0000 Subject: - numerous fixes - socket in non blocking mode (resolve some deadlock, and agent are immune to another agent beeing blocked) --- src/ivyfifo.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/ivyfifo.h (limited to 'src/ivyfifo.h') diff --git a/src/ivyfifo.h b/src/ivyfifo.h new file mode 100644 index 0000000..14d0106 --- /dev/null +++ b/src/ivyfifo.h @@ -0,0 +1,35 @@ +#ifndef IVYFIFO_H +#define IVYFIFO_H + +typedef struct IvyFifoBuffer { + char *buffer; + char *rptr, *wptr, *end; + int full; +} IvyFifoBuffer; + + +int IvyFifoInit(IvyFifoBuffer *f); + +void IvyFifoFree(IvyFifoBuffer *f); + +IvyFifoBuffer* IvyFifoNew (void); + +void IvyFifoDelete (IvyFifoBuffer *f); + +unsigned int IvyFifoLength(const IvyFifoBuffer *f); + +unsigned int IvyFifoSize(const IvyFifoBuffer *f); + +unsigned int IvyFifoAvail(const IvyFifoBuffer *f); + +unsigned int IvyFifoRead(IvyFifoBuffer *f, char *buf, int buf_size); + +unsigned int IvyFifoSendSocket (IvyFifoBuffer *f, const int fd); + +int IvyFifoIsFull (const IvyFifoBuffer *f) ; + +void IvyFifoWrite(IvyFifoBuffer *f, const char *buf, int size); + + + +#endif /* IVYFIFO_H */ -- cgit v1.1