diff options
author | bustico | 2008-03-21 09:03:34 +0000 |
---|---|---|
committer | bustico | 2008-03-21 09:03:34 +0000 |
commit | 6ca781b8a38474ab428d5fcb3b489dfe3e974334 (patch) | |
tree | 8c8725c88c3fd031d632a9f2b1f7376d1cb3c75b /src/ivyfifo.h | |
parent | 50236114f04a0050625bedee7c4c02b36b1213ae (diff) | |
download | ivy-c-6ca781b8a38474ab428d5fcb3b489dfe3e974334.zip ivy-c-6ca781b8a38474ab428d5fcb3b489dfe3e974334.tar.gz ivy-c-6ca781b8a38474ab428d5fcb3b489dfe3e974334.tar.bz2 ivy-c-6ca781b8a38474ab428d5fcb3b489dfe3e974334.tar.xz |
- numerous fixes
- socket in non blocking mode (resolve some deadlock, and agent are immune to another agent beeing blocked)
Diffstat (limited to 'src/ivyfifo.h')
-rw-r--r-- | src/ivyfifo.h | 35 |
1 files changed, 35 insertions, 0 deletions
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 */ |