debian/rules: Use `git' potty wrapper.
[qmail] / getln2.3
CommitLineData
2117e02e
MW
1.TH getln2 3
2.SH NAME
3getln2 \- read one line of data
4.SH SYNTAX
5.B #include <getln.h>
6
7int \fBgetln2\fP(&\fIss\fR,&\fIsa\fR,&\fIcont\fR,&\fIclen\fR,\fIsep\fR);
8
9substdio \fIss\fR;
10.br
11stralloc \fIsa\fR;
12.br
13char *\fIcont\fR;
14.br
15unsigned int \fIclen\fR;
16.br
17int \fIsep\fR;
18.SH DESCRIPTION
19.B getln2
20reads a line of characters, terminated by a
21.I sep
22character,
23from
24.IR ss .
25
26The line is returned in two pieces.
27The first piece is stored in
28.IR sa .
29The second piece is
30.IR cont ,
31a pointer to
32.I clen
33characters inside the
34.I ss
35buffer.
36The second piece must be copied somewhere else
37before
38.I ss
39is used again.
40
41If
42.B getln2
43sees end-of-input before it sees
44.IR sep ,
45it sets
46.I clen
47to 0 and does not set
48.IR cont .
49It puts the partial line into
50.IR sa .
51
52.B getln2
53normally returns 0.
54If it runs out of memory,
55or encounters an error from
56.IR ss ,
57it returns -1,
58setting
59.B errno
60appropriately.
61.SH "SEE ALSO"
62stralloc(3),
63substdio(3),
64getln(3)