/* Copyright (C) 1981, 1982 by Manx Software Systems */
#define fputc putc
#define fgetc getc

#define NULL 0
#define EOF -1
#define _BUFSIZ 1024

#define _SCTSIZE sctparm.size
#define _SCTMASK sctparm.mask
#define _SCTSHFT sctparm.shift
#define _FILLC sctparm.fillc

struct _sctparm {
	int size;
	unsigned mask;
	unsigned shift;
	int fillc;
} sctparm;

#define _KIND	0x03
#define _TTY	0x01
#define _FILE	0x02
#define _RDRPUN	0x03
#define _READ	0x04
#define _WRITE	0x08
#define _DIRTY	0x10
#define _ATEND	0x20

typedef struct {
	char *_bp;			/* current position in buffer */
	char *_bend;		/* last character in buffer + 1 */
	char *_buff;		/* address of buffer */
	char _flags;		/* open mode, etc. */
	char _unit;			/* token returned by open */
	unsigned _curpos;	/* current sector position */
} FILE;

int errno;
#define FLT_FAULT	0		/* vector for floating-point faults */
#define	MAXVEC		4		/* reserve 4 vectors for now */
int (*Sysvec)()[MAXVEC];
