ack/lang/basic/lib/write.c
keie 7556180ab3 Printf does not return a truth value for failure.
These -incorrect- tests were replaced by calls to ferror.
1985-01-21 23:58:07 +00:00

36 lines
525 B
C

#include "string.h"
#include "io.h"
/* $Header$ */
/* assume that the channel has been set */
_wrnl()
{
if( fputc('\n',_chanwr) == EOF) error(29);
}
_wrcomma()
{
if( fputc(',',_chanwr) == EOF) error(29);
}
_wrint(i)
int i;
{
if(i>0)
if( fputc(' ',_chanwr)==EOF) error(29);
fprintf(_chanwr,"%d",i);
if( ferror(_chanwr) ) error(29);
}
_wrflt(f)
double f;
{
fprintf(_chanwr,"%f",f);
if( ferror(_chanwr) ) error(29);
}
_wrstr(s)
String *s;
{
fprintf(_chanwr,"\"%s\"",s->strval);
if( ferror(_chanwr) ) error(29);
}