20 #include "nc4internal.h"
21 #include "nc4dispatch.h"
22 #include "ncdispatch.h"
48 size_t *lenp,
int *attnum,
void *data)
50 NC_ATT_INFO_T *att = NULL;
52 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,
144 nc_hvl_t *vldest = data;
145 NC_TYPE_INFO_T *type;
155 for (i = 0; i < att->len; i++)
157 vldest[i].len = att->vldata[i].len;
158 if (!(vldest[i].p = malloc(vldest[i].len * base_typelen)))
160 memcpy(vldest[i].p, att->vldata[i].p, vldest[i].len * base_typelen);
163 else if (att->stdata)
165 for (i = 0; i < att->len; i++)
170 if (!(((
char **)data)[i] = strdup(att->stdata[i])))
174 ((
char **)data)[i] = att->stdata[i];
179 memcpy(data, bufr, (
size_t)(att->len * type_size));
214 nc_type mem_type,
size_t *lenp,
int *attnum,
void *data)
218 NC_VAR_INFO_T *var = NULL;
222 LOG((3,
"%s: ncid 0x%x varid %d mem_type %d", __func__, ncid,
233 if (!(var = (NC_VAR_INFO_T*)ncindexith(grp->vars,varid)))
235 assert(var->hdr.id == varid);
268 LOG((2,
"%s: ncid 0x%x varid %d name %s", __func__, ncid, varid, name));
286 LOG((2,
"%s: ncid 0x%x varid %d name %s", __func__, ncid, varid, name));
308 LOG((2,
"nc_inq_attname: ncid 0x%x varid %d attnum %d", ncid, varid,
317 strcpy(name, att->hdr.name);
338 return nc4_get_att(ncid, varid, name, NULL, memtype, NULL, NULL, value);