]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/libf2c/libI77/sfe.c
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / libf2c / libI77 / sfe.c
1 /* sequential formatted external common routines*/
2 #include "config.h"
3 #include "f2c.h"
4 #include "fio.h"
5
6 extern char *f__fmtbuf;
7
8 integer
9 e_rsfe (void)
10 {
11   int n;
12   f__init = 1;
13   n = en_fio ();
14   f__fmtbuf = NULL;
15   return (n);
16 }
17
18 int
19 c_sfe (cilist * a)              /* check */
20 {
21   unit *p;
22   if (a->ciunit >= MXUNIT || a->ciunit < 0)
23     err (a->cierr, 101, "startio");
24   p = &f__units[a->ciunit];
25   if (p->ufd == NULL && fk_open (SEQ, FMT, a->ciunit))
26     err (a->cierr, 114, "sfe");
27   if (!p->ufmt)
28     err (a->cierr, 102, "sfe");
29   return (0);
30 }
31
32 integer
33 e_wsfe (void)
34 {
35   int n;
36   f__init = 1;
37   n = en_fio ();
38   f__fmtbuf = NULL;
39 #ifdef ALWAYS_FLUSH
40   if (!n && fflush (f__cf))
41     err (f__elist->cierr, errno, "write end");
42 #endif
43   return n;
44 }