aboutsummaryrefslogtreecommitdiff
path: root/unix/os/doc/zputtx.hlp
blob: d04df54156df601e7aae428f4545eb341cc318e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.help zputtx May84 "System Interface"
.ih
NAME
zputtx -- put next line to a text file
.ih
SYNOPSIS
.nf
zputtx (chan, text, nchars, status)

int	chan			# OS channel of file
char	text[nchars]		# text data to be output
int	nchars			# number of characters in buffer
int	status
.fi
.ih
DESCRIPTION
Exactly \fInchars\fR chars are written from the SPP char array \fItext\fR
to the text file connected to channel \fIchan\fR.  Output is normally a line
of text, i.e., a sequence of zero or more characters terminated by the
\fBnewline\fR character (normally linefeed), although there is no guarantee
that the newline delimiter will be present.  If the newline delimiter is
present it must be the final character and it must be counted in \fInchars\fR.
A blank line is output by calling \fBzputtx\fR with a single newline character
in \fItext\fR and with \fInchars\fR equal to one.  Only ASCII data may be
written to a text file, i.e., the value of a char must be constrained to the
range 0 to 127.  Writing is permitted only at EOF.
.ih
RETURN VALUE
ERR is returned for a write error or for an illegal call.  If the write is
successful the number of characters written (including the newline) is returned
in \fIstatus\fR.
.ih
NOTES
There is no fixed upper limit on the length of a line.  In normal usage FIO
calls \fBzputtx\fR to write out the internal FIO fixed size line buffer
whenever it sees a newline in the output.  If an applications program writes
a very long line, the line buffer in FIO will overflow and \fBzputtx\fR will
be called to write out the contents of the buffer without a newline terminator.
FIO will also write out a partial line when the output is explicitly flushed.
On input FIO uses the same fixed size line buffer, and several calls to
\fBzgettx\fR may be required to read a full line.

If the host system does not use the ASCII character set \fBzputtx\fR will
convert characters from ASCII to the host character set upon output.
The full ASCII character set is permitted, i.e., control characters may be
embedded in the text.  For efficiency reasons character data is not checked
to verify that it is in the range 0 to 127.  If non-ASCII data is input the
results are unpredictable.
.ih
BUGS
Individual IRAF and host system utilities may place their own limits on the
maximum length of a line of text.  The lower bound on the size of a line
of text in IRAF programs is globally defined by the parameter SZ_LINE in
\fBiraf.h\fR and may easily be adjusted by the system installer.  A sysgen
of the entire system is required as SZ_LINE is used everywhere.
.ih
SEE ALSO
zfiotx, zgettx
.endhelp