Commit | Line | Data |
---|---|---|
a876201b KM |
1 | /* Copyright (c) 1979 Regents of the University of California */ |
2 | ||
3 | static char sccsid[] = "@(#)READ8.c 1.1 %G%"; | |
4 | ||
5 | #include "h00vars.h" | |
6 | #include "h01errs.h" | |
7 | ||
8 | double | |
9 | READ8(curfile) | |
10 | ||
11 | register struct iorec *curfile; | |
12 | { | |
13 | double data; | |
14 | ||
15 | if (curfile->funit & FWRITE) { | |
16 | ERROR(EREADIT, curfile->pfname); | |
17 | return; | |
18 | } | |
19 | UNSYNC(curfile); | |
20 | if (fscanf(curfile->fbuf, "%lf", &data) == 0) { | |
21 | ERROR(EBADFNUM, curfile->pfname); | |
22 | return; | |
23 | } | |
24 | curfile->funit |= SYNC; | |
25 | return data; | |
26 | } |