
/*
** CLIB.DEF -- Definitions for Small-C library functions
**
** For other credits and references, see DDJ, May 1984
*/

/*
** Definition of CP/M FCB and additional parameters
*/
#define FCBSIZE 36  /*size of file control block*/
#define DRIVE 0 /*CP/M drive designator offset*/
#define NAMEOFF 1 /*CP/M file name offset*/
#define NAMEOFF2  16  /*CP/M 2nd file name offset*/
#define NAMESIZE  8 /*CP/M file name size*/
#define TYPEOFF 9 /*CP/M file type offset*/
#define TYPESIZE  3 /*CP/M file type size*/
#define NTSIZE  11  /*CP/M file name and type size*/
#define RRNOFF 33  /*CP/M random record number offset*/
#define CPMEOF  26  /*CP/M end-of-file byte*/
#define BUFSIZE 128 /*size of I/O buffer*/
#define MAXFILES  10  /*maximum open files*/
/*
** CP/M function calls
*/
#define CLOFIL  16  /*close file*/
#define DCONIO  6 /*direct console i/o*/
#define DELFIL  19  /*delete file*/
#define FNDFIL  17  /*find first occurence of file*/
#define FNDNXT  18  /*find next occurence of file*/

#define GETPOS  36  /*get number of current sector*/
#define GOCPM 00  /*go to CP/M*/
#define LSTOUT  05  /*list output*/
#define MAKFIL  22  /*make file*/
#define OPNFIL  15  /*open file*/
#define POSEND  35  /*position file to end*/
#define PUNOUT  04  /*punch output*/
#define RENAME  23  /*rename file*/
#define RDRND 33  /*read sector randomly*/
#define RDRINP 03  /*reader input*/
#define SETDMA  26  /*set dma*/
#define WRTRND  40  /*write sector randomly*/
/*
** Device codes
*/
#define CPMCON DCONIO /*console*/
#define CPMRDR RDRINP /*reader*/
#define CPMPUN PUNOUT /*punch*/
#define CPMLST LSTOUT /*list*/
/*
** File status bits
*/
#define RDBIT 1 /*open for read*/
#define WRTBIT  2 /*open for write*/
#define EOFBIT  4 /*eof condition*/
#define ERRBIT  8 /*error condition*/
/*
** ASCII characters
*/
#define ABORT 3
#define RUB 8
#define PAUSE 19
#define WIPE  24
#define DEL 127
