20#include "nc4internal.h"
21#include "nc4dispatch.h"
22#include "ncdispatch.h"
49 size_t *lenp,
int *attnum,
void *data)
51 NC_ATT_INFO_T *att = NULL;
53 int need_to_convert = 0;
60 LOG((3,
"%s: mem_type %d", __func__, mem_type));
78 mem_type = att->nc_typeid;
93 *xtype = att->nc_typeid;
95 *attnum = att->hdr.id;
109 if (data && att->len && mem_type != att->nc_typeid &&
114 if (!(bufr = malloc((
size_t)(att->len) * type_size)))
118 mem_type, (
size_t)att->len, &range_error,
143 if((retval = NC_copy_data(h5->controller,mem_type,bufr,att->len,data)))
179 nc_type mem_type,
size_t *lenp,
int *attnum,
void *data)
183 NC_VAR_INFO_T *var = NULL;
187 LOG((3,
"%s: ncid 0x%x varid %d mem_type %d", __func__, ncid,
198 if (!(var = (NC_VAR_INFO_T*)ncindexith(grp->vars,(
size_t)varid)))
200 assert(var->hdr.id == varid);
233 LOG((2,
"%s: ncid 0x%x varid %d name %s", __func__, ncid, varid, name));
251 LOG((2,
"%s: ncid 0x%x varid %d name %s", __func__, ncid, varid, name));
273 LOG((2,
"nc_inq_attname: ncid 0x%x varid %d attnum %d", ncid, varid,
282 strcpy(name, att->hdr.name);
303 return nc4_get_att(ncid, varid, name, NULL, memtype, NULL, NULL, value);
int NC4_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp)
int NC4_inq_attid(int ncid, int varid, const char *name, int *attnump)
int NC4_inq_attname(int ncid, int varid, int attnum, char *name)
int nc4_get_att(int ncid, int varid, const char *name, nc_type *xtype, nc_type mem_type, size_t *lenp, int *attnum, void *data)
int nc4_get_att_ptrs(NC_FILE_INFO_T *h5, NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, const char *name, nc_type *xtype, nc_type mem_type, size_t *lenp, int *attnum, void *data)
int NC4_get_att(int ncid, int varid, const char *name, void *value, nc_type memtype)
int nc4_find_grp_att(NC_GRP_INFO_T *grp, int varid, const char *name, int attnum, NC_ATT_INFO_T **att)
int nc4_find_grp_h5(int ncid, NC_GRP_INFO_T **grp, NC_FILE_INFO_T **h5)
int nc4_find_nc_att(int ncid, int varid, const char *name, int attnum, NC_ATT_INFO_T **att)
int nc4_normalize_name(const char *name, char *norm_name)
int nc4_convert_type(const void *src, void *dest, const nc_type src_type, const nc_type dest_type, const size_t len, int *range_error, const void *fill_value, int strict_nc3, int quantize_mode, int nsd)
int nc4_get_typelen_mem(NC_FILE_INFO_T *h5, nc_type xtype, size_t *len)
#define NC_ECHAR
Attempt to convert between text & numbers.
#define NC_BYTE
signed 1 byte integer
#define NC_NAT
Not A Type.
#define NC_UBYTE
unsigned 1 byte int
#define NC_ENOMEM
Memory allocation (malloc) failure.
#define NC_GLOBAL
Attribute id to put/get a global attribute.
#define NC_ENOTVAR
Variable not found.
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
#define NC_MAX_NAME
Maximum for classic library.
#define NC_NOERR
No Error.
#define NC_NOQUANTIZE
No quantization in use.
#define NC_EBADNAME
Attribute or variable name contains illegal characters.
#define NC_CHAR
ISO/ASCII character.
#define NC_ERANGE
Math result not representable.
int nc_type
The nc_type type is just an int.