Back to index

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