1 /*	cpmfio.h	1.5	83/05/13	*/
2 
3 #define C_NFILE		5	/* max number of concurrently open cp/m files */
4 
5 typedef struct	c_iobuf {
6 	int	c_cnt;		/* bytes left in buffer */
7 	int	c_blk;		/* block number within the current extent */
8 				/* (starting at 0) */
9 	int	c_seccnt;	/* number of physical sectors left in */
10 				/* the current extent */
11 	int	c_ext;		/* current extent's directory index */
12 	int	c_extno;	/* extent number within current file */
13 	char	*c_buf;		/* next character position */
14 	char	*c_base;	/* location of buffer */
15 	short	c_flag;		/* access mode (READ or WRITE) */
16 	struct directory *c_dirp;	/* pointer to the current */
17 					/* extent's directory entry */
18 }	C_FILE;
19 extern	C_FILE	c_iob[C_NFILE];
20 
21 #define c_getc(p)	(--(p)->c_cnt>=0 ? *(p)->c_buf++&0377 : c_fillbuf(p))
22 #define c_putc(x,p)	(--(p)->c_cnt>=0 ? ((int)(*(p)->c_buf++=(unsigned)(x))) : c_flsbuf((unsigned)(x), p))
23 
24 C_FILE	*c_open(), *c_creat();
25 
26 #define READ	0x01
27 #define WRITE	0x02
28 #define RW	0x03
29 #define MODFLG	0x08
30 #define BINARY	0x10
31