NetCDF 4.8.0
Loading...
Searching...
No Matches
dattinq.c
Go to the documentation of this file.
1/* Copyright 2018 University Corporation for Atmospheric
2Research/Unidata. See \ref copyright file for more info. */
9#include "ncdispatch.h"
10
15 /* All these functions are part of this named group... */
16
84int
85nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
86 size_t *lenp)
87{
88 NC* ncp;
89 int stat = NC_check_id(ncid, &ncp);
90 if(stat != NC_NOERR) return stat;
91 return ncp->dispatch->inq_att(ncid, varid, name, xtypep, lenp);
92}
93
162int
163nc_inq_attid(int ncid, int varid, const char *name, int *idp)
164{
165 NC* ncp;
166 int stat = NC_check_id(ncid, &ncp);
167 if(stat != NC_NOERR) return stat;
168 return ncp->dispatch->inq_attid(ncid, varid, name, idp);
169}
170
253int
254nc_inq_attname(int ncid, int varid, int attnum, char *name)
255{
256 NC* ncp;
257 int stat = NC_check_id(ncid, &ncp);
258 if(stat != NC_NOERR) return stat;
259 return ncp->dispatch->inq_attname(ncid, varid, attnum, name);
260}
261
298int
299nc_inq_natts(int ncid, int *nattsp)
300{
301 NC* ncp;
302 int stat = NC_check_id(ncid, &ncp);
303 if(stat != NC_NOERR) return stat;
304 if(nattsp == NULL) return NC_NOERR;
305 return ncp->dispatch->inq(ncid, NULL, NULL, nattsp, NULL);
306}
307
356int
357nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
358{
359 NC* ncp;
360 int stat = NC_check_id(ncid, &ncp);
361 if(stat != NC_NOERR) return stat;
362 return ncp->dispatch->inq_att(ncid, varid, name, xtypep, NULL);
363}
364
422int
423nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp)
424{
425 NC* ncp;
426 int stat = NC_check_id(ncid, &ncp);
427 if(stat != NC_NOERR) return stat;
428 return ncp->dispatch->inq_att(ncid, varid, name, NULL, lenp);
429}
430
431 /* End of named group ...*/
int nc_inq_attid(int ncid, int varid, const char *name, int *idp)
Find an attribute ID.
Definition dattinq.c:163
int nc_inq_natts(int ncid, int *nattsp)
Find number of global or group attributes.
Definition dattinq.c:299
int nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp)
Return information about a netCDF attribute.
Definition dattinq.c:85
int nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
Find the type of an attribute.
Definition dattinq.c:357
int nc_inq_attname(int ncid, int varid, int attnum, char *name)
Find the name of an attribute.
Definition dattinq.c:254
int nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp)
Find the length of an attribute.
Definition dattinq.c:423
#define NC_NOERR
No Error.
Definition netcdf.h:330
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25