Back to index

plt-scheme  4.2.1
gd_io.h
Go to the documentation of this file.
00001 #ifndef GD_IO_H
00002 #define GD_IO_H 1
00003 
00004 #include <stdio.h>
00005 
00006 #ifdef VMS
00007 #define Putchar gdPutchar
00008 #endif
00009 
00010 typedef struct gdIOCtx
00011 {
00012   int (*getC) (struct gdIOCtx *);
00013   int (*getBuf) (struct gdIOCtx *, void *, int);
00014 
00015   void (*putC) (struct gdIOCtx *, int);
00016   int (*putBuf) (struct gdIOCtx *, const void *, int);
00017 
00018   /* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */
00019   int (*seek) (struct gdIOCtx *, const int);
00020 
00021   long (*tell) (struct gdIOCtx *);
00022 
00023   void (*gd_free) (struct gdIOCtx *);
00024 
00025 }
00026 gdIOCtx;
00027 
00028 typedef struct gdIOCtx *gdIOCtxPtr;
00029 
00030 void Putword (int w, gdIOCtx * ctx);
00031 void Putchar (int c, gdIOCtx * ctx);
00032 
00033 void gdPutC (const unsigned char c, gdIOCtx * ctx);
00034 int gdPutBuf (const void *, int, gdIOCtx *);
00035 void gdPutWord (int w, gdIOCtx * ctx);
00036 void gdPutInt (int w, gdIOCtx * ctx);
00037 
00038 int gdGetC (gdIOCtx * ctx);
00039 int gdGetBuf (void *, int, gdIOCtx *);
00040 int gdGetByte (int *result, gdIOCtx * ctx);
00041 int gdGetWord (int *result, gdIOCtx * ctx);
00042 int gdGetInt (int *result, gdIOCtx * ctx);
00043 
00044 int gdSeek (gdIOCtx * ctx, const int);
00045 long gdTell (gdIOCtx * ctx);
00046 
00047 #endif