|
|
1.1 ! root 1: /************************************************************************* ! 2: * This program is copyright (C) 1985, 1986 by Jonathan Payne. It is * ! 3: * provided to you without charge for use only on a licensed Unix * ! 4: * system. You may copy JOVE provided that this notice is included with * ! 5: * the copy. You may not sell copies of this program or versions * ! 6: * modified for use on microcomputer systems, unless the copies are * ! 7: * included with a Unix system distribution and the source is provided. * ! 8: *************************************************************************/ ! 9: ! 10: #define putchar(c) putc(c, stdout) ! 11: #define putc(c, fp) (--(fp)->f_cnt >= 0 ? (*(fp)->f_ptr++ = (c)) : _flush((c), fp)) ! 12: #define getc(fp) (((--(fp)->f_cnt < 0) ? filbuf(fp) : *(fp)->f_ptr++)) ! 13: ! 14: typedef struct { ! 15: int f_cnt, /* number of characters left in buffer */ ! 16: f_bufsize, /* size of what f_base points to */ ! 17: f_fd, /* fildes */ ! 18: f_flags; /* various flags */ ! 19: char *f_ptr, /* current offset */ ! 20: *f_base; /* pointer to base */ ! 21: char *f_name; /* name of open file */ ! 22: } File; ! 23: ! 24: #define F_READ 01 ! 25: #define F_WRITE 02 ! 26: #define F_APPEND 04 ! 27: #define F_MODE(x) (x&07) ! 28: #define F_EOF 010 ! 29: #define F_STRING 020 ! 30: #define F_ERR 040 ! 31: #define F_LOCK 0100 /* don't close this file upon error */ ! 32: #define F_MYBUF 0200 /* f_alloc allocated the buffer, so ! 33: f_close knows to free it up */ ! 34: ! 35: extern long io_chars; ! 36: extern int io_lines; ! 37: ! 38: extern File ! 39: *stdout, ! 40: *mru_file, ! 41: ! 42: *open_file(), ! 43: *fd_open(), ! 44: *f_open();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.