[Back to Interface] [Prev] [Next]

VSread/vsfrd/vsfrdc/vsfread

int32 VSread(int32 vdata_id, uint8 *databuf, int32 n_records, int32 interlace_mode)

vdata_id IN:

Vdata identifier returned by VSattach

databuf OUT:

Buffer to store the retrieved data

n_records IN:

Number of records to be retrieved

interlace_mode IN:

Interlace mode of the data to be stored in the buffer

Purpose

Retrieves data from a vdata.

Return value

Returns the total number of records read if successful and FAIL (or -1) otherwise.

Description

VSread reads n_records records from the vdata identified by the parameter vdata_id and stores the data in the buffer databuf using the interlace mode specified by the parameter interlace_mode.

The user can specify the fields and the order in which they are to be read by calling VSsetfields prior to reading. VSread stores the requested fields in databuf in the specified order.

Valid values for interlace_mode are FULL_INTERLACE (or 1) and NO_INTERLACE (or 0). Selecting FULL_INTERLACE causes databuf to be filled by record and is recommended for speed and efficiency. Specifying NO_INTERLACE causes databuf to be filled by field, i.e., all values of a field in n_records records are filled before moving to the next field. Note that the default interlace mode of the buffer is FULL_INTERLACE.

As the data is stored contiguously in the vdata, VSfpack should be used to unpack the fields after reading. Refer to the discussion of VSfpack in the HDF User's Guide for more information.

Note that there are three FORTRAN-77 versions of this routine: vsfrd is for buffered numeric data, vsfrdc is for buffered character data and vsfread is for generic packed data.

FORTRAN

integer function vsfrd(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

<valid numeric data type> databuf(*)

integer function vsfrdc(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

character*(*) databuf

integer function vsfread(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

integer databuf(*)



[Back to Interface] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.