[Top] [Prev] [Next] [Bottom]

VSlone/vsflone

int32 VSlone(int32 file_id, int32 ref_array[], int32 maxsize)
file_id

IN:

File identifier returned by Hopen

ref_array

OUT:

Buffer for the returned list of vdata reference numbers

maxsize

IN:

Maximum number of vdata reference numbers to be stored in the array

Purpose

Locates all lone vdatas (i.e. those that are not grouped with other objects) in a HDF file.

Return value

Returns the total number of lone vdatas in the file if successful and FAIL (or -1) otherwise.

Description

The integer array ref_array must be provided, and the maximum size of the array must be specified in the parameter maxsize. At most maxsize reference numbers will be returned in ref_array.

An array size of 65,000 integers for ref_array is generally adequate. The preferred method is to use dynamic memory instead; first call VSlone with a value of 0 for maxsize, and then use the returned value to allocate memory for ref_array to be passed to a subsequent call to VSlone. Refer to the Reference Manual page on Vlone.

Example

This sample code illustrates the preferred method of using VSlone. The second call to VSlone returns the required reference numbers.

     int32 file_id; /* id of opened HDF file */
     int32 maxsize, status;
     int32 *ref_array;

     maxsize = VSlone (file_id, NULL, 0);
     ref_array = (int32*) malloc(sizeof(int32)*maxsize);
     status   = VSlone (file_id, ref_array, maxsize); 
FORTRAN

integer function vsflone(file_id, ref_array, maxsize)

integer file_id, maxsize

integer ref_array(*)



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.