home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
bdsc
/
bdsc-4
/
bdslib.ark
/
STDIO.H
< prev
next >
Wrap
Text File
|
1983-07-15
|
2KB
|
69 lines
/* stdio.h 7/4/83 */
#define BUFSIZ 1024
#define _NFILE 20
#ifndef FILE
struct _iobuf {
int _fd; /* File descriptor */
int _nleft; /* Bytes remaining in buffer */
char *_nextp; /* Pointer to next byte */
char _flag; /* Flag denoting I/O status */
char *_base; /* Pointer to the I/O buffer */
} filebuf[_NFILE];
#endif
#define FILE struct _iobuf
#define SECSIZ 128
#define NSECTS (BUFSIZ/SECSIZ)
#define NULL 0 /* Value of an empty pointer */
#define EOF (-1) /* Physical end of file on stream */
#define ERROR (-1) /* General "on error" return value */
#define CPMEOF 0x1a /* CP/M LOGICAL End-of-file marker */
#define MAXLINE 135 /* Longest line expected from console */
#define TRUE 1 /* General purpose true truth value */
#define FALSE 0 /* General purpose false truth value */
#define _IOREAD 01 /* Flag denoting stream open for read */
#define _IOWRT 02 /* Flag denoting stream open for write */
#define _IONBF 04 /* Flag denoting stream is unbuffered */
#define _IOEOF 020 /* End of file has occurred on stream */
#define _IOERR 040 /* Error status during io on stream */
#define stdin 0 /* Standard input channel */
#define stdout 1 /* Standard output channel */
#define stderr 2 /* Standard error channel */
#define DEV_LST 3 /* List Device/Line Printer */
#define DEV_PUN 4 /* Punch Device/Tape output */
#define DEV_RDR 5 /* Reader Device/Tape input */
#define getc(f) fgetc(f)
#define putc(c,f) fputc(c,f)
#define feof(f) (((f)->_flag&_IOEOF)!=0)
#define ferror(f) (((f)->_flag&_IOERR)!=0)
#define fileno(f) ((f)->_fd)
#define isatty(f) ((f) >= stdin && (f) <= DEV_PUN)
#define rewind(f) (fseek((f), 0, 0))
#define clrerr(f) (((f)->_flag&_IOERR)?((f)->_flag &=_IOERR):(0))
#define clreof(f) (((f)->_flag&_IOEOF)?((f)->_flag &=_IOEOF):(0))
#define getchar() fgetc(stdin)
#define putchar(c) fputc(c,stdout)
#define void int
#define long int
void fputc();
FILE *fopen();
void fflush();
char *fgets();
char *gets();
void puts();
void fputs();
char *malloc();
char *calloc();
char *realloc();
void setbuf();
#include "fcb.h"
#include "malloc.h"