source: trunk/src/gcc/libf2c/libI77/backspace.c@ 603

Last change on this file since 603 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: 1.3 KB
Line 
1#include "config.h"
2#include <sys/types.h>
3#include "f2c.h"
4#include "fio.h"
5#ifdef KR_headers
6integer f_back(a) alist *a;
7#else
8integer 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)