#define VERSION     0
#define REVISION    0
#define PATCH	    'e' 	/* 12 jan 84 */

#define ever	    (;;)
#define FALSE	    0
#define TRUE	    1
#define CR	    0x0D
#define BS	    0x08
#define DEL	    0x7F
#define CTRL_X	    'X'-'@'
#define BELL	    0x07
#define ESC	    0x1B

/* ************************* C MACROS **************************** */

#define getfile(f)	  hd_xfer(READ,f.track,f.sector,f.buffer,f.length)
#define putfile(f)	  hd_xfer(WRITE,f.track,f.sector,f.buffer,f.length)

/* ******************* EXTERNAL VARIABLES AND STRUC TURES ******** */

struct SDentry {
    char name[8];   /* file name */
    char volume;    /* disk address */
    char unit;
    int  track;
    char sector;
    int  length;    /* number of 128-byte records */
    long load_addr; /* load address in host memory */
    int  exec_off;  /* offset from there to start of code */
    char prog_flag; /* program/data flag (not currently used) */
    char reserved[2];
    };

struct OSTentry {
    char os;
    char prod_map[16];
    char opt_map[6];
    char load_list[8][8];
    int  length;
    char reserved[7];
    };

struct PTentry {
    char type;
    char bp2_name[8];
    char lgn_name[8];
    char osm_name[8];
    };

typedef struct sfile {		/* table description */
    int track;		/* beginning track   */
    char sector;	/* beginning sector  */
    char length;	/* number of sectors */
    char *buffer;	/* buffer it goes in */
    } SFILE;


SFILE sysdir, ostable, prodtable;
extern int  error, abort_req;
extern char *product[];
extern int unit_0_k;

long gethex();

#define ENOENT	-1
#define E2BIG	-2
#define EBADF	-3
#define ENOMEM	-4
#define EEXIST	-5
#define EINVAL	-6
#define ENFILE	-7
#define EMFILE	-8
#define ENOTTY	-9
#define EACCES	-10

#define ERANGE	-20
#define EDOM	-21

VAL	-6
#define ENFILE	-7
#define EMFILE	-8
#defin