Initial import from FreeBSD RELENG_4:
[games.git] / contrib / libf2c / libI77 / sfe.c
1 /* sequential formatted external common routines*/
2 #include "f2c.h"
3 #include "fio.h"
4
5 extern char *f__fmtbuf;
6
7 integer e_rsfe(Void)
8 {       int n;
9         f__init = 1;
10         n=en_fio();
11         f__fmtbuf=NULL;
12         return(n);
13 }
14 #ifdef KR_headers
15 c_sfe(a) cilist *a; /* check */
16 #else
17 c_sfe(cilist *a) /* check */
18 #endif
19 {       unit *p;
20         if(a->ciunit >= MXUNIT || a->ciunit<0)
21                 err(a->cierr,101,"startio");
22         p = &f__units[a->ciunit];
23         if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe");
24         if(!p->ufmt) err(a->cierr,102,"sfe");
25         return(0);
26 }
27 integer e_wsfe(Void)
28 {
29         int n;
30         f__init = 1;
31         n = en_fio();
32         f__fmtbuf=NULL;
33         return n;
34 }