1985-02-04 22:18:16 +00:00
|
|
|
#include "bc_io.h"
|
2018-06-23 22:35:51 +00:00
|
|
|
#include "lib.h"
|
1984-11-29 14:22:02 +00:00
|
|
|
|
|
|
|
/* assume that the channel has been set */
|
|
|
|
|
2016-12-12 20:15:25 +00:00
|
|
|
void _wrnl(void)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
if (fputc('\n', _chanwr) == EOF)
|
|
|
|
error(29);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
2016-12-12 20:15:25 +00:00
|
|
|
void _wrcomma(void)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
if (fputc(',', _chanwr) == EOF)
|
|
|
|
error(29);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
2016-12-12 20:15:25 +00:00
|
|
|
void _wrint(int i)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
if (i > 0)
|
|
|
|
if (fputc(' ', _chanwr) == EOF)
|
|
|
|
error(29);
|
|
|
|
fprintf(_chanwr, "%d", i);
|
|
|
|
if (ferror(_chanwr))
|
|
|
|
error(29);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
2016-12-12 20:15:25 +00:00
|
|
|
void _wrflt(double f)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
fprintf(_chanwr, "%f", f);
|
|
|
|
if (ferror(_chanwr))
|
|
|
|
error(29);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
2016-12-12 20:15:25 +00:00
|
|
|
void _wrstr(String* s)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
fprintf(_chanwr, "\"%s\"", s->strval);
|
|
|
|
if (ferror(_chanwr))
|
|
|
|
error(29);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|