|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 465 (0x1d1)
Types: TextFile
Notes: UNIX file
Names: »_fgetc.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »libc/stdio/_fgetc.c«
/*
* Standard I/O Library Internals
* Unbuffered input
*/
#include <stdio.h>
#include <errno.h>
int
_fgetc(fp)
register FILE *fp;
{
register unsigned char s[1];
extern int _fputt();
if (stdout->_pt==&_fputt) /* special kludge */
fflush(stdout);
fp->_cc = 0;
errno = 0;
switch (read(fileno(fp), s, 1)) {
case -1:
if (errno != EINTR)
fp->_ff |= _FERR;
break;
case 0:
fp->_ff |= _FEOF;
break;
default:
return (s[0]);
}
return (EOF);
}