|
Server 0.0.1
HTTP/REST server implementation
|
00001 00030 #ifndef __CBUF_H__ 00031 #define __CBUF_H__ 00032 00033 #include <ctype.h> 00034 #include <string.h> 00035 #include <sys/types.h> 00036 00037 #include "class.h" 00038 #include "stream.h" 00039 00040 #include "commons.h" 00041 00042 #define ECBUFOVFL 100 00043 00044 00045 CLASS(Cbuf) { 00046 char * shm_name; // shared memory identifier 00047 00048 char * data; 00049 Bool lock; 00050 00051 size_t bsize; 00052 size_t bused; 00053 00054 size_t write; 00055 size_t read; 00056 }; 00057 00058 ssize_t cbufRead(Cbuf, Stream); 00059 ssize_t cbufWrite(Cbuf, Stream); 00060 00061 char * cbufGetLine(Cbuf, char **); 00062 char * cbufGetData(Cbuf, size_t); 00063 char * cbufSetData(Cbuf, const void *, size_t); 00064 void cbufEmpty(Cbuf); 00065 00066 char * cbufGetRead(Cbuf this); 00067 char * cbufGetWrite(Cbuf this); 00068 char * cbufMemchr(Cbuf this, int c); 00069 size_t cbufAddrIndex(Cbuf this, const void * c); 00070 void cbufIncRead(Cbuf this, size_t n); 00071 void cbufIncWrite(Cbuf this, size_t n); 00072 size_t cbufGetFree(Cbuf this); 00073 char cbufIsEmpty(Cbuf this); 00074 void cbufSkipNonAlpha(Cbuf this); 00075 Bool cbufIsLocked(Cbuf this); 00076 void cbufLock(Cbuf this); 00077 void cbufRelease(Cbuf this); 00078 00079 #endif // __CBUF_H__ 00080 00081 // vim: set ts=4 sw=4: