kfile_readdata - read the contents of a khoros transport into a data array
LIBRARY CALL
kaddr kfile_readdata(
int id,
kaddr ptr,
size_t *num)
INPUT
id - the khoros transport descriptor
ptr - data to be used if not NULL
OUTPUT
num - if not NULL the number of bytes read is returned
RETURN VALUE
a pointer to the contents of the file or NULL upon failure
DESCRIPTION
This routine reads the contents of a file, using the khoros
transport mechanisms, into an array. If the data array is
NULL then a data array of suitable size is allocated and
passed back. An optional "num_read" can be used to find
out the actual number of bytes read. If "num_read" is
NULL then the parameter is ignored.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
the data returned is allocated and needs to freed using
kfree_and_NULL().
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/kfile.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.