BSD 4_2 development
[unix-history] / usr / man / man3 / ioinit.3f
CommitLineData
3b9e8f30
C
1.TH IOINIT 3F "13 June 1983"
2.UC 4
3.SH NAME
4ioinit \- change f77 I/O initialization
5.SH SYNOPSIS
6\fBlogical function ioinit (cctl, bzro, apnd, prefix, vrbose)\fP
7.br
8.B logical cctl, bzro, apnd, vrbose
9.br
10.B character*(*) prefix
11.SH DESCRIPTION
12This routine will initialize several global parameters in the f77 I/O system,
13and attach externally defined files to logical units at run time.
14The effect of the flag arguments applies to logical units opened after
15.I ioinit
16is called.
17The exception is the preassigned units, 5 and 6, to which
18.I cctl
19and
20.I bzro
21will apply at any time.
22.I Ioinit
23is written in Fortran-77.
24.PP
25By default,
26carriage control is not recognized on any logical unit. If
27.I cctl
28is
29.B .true.
30then carriage control will be recognized on formatted output
31to all logical units except unit 0, the diagnostic channel.
32Otherwise the default will be restored.
33.PP
34By default, trailing and embedded blanks in input data fields
35are ignored. If
36.I bzro
37is
38.B .true.
39then such blanks will be treated as zero's.
40Otherwise the default will be restored.
41.PP
42By default, all files opened for sequential access are positioned at
43their beginning.
44It is sometimes necessary or convenient to open at the END-OF-FILE
45so that a write will append to the existing data.
46If
47.I apnd
48is
49.B .true.
50then files opened subsequently on any logical unit
51will be positioned at their end upon opening.
52A value of
53.B .false.
54will restore the default behavior.
55.PP
56Many systems provide an automatic association of global names with
57fortran logical units when a program is run.
58There is no such automatic association in
59.UX
60f77.
61However, if the argument
62.I prefix
63is a non-blank string, then names of the form
64.BR prefix NN
65will be sought in the program environment. The value associated with
66each such name found will be used to open logical unit NN for formatted
67sequential access.
68For example, if f77 program
69.I myprogram
70included the call
71.nf
72
73 call ioinit (.true., .false., .false., \(fmFORT\(fm, .false.)
74
75.fi
76then when the following sequence
77.nf
78
79 % setenv FORT01 mydata
80 % setenv FORT12 myresults
81 % myprogram
82
83.fi
84would result in logical unit 1 opened to file
85.I mydata
86and logical unit 12 opened to file
87.IR myresults .
88Both files would be positioned at their beginning.
89Any formatted output would have column 1 removed and interpreted
90as carriage control.
91Embedded and trailing blanks would be ignored on input.
92.PP
93If the argument
94.I vrbose
95is
96.B .true.
97then
98.I ioinit
99will report on its activity.
100.PP
101The effect of
102.nf
103
104 call ioinit (.true., .true., .false., \(fm\(fm, .false.)
105
106.fi
107can be achieved without the actual call by including ``\-lI66''
108on the
109.I f77
110command line.
111This gives carriage control on all logical units except 0,
112causes files to be opened at their beginning, and causes
113blanks to be interpreted as zero's.
114.PP
115The internal flags are stored in a labeled common block with the following
116definition:
117.nf
118
119 integer*2 ieof, ictl, ibzr
120 common /ioiflg/ ieof, ictl, ibzr
121
122.fi
123.SH FILES
124.ta \w'/usr/ucb/lib/libI77.a 'u
125.ie \nM /usr/ucb/lib/libI77.a f77 I/O library
126.el /usr/lib/libI77.a f77 I/O library
127.br
128.ie \nM /usr/ucb/lib/libI66.a sets older fortran I/O modes
129.el /usr/lib/libI66.a sets older fortran I/O modes
130.SH "SEE ALSO"
131getarg(3F), getenv(3F), ``Introduction to the f77 I/O Library''
132.SH BUGS
133.I Prefix
134can be no longer than 30 characters.
135A pathname associated with an environment name can be no longer than 255
136characters.
137.PP
138The ``+'' carriage control does not work.