Merge from vendor branch DIFFUTILS:
[dragonfly.git] / contrib / libf2c / libI77 / ilnw.c
1 #include "f2c.h"
2 #include "fio.h"
3 #include "lio.h"
4 extern char *f__icptr;
5 extern char *f__icend;
6 extern icilist *f__svic;
7 extern int f__icnum;
8 #ifdef KR_headers
9 extern void z_putc();
10 #else
11 extern void z_putc(int);
12 #endif
13
14  static int
15 z_wSL(Void)
16 {
17         while(f__recpos < f__svic->icirlen)
18                 z_putc(' ');
19         return z_rnew();
20         }
21
22  static void
23 #ifdef KR_headers
24 c_liw(a) icilist *a;
25 #else
26 c_liw(icilist *a)
27 #endif
28 {
29         f__reading = 0;
30         f__external = 0;
31         f__formatted = 1;
32         f__putn = z_putc;
33         L_len = a->icirlen;
34         f__donewrec = z_wSL;
35         f__svic = a;
36         f__icnum = f__recpos = 0;
37         f__cursor = 0;
38         f__cf = 0;
39         f__curunit = 0;
40         f__icptr = a->iciunit;
41         f__icend = f__icptr + a->icirlen*a->icirnum;
42         f__elist = (cilist *)a;
43         }
44
45  integer
46 #ifdef KR_headers
47 s_wsni(a) icilist *a;
48 #else
49 s_wsni(icilist *a)
50 #endif
51 {
52         cilist ca;
53
54         if(f__init != 1) f_init();
55         f__init = 3;
56         c_liw(a);
57         ca.cifmt = a->icifmt;
58         x_wsne(&ca);
59         z_wSL();
60         return 0;
61         }
62
63  integer
64 #ifdef KR_headers
65 s_wsli(a) icilist *a;
66 #else
67 s_wsli(icilist *a)
68 #endif
69 {
70         if(f__init != 1) f_init();
71         f__init = 3;
72         f__lioproc = l_write;
73         c_liw(a);
74         return(0);
75         }
76
77 integer e_wsli(Void)
78 {
79         f__init = 1;
80         z_wSL();
81         return(0);
82         }