123456789101112131415161718192021222324252627282930 |
- #ifndef STREAM_H
- #define STREAM_H
- typedef struct Stream
- {
- int size;
- int index;
- char* data;
- } Stream;
- void streamInit(Stream* s, int size);
- void streamRemove(Stream* s);
- void streamUpdateIndex(Stream* s);
- int streamGetIndex(Stream* s);
- void streamEnsureCapacity(Stream* s, int length);
- typedef void (*StreamFunction) (Stream*);
- int streamGetChar(Stream* in, char* c);
- int streamGetChars(Stream* in, char* buffer, int length);
- int streamGetShort(Stream* in, short* s);
- int streamGetInt(Stream* in, int* i);
- int streamWriteChar(Stream* out, char c);
- int streamWriteChars(Stream* out, char* c);
- int streamWriteShort(Stream* out, short s);
- int streamWriteInt(Stream* out, int i);
- #endif
|