BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kread_array - read in a variable array

LIBRARY CALL

ssize_t kread_array(
   int  id,
   kaddr *data,
   size_t num,
   int    type)

INPUT

OUTPUT

RETURN VALUE

the number of points read or -1 on error

DESCRIPTION

This module is used to read in a pointer to an variable sized array. The size of the array and the data is stored in the transport. The reader first reads the number of points, allocates enough space for the return data, and then calls kread_generic() to do the actual reading of the data. If NULL is stored then kread_array() will set the data pointer to NULL and return that 0 data points were read.

The "num" argument should be used to represent a maximum number of data points to be read. In the case that num is less than the number of data points stored, then kread_array() will advance to the end of the stored data. This allows for partial reads of the stored data.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/kread.c

SEE ALSO

kutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.