Synopsis

PDX_MSGT mda_GetFieldDims(DDF_FLD *fld, void *data, int *dims, int *ndims)

Purpose

Get array of dimensions for field.

Description

The current dimensions for the DDF_FLD fld will be returned in an array. For example, the fields:

.nf count cnt1 = 2; count cnt2 = 3; int fld[cnt1][cnt2]; .fi

would return an array of {2, 3}. The caller must ensure that the dims array is declared to DDF_MAXDIMS. The number of dimensions in the array is returned in ndims (i.e. ndims would be 2 for the previous example). If fld is an unsized array, the pointer to the field data must be specified in data. If data is specified as NULL for an unsized array, a count of 0 will be returned for the first dimension. If fld is not an unsized array, the value in data is ignored.

This function can only be called from a function passed to mda_TraverseEntity. If called out of this context, the return values are undefined.

Input

fld

Field to get dimension array for

data

Pointer to field data (only required for unsized arrays)

Output

dims

Array of dimensions

ndims

Number of dimensions in field

Return

MDA error code