PR opt/3995
[official-gcc.git] / libf2c / libI77 / sfe.c
blobb67d823cf7c6015ef9cad7eaefb3b2b2b8e93f57
1 /* sequential formatted external common routines*/
2 #include "config.h"
3 #include "f2c.h"
4 #include "fio.h"
6 extern char *f__fmtbuf;
8 integer e_rsfe(Void)
9 { int n;
10 f__init = 1;
11 n=en_fio();
12 f__fmtbuf=NULL;
13 return(n);
15 #ifdef KR_headers
16 c_sfe(a) cilist *a; /* check */
17 #else
18 c_sfe(cilist *a) /* check */
19 #endif
20 { unit *p;
21 if(a->ciunit >= MXUNIT || a->ciunit<0)
22 err(a->cierr,101,"startio");
23 p = &f__units[a->ciunit];
24 if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe");
25 if(!p->ufmt) err(a->cierr,102,"sfe");
26 return(0);
28 integer e_wsfe(Void)
30 int n;
31 f__init = 1;
32 n = en_fio();
33 f__fmtbuf=NULL;
34 #ifdef ALWAYS_FLUSH
35 if (!n && fflush(f__cf))
36 err(f__elist->cierr, errno, "write end");
37 #endif
38 return n;