herr_t H5ARRAYget_fill_value( hid_t dataset_id, hid_t type_id, int *status, void *value) { hid_t plist_id; /* Get creation properties list */ if ( (plist_id = H5Dget_create_plist(dataset_id)) < 0 ) goto out; /* How the fill value is defined? */ if ( (H5Pfill_value_defined(plist_id, status)) < 0 ) goto out; if ( *status == H5D_FILL_VALUE_USER_DEFINED ) { if ( H5Pget_fill_value(plist_id, type_id, value) < 0 ) goto out; } /* Terminate access to the datatype */ if ( H5Pclose( plist_id ) < 0 ) goto out; return 0; out: return -1; }
//-------------------------------------------------------------------------- // Function: DSetCreatPropList::isFillValueDefined ///\brief Check if fill value has been defined for this property ///\return /// \li \c H5D_FILL_VALUE_UNDEFINED =0, /// \li \c H5D_FILL_VALUE_DEFAULT =1, /// \li \c H5D_FILL_VALUE_USER_DEFINED =2 ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() { H5D_fill_value_t status; herr_t ret_value = H5Pfill_value_defined(id, &status); if( ret_value < 0 ) { throw PropListIException("DSetCreatPropList::isFillValueDefined", "H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)"); } else return (status); }