ap_bgets — read a line from a stream
int ap_bgets(char *buff, int n, BUFF *fb)
Reads up to n-1
bytes into buff
until an LF is seen or the end of file is reached. If LF is preceded
by CR, the CR is deleted. The buffer is then terminated with a
NUL
(leaving the LF as the character before the
NUL
). Returns the number of bytes stored in the
buffer, excluding the terminating NUL
.