adapted to coding style

This commit is contained in:
2010-05-27 13:27:30 +00:00
parent d3dc68d045
commit f8f1590df8
+43 -43
View File
@@ -17,10 +17,10 @@
*/
h5_err_t
h5_read_attrib (
h5_file_t * const f, /*!< handle to open file */
h5_file_t* const f, /*!< handle to open file */
const hid_t id, /*!< id of HDF5 object */
const char *attrib_name, /*!< name of HDF5 attribute to read */
void * const attrib_value /*!< OUT: attribute value */
const char* attrib_name, /*!< name of HDF5 attribute to read */
void* const attrib_value /*!< OUT: attribute value */
) {
hid_t attrib_id;
hid_t space_id;
@@ -28,15 +28,15 @@ h5_read_attrib (
hid_t mytype;
hsize_t nelem;
TRY ( attrib_id = h5priv_open_hdf5_attribute ( f, id, attrib_name ) );
TRY ( mytype = h5priv_get_hdf5_attribute_type ( f, attrib_id ) );
TRY ( space_id = h5priv_get_hdf5_attribute_dataspace ( f, attrib_id ) );
TRY ( nelem = h5priv_get_npoints_of_hdf5_dataspace ( f, space_id ) );
TRY ( type_id = h5_normalize_h5_type ( f, mytype ) );
TRY ( h5priv_read_hdf5_attribute ( f, attrib_id, type_id, attrib_value ) );
TRY ( h5priv_close_hdf5_dataspace( f, space_id ) );
TRY ( h5priv_close_hdf5_type( f, mytype ) );
TRY ( h5priv_close_hdf5_attribute ( f, attrib_id ) );
TRY( attrib_id = h5priv_open_hdf5_attribute (f, id, attrib_name) );
TRY( mytype = h5priv_get_hdf5_attribute_type (f, attrib_id) );
TRY( space_id = h5priv_get_hdf5_attribute_dataspace (f, attrib_id) );
TRY( nelem = h5priv_get_npoints_of_hdf5_dataspace (f, space_id) );
TRY( type_id = h5_normalize_h5_type (f, mytype) );
TRY( h5priv_read_hdf5_attribute (f, attrib_id, type_id, attrib_value) );
TRY( h5priv_close_hdf5_dataspace(f, space_id) );
TRY( h5priv_close_hdf5_type(f, mytype) );
TRY( h5priv_close_hdf5_attribute (f, attrib_id) );
return H5_SUCCESS;
}
@@ -50,28 +50,28 @@ h5_read_attrib (
*/
h5_err_t
h5_write_attrib (
h5_file_t * const f, /*!< handle to open file */
h5_file_t* const f, /*!< handle to open file */
const hid_t id, /*!< id of HDF5 object */
const char *attrib_name, /*!< name of HDF5 attribute to write */
const char* attrib_name, /*!< name of HDF5 attribute to write */
const hid_t attrib_type, /*!< HDF5 type of attribute */
const void *attrib_value, /*!< value of attribute */
const void* attrib_value, /*!< value of attribute */
const hsize_t attrib_nelem /*!< number of elements (dimension) */
) {
hid_t space_id;
hid_t attrib_id;
TRY ( space_id = h5priv_create_hdf5_dataspace ( f, 1, &attrib_nelem, NULL) );
TRY ( attrib_id = h5priv_create_hdf5_attribute (
TRY( space_id = h5priv_create_hdf5_dataspace (f, 1, &attrib_nelem, NULL) );
TRY( attrib_id = h5priv_create_hdf5_attribute (
f,
id,
attrib_name,
attrib_type,
space_id,
H5P_DEFAULT, H5P_DEFAULT ) );
H5P_DEFAULT, H5P_DEFAULT) );
TRY ( h5priv_write_hdf5_attribute ( f, attrib_id, attrib_type, attrib_value ) );
TRY ( h5priv_close_hdf5_attribute ( f, attrib_id ) );
TRY ( h5priv_close_hdf5_dataspace ( f, space_id ) );
TRY( h5priv_write_hdf5_attribute (f, attrib_id, attrib_type, attrib_value) );
TRY( h5priv_close_hdf5_attribute (f, attrib_id) );
TRY( h5priv_close_hdf5_dataspace (f, space_id) );
return H5_SUCCESS;
}
@@ -85,42 +85,42 @@ h5_write_attrib (
*/
h5_err_t
h5_get_attrib_info (
h5_file_t * const f, /*!< handle to open file */
h5_file_t* const f, /*!< handle to open file */
const hid_t id, /*!< id of HDF5 object */
const h5_int64_t attrib_idx, /*!< index of attribute */
char *attrib_name, /*!< OUT: name of attribute */
char* attrib_name, /*!< OUT: name of attribute */
const h5_int64_t len_attrib_name, /*!< buffer length */
h5_int64_t *attrib_type, /*!< OUT: H5 type of attribute */
h5_int64_t *attrib_nelem /*!< OUT: number of elements (dimension) */
h5_int64_t* attrib_type, /*!< OUT: H5 type of attribute */
h5_int64_t* attrib_nelem /*!< OUT: number of elements (dimension) */
) {
hid_t attrib_id;
hid_t mytype;
hid_t space_id;
TRY ( attrib_id = h5priv_open_hdf5_attribute_idx (
TRY( attrib_id = h5priv_open_hdf5_attribute_idx (
f,
id,
(unsigned int)attrib_idx ) );
(unsigned int)attrib_idx) );
if ( attrib_nelem ) {
TRY ( space_id = h5priv_get_hdf5_attribute_dataspace ( f, attrib_id ) );
TRY ( *attrib_nelem = h5priv_get_npoints_of_hdf5_dataspace (
f, space_id ) );
TRY( h5priv_close_hdf5_dataspace( f, space_id ) );
if (attrib_nelem) {
TRY( space_id = h5priv_get_hdf5_attribute_dataspace (f, attrib_id) );
TRY( *attrib_nelem = h5priv_get_npoints_of_hdf5_dataspace (
f, space_id) );
TRY( h5priv_close_hdf5_dataspace (f, space_id) );
}
if ( attrib_name ) {
TRY ( h5priv_get_hdf5_attribute_name (
if (attrib_name) {
TRY( h5priv_get_hdf5_attribute_name (
f,
attrib_id,
(size_t)len_attrib_name,
attrib_name ) );
attrib_name) );
}
if ( attrib_type ) {
TRY ( mytype = h5priv_get_hdf5_attribute_type ( f, attrib_id ) );
TRY ( *attrib_type = h5_normalize_h5_type ( f, mytype ) );
TRY ( h5priv_close_hdf5_type( f, mytype ) );
if (attrib_type) {
TRY( mytype = h5priv_get_hdf5_attribute_type (f, attrib_id) );
TRY( *attrib_type = h5_normalize_h5_type (f, mytype) );
TRY( h5priv_close_hdf5_type(f, mytype) );
}
TRY ( h5priv_close_hdf5_attribute ( f, attrib_id ) );
TRY( h5priv_close_hdf5_attribute (f, attrib_id) );
return H5_SUCCESS;
}
@@ -134,9 +134,9 @@ h5_get_attrib_info (
*/
h5_ssize_t
h5_get_num_attribs (
h5_file_t * const f, /*!< handle to open file */
h5_file_t* const f, /*!< handle to open file */
const hid_t id
) {
CHECK_FILEHANDLE ( f );
return h5priv_get_num_hdf5_attribute ( f, id );
CHECK_FILEHANDLE (f);
return h5priv_get_num_hdf5_attribute (f, id);
}