Category : C Source Code
Archive   : SC88.ZIP
Filename : FGETC.C

 
Output of file : FGETC.C contained in archive : SC88.ZIP
#define NOCCARGC /* no argument count passing */
#include stdio.h
#include clib.def
/*
** Character-stream input of one character from fd.
** Entry: fd = File descriptor of pertinent file.
** Returns the next character on success, else EOF.
*/
fgetc(fd) int fd; {
int ch;
char buff;
if(Uread(&buff,fd,1)==EOF) {
Useteof(fd);
return(EOF);
}
ch=buff;
switch(ch) {
default: return (ch);
case FILEOF: /* switch(Uchrpos[fd]) {
default: --Uchrpos[fd];
case 0:
case BUFSIZE:
} */
Useteof(fd);
return (EOF);
case CR: return ('\n');
case LF: /* NOTE: Uconin() maps LF -> CR */
}
}
#asm
_getc EQU _fgetc
PUBLIC _getc
#endasm



  3 Responses to “Category : C Source Code
Archive   : SC88.ZIP
Filename : FGETC.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/