| 1 | #include "config.h"
|
|---|
| 2 | #include <sys/types.h>
|
|---|
| 3 | #include "f2c.h"
|
|---|
| 4 | #include "fio.h"
|
|---|
| 5 | #ifdef KR_headers
|
|---|
| 6 | integer f_back(a) alist *a;
|
|---|
| 7 | #else
|
|---|
| 8 | integer f_back(alist *a)
|
|---|
| 9 | #endif
|
|---|
| 10 | { unit *b;
|
|---|
| 11 | off_t v, w, x, y, z;
|
|---|
| 12 | uiolen n;
|
|---|
| 13 | FILE *f;
|
|---|
| 14 |
|
|---|
| 15 | f__curunit = b = &f__units[a->aunit]; /* curunit for error messages */
|
|---|
| 16 | if (f__init & 2)
|
|---|
| 17 | f__fatal (131, "I/O recursion");
|
|---|
| 18 | if(a->aunit >= MXUNIT || a->aunit < 0)
|
|---|
| 19 | err(a->aerr,101,"backspace");
|
|---|
| 20 | if(b->useek==0) err(a->aerr,106,"backspace");
|
|---|
| 21 | if(b->ufd == NULL) {
|
|---|
| 22 | fk_open(1, 1, a->aunit);
|
|---|
| 23 | return(0);
|
|---|
| 24 | }
|
|---|
| 25 | if(b->uend==1)
|
|---|
| 26 | { b->uend=0;
|
|---|
| 27 | return(0);
|
|---|
| 28 | }
|
|---|
| 29 | if(b->uwrt) {
|
|---|
| 30 | t_runc(a);
|
|---|
| 31 | if (f__nowreading(b))
|
|---|
| 32 | err(a->aerr,errno,"backspace");
|
|---|
| 33 | }
|
|---|
| 34 | f = b->ufd; /* may have changed in t_runc() */
|
|---|
| 35 | if(b->url>0)
|
|---|
|
|---|