mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-31 17:50:26 +08:00
rest of separation of libhdf5 and libsrc4
This commit is contained in:
parent
b5ed407e9f
commit
f6443bce8f
@ -809,6 +809,15 @@ NC4_HDF5_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
|
||||
&h5, &grp, &var, NULL)))
|
||||
return retval;
|
||||
|
||||
/* If this is one of the reserved atts, use nc_get_att_special. */
|
||||
if (!var)
|
||||
{
|
||||
const NC_reservedatt *ra = NC_findreserved(norm_name);
|
||||
if (ra && ra->flags & NAMEONLYFLAG)
|
||||
return nc4_get_att_special(h5, norm_name, xtypep, NC_NAT, lenp, NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
return nc4_get_att_ptrs(h5, grp, var, norm_name, xtypep, NC_NAT,
|
||||
lenp, NULL, NULL);
|
||||
}
|
||||
@ -841,6 +850,15 @@ NC4_HDF5_inq_attid(int ncid, int varid, const char *name, int *attnump)
|
||||
&h5, &grp, &var, NULL)))
|
||||
return retval;
|
||||
|
||||
/* If this is one of the reserved atts, use nc_get_att_special. */
|
||||
if (!var)
|
||||
{
|
||||
const NC_reservedatt *ra = NC_findreserved(norm_name);
|
||||
if (ra && ra->flags & NAMEONLYFLAG)
|
||||
return nc4_get_att_special(h5, norm_name, NULL, NC_NAT, NULL, attnump,
|
||||
NULL);
|
||||
}
|
||||
|
||||
return nc4_get_att_ptrs(h5, grp, var, norm_name, NULL, NC_NAT,
|
||||
NULL, attnump, NULL);
|
||||
}
|
||||
@ -886,14 +904,16 @@ NC4_HDF5_inq_attname(int ncid, int varid, int attnum, char *name)
|
||||
* @param varid Variable ID.
|
||||
* @param name Name of attribute.
|
||||
* @param value Pointer that gets attribute data.
|
||||
* @param memtype The type the data should be converted to as it is read.
|
||||
* @param memtype The type the data should be converted to as it is
|
||||
* read.
|
||||
*
|
||||
* @return ::NC_NOERR No error.
|
||||
* @return ::NC_EBADID Bad ncid.
|
||||
* @author Ed Hartnett
|
||||
*/
|
||||
int
|
||||
NC4_HDF5_get_att(int ncid, int varid, const char *name, void *value, nc_type memtype)
|
||||
NC4_HDF5_get_att(int ncid, int varid, const char *name, void *value,
|
||||
nc_type memtype)
|
||||
{
|
||||
NC_FILE_INFO_T *h5;
|
||||
NC_GRP_INFO_T *grp;
|
||||
@ -909,6 +929,15 @@ NC4_HDF5_get_att(int ncid, int varid, const char *name, void *value, nc_type mem
|
||||
&h5, &grp, &var, NULL)))
|
||||
return retval;
|
||||
|
||||
/* If this is one of the reserved atts, use nc_get_att_special. */
|
||||
if (!var)
|
||||
{
|
||||
const NC_reservedatt *ra = NC_findreserved(norm_name);
|
||||
if (ra && ra->flags & NAMEONLYFLAG)
|
||||
return nc4_get_att_special(h5, norm_name, NULL, NC_NAT, NULL, NULL,
|
||||
value);
|
||||
}
|
||||
|
||||
return nc4_get_att_ptrs(h5, grp, var, norm_name, NULL, memtype,
|
||||
NULL, NULL, value);
|
||||
}
|
||||
|
@ -91,10 +91,10 @@ nc_initialize()
|
||||
#endif
|
||||
#ifdef USE_NETCDF4
|
||||
if((stat = NC4_initialize())) goto done;
|
||||
stat = NC4_provenance_init();
|
||||
#endif /* USE_NETCDF4 */
|
||||
#ifdef USE_HDF5
|
||||
if((stat = NC_HDF5_initialize())) goto done;
|
||||
stat = NC4_provenance_init();
|
||||
#endif
|
||||
#ifdef USE_HDF4
|
||||
if((stat = NC_HDF4_initialize())) goto done;
|
||||
|
@ -68,14 +68,6 @@ nc4_get_att_ptrs(NC_FILE_INFO_T *h5, NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var,
|
||||
if (name == NULL)
|
||||
BAIL(NC_EBADNAME);
|
||||
|
||||
/* If this is one of the reserved atts, use nc_get_att_special. */
|
||||
if (!var)
|
||||
{
|
||||
const NC_reservedatt* ra = NC_findreserved(name);
|
||||
if(ra != NULL && (ra->flags & NAMEONLYFLAG))
|
||||
return nc4_get_att_special(h5, name, xtype, mem_type, lenp, attnum, data);
|
||||
}
|
||||
|
||||
/* Find the attribute, if it exists. */
|
||||
if ((retval = nc4_find_grp_att(grp, varid, name, my_attnum, &att)))
|
||||
return retval;
|
||||
|
Loading…
x
Reference in New Issue
Block a user