Commit | Line | Data |
---|---|---|
2117e02e MW |
1 | #ifndef SUBSTDIO_H |
2 | #define SUBSTDIO_H | |
3 | ||
4 | typedef struct substdio { | |
5 | char *x; | |
6 | int p; | |
7 | int n; | |
8 | int fd; | |
9 | int (*op)(); | |
10 | } substdio; | |
11 | ||
12 | #define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) } | |
13 | ||
14 | extern void substdio_fdbuf(); | |
15 | ||
16 | extern int substdio_flush(); | |
17 | extern int substdio_put(); | |
18 | extern int substdio_bput(); | |
19 | extern int substdio_putflush(); | |
20 | extern int substdio_puts(); | |
21 | extern int substdio_bputs(); | |
22 | extern int substdio_putsflush(); | |
23 | ||
24 | extern int substdio_get(); | |
25 | extern int substdio_bget(); | |
26 | extern int substdio_feed(); | |
27 | ||
28 | extern char *substdio_peek(); | |
29 | extern void substdio_seek(); | |
30 | ||
31 | #define substdio_fileno(s) ((s)->fd) | |
32 | ||
33 | #define SUBSTDIO_INSIZE 8192 | |
34 | #define SUBSTDIO_OUTSIZE 8192 | |
35 | ||
36 | #define substdio_PEEK(s) ( (s)->x + (s)->n ) | |
37 | #define substdio_SEEK(s,len) ( ( (s)->p -= (len) ) , ( (s)->n += (len) ) ) | |
38 | ||
39 | extern int substdio_copy(); | |
40 | ||
41 | #endif |