xref: /PHP-8.1/ext/gd/libgd/gd_io.h (revision 500b496f)
1 #ifndef GD_IO_H
2 #define GD_IO_H 1
3 
4 #include <stdio.h>
5 
6 #ifdef VMS
7 #define Putchar gdPutchar
8 #endif
9 
10 typedef struct gdIOCtx {
11 	int	(*getC)(struct gdIOCtx*);
12 	int	(*getBuf)(struct gdIOCtx*, void*, int);
13 
14 	void	(*putC)(struct gdIOCtx*, int);
15 	int	(*putBuf)(struct gdIOCtx*, const void*, int);
16 
17 	int	(*seek)(struct gdIOCtx*, const int);
18 	long	(*tell)(struct gdIOCtx*);
19 
20 	void	(*gd_free)(struct gdIOCtx*);
21 
22 	void	*data;
23 } gdIOCtx;
24 
25 typedef struct gdIOCtx	*gdIOCtxPtr;
26 
27 void Putword(int w, gdIOCtx *ctx);
28 void Putchar(int c, gdIOCtx *ctx);
29 
30 void gdPutC(const unsigned char c, gdIOCtx *ctx);
31 int gdPutBuf(const void *, int, gdIOCtx*);
32 void gdPutWord(int w, gdIOCtx *ctx);
33 void gdPutInt(int w, gdIOCtx *ctx);
34 
35 int gdGetC(gdIOCtx *ctx);
36 int gdGetBuf(void *, int, gdIOCtx*);
37 int gdGetByte(int *result, gdIOCtx *ctx);
38 int gdGetWord(int *result, gdIOCtx *ctx);
39 int gdGetWordLSB(signed short int *result, gdIOCtx *ctx);
40 int gdGetInt(int *result, gdIOCtx *ctx);
41 int gdGetIntLSB(signed int *result, gdIOCtx *ctx);
42 
43 int gdSeek(gdIOCtx *ctx, const int);
44 long gdTell(gdIOCtx *ctx);
45 
46 #endif
47