|
0
|
1 |
.TH getln 3
|
|
|
2 |
.SH NAME
|
|
|
3 |
getln \- read one line of data
|
|
|
4 |
.SH SYNTAX
|
|
|
5 |
.B #include <getln.h>
|
|
|
6 |
|
|
|
7 |
int \fBgetln\fP(&\fIss\fR,&\fIsa\fR,&\fImatch\fR,\fIsep\fR);
|
|
|
8 |
|
|
|
9 |
substdio \fIss\fR;
|
|
|
10 |
.br
|
|
|
11 |
stralloc \fIsa\fR;
|
|
|
12 |
.br
|
|
|
13 |
int \fImatch\fR;
|
|
|
14 |
.br
|
|
|
15 |
int \fIsep\fR;
|
|
|
16 |
.SH DESCRIPTION
|
|
|
17 |
.B getln
|
|
|
18 |
reads a line of characters, terminated by a
|
|
|
19 |
.I sep
|
|
|
20 |
character,
|
|
|
21 |
from
|
|
|
22 |
.IR ss .
|
|
|
23 |
It returns the line in
|
|
|
24 |
.I sa
|
|
|
25 |
and sets
|
|
|
26 |
.I match
|
|
|
27 |
to 1.
|
|
|
28 |
|
|
|
29 |
If
|
|
|
30 |
.B getln
|
|
|
31 |
sees end-of-input before it sees
|
|
|
32 |
.IR sep ,
|
|
|
33 |
it returns the partial line in
|
|
|
34 |
.I sa
|
|
|
35 |
and sets
|
|
|
36 |
.I match
|
|
|
37 |
to 0.
|
|
|
38 |
|
|
|
39 |
.B getln
|
|
|
40 |
normally returns 0.
|
|
|
41 |
If it runs out of memory,
|
|
|
42 |
or encounters an error from
|
|
|
43 |
.IR ss ,
|
|
|
44 |
it returns -1,
|
|
|
45 |
setting
|
|
|
46 |
.B errno
|
|
|
47 |
appropriately.
|
|
|
48 |
.SH "SEE ALSO"
|
|
|
49 |
stralloc(3),
|
|
|
50 |
substdio(3),
|
|
|
51 |
getln2(3)
|