from John Gilmore to support gcc
[unix-history] / usr / src / usr.bin / pascal / libpc / WRITEC.c
CommitLineData
55bf170c
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
86997b19 3static char sccsid[] = "@(#)WRITEC.c 1.4 %G%";
55bf170c
KM
4
5#include "h00vars.h"
55bf170c
KM
6
7WRITEC(curfile, d1, d2)
8
9 register struct iorec *curfile;
44dfd6de 10 char d1;
492cc5d3 11 FILE *d2;
55bf170c
KM
12{
13 if (curfile->funit & FREAD) {
86997b19
KM
14 ERROR("%s: Attempt to write, but open for reading\n",
15 curfile->pfname);
55bf170c
KM
16 return;
17 }
44dfd6de 18 fputc(d1, d2);
55bf170c 19 if (ferror(curfile->fbuf)) {
86997b19 20 PERROR("Could not write to ", curfile->pfname);
55bf170c
KM
21 return;
22 }
23}