SYNTAX
       #include "getln.h"

       int getln(&buffer_0,&sa,&match,sep);
       int getln2(&buffer_0,&sa,&cont,&clen,sep);

       buffer buffer_0;
       stralloc sa;
       int match;
       int sep;
       char *cont;
       unsigned int clen;

DESCRIPTION
       getln  reads  a line of characters, terminated by a sep character, from
       buffer_0.  It returns the line in sa and sets match  to  1.   If  getln
       sees end-of-input before it sees sep, it returns the partial line in sa
       and sets match to 0.

       getln2 reads a line of characters, terminated by a sep character,  from
       buffer_0.   The  line  is  returned  in  two pieces. The first piece is
       stored in sa.  The second piece is cont, a pointer to  clen  characters
       inside  the  buffer_0 buffer. The second piece must be copied somewhere
       else before ss is used again.  If getln2 sees  end-of-input  before  it
       sees sep, it sets clen to 0 and does not set cont.  It puts the partial
       line into sa.

RETURN CODES
       getln normally returns 0.  If it runs out of memory, or  encounters  an
       error from ss, it returns -1, setting errno appropriately.

       getln2  normally returns 0.  If it runs out of memory, or encounters an
       error from ss, it returns -1, setting errno appropriately.

NOTE
       The input buffer buffer_0 is already pre-allocated.   It  can  be  used
       without initialization as synonym for STDIN.

CREDITS
       The getln and getln2 man page were taken from Bruce Guenther and origiā€
       nally published by Dan Bernstein for qmail-1.03.

SEE ALSO
       stralloc(3)



                                       3                         glibs:(getln)

Man(1) output converted with man2html