1 #define EOF (-1) 2 #define NBUF 512 3 4 struct io{ 5 int fd; 6 uchar *bufp, *ebuf, *strp; 7 uchar buf[NBUF]; 8 }; 9 io *err; 10 11 io *openfd(int), *openstr(void), *opencore(char *, int); 12 int emptybuf(io*); 13 void pchr(io*, int); 14 int rchr(io*); 15 int rutf(io*, char*, Rune*); 16 void closeio(io*); 17 void flush(io*); 18 int fullbuf(io*, int); 19 void pdec(io*, int); 20 void poct(io*, unsigned); 21 void pptr(io*, void*); 22 void pquo(io*, char*); 23 void pwrd(io*, char*); 24 void pstr(io*, char*); 25 void pcmd(io*, tree*); 26 void pval(io*, word*); 27 void pfnc(io*, thread*); 28 void pfmt(io*, char*, ...); 29