Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
Previous: Enum Example Next: Variable-Length Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4

16.10 Using the Opaque Type
The opaque type holds arrays of unknown contents, with known size.

 

The following example, from libsrc4/tst_opaques.c, creates a very simple opaque type.

      /* 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;

      /* Write an att. */
      if (nc_put_att(ncid, NC_GLOBAL, ATT_NAME, xtype, DIM_LEN, data)) ERR;
      if (nc_close(ncid)) ERR;

 


Previous: Enum Example Next: Variable-Length Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community 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