Import ezmlm 0.53
[ezmlm] / substdio_out.3
CommitLineData
5b62e993
MW
1.TH substdio_out 3
2.SH NAME
3substdio_out \- substdio output routines
4.SH SYNTAX
5.B #include <substdio.h>
6
7int \fBsubstdio_put\fP(&\fIs\fR,\fIfrom\fR,\fIlen\fR);
8.br
9int \fBsubstdio_puts\fP(&\fIs\fR,\fIfrom\fR);
10
11int \fBsubstdio_bput\fP(&\fIs\fR,\fIfrom\fR,\fIlen\fR);
12.br
13int \fBsubstdio_bputs\fP(&\fIs\fR,\fIfrom\fR);
14
15int \fBsubstdio_flush\fP(&\fIs\fR);
16
17int \fBsubstdio_putflush\fP(&\fIs\fR,\fIfrom\fR,\fIlen\fR);
18.br
19int \fBsubstdio_putsflush\fP(&\fIs\fR,\fIfrom\fR);
20
21substdio \fIs\fR;
22.br
23char *\fIfrom\fR;
24.br
25int \fIlen\fR;
26.SH DESCRIPTION
27.B substdio_put
28writes
29.I len
30characters to
31.I s
32out of the character array
33.IR from .
34It returns 0 on success, -1 on error.
35
36.B substdio_bput
37has the same function as
38.BR substdio_put .
39The difference is how the buffer is flushed
40when there isn't enough room for
41.I len
42characters:
43.B substdio_put
44flushes the buffered data before copying the new data,
45whereas
46.B substdio_bput
47fills the buffer with new data before flushing.
48
49.B substdio_flush
50forces all data to be written from the internal buffer.
51It returns 0 on success, -1 on error.
52
53.B substdio_putflush
54is similar to
55.B substdio_put
56followed by
57.BR substdio_flush ,
58but it avoids all internal copies.
59
60.BR substdio_puts ,
61.BR substdio_bputs ,
62and
63.B substdio_putsflush
64are the same as
65.BR substdio_put ,
66.BR substdio_bput ,
67and
68.B substdio_putflush
69except that
70.I from
71must be a 0-terminated string of characters.
72The string, not including the 0, is written.
73
74The
75.B SUBSTDIO_OUTSIZE
76macro is defined as a reasonably large output buffer size for
77.BR substdio_fdbuf .
78.SH "INTERNALS"
79When a
80.B substdio
81variable
82.I s
83is used for output,
84data is buffered from
85.I s\fB.x
86to
87.I s\fB.x\fR +
88.I s\fB.p\fR;
89there is free buffer space from
90to
91.I s\fB.x\fR +
92.I s\fB.p
93to
94.I s\fB.x\fR +
95.I s\fB.n\fR;
96the total buffer length is
97.I s\fB.n\fR.
98.SH "SEE ALSO"
99substdio(3)