debian/rules: Use `git' potty wrapper.
[qmail] / substdio.h
CommitLineData
2117e02e
MW
1#ifndef SUBSTDIO_H
2#define SUBSTDIO_H
3
4typedef 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
14extern void substdio_fdbuf();
15
16extern int substdio_flush();
17extern int substdio_put();
18extern int substdio_bput();
19extern int substdio_putflush();
20extern int substdio_puts();
21extern int substdio_bputs();
22extern int substdio_putsflush();
23
24extern int substdio_get();
25extern int substdio_bget();
26extern int substdio_feed();
27
28extern char *substdio_peek();
29extern 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
212b6f5d
MW
39#define substdio_BPUTC(s,c) \
40 ( ((s)->n != (s)->p) \
41 ? ( (s)->x[(s)->p++] = (c), 0 ) \
42 : substdio_bput((s),&(c),1) \
43 )
44
2117e02e
MW
45extern int substdio_copy();
46
47#endif