Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include <portab.h>
#define BUFSIZ 512
#define MAXFILES 16
struct _iobuf {
WORD _fd;
WORD _flag;
BYTE *_base;
BYTE *_ptr;
WORD _cnt;
};
#ifndef FILE
extern struct _iobuf _iob[MAXFILES];
#define FILE struct _iobuf
#endif
#define _IOREAD 0x01
#define _IOWRT 0x02
#define _IOABUF 0x04
#define _IONBUF 0x08
#define _IOERR 0x10
#define _IOEOF 0x20
#define _IOLBUF 0x40
#define _IOSTRI 0x80
#define _IOASCI 0x100
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
#define clearerr(p) ((p)->_flag & ~_IOERR)
#define feof(p) ((p)->_flag & _IOEOF)
#define ferror(p) ((p)->_flag & _IOERR)
#define fileno(p) ((p)->_fd)
#define getchar() getc(stdin)
#define putchar(c) putc(c,stdout)
#define putc fputc
#define getc fgetc
#define abs(x) ((x) < 0 ? -(x) : (x))
#define max(x,y) (((x) > (y)) ? (x) : (y))
#define min(x,y) (((x) < (y)) ? (x) : (y))
*