gd_io.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef GD_IO_H
  2. #define GD_IO_H 1
  3. #include <stdio.h>
  4. #ifdef VMS
  5. #define Putchar gdPutchar
  6. #endif
  7. typedef struct gdIOCtx {
  8. int (*getC)(struct gdIOCtx*);
  9. int (*getBuf)(struct gdIOCtx*, void*, int);
  10. void (*putC)(struct gdIOCtx*, int);
  11. int (*putBuf)(struct gdIOCtx*, const void*, int);
  12. int (*seek)(struct gdIOCtx*, const int);
  13. long (*tell)(struct gdIOCtx*);
  14. void (*gd_free)(struct gdIOCtx*);
  15. void *data;
  16. } gdIOCtx;
  17. typedef struct gdIOCtx *gdIOCtxPtr;
  18. void Putword(int w, gdIOCtx *ctx);
  19. void Putchar(int c, gdIOCtx *ctx);
  20. void gdPutC(const unsigned char c, gdIOCtx *ctx);
  21. int gdPutBuf(const void *, int, gdIOCtx*);
  22. void gdPutWord(int w, gdIOCtx *ctx);
  23. void gdPutInt(int w, gdIOCtx *ctx);
  24. int gdGetC(gdIOCtx *ctx);
  25. int gdGetBuf(void *, int, gdIOCtx*);
  26. int gdGetByte(int *result, gdIOCtx *ctx);
  27. int gdGetWord(int *result, gdIOCtx *ctx);
  28. int gdGetWordLSB(signed short int *result, gdIOCtx *ctx);
  29. int gdGetInt(int *result, gdIOCtx *ctx);
  30. int gdGetIntLSB(signed int *result, gdIOCtx *ctx);
  31. int gdSeek(gdIOCtx *ctx, const int);
  32. long gdTell(gdIOCtx *ctx);
  33. #endif