1buffer_getnewline_sa(3)    Library Functions Manual    buffer_getnewline_sa(3)
2
3
4

NAME

6       buffer_getnewline_sa - read line from buffer
7

SYNTAX

9       #include <stralloc.h>
10       #include <buffer.h>
11
12       int buffer_getnewline_sa(buffer* b,stralloc* sa);
13

DESCRIPTION

15       buffer_getnewline_sa  copies  data  from  the  b  to sa until a '\n' is
16       found, overwriting the previous content of sa.  The  new-line  is  also
17       appended to sa.
18
19       If  reading  from the buffer or allocating memory fails, buffer_getnew‐
20       line_sa returns -1 and sets errno appropriately.  At that point sa  may
21       be empty or it may already contain a partial token.
22
23       To read from a non-blocking socket, use buffer_getline_sa.
24

RETURN VALUE

26       -1 on error (setting errno), 0 on EOF, 1 when successful.
27

SEE ALSO

29       buffer_get_token_sa(3), buffer(3)
30
31
32
33                                                       buffer_getnewline_sa(3)
Impressum