kharm/hdf5_utils.hpp
// Add an attribute named "units"
Add an attribute named "units"
Add an attribute named " units "
int H5F::add_units(const char *name, const char *unit)
{
    hid_t string_type = H5Tcopy(H5T_C_S1);
    H5Tset_size(string_type, strlen(unit) + 1);
    herr_t err = add_attr(unit, "units", name, string_type);
    if (err < 0)
        FAIL(err, "hdf5_add_units", name);
    H5Tclose(string_type);
    return 0;
}
int H5F :: add_units ( const char * name , const char * unit ) { hid_t string_type = H5Tcopy ( H5T_C_S1 ) ; H5Tset_size ( string_type , strlen ( unit ) + 1 ) ; herr_t err = add_attr ( unit , " " , name , string_type ) ; if ( err < 0 ) FAIL ( err , " " , name ) ; H5Tclose ( string_type ) ; return 0 ; }
Add an attribute named "units"
Add an attribute named " units "