GFS_PIO_READLINE(3) GFS_PIO_READLINE(3)
NAME
gfs_pio_readline - read one line
SYNOPSIS
#include <gfarm/gfarm.h>
char *gfs_pio_readline (GFS_File f, char **bufp, size_t *sizep, size_t *lenp);
DESCRIPTION
gfs_pio_readline() reads one line from the file specified by the parameter gf.
Parameter bufp specifies an address of a pointer variable initialzed by NULL at first. gfs_pio_readline() allocates a buffer for I/O
dynamically, and stores the address of the buffer to this variable pointed by bufp. Parameter sizep specifies an address of a size_t vari-
able initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3)
in the variable pointed by the parameter bufp. In this case, you have to specify the size of the allocated buffer by the parameter sizep.
If the length of the line exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by bufp
and sizep will be updated respectively. Note that you are responsible to free(3) this buffer.
This function returns the length of the line to a variable pointed by the parameter lenp. This length includes newline character.
Just like gfs_pio_gets(3), this function doesn't remove newline character at the end of lines. Also, this function always appends '