source:
trunk/src/gcc/libf2c/libI77/rewind.c@
1392
| Last change on this file since 1392 was 1392, checked in by , 22 years ago | |
|---|---|
|
|
| File size: 490 bytes | |
| Line | |
|---|---|
| 1 | #include "config.h" |
| 2 | #include "f2c.h" |
| 3 | #include "fio.h" |
| 4 | integer |
| 5 | f_rew (alist * a) |
| 6 | { |
| 7 | unit *b; |
| 8 | if (f__init & 2) |
| 9 | f__fatal (131, "I/O recursion"); |
| 10 | if (a->aunit >= MXUNIT || a->aunit < 0) |
| 11 | err (a->aerr, 101, "rewind"); |
| 12 | b = &f__units[a->aunit]; |
| 13 | if (b->ufd == NULL || b->uwrt == 3) |
| 14 | return (0); |
| 15 | if (!b->useek) |
| 16 | err (a->aerr, 106, "rewind"); |
| 17 | if (b->uwrt) |
| 18 | { |
| 19 | (void) t_runc (a); |
| 20 | b->uwrt = 3; |
| 21 | } |
| 22 | FSEEK (b->ufd, 0, SEEK_SET); |
