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