Next: , Previous: nc_def_opaque, Up: User Defined Data Types


5.28 Learn About an Opaque Type: nc_inq_opaque

Given a typeid, get the information about an opaque type.

Usage

     int nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep);
ncid
The ncid for the group containing the opaque type.
xtype
The typeid for this opaque type, as returned by nc_def_compound, or nc_inq_var.
name
If non-NULL, the name of the opaque type will be copied here. It will be NC_MAX_NAME bytes or less.
sizep
If non-NULL, the size of the opaque type will be copied here.

Errors

NC_NOERR
No error.
NC_EBADTYPEID
Bad typeid.
NC_EBADFIELDID
Bad fieldid.
NC_EHDFERR
An error was reported by the HDF5 layer.

Example

This example is from test program libsrc4/tst_opaques.c:

           if (nc_def_opaque(ncid, BASE_SIZE, TYPE_NAME, &xtype)) ERR;
     
           if (nc_inq_opaque(ncid, xtype, name_in, &base_size_in)) ERR;
           if (strcmp(name_in, TYPE_NAME) || base_size_in != BASE_SIZE) ERR;