Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Next: , Previous: Opaque Type, Up: User Defined Data Types



5.25 Creating Opaque Types: nc_def_opaque

Create an opaque type. Provide a size and a name.

Usage

     nc_def_opaque(int ncid, char *name, size_t size, nc_type *typeidp);
ncid
The groupid where the type will be created. The type may be used anywhere in the file, no matter what group it is in.
name
The name for this type. Must be shorter than NC_MAX_NAME.
size
The size of each opaque object.
typeidp
Pointer where the new typeid for this type is returned. Use this typeid when defining variables of this type with nc_def_var.

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 the test program libsrc4/tst_opaques.c.

           /* Create a file that has an opaque attribute. */
           if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
           if (nc_def_opaque(ncid, BASE_SIZE, TYPE_NAME, &xtype)) ERR;
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690