12345678910111213141516171819202122232425262728 |
- #ifndef STREAM_H
- #define STREAM_H
- #define BUFFER_SIZE 1024
- typedef struct Stream
- {
- int size;
- int index;
- char data[BUFFER_SIZE];
- } Stream;
- void streamInit(Stream* s);
- 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
|