|
Last change
on this file since 696 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
494 bytes
|
| Line | |
|---|
| 1 | #include "config.h"
|
|---|
| 2 | #include "f2c.h"
|
|---|
| 3 | #include "fio.h"
|
|---|
| 4 | #ifdef KR_headers
|
|---|
| 5 | integer f_rew(a) alist *a;
|
|---|
| 6 | #else
|
|---|
| 7 | integer f_rew(alist *a)
|
|---|
| 8 | #endif
|
|---|
| 9 | {
|
|---|
| 10 | unit *b;
|
|---|
| 11 | if (f__init & 2)
|
|---|
| 12 | f__fatal (131, "I/O recursion");
|
|---|
| 13 | if(a->aunit>=MXUNIT || a->aunit<0)
|
|---|
| 14 | err(a->aerr,101,"rewind");
|
|---|
| 15 | b = &f__units[a->aunit];
|
|---|
| 16 | if(b->ufd == NULL || b->uwrt == 3)
|
|---|
| 17 | return(0);
|
|---|
| 18 | if(!b->useek)
|
|---|
| 19 | err(a->aerr,106,"rewind");
|
|---|
| 20 | if(b->uwrt) {
|
|---|
| 21 | (void) t_runc(a);
|
|---|
| 22 | b->uwrt = 3;
|
|---|
| 23 | }
|
|---|
| 24 | FSEEK(b->ufd, 0, SEEK_SET);
|
|---|
| 25 | b->uend=0;
|
|---|
| 26 | return(0);
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.