Files
Digital-Research-Source-Code/MPM OPERATING SYSTEMS/MPM-86/MISC DRI DISKS/03/STDIO.H
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

45 lines
1.0 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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))
*