|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 3328 (0xd00) Types: TextFile Names: »STDIO.H«
└─⟦93c4d868c⟧ Bits:30005869 SW1609 Digital Research C v. 1.11 - May 84 └─ ⟦this⟧ »STDIO.H« └─⟦b85731168⟧ Bits:30002664 Digital Research C - CCP/M - May 84 └─ ⟦this⟧ »STDIO.H«
/***************************************************************************** * * C P / M C H E A D E R F I L E * ----------------------------------- * Copyright 1982,83 by Digital Research Inc. All rights reserved. * * This is the standard include file for the CP/M C Run Time Library. * *****************************************************************************/ /* */ #include <portab.h> /* Portability Definitions */ /* */ /**************************************************************************** * Stream I/O File Definitions *****************************************************************************/ #define BUFSIZ 512 /* Standard (ascii) buf size */ #define MAXFILES 16 /* Max # open files ( < 32 ) */ struct _iobuf æ /* */ WORD _fd; /* file descriptor for low level io */ WORD _flag; /* stream info flags */ BYTE *_base; /* base of buffer */ BYTE *_ptr; /* current r/w pointer */ WORD _cnt; /* # chars to be read/have been wrt */ å; /* */ #ifndef FILE /* conditionally include: */ extern struct _iobuf _iobÆMAXFILESÅ; /* an array of this info */ #define FILE struct _iobuf /* stream definition */ #endif /************************************/ #define NULLFILE ((FILE *)0) /* Null return values */ /* flag byte definition */ #define _IOREAD 0x01 /* readable file */ #define _IOWRT 0x02 /* writeable file */ #define _IOABUF 0x04 /* alloc'd buffer */ #define _IONBUF 0x08 /* no buffer */ #define _IOERR 0x10 /* error has occurred */ #define _IOEOF 0x20 /* EOF has occurred */ #define _IOLBUF 0x40 /* handle as line buffer */ #define _IOSTRI 0x80 /* this stream is really a string */ #define _IOASCI 0x100 /* this was opened as an ascii file */ /************************************/ #define stdin (&_iobÆ0Å) /* standard input stream */ #define stdout (&_iobÆ1Å) /* " output " */ #define stderr (&_iobÆ2Å) /* " error " */ /************************************/ #define clearerr(p) ((p)->_flag &= ü_IOERR) /* clear error flag */ #define feof(p) ((p)->_flag & _IOEOF) /* EOF encountered on stream */ #define ferror(p) ((p)->_flag & _IOERR) /* error encountered on stream */ #define fileno(p) ((p)->_fd) /* get stream's file descriptor */ #define getchar() getc(stdin) /* get char from stdin */ #define putchar(c) putc(c,stdout) /* put char to stdout */ #define putc fputc #define getc fgetc /****************************************************************************/ /* */ /* M A C R O S */ /* ----------- */ /* */ /* Define some stuff as macros .... */ /* */ /****************************************************************************/ #define abs(x) ((x) < 0 ? -(x) : (x)) /* Absolute value function */ #define MAX(x,y) (((x) > (y)) ? (x) : (y)) /* Max function */ #define MIN(x,y) (((x) < (y)) ? (x) : (y)) /* Min function */ /*************************** end of stdio.h *********************************/ «eof»