1234567891011121314151617181920212223242526272829 |
- #ifndef STREAM_H
- #define STREAM_H
- typedef struct Stream
- {
- int capacity;
- int size;
- int index;
- char* data;
- } Stream;
- void streamInit(Stream* s, int size);
- void streamRemove(Stream* s);
- void streamEnsureIndex(Stream* s, int length);
- typedef void (*ClientStreamFunction) (Stream*);
- typedef int (*ServerStreamFunction) (int, int, Stream*);
- int streamSeekNewLine(Stream* in);
- int streamHasData(Stream* in);
- int streamGetChar(Stream* in, char* c);
- int streamGetChars(Stream* in, char* buffer, int length);
- int streamWriteChar(Stream* out, char c);
- int streamWriteChars(Stream* out, char* c);
- #endif
|