BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
kfgets - get a string from a data transport stream
LIBRARY CALL
char *kfgets(
char *buffer,
int num,
kfile *file)
INPUT
- num - maximum number of characters to read (the
size of the character array).
- file - the kfile pointer associated with the open stream
to the data transport, opened earlier with kfopen()
OUTPUT
- buffer - pointer to allocated character array into which
to read the string.
RETURN VALUE
Returns the string read on success,
NULL if EOF is encountered before any characters have
been read, or if an error occurs.
DESCRIPTION
This function is a replacement for the system "fgets"
call; kfgets() supports all khoros data transport
mechanisms, not just Unix files.
The routine reads a string of characters from the
specified data transport stream, and moves the data
transport pointer ahead by that number of characters.
kfgets() reads characters
from the stream into the array pointed to by 'buffer'
until 'num'-1 characters are read, or until a '\n'
(newline character) is read (and added to the string),
or until EOF is encountered. The string is terminated
with a NULL character. If the string could not be read,
NULL is returned; otherwise, the string is returned.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/kstdio.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.