rlgets(3)

NAME
rlgets - read arbitrary lines from a file rlputs - write arbitrary lines to a file

SYNOPSIS
#include <rlstring.h>
typedef struct {
    char *data;
    int size;
    int alloc; } rlString;
int rlgets(rlString*, FILE*); int rlputs(rlString*, FILE*);

DESCRIPTION
Rlgets reads a string of arbitrary length out of a file into the rlString that's passed into it. The data string is dynamically allocated memory, and will be reused by subsequent calls to rlgets.

Rlputs writes a string of arbitrary length out to a file.

RETURN VALUES
Rlgets returns the number of byte, including the trailing \n, that are in the line. On end of file or error, 0 is returned, and the calling program may call ferror(3) and feof(3) to find out why it failed. If the call fails because of a lack of memory,neitherr ferror or feof will be set.

Rlputs returns the number of bytes successfully written, or EOF if a total failure.

BUGS
Rlgets used to be known as readline, but has been rename because of namespace collision with the FSF's readline function.

NOTES
Rlgets is basically a reimplementation of the BSD 4.4 fgetln(3) function, because Linux libc doesn't reliably support that call.

Rlputs was written to complement rlgets.

AUTHOR
David Parsons ( orc@pell.chi.il.us )