mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Check that transient/unnamed types can be queried
This commit is contained in:
parent
9c18dad567
commit
8589214b93
@ -57,10 +57,22 @@ main()
|
||||
{
|
||||
int ncid, varid;
|
||||
double complex read_z;
|
||||
int num_types, class;
|
||||
int *typeids;
|
||||
nc_type base_nc_type;
|
||||
char name[NC_MAX_NAME];
|
||||
size_t size, nfields;
|
||||
|
||||
|
||||
nc_set_log_level(4);
|
||||
if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
|
||||
|
||||
if (nc_inq_typeids(ncid, &num_types, NULL)) ERR;
|
||||
typeids = (int*)malloc((size_t)num_types * sizeof(int));
|
||||
if (nc_inq_typeids(ncid, NULL, typeids)) ERR;
|
||||
|
||||
if (nc_inq_user_type(ncid, typeids[0], name, &size, &base_nc_type, &nfields, &class)) ERR;
|
||||
|
||||
/* Verify that the dataset is present */
|
||||
if (nc_inq_varid(ncid, VAR_NAME, &varid)) ERR;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user