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