/* Copies an SDSInfo struct, its attributes, dimensions and variables. The copy * is deep and typeless (i.e. not tied to NetCDF, HDF, etc.), so a new SDS * file of any type can be created from it. * * The returned data structure still needs to be freed with sds_close() even * if you don't write it to a file. */ SDSInfo *sds_generic_copy(SDSInfo *sds) { SDSAttInfo *gatts = (sds->gatts == NULL) ? NULL : sds_atts_generic_copy(sds->gatts); SDSDimInfo *dims = (sds->dims == NULL) ? NULL : sds_dims_generic_copy(sds->dims); SDSVarInfo *vars = (sds->vars == NULL) ? NULL : sds_vars_generic_copy(sds->vars, dims); return create_sds(gatts, dims, vars); }
SDS sdsdup(const SDS content) { SDS *new_sds = create_sds(content); return new_sds; }