home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SMC21LIB.LZH
/
FPUTC.C
< prev
next >
Wrap
Text File
|
2000-06-30
|
640b
|
28 lines
#define NOCCARGC
#include stdio.h
#include clib.def
extern int _status[];
/*
** Character-stream output of a character to fd.
** Entry: ch = Character to write
** fd = File descriptor of pertinent file.
** Returns character written on success, else EOF.
*/
fputc(ch, fd) int ch, fd; {
switch(ch) {
case EOF: _write(CPMEOF, fd); break;
case '\n': _write(CR, fd); _write(LF, fd); break;
default: _write(ch, fd);
}
if(_status[fd] & ERRBIT) return (EOF);
return (ch);
}
#asm
putc equ fputc
entry putc
#endasm