Stream.h 449 B

123456789101112131415161718192021222324
  1. #ifndef STREAM_H
  2. #define STREAM_H
  3. #define BUFFER_SIZE 1024
  4. typedef struct Stream
  5. {
  6. int size;
  7. int index;
  8. char data[BUFFER_SIZE];
  9. } Stream;
  10. typedef void (*StreamFunction) (Stream*);
  11. int streamGetChar(char* c, Stream* in);
  12. int streamGetShort(short* s, Stream* in);
  13. int streamGetInt(int* i, Stream* in);
  14. int streamWriteChar(char c, Stream* in);
  15. int streamWriteShort(short s, Stream* in);
  16. int streamWriteInt(int i, Stream* in);
  17. #endif