|
Last change
on this file since 197ff76 was d60f436, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
|
Alignment fix.
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | stdio.h -- Standard I/O Package header for the Buchla 700
|
|---|
| 4 | Version 6 -- 1987-10-20 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #pragma once
|
|---|
| 9 |
|
|---|
| 10 | #include "fspars.h" /* file system parameters */
|
|---|
| 11 | #include "stdint.h"
|
|---|
| 12 |
|
|---|
| 13 | #define EOF -1
|
|---|
| 14 |
|
|---|
| 15 | #define fgetc getc
|
|---|
| 16 | #define fputc putc
|
|---|
| 17 |
|
|---|
| 18 | #define _BUSY 0x01u
|
|---|
| 19 | #define _ALLBUF 0x02u
|
|---|
| 20 | #define _DIRTY 0x04u
|
|---|
| 21 | #define _EOF 0x08u
|
|---|
| 22 | #define _IOERR 0x10u
|
|---|
| 23 |
|
|---|
| 24 | typedef struct {
|
|---|
| 25 |
|
|---|
| 26 | int8_t *_bp; /* current position in buffer */
|
|---|
| 27 | int8_t *_bend; /* last character in buffer + 1 */
|
|---|
| 28 | int8_t *_buff; /* address of buffer */
|
|---|
| 29 | int16_t _unit; /* fd token returned by open */
|
|---|
| 30 | uint8_t _flags; /* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR} */
|
|---|
| 31 | int8_t _bytbuf; /* single byte buffer for unbuffered streams */
|
|---|
| 32 | int16_t _buflen; /* length of buffer */
|
|---|
| 33 |
|
|---|
| 34 | } FILE;
|
|---|
| 35 |
|
|---|
| 36 | #define stdin (&Cbuffs[0])
|
|---|
| 37 | #define stdout (&Cbuffs[1])
|
|---|
| 38 | #define stderr (&Cbuffs[2])
|
|---|
| 39 |
|
|---|
| 40 | #define getchar() getc(stdin)
|
|---|
| 41 | #define putchar(c) putc(c, stdout)
|
|---|
| 42 | #define feof(fp) (((fp)->_flags & _EOF) != 0)
|
|---|
| 43 | #define ferror(fp) (((fp)->_flags & _IOERR) != 0)
|
|---|
| 44 | #define clearerr(fp) ((fp)->_flags &= ~(_IOERR | _EOF))
|
|---|
| 45 | #define fileno(fp) ((fp)->_unit)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.