From 438b942b6c9d0d9570fc3bb28edc4e61a072b67c Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Thu, 22 Mar 1990 16:09:33 +0000 Subject: [PATCH] add LCC - a better C-Compiler for WEGA --- WEGA/contrib/lcc/lib/libc/port/stdio/data.c | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 WEGA/contrib/lcc/lib/libc/port/stdio/data.c diff --git a/WEGA/contrib/lcc/lib/libc/port/stdio/data.c b/WEGA/contrib/lcc/lib/libc/port/stdio/data.c new file mode 100644 index 0000000..7e283ec --- /dev/null +++ b/WEGA/contrib/lcc/lib/libc/port/stdio/data.c @@ -0,0 +1,30 @@ +#include + +/* some slop is allowed at the end of the buffers in case an upset in + * the synchronization of _cnt and _ptr (caused by an interrupt or other + * signal) is not immediately detected. + */ +unsigned char _sibuf[BUFSIZ+8], _sobuf[BUFSIZ+8]; +/* + * Ptrs to start of preallocated buffers for stdin, stdout. + */ +unsigned char *_stdbuf[] = { _sibuf, _sobuf }; + +unsigned char _smbuf[_NFILE+1][_SBFSIZ]; + +FILE _iob[_NFILE] = { + { NULL, 0, NULL, _IOREAD, 0}, + { NULL, 0, NULL, _IOWRT, 1}, + { _smbuf[2], 0, _smbuf[2], _IOWRT+_IONBF, 2}, +}; +/* + * Ptr to end of io control blocks + */ +FILE *_lastbuf = { &_iob[_NFILE] }; + +/* + * Ptrs to end of read/write buffers for each device + * There is an extra bufend pointer which corresponds to the dummy + * file number _NFILE, which is used by sscanf and sprintf. + */ +unsigned char *_bufendtab[_NFILE+1] = { NULL, NULL, _smbuf[2]+_SBFSIZ, };