GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
readline(l) BEGEMOT Library readline(l)

readline - read line of arbitrary size from file

# include <stdio.h>
# include <begemot.h>
char * readline(FILE * fp);
int readlinecnt;

This function allows you to read lines of arbitrary length from an input file. It thus overcomes the problem of ``how large should I allocate 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.

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 transfered 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 insufficient memory.

panic(l), xrealloc(l)
30 Aug 1996 BEGEMOT

Search for    or go to Top of page |  Section l |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.