mcDBinqSetAtt — inquire dataset attributes
#include <memcom.h> int mcDBinqSetAtt(int handle, const char* name, mcSetAttributes* att);
mcDBinqSetAtt
returns the attributes of a
dataset in a structure of type mcSetAttributes
.
The database pointed to by handle
is searched. If
the set exists, the function returns 1. If not, 0 is returned. If
the handle has a wrong value or the database assigned to
handle
is not open, the function returns a
negative value.
If the structure att
is set to NULL before
calling mcDBinqSetAtt
no values are returned,
i.e the function can be used to check if the set exists, without
retrieving any attributes.
handle
Database handle (input).
name
Dataset name of set to be inquired (input).
att
Pointer to structure of type
mcSetAttributes
(input). If set to NULL,
no values are returned, i.e the function can be used to
check if the set exists. mcSetAttributes
structure:
#include <memcom.h> struct mcSetAttributes { char name[SET_NAME_LENGTH + 1]; /* Name ('\0'-terminated) */ char type[4]; /* Data set type ('\0'-terminated). */ int ndim; /* Number of array dimensions (1,2,3...) */ mcOff dim[5]; /* ndim Dimensions */ mcOff size; /* Total size in number of elements */ mcOff faddr; /* File address (bytes) */ mcSize dsize; /* Descriptor size (bytes). 0 means no descriptor. */ };
SET_NAME_LENGTH
is the maximum size of a
dataset name (usually 64 characters). It can be retrieved from
mcdefs.h
.
All size information is expressed in data elements.
Only the first ndim
elements of
dim
are defined. ndim = 0
means that the size is not (or not yet) defined. The dimensions of
dim correspond to the C array row-major order.
A C array a[100][3] must be dimensioned with
mcSetAttributes att; att.ndim=2; att.dim[0]=100; att.dim[1]=3;