Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
readline(l)			BEGEMOT	Library			   readline(l)

NAME
       readline	- read line of arbitrary size from file

SYNOPSIS
       # include <stdio.h>
       # include <begemot.h>

       char * readline(FILE * fp);

       int readlinecnt;

DESCRIPTION
       This  function allows you to read lines of arbitrary length from	an in-
       put file. It thus overcomes the problem of ``how	large should  I	 allo-
       cate the	input buffer?''	in many	programs. It handles the convention of
       signaling line continuation with	a backslash in the last	position, i.e.
       it silently removes sequences of	``\\\n'' from input.

       The variable readlinecnt	contains the number of input lines which where
       folded together for the last line returned by readline.

RETURN VALUE
       The function returnes a pointer to a malloc(3C)ed area on  success.  If
       end  of	file or	an error is encountered	before any character is	trans-
       fered to	the buffer, NULL is returned.  readline(l) uses	xrealloc(l) to
       allocate	the buffer and thus exists with	panic(l) in the	case of	insuf-
       ficient memory.

SEE ALSO
       panic(l), xrealloc(l)

BEGEMOT				  30 Aug 1996			   readline(l)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=readline&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help