Loading...
Searching...
No Matches
dattget.c
Go to the documentation of this file.
/* Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See copyright file for more info. */
#include "ncdispatch.h"
/* Start doxygen member group. */
int
nc_get_att(int ncid, int varid, const char *name, void *value)
{
NC* ncp;
int stat = NC_NOERR;
nc_type xtype;
if ((stat = NC_check_id(ncid, &ncp)))
return stat;
/* Need to get the type */
if ((stat = nc_inq_atttype(ncid, varid, name, &xtype)))
return stat;
TRACE(nc_get_att);
return ncp->dispatch->get_att(ncid, varid, name, value, xtype);
}
int
nc_get_att_text(int ncid, int varid, const char *name, char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_text);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_CHAR);
}
int
nc_get_att_schar(int ncid, int varid, const char *name, signed char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_schar);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_BYTE);
}
int
nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_uchar);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UBYTE);
}
int
nc_get_att_short(int ncid, int varid, const char *name, short *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_short);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_SHORT);
}
int
nc_get_att_int(int ncid, int varid, const char *name, int *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_int);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_INT);
}
int
nc_get_att_long(int ncid, int varid, const char *name, long *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_long);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, longtype);
}
int
nc_get_att_float(int ncid, int varid, const char *name, float *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_float);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_FLOAT);
}
int
nc_get_att_double(int ncid, int varid, const char *name, double *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_double);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_DOUBLE);
}
int
nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_ubyte);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UBYTE);
}
int
nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_ushort);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_USHORT);
}
int
nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_uint);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UINT);
}
int
nc_get_att_longlong(int ncid, int varid, const char *name, long long *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_longlong);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_INT64);
}
int
nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *value)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_ulonglong);
return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UINT64);
}
int
nc_get_att_string(int ncid, int varid, const char *name, char **value)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_get_att_string);
return ncp->dispatch->get_att(ncid,varid,name,(void*)value, NC_STRING);
}
/* End doxygen member group. */
nc_get_att_int
int nc_get_att_int(int ncid, int varid, const char *name, int *value)
Get an attribute array of type int.
Definition dattget.c:354
nc_get_att_string
int nc_get_att_string(int ncid, int varid, const char *name, char **value)
Get an attribute array of type string.
Definition dattget.c:711
nc_get_att
int nc_get_att(int ncid, int varid, const char *name, void *value)
Get an attribute of any type.
Definition dattget.c:133
nc_get_att_float
int nc_get_att_float(int ncid, int varid, const char *name, float *value)
Get an attribute array of type float.
Definition dattget.c:420
nc_get_att_long
int nc_get_att_long(int ncid, int varid, const char *name, long *value)
Get an attribute array of type long.
Definition dattget.c:387
nc_get_att_uchar
int nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *value)
Get an attribute of an signed char type.
Definition dattget.c:288
nc_get_att_longlong
int nc_get_att_longlong(int ncid, int varid, const char *name, long long *value)
Get an attribute array of type long long.
Definition dattget.c:585
nc_get_att_ubyte
int nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *value)
Get an attribute array of type unsigned char.
Definition dattget.c:486
nc_get_att_ulonglong
int nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *value)
Get an attribute array of type unsigned long long.
Definition dattget.c:618
nc_get_att_text
int nc_get_att_text(int ncid, int varid, const char *name, char *value)
Get a text attribute.
Definition dattget.c:222
nc_get_att_short
int nc_get_att_short(int ncid, int varid, const char *name, short *value)
Get an attribute array of type short.
Definition dattget.c:321
nc_get_att_schar
int nc_get_att_schar(int ncid, int varid, const char *name, signed char *value)
Get an attribute of an signed char type.
Definition dattget.c:255
nc_get_att_double
int nc_get_att_double(int ncid, int varid, const char *name, double *value)
Get an attribute array of type double.
Definition dattget.c:453
nc_inq_atttype
EXTERNL int nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
Find the type of an attribute.
Definition dattinq.c:358
nc_get_att_ushort
int nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *value)
Get an attribute array of type unsigned short.
Definition dattget.c:519
nc_get_att_uint
int nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *value)
Get an attribute array of type unsigned int.
Definition dattget.c:552
NC_UINT
#define NC_UINT
unsigned 4-byte int
Definition netcdf.h:44
NC_INT
#define NC_INT
signed 4 byte integer
Definition netcdf.h:38
NC_BYTE
#define NC_BYTE
signed 1 byte integer
Definition netcdf.h:35
NC_DOUBLE
#define NC_DOUBLE
double precision floating point number
Definition netcdf.h:41
NC_UBYTE
#define NC_UBYTE
unsigned 1 byte int
Definition netcdf.h:42
NC_FLOAT
#define NC_FLOAT
single precision floating point number
Definition netcdf.h:40
NC_SHORT
#define NC_SHORT
signed 2 byte integer
Definition netcdf.h:37
NC_INT64
#define NC_INT64
signed 8-byte int
Definition netcdf.h:45
NC_UINT64
#define NC_UINT64
unsigned 8-byte int
Definition netcdf.h:46
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:378
NC_USHORT
#define NC_USHORT
unsigned 2-byte int
Definition netcdf.h:43
NC_STRING
#define NC_STRING
string
Definition netcdf.h:47
NC_CHAR
#define NC_CHAR
ISO/ASCII character.
Definition netcdf.h:36
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25