[Back to Interface] [Prev] [Next]

VSfpack/vsfcpak/vsfnpak

intn VSfpack(int32 vdata_id, intn action, char *fields_in_buf, VOIDP buf, intn buf_size, intn n_records, char *field_name_list, VOIDP bufptrs[])

vdata_id IN:

Vdata identifier returned by VSattach

action IN:

Action to be performed

fields_in_buf IN:

Names of the fields in buf

buf IN/OUT:

Buffer containing the values of the packed fields to write to or read from the vdata

buf_size IN:

Buffer size in bytes

n_records IN:

Number of records to pack or unpack

field_name_list IN:

Names of the fields to be packed or unpacked

bufptrs IN/OUT:

Array of pointers to the field buffers

Purpose

Packs field data into a buffer or unpacks buffered field data into vdata field(s) for fully interlaced fields.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

VSfpack packs or unpacks the field(s) listed in the parameter field_name_list to or from the buffer buf according to the specified action in the parameter action.

Valid values for action are _HDF_VSPACK (or 0) which packs field values from bufptrs (the field buffers) to buf, or _HDF_VSUNPACK (or 1) which unpacks vdata field values from buf into bufptrs.

When VSfpack is called to pack field values into buf, fields_in_buf must list all fields of the vdata. When VSfpack is called to unpack field values, fields_in_buf may be a subset of the vdata fields. To specify all vdata fields in fields_in_buf, NULL can be used in C and a blank character (" ") in Fortran.

The name(s) of the field(s) to be packed or unpacked are specified by the field_name_list. In C, the names in the parameter field_name_list can be a subset of or all field names listed in fields_in_buf. To specify all vdata fields, NULL can be used in C.

The FORTRAN-77 versions of this routine can pack or unpack only one field at a time. Therefore, field_name_list will contain the name of the field that will be packed or unpacked.

The calling program must allocate sufficient space for buf to hold all of the packed fields. The size of the buf buffer should be at least n_records * (the total size of all fields specified in fields_in_buf).

Note that there are two FORTRAN-77 versions of this routine: vsfnpak to pack or unpack a numeric field and vsfcpak to pack or unpack a character field.

Refer to the HDF User's Guide for an example on how to use this routine.

FORTRAN

integer function vsfnpak(vdata_id, action, fields_in_buf, buf, buf_size, n_records, field_name_list, bufptrs)

integer vdata_id, action, buf(*), buf_size, n_records

character*(*) fields_in_buf, field_name_list

<valid numeric data type> bufptrs(*)

integer function vsfcpak(vdata_id, action, fields_in_buf, buf, buf_size, n_records, field_name_list, bufptrs)

integer vdata_id, action, buf(*), buf_size, n_records

character*(*) fields_in_buf, field_name_list, bufptrs(*)



[Back to Interface] [Prev] [Next]

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