diff --git a/src/C/H5Block.c b/src/C/H5Block.c index 98fa0d4..0652112 100644 --- a/src/C/H5Block.c +++ b/src/C/H5Block.c @@ -423,8 +423,8 @@ H5BlockWriteFieldAttribString ( ) { H5_API_ENTER4 (h5_err_t, "f=%p, " - "field_name=\"%s\"" - "attrib_name=\"%s\"" + "field_name=\"%s\", " + "attrib_name=\"%s\", " "buffer=\"%s\"", f, field_name, @@ -457,8 +457,8 @@ H5BlockReadFieldAttribString ( ) { H5_API_ENTER4 (h5_err_t, "f=%p, " - "field_name=\"%s\"" - "attrib_name=\"%s\"" + "field_name=\"%s\", " + "attrib_name=\"%s\", " "buffer=0x%p", f, field_name, diff --git a/src/C/H5Block_readwrite.c b/src/C/H5Block_readwrite.c index f692d6d..b89caf5 100644 --- a/src/C/H5Block_readwrite.c +++ b/src/C/H5Block_readwrite.c @@ -1,5 +1,4 @@ -#include "H5hut.h" #include "h5core/h5_core.h" /*! @@ -15,18 +14,14 @@ */ h5_err_t H5Block3dWriteScalarFieldFloat64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_float64_t *buffer /*!< IN: scalar data to write */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float64_t *buffer /*!< IN: pointer to write buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_write_scalar_data ( - f, name, - (void*)buffer, - H5T_NATIVE_DOUBLE)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE )); } /*! @@ -42,18 +37,14 @@ H5Block3dWriteScalarFieldFloat64 ( */ h5_err_t H5Block3dReadScalarFieldFloat64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to read */ - h5_float64_t *buffer /*!< OUT: ptr to read buffer */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to read */ + h5_float64_t *buffer /*!< OUT: pointer to read buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_read_scalar_data ( - f, name, - (void*)buffer, - H5T_NATIVE_DOUBLE)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_DOUBLE)); } /*! @@ -61,30 +52,27 @@ H5Block3dReadScalarFieldFloat64 ( */ /*! Write a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_data, \c y_data and \c z_data to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with floating points (64-bit) values. - You must use the Fortran indexing scheme to access items in \c data. + You must use the Fortran indexing scheme to access items in \c x_buf. \return \c H5_SUCCESS or error code */ h5_err_t H5Block3dWriteVector3dFieldFloat64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_float64_t *x_buffer, /*!< IN: X axis data */ - const h5_float64_t *y_buffer, /*!< IN: Y axis data */ - const h5_float64_t *z_buffer /*!< IN: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float64_t *x_buf, /*!< IN: pointer to X axis buffer */ + const h5_float64_t *y_buf, /*!< IN: pointer to Y axis buffer */ + const h5_float64_t *z_buf /*!< IN: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_write_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_DOUBLE)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_write_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE)); } /*! @@ -92,7 +80,7 @@ H5Block3dWriteVector3dFieldFloat64 ( */ /*! Read a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with floating points (64-bit) values. @@ -102,20 +90,17 @@ H5Block3dWriteVector3dFieldFloat64 ( */ h5_err_t H5Block3dReadVector3dFieldFloat64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - h5_float64_t *x_buffer, /*!< OUT: X axis data */ - h5_float64_t *y_buffer, /*!< OUT: Y axis data */ - h5_float64_t *z_buffer /*!< OUT: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float64_t *x_buf, /*!< OUT: pointer to X axis buffer */ + const h5_float64_t *y_buf, /*!< OUT: pointer to Y axis buffer */ + const h5_float64_t *z_buf /*!< OUT: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_read_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_DOUBLE)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_read_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE)); } /*! @@ -131,18 +116,14 @@ H5Block3dReadVector3dFieldFloat64 ( */ h5_err_t H5Block3dWriteScalarFieldFloat32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_float32_t *buffer /*!< IN: scalar data to write */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float32_t *buffer /*!< IN: pointer to write buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_write_scalar_data( - f, name, - (void*)buffer, - H5T_NATIVE_FLOAT)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_FLOAT )); } /*! @@ -158,18 +139,14 @@ H5Block3dWriteScalarFieldFloat32 ( */ h5_err_t H5Block3dReadScalarFieldFloat32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to read */ - h5_float32_t *buffer /*!< OUT: ptr to read buffer */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to read */ + h5_float32_t *buffer /*!< OUT: pointer to read buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_read_scalar_data( - f, name, - (void*)buffer, - H5T_NATIVE_FLOAT)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_FLOAT)); } /*! @@ -177,30 +154,27 @@ H5Block3dReadScalarFieldFloat32 ( */ /*! Write a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with floating points (32-bit) values. - You must use the Fortran indexing scheme to access items in \c data. + You must use the Fortran indexing scheme to access items in \c x_buf. \return \c H5_SUCCESS or error code */ h5_err_t H5Block3dWriteVector3dFieldFloat32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_float32_t *x_buffer, /*!< IN: X axis data */ - const h5_float32_t *y_buffer, /*!< IN: Y axis data */ - const h5_float32_t *z_buffer /*!< IN: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float32_t *x_buf, /*!< IN: pointer to X axis buffer */ + const h5_float32_t *y_buf, /*!< IN: pointer to Y axis buffer */ + const h5_float32_t *z_buf /*!< IN: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_write_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_FLOAT)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_write_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT)); } /*! @@ -208,7 +182,7 @@ H5Block3dWriteVector3dFieldFloat32 ( */ /*! Read a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with floating points (32-bit) values. @@ -218,20 +192,17 @@ H5Block3dWriteVector3dFieldFloat32 ( */ h5_err_t H5Block3dReadVector3dFieldFloat32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - h5_float32_t *x_buffer, /*!< OUT: X axis data */ - h5_float32_t *y_buffer, /*!< OUT: Y axis data */ - h5_float32_t *z_buffer /*!< OUT: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_float32_t *x_buf, /*!< OUT: pointer to X axis buffer */ + const h5_float32_t *y_buf, /*!< OUT: pointer to Y axis buffer */ + const h5_float32_t *z_buf /*!< OUT: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_read_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_FLOAT)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_read_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT)); } /*! @@ -247,18 +218,14 @@ H5Block3dReadVector3dFieldFloat32 ( */ h5_err_t H5Block3dWriteScalarFieldInt64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_int64_t *buffer /*!< IN: scalar data to write */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_int64_t *buffer /*!< IN: pointer to write buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_write_scalar_data ( - f, name, - (void*)buffer, - H5T_NATIVE_INT64)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_INT64 )); } /*! @@ -274,18 +241,14 @@ H5Block3dWriteScalarFieldInt64 ( */ h5_err_t H5Block3dReadScalarFieldInt64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to read */ - h5_int64_t *buffer /*!< OUT: ptr to read buffer */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to read */ + h5_int64_t *buffer /*!< OUT: pointer to read buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_read_scalar_data( - f, name, - (void*)buffer, - H5T_NATIVE_INT64)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_INT64)); } /*! @@ -293,30 +256,27 @@ H5Block3dReadScalarFieldInt64 ( */ /*! Write a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with integers (64-bit) values. - You must use the Fortran indexing scheme to access items in \c data. + You must use the Fortran indexing scheme to access items in \c x_buf. \return \c H5_SUCCESS or error code */ h5_err_t H5Block3dWriteVector3dFieldInt64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_int64_t *x_buffer, /*!< IN: X axis data */ - const h5_int64_t *y_buffer, /*!< IN: Y axis data */ - const h5_int64_t *z_buffer /*!< IN: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_int64_t *x_buf, /*!< IN: pointer to X axis buffer */ + const h5_int64_t *y_buf, /*!< IN: pointer to Y axis buffer */ + const h5_int64_t *z_buf /*!< IN: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_write_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_INT64)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_write_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64)); } /*! @@ -324,7 +284,7 @@ H5Block3dWriteVector3dFieldInt64 ( */ /*! Read a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with integers (64-bit) values. @@ -334,20 +294,17 @@ H5Block3dWriteVector3dFieldInt64 ( */ h5_err_t H5Block3dReadVector3dFieldInt64 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - h5_int64_t *x_buffer, /*!< OUT: X axis data */ - h5_int64_t *y_buffer, /*!< OUT: Y axis data */ - h5_int64_t *z_buffer /*!< OUT: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_int64_t *x_buf, /*!< OUT: pointer to X axis buffer */ + const h5_int64_t *y_buf, /*!< OUT: pointer to Y axis buffer */ + const h5_int64_t *z_buf /*!< OUT: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_read_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_INT64)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_read_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64)); } /*! @@ -363,18 +320,14 @@ H5Block3dReadVector3dFieldInt64 ( */ h5_err_t H5Block3dWriteScalarFieldInt32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *name, /*!< IN: name of dataset to write */ - const h5_int32_t *buffer /*!< IN: scalar data to write */ + const h5_int32_t *buffer /*!< IN: pointer to write buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_write_scalar_data( - f, name, - (void*)buffer, - H5T_NATIVE_INT32)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, H5T_NATIVE_INT32 )); } /*! @@ -390,18 +343,14 @@ H5Block3dWriteScalarFieldInt32 ( */ h5_err_t H5Block3dReadScalarFieldInt32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *name, /*!< IN: name of dataset to read */ - h5_int32_t *buffer /*!< OUT: ptr to read buffer */ + h5_int32_t *buffer /*!< OUT: pointer to read buffer */ ) { - H5_API_ENTER3 (h5_err_t, - "f=0x%p, name=\"%s\", buffer=0x%p", - f, name, buffer); - H5_API_RETURN ( - h5b_read_scalar_data( - f, name, - (void*)buffer, - H5T_NATIVE_INT32)); + + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, H5T_NATIVE_INT32)); } /*! @@ -409,30 +358,27 @@ H5Block3dReadScalarFieldInt32 ( */ /*! Write a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with integers (32-bit) values. - You must use the Fortran indexing scheme to access items in \c data. + You must use the Fortran indexing scheme to access items in \c x_buf. \return \c H5_SUCCESS or error code */ h5_err_t H5Block3dWriteVector3dFieldInt32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_int32_t *x_buffer, /*!< IN: X axis data */ - const h5_int32_t *y_buffer, /*!< IN: Y axis data */ - const h5_int32_t *z_buffer /*!< IN: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_int32_t *x_buf, /*!< IN: pointer to X axis buffer */ + const h5_int32_t *y_buf, /*!< IN: pointer to Y axis buffer */ + const h5_int32_t *z_buf /*!< IN: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_write_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_INT32)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_write_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32)); } /*! @@ -440,7 +386,7 @@ H5Block3dWriteVector3dFieldInt32 ( */ /*! Read a 3-dimensional field \c name with 3-dimensional vectors as values - from the buffers starting at \c x_buffer, \c y_buffer and \c z_buffer to the + from the buffers starting at \c x_buf, \c y_buf and \c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with integers (32-bit) values. @@ -450,20 +396,17 @@ H5Block3dWriteVector3dFieldInt32 ( */ h5_err_t H5Block3dReadVector3dFieldInt32 ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - h5_int32_t *x_buffer, /*!< OUT: X axis data */ - h5_int32_t *y_buffer, /*!< OUT: Y axis data */ - h5_int32_t *z_buffer /*!< OUT: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_int32_t *x_buf, /*!< OUT: pointer to X axis buffer */ + const h5_int32_t *y_buf, /*!< OUT: pointer to Y axis buffer */ + const h5_int32_t *z_buf /*!< OUT: pointer to Z axis buffer */ ) { - H5_API_ENTER5 (h5_err_t, - "f=0x%p, name=\"%s\", x_buffer=0x%p, y_buffer=0x%p, z_buffer=0x%p", - f, name, x_buffer, y_buffer, z_buffer); - H5_API_RETURN ( - h5b_read_vector3d_data( - f, name, - (void*)x_buffer, (void*)y_buffer, (void*)z_buffer, - H5T_NATIVE_INT32)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_read_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32)); } /*! @@ -476,30 +419,23 @@ H5Block3dReadVector3dFieldInt32 ( */ h5_err_t H5BlockWriteFieldAttribFloat64 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ const h5_float64_t *buffer, /*!< IN: attribute values */ - const h5_size_t len_buffer /*!< IN: number of elements */ + const h5_size_t nelems /*!< IN: number of elements */ ) { - H5_API_ENTER5 (h5_err_t, - "f=%p field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p, " - "len_buffer=%lld", - f, - field_name, - attrib_name, - buffer, - (long long)len_buffer); - H5_API_RETURN ( - h5_write_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_DOUBLE, - buffer, - len_buffer)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld", + f, field_name, attrib_name, buffer, (long long)nelems); + H5_API_RETURN(h5_write_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_DOUBLE, + buffer, + nelems )); } /*! @@ -512,25 +448,20 @@ H5BlockWriteFieldAttribFloat64 ( */ h5_err_t H5BlockReadFieldAttribFloat64 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ h5_float64_t *buffer /*!< OUT: attribute values */ ) { - H5_API_ENTER4 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p", - f, - field_name, - attrib_name, - buffer); - H5_API_RETURN (h5_read_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_DOUBLE, - (void*)buffer)); + + H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\"%s\", attrib_name=\"%s\", buffer=0x%p", + f, field_name, attrib_name, buffer); + H5_API_RETURN(h5_read_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_DOUBLE, + (void*)buffer )); } /*! @@ -543,29 +474,23 @@ H5BlockReadFieldAttribFloat64 ( */ h5_err_t H5BlockWriteFieldAttribFloat32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ const h5_float32_t *buffer, /*!< IN: attribute values */ - const h5_size_t len_buffer /*!< IN: number of elements */ + const h5_size_t nelems /*!< IN: number of elements */ ) { - H5_API_ENTER5 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p, len_buffer=%llu", - f, - field_name, - attrib_name, - buffer, - (long long unsigned)len_buffer); - H5_API_RETURN ( - h5_write_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_FLOAT, - buffer, - len_buffer)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld", + f, field_name, attrib_name, buffer, (long long)nelems); + H5_API_RETURN(h5_write_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_FLOAT, + buffer, + nelems )); } /*! @@ -578,26 +503,20 @@ H5BlockWriteFieldAttribFloat32 ( */ h5_err_t H5BlockReadFieldAttribFloat32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ h5_float32_t *buffer /*!< OUT: attribute values */ ) { - H5_API_ENTER4 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p", - f, - field_name, - attrib_name, - buffer); - H5_API_RETURN ( - h5_read_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_FLOAT, - (void*)buffer)); + + H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\"%s\", attrib_name=\"%s\", buffer=0x%p", + f, field_name, attrib_name, buffer); + H5_API_RETURN(h5_read_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_FLOAT, + (void*)buffer )); } /*! @@ -610,29 +529,23 @@ H5BlockReadFieldAttribFloat32 ( */ h5_err_t H5BlockWriteFieldAttribInt64 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ const h5_int64_t *buffer, /*!< IN: attribute values */ - const h5_size_t len_buffer /*!< IN: number of elements */ + const h5_size_t nelems /*!< IN: number of elements */ ) { - H5_API_ENTER5 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p, len_buffer=%llu", - f, - field_name, - attrib_name, - buffer, - (long long unsigned)len_buffer); - H5_API_RETURN ( - h5_write_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_INT64, - buffer, - len_buffer)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld", + f, field_name, attrib_name, buffer, (long long)nelems); + H5_API_RETURN(h5_write_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_INT64, + buffer, + nelems )); } /*! @@ -645,26 +558,20 @@ H5BlockWriteFieldAttribInt64 ( */ h5_err_t H5BlockReadFieldAttribInt64 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ h5_int64_t *buffer /*!< OUT: attribute values */ ) { - H5_API_ENTER4 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p", - f, - field_name, - attrib_name, - buffer); - H5_API_RETURN ( - h5_read_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_INT64, - (void*)buffer)); + + H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\"%s\", attrib_name=\"%s\", buffer=0x%p", + f, field_name, attrib_name, buffer); + H5_API_RETURN(h5_read_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_INT64, + (void*)buffer )); } /*! @@ -677,29 +584,23 @@ H5BlockReadFieldAttribInt64 ( */ h5_err_t H5BlockWriteFieldAttribInt32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ const h5_int32_t *buffer, /*!< IN: attribute values */ - const h5_size_t len_buffer /*!< IN: number of elements */ + const h5_size_t nelems /*!< IN: number of elements */ ) { - H5_API_ENTER5 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p, len_buffer=%llu", - f, - field_name, - attrib_name, - buffer, - (long long unsigned)len_buffer); - H5_API_RETURN ( - h5_write_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_INT32, - buffer, - len_buffer)); + + H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld", + f, field_name, attrib_name, buffer, (long long)nelems); + H5_API_RETURN(h5_write_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_INT32, + buffer, + nelems )); } /*! @@ -712,24 +613,18 @@ H5BlockWriteFieldAttribInt32 ( */ h5_err_t H5BlockReadFieldAttribInt32 ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ h5_int32_t *buffer /*!< OUT: attribute values */ ) { - H5_API_ENTER4 (h5_err_t, - "f=%p, field_name=\"%s\", " - "attrib_name=\"%s\", " - "buffer=%p", - f, - field_name, - attrib_name, - buffer); - H5_API_RETURN ( - h5_read_field_attrib ( - f, - field_name, - attrib_name, - H5T_NATIVE_INT32, - (void*)buffer)); + + H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\"%s\", attrib_name=\"%s\", buffer=0x%p", + f, field_name, attrib_name, buffer); + H5_API_RETURN(h5_read_field_attrib ( + f, + field_name, + attrib_name, + H5T_NATIVE_INT32, + (void*)buffer )); } diff --git a/src/C/generate-h5b-readwrite.py b/src/C/generate-h5b-readwrite.py index c065a6d..02dd447 100755 --- a/src/C/generate-h5b-readwrite.py +++ b/src/C/generate-h5b-readwrite.py @@ -32,18 +32,18 @@ fc_head = """ write_scalar_h = """ h5_err_t H5Block#DIM#dWriteScalarField#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_#TYPE_H5P#_t *data + const h5_#TYPE_H5P#_t *buffer ); """ read_scalar_h = """ h5_err_t H5Block#DIM#dReadScalarField#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_#TYPE_H5P#_t *data + h5_#TYPE_H5P#_t *buffer ); """ @@ -61,14 +61,14 @@ write_scalar_c = """ */ h5_err_t H5Block#DIM#dWriteScalarField#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_#TYPE_H5P#_t *data /*!< IN: scalar data to write */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_#TYPE_H5P#_t *buffer /*!< IN: pointer to write buffer */ ) { - SET_FNAME( f, __func__ ); - - return h5b_write_scalar_data(f, name, (void*)data, #TYPE_HDF5# ); + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_write_scalar_data(f, name, (void*)buffer, #TYPE_HDF5# )); } """ @@ -86,14 +86,14 @@ read_scalar_c = """ */ h5_err_t H5Block#DIM#dReadScalarField#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to read */ - h5_#TYPE_H5P#_t *data /*!< OUT: ptr to read buffer */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to read */ + h5_#TYPE_H5P#_t *buffer /*!< OUT: pointer to read buffer */ ) { - SET_FNAME( f, __func__ ); - - return h5b_read_scalar_data(f, name, (void*)data, #TYPE_HDF5#); + H5_API_ENTER3 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p", + f, name, buffer); + H5_API_RETURN (h5b_read_scalar_data(f, name, (void*)buffer, #TYPE_HDF5#)); } """ @@ -102,10 +102,10 @@ write_scalar_fi = """ !! See \\ref H5Block#DIM#dWriteScalarField#TYPE_ABV# !! \\return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - #TYPE_F90#, INTENT(IN) :: data(*) !< the array of data + #TYPE_F90#, INTENT(IN) :: buffer(*) !< the array of data END FUNCTION """ @@ -114,10 +114,10 @@ read_scalar_fi = """ !! See \\ref H5Block#DIM#dReadScalarField#TYPE_ABV# !! \\return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - #TYPE_F90#, INTENT(OUT) :: data(*) !< buffer to read the data into + #TYPE_F90#, INTENT(OUT) :: buffer(*) !< buffer to read the data into END FUNCTION """ @@ -130,19 +130,20 @@ write_scalar_fc = """ h5_err_t h5bl_#DIM#d_write_scalar_field_#TYPE_F90_ABV# ( - h5_int64_t *f, - const char *field_name, - const h5_#TYPE_H5P#_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_#TYPE_H5P#_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_scalar_data ( - filehandle, field_name2, (void*)data, #TYPE_HDF5# ); - free ( field_name2 ); - return herr; + fh, name2, (void*)buffer, #TYPE_HDF5# ); + free ( name2 ); + H5_API_RETURN(herr); } """ @@ -155,41 +156,42 @@ read_scalar_fc = """ h5_err_t h5bl_#DIM#d_read_scalar_field_#TYPE_F90_ABV# ( - h5_int64_t *f, - const char *field_name, - h5_#TYPE_H5P#_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_#TYPE_H5P#_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\\"%s\\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_scalar_data ( - filehandle, field_name2, data, #TYPE_HDF5# ); - free ( field_name2 ); - return herr; + fh, name2, buffer, #TYPE_HDF5# ); + free ( name2 ); + H5_API_RETURN(herr); } """ write_vector_h = """ h5_err_t H5Block#DIM#dWriteVector3dField#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_#TYPE_H5P#_t *x_data, - const h5_#TYPE_H5P#_t *y_data, - const h5_#TYPE_H5P#_t *z_data + const h5_#TYPE_H5P#_t *x_buf, + const h5_#TYPE_H5P#_t *y_buf, + const h5_#TYPE_H5P#_t *z_buf ); """ read_vector_h = """ h5_err_t H5Block#DIM#dReadVector3dField#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_#TYPE_H5P#_t *x_data, - h5_#TYPE_H5P#_t *y_data, - h5_#TYPE_H5P#_t *z_data + h5_#TYPE_H5P#_t *x_buf, + h5_#TYPE_H5P#_t *y_buf, + h5_#TYPE_H5P#_t *z_buf ); """ @@ -199,27 +201,27 @@ write_vector_c = """ */ /*! Write a 3-dimensional field \\c name with 3-dimensional vectors as values - from the buffers starting at \\c x_data, \\c y_data and \\c z_data to the + from the buffers starting at \\c x_buf, \\c y_buf and \\c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with #TYPE_FULL# values. - You must use the Fortran indexing scheme to access items in \\c data. + You must use the Fortran indexing scheme to access items in \\c x_buf. \\return \\c H5_SUCCESS or error code */ h5_err_t H5Block#DIM#dWriteVector3dField#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - const h5_#TYPE_H5P#_t *x_data, /*!< IN: X axis data */ - const h5_#TYPE_H5P#_t *y_data, /*!< IN: Y axis data */ - const h5_#TYPE_H5P#_t *z_data /*!< IN: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_#TYPE_H5P#_t *x_buf, /*!< IN: pointer to X axis buffer */ + const h5_#TYPE_H5P#_t *y_buf, /*!< IN: pointer to Y axis buffer */ + const h5_#TYPE_H5P#_t *z_buf /*!< IN: pointer to Z axis buffer */ ) { - SET_FNAME( f, __func__ ); - - return h5b_write_vector3d_data(f, name, - (void*)x_data, (void*)y_data, (void*)z_data, #TYPE_HDF5#); + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_write_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5#)); } """ @@ -229,7 +231,7 @@ read_vector_c = """ */ /*! Read a 3-dimensional field \\c name with 3-dimensional vectors as values - from the buffers starting at \\c x_data, \\c y_data and \\c z_data to the + from the buffers starting at \\c x_buf, \\c y_buf and \\c z_buf to the current time-step using the defined field layout. Values are 3-dimensional vectors with #TYPE_FULL# values. @@ -239,17 +241,17 @@ read_vector_c = """ */ h5_err_t H5Block#DIM#dReadVector3dField#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ - const char *name, /*!< IN: name of dataset to write */ - h5_#TYPE_H5P#_t *x_data, /*!< OUT: X axis data */ - h5_#TYPE_H5P#_t *y_data, /*!< OUT: Y axis data */ - h5_#TYPE_H5P#_t *z_data /*!< OUT: Z axis data */ + h5_file_t *const f, /*!< IN: file handle */ + const char *name, /*!< IN: name of dataset to write */ + const h5_#TYPE_H5P#_t *x_buf, /*!< OUT: pointer to X axis buffer */ + const h5_#TYPE_H5P#_t *y_buf, /*!< OUT: pointer to Y axis buffer */ + const h5_#TYPE_H5P#_t *z_buf /*!< OUT: pointer to Z axis buffer */ ) { - SET_FNAME( f, __func__ ); - - return h5b_read_vector3d_data(f, name, - (void*)x_data, (void*)y_data, (void*)z_data, #TYPE_HDF5#); + H5_API_ENTER5 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p", + f, name, x_buf, y_buf, z_buf); + H5_API_RETURN(h5b_read_vector3d_data(f, name, + (void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5#)); } """ @@ -290,22 +292,23 @@ write_vector_fc = """ h5_err_t h5bl_#DIM#d_write_vector3d_field_#TYPE_F90_ABV# ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - const h5_#TYPE_H5P#_t *xval, /*!< array of x component data */ - const h5_#TYPE_H5P#_t *yval, /*!< array of y component data */ - const h5_#TYPE_H5P#_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_#TYPE_H5P#_t *x_buf, + const h5_#TYPE_H5P#_t *y_buf, + const h5_#TYPE_H5P#_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, #TYPE_HDF5# ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5# ); + free ( name2 ); + H5_API_RETURN(herr); } """ @@ -318,33 +321,34 @@ read_vector_fc = """ h5_err_t h5bl_#DIM#d_read_vector3d_field_#TYPE_F90_ABV# ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - h5_#TYPE_H5P#_t *xval, /*!< array of x component data */ - h5_#TYPE_H5P#_t *yval, /*!< array of y component data */ - h5_#TYPE_H5P#_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_#TYPE_H5P#_t *x_buf, + h5_#TYPE_H5P#_t *y_buf, + h5_#TYPE_H5P#_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\\"%s\\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, #TYPE_HDF5# ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, #TYPE_HDF5# ); + free ( name2 ); + H5_API_RETURN(herr); } """ write_attr_h = """ h5_err_t H5BlockWriteFieldAttrib#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, - const h5_#TYPE_H5P#_t *values, - const h5_size_t nvalues + const h5_#TYPE_H5P#_t *buffer, + const h5_size_t nelems ); """ @@ -359,22 +363,23 @@ write_attr_c = """ */ h5_err_t H5BlockWriteFieldAttrib#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ - const h5_#TYPE_H5P#_t *values, /*!< IN: attribute values */ - const h5_size_t nvalues /*!< IN: number of elements */ + const h5_#TYPE_H5P#_t *buffer, /*!< IN: attribute values */ + const h5_size_t nelems /*!< IN: number of elements */ ) { - SET_FNAME( f, __func__ ); - - return h5_write_field_attrib ( + H5_API_ENTER5 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", " + "buffer=0x%p, nelems=%lld", + f, field_name, attrib_name, buffer, (long long)nelems); + H5_API_RETURN(h5_write_field_attrib ( f, field_name, attrib_name, #TYPE_HDF5#, - values, - nvalues ); + buffer, + nelems )); } """ @@ -387,8 +392,8 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_#TYPE_F90_ABV# ( filehandle, field_name INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - #TYPE_F90#, INTENT(IN) :: values(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array + #TYPE_F90#, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION """ @@ -401,32 +406,35 @@ write_attr_fc = """ h5_err_t h5bl_writefieldattrib_#TYPE_F90_ABV# ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const h5_#TYPE_H5P#_t *values, - const h5_size_t *nvalues, + const h5_#TYPE_H5P#_t *buffer, + const h5_size_t *nelems, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", " + "buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, (long long)*nelems, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - #TYPE_HDF5#, values, *nvalues ); + fh, field_name2, attrib_name2, + #TYPE_HDF5#, buffer, *nelems ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } """ read_attr_h = """ h5_err_t H5BlockReadFieldAttrib#TYPE_ABV# ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, h5_#TYPE_H5P#_t *buffer @@ -444,20 +452,20 @@ read_attr_c = """ */ h5_err_t H5BlockReadFieldAttrib#TYPE_ABV# ( - h5_file_t *f, /*!< IN: file handle */ + h5_file_t *const f, /*!< IN: file handle */ const char *field_name, /*!< IN: field name */ const char *attrib_name, /*!< IN: attribute name */ h5_#TYPE_H5P#_t *buffer /*!< OUT: attribute values */ ) { - SET_FNAME( f, __func__ ); - - return h5_read_field_attrib ( + H5_API_ENTER4 (h5_err_t, "f=%p, field_name=\\\"%s\\", attrib_name=\\"%s\\", buffer=0x%p", + f, field_name, attrib_name, buffer); + H5_API_RETURN(h5_read_field_attrib ( f, field_name, attrib_name, #TYPE_HDF5#, - (void*)buffer); + (void*)buffer )); } """ @@ -470,7 +478,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_#TYPE_F90_ABV# ( filehandle, field_name, INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - #TYPE_F90#, INTENT(IN) :: values(*) !< the buffer to read into + #TYPE_F90#, INTENT(IN) :: buffer(*) !< the buffer to read into END FUNCTION """ @@ -483,23 +491,26 @@ read_attr_fc = """ h5_err_t h5bl_readfieldattrib_#TYPE_F90_ABV# ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - h5_#TYPE_H5P#_t *values, + h5_#TYPE_H5P#_t *buffer, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\\"%s\\", attrib_name=\\"%s\\", " + "values=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, #TYPE_HDF5#, values ); + fh, field_name2, attrib_name2, #TYPE_HDF5#, buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } """ diff --git a/src/Fortran/H5Block_F.c b/src/Fortran/H5Block_F.c index 01da8f5..10b3033 100755 --- a/src/Fortran/H5Block_F.c +++ b/src/Fortran/H5Block_F.c @@ -52,173 +52,202 @@ h5_err_t h5bl_3d_setview ( - h5_int64_t *f, + h5_int64_t *const f, const h5_int64_t *i_start, /*!< start index of i */ const h5_int64_t *i_end, /*!< end index of i */ const h5_int64_t *j_start, /*!< start index of j */ const h5_int64_t *j_end, /*!< end index of j */ const h5_int64_t *k_start, /*!< start index of k */ - const h5_int64_t *k_end /*!< end index of k */ + const h5_int64_t *k_end /*!< end index of k */ ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5b_3d_set_view ( - filehandle, + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, + "f=0X%p, " + "i_start=%lld, i_end=%lld, " + "j_start=%lld, j_end=%lld, " + "k_start=%lld, k_end=%lld", + fh, + (long long)i_start, (long long)i_end, + (long long)j_start, (long long)j_end, + (long long)k_start, (long long)k_end); + H5_API_RETURN(h5b_3d_set_view ( + fh, *i_start-1, *i_end-1, *j_start-1, *j_end-1, - *k_start-1, *k_end-1 ); + *k_start-1, *k_end-1 )); } h5_err_t h5bl_3d_setchunk ( - h5_int64_t *f, + h5_int64_t *const f, const h5_int64_t *i, const h5_int64_t *j, const h5_int64_t *k ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5b_3d_set_chunk ( filehandle, *i, *j, *k ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, + "f=0x%p, i=%lld, j=%lld, k=%lld", + fh, (long long)i, (long long)j, (long long)k); + H5_API_RETURN(h5b_3d_set_chunk ( fh, *i, *j, *k )); } h5_err_t h5bl_3d_getview ( - h5_int64_t *f, - h5_int64_t *i_start, - h5_int64_t *i_end, - h5_int64_t *j_start, - h5_int64_t *j_end, - h5_int64_t *k_start, - h5_int64_t *k_end + h5_int64_t *const f, + h5_int64_t *const i_start, + h5_int64_t *const i_end, + h5_int64_t *const j_start, + h5_int64_t *const j_end, + h5_int64_t *const k_start, + h5_int64_t *const k_end ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - h5_err_t herr = h5b_3d_get_view ( - filehandle, - i_start, i_end, j_start, j_end, k_start, k_end ); - if ( herr < 0 ) return herr; - - return H5_SUCCESS; + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, + "f=0X%p, " + "i_start=0x%p, i_end=0x%p, " + "j_start=0x%p, j_end=0x%p, " + "k_start=0x%p, k_end=0x%p", + fh, + i_start, i_end, + j_start, j_end, + k_start, k_end); + H5_API_RETURN(h5b_3d_get_view ( + fh, + i_start, i_end, j_start, j_end, k_start, k_end )); } h5_err_t h5bl_3d_getreducedview ( - h5_int64_t *f, - h5_int64_t *i_start, - h5_int64_t *i_end, - h5_int64_t *j_start, - h5_int64_t *j_end, - h5_int64_t *k_start, - h5_int64_t *k_end + h5_int64_t *const f, + h5_int64_t *const i_start, + h5_int64_t *const i_end, + h5_int64_t *const j_start, + h5_int64_t *const j_end, + h5_int64_t *const k_start, + h5_int64_t *const k_end ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - h5_err_t herr = h5b_3d_get_reduced_view ( - filehandle, - i_start, i_end, j_start, j_end, k_start, k_end ); - if ( herr < 0 ) return herr; - - return H5_SUCCESS; + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, + "f=0X%p, " + "i_start=0x%p, i_end=0x%p, " + "j_start=0x%p, j_end=0x%p, " + "k_start=0x%p, k_end=0x%p", + fh, + i_start, i_end, + j_start, j_end, + k_start, k_end); + H5_API_RETURN(h5b_3d_get_reduced_view ( + fh, + i_start, i_end, j_start, j_end, k_start, k_end )); } h5_int64_t h5bl_3d_hasview ( - h5_int64_t *f + h5_int64_t *const f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5b_3d_has_view ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1 (h5_int64_t, "f=0x%p", fh); + H5_API_RETURN(h5b_3d_has_view ( fh )); } h5_err_t h5bl_getnumfields ( - h5_int64_t *f /*!< file handle */ + h5_int64_t *const f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5b_get_num_fields ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1 (h5_int64_t, "f=0x%p", fh); + H5_API_RETURN(h5b_get_num_fields ( fh )); } h5_err_t h5bl_getfieldinfo ( - h5_int64_t *f, + h5_int64_t *const f, const h5_int64_t *idx, - char *field_name, + char *name, h5_size_t *field_rank, h5_size_t *field_dims, h5_size_t *elem_rank, h5_int64_t *type, - const int l_field_name + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER8 (h5_err_t, + "f=0x%p, idx=%lld, " + "name=0x%p," + "field_rank=0x%p, field_dims=0x%p, elem_rank=0x%p, type=0x%p, l_name=%d", + fh, (long long)*idx, name, + field_rank, field_dims, elem_rank, type, l_name); h5_err_t herr = h5b_get_field_info ( - filehandle, *idx, field_name, l_field_name, + fh, *idx, name, (h5_size_t)l_name, field_rank, field_dims, elem_rank, type ); - h5_strc2for ( field_name, l_field_name ); - return herr; + h5_strc2for ( name, l_name ); + H5_API_RETURN(herr); } h5_err_t h5bl_writefieldattrib_string ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const char *attrib_value, + const char *buffer, const int l_field_name, const int l_attrib_name, - const int l_attrib_value + const int l_buffer ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); - char *attrib_value2 = h5_strdupfor2c ( attrib_value, l_attrib_value ); - + char *buffer2 = h5_strdupfor2c ( buffer, l_buffer ); + H5_API_ENTER7 (h5_err_t, + "f=%p, " + "field_name=\"%s\", " + "attrib_name=\"%s\", " + "buffer=\"%s\", " + "l_field_name=%d, " + "l_attrib_name=%d, " + "l_buffer=%d", + fh, + field_name2, + attrib_name2, + buffer2, l_field_name, l_attrib_name, l_buffer); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - H5T_NATIVE_CHAR, attrib_value2, strlen(attrib_value2)+1 ); + fh, field_name2, attrib_name2, + H5_STRING_T, buffer2, strlen(buffer2)+1 ); free ( field_name2 ); free ( attrib_name2 ); - free ( attrib_value2 ); - return herr; + free ( buffer2 ); + H5_API_RETURN(herr); } h5_err_t h5bl_getnfieldattribs ( - h5_int64_t *f, - const char *field_name, - const int l_field_name + h5_int64_t *const f, + const char *name, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); - - h5_err_t herr = h5b_get_num_field_attribs ( - filehandle, field_name2 ); - - free ( field_name2 ); - return herr; + h5_file_t *fh = h5_filehandlefor2c(f); + char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER3 (h5_err_t, + "f=0x%p, name=\"%s\", l_name=%d", fh, name2, l_name); + h5_err_t herr = h5b_get_num_field_attribs ( fh, name2 ); + free ( name2 ); + H5_API_RETURN(herr); } h5_err_t h5bl_getfieldattribinfo ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const h5_int64_t *attrib_idx, char *attrib_name, @@ -227,15 +256,21 @@ h5bl_getfieldattribinfo ( const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - h5_int64_t attrib_type; - - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + H5_API_ENTER7 (h5_err_t, + "f=%p field_name=\"%s\", " + "attrib_idx=%lld, " + "attrib_name=0x%p, " + "attrib_nelem=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, + field_name2, + (long long)*attrib_idx, + attrib_name, attrib_nelem, l_field_name, l_attrib_name); + h5_int64_t attrib_type; h5_err_t herr = h5b_get_field_attrib_info ( - filehandle, field_name2, *attrib_idx, + fh, field_name2, *attrib_idx, attrib_name, l_attrib_name, &attrib_type, attrib_nelem ); @@ -243,35 +278,43 @@ h5bl_getfieldattribinfo ( h5_strc2for ( attrib_name, l_attrib_name ); free ( field_name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t h5bl_readfieldattrib_string ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - char *attrib_value, + char *buffer, const int l_field_name, const int l_attrib_name, - const int l_attrib_value + const int l_buffer ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); + H5_API_ENTER7 (h5_err_t, + "f=%p, " + "field_name=\"%s\", " + "attrib_name=\"%s\", " + "buffer=0x%p, l_field_name=%d, l_attrib_name=%d, l_buffer=%d", + fh, + field_name, + attrib_name, + buffer, l_field_name, l_attrib_name, l_buffer); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, - H5_STRING_T, attrib_value ); + fh, field_name2, attrib_name2, + H5_STRING_T, buffer ); - h5_strc2for ( attrib_value, l_attrib_value ); + h5_strc2for ( buffer, l_buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + + H5_API_RETURN(herr); } diff --git a/src/Fortran/H5Block_readwrite.f90 b/src/Fortran/H5Block_readwrite.f90 index 706c25f..a5639f3 100644 --- a/src/Fortran/H5Block_readwrite.f90 +++ b/src/Fortran/H5Block_readwrite.f90 @@ -3,20 +3,20 @@ !! See \ref H5Block3dWriteScalarFieldFloat64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r8 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - REAL*8, INTENT(IN) :: data(*) !< the array of data + REAL*8, INTENT(IN) :: buffer(*) !< the array of data END FUNCTION !> \ingroup h5block_data_f !! See \ref H5Block3dReadScalarFieldFloat64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r8 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - REAL*8, INTENT(OUT) :: data(*) !< buffer to read the data into + REAL*8, INTENT(OUT) :: buffer(*) !< buffer to read the data into END FUNCTION !> \ingroup h5block_data_f @@ -47,20 +47,20 @@ END FUNCTION !! See \ref H5Block3dWriteScalarFieldFloat32 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_r4 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - REAL*4, INTENT(IN) :: data(*) !< the array of data + REAL*4, INTENT(IN) :: buffer(*) !< the array of data END FUNCTION !> \ingroup h5block_data_f !! See \ref H5Block3dReadScalarFieldFloat32 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_r4 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - REAL*4, INTENT(OUT) :: data(*) !< buffer to read the data into + REAL*4, INTENT(OUT) :: buffer(*) !< buffer to read the data into END FUNCTION !> \ingroup h5block_data_f @@ -91,20 +91,20 @@ END FUNCTION !! See \ref H5Block3dWriteScalarFieldInt64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i8 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - INTEGER*8, INTENT(IN) :: data(*) !< the array of data + INTEGER*8, INTENT(IN) :: buffer(*) !< the array of data END FUNCTION !> \ingroup h5block_data_f !! See \ref H5Block3dReadScalarFieldInt64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i8 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read the data into + INTEGER*8, INTENT(OUT) :: buffer(*) !< buffer to read the data into END FUNCTION !> \ingroup h5block_data_f @@ -135,20 +135,20 @@ END FUNCTION !! See \ref H5Block3dWriteScalarFieldInt32 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_write_scalar_field_i4 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - INTEGER*4, INTENT(IN) :: data(*) !< the array of data + INTEGER*4, INTENT(IN) :: buffer(*) !< the array of data END FUNCTION !> \ingroup h5block_data_f !! See \ref H5Block3dReadScalarFieldInt32 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, data ) +INTEGER*8 FUNCTION h5bl_3d_read_scalar_field_i4 ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the dataset - INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read the data into + INTEGER*4, INTENT(OUT) :: buffer(*) !< buffer to read the data into END FUNCTION !> \ingroup h5block_data_f @@ -183,8 +183,8 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_r8 ( filehandle, field_name, attrib_nam INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - REAL*8, INTENT(IN) :: values(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array + REAL*8, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION !> \ingroup h5block_attrib_f @@ -195,7 +195,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_r8 ( filehandle, field_name, attrib_name INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - REAL*8, INTENT(IN) :: values(*) !< the buffer to read into + REAL*8, INTENT(IN) :: buffer(*) !< the buffer to read into END FUNCTION !> \ingroup h5block_attrib_f @@ -206,8 +206,8 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_r4 ( filehandle, field_name, attrib_nam INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - REAL*4, INTENT(IN) :: values(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array + REAL*4, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION !> \ingroup h5block_attrib_f @@ -218,7 +218,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_r4 ( filehandle, field_name, attrib_name INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - REAL*4, INTENT(IN) :: values(*) !< the buffer to read into + REAL*4, INTENT(IN) :: buffer(*) !< the buffer to read into END FUNCTION !> \ingroup h5block_attrib_f @@ -229,8 +229,8 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_i8 ( filehandle, field_name, attrib_nam INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - INTEGER*8, INTENT(IN) :: values(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array + INTEGER*8, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION !> \ingroup h5block_attrib_f @@ -241,7 +241,7 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_i8 ( filehandle, field_name, attrib_name INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - INTEGER*8, INTENT(IN) :: values(*) !< the buffer to read into + INTEGER*8, INTENT(IN) :: buffer(*) !< the buffer to read into END FUNCTION !> \ingroup h5block_attrib_f @@ -252,8 +252,8 @@ INTEGER*8 FUNCTION h5bl_writefieldattrib_i4 ( filehandle, field_name, attrib_nam INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - INTEGER*4, INTENT(IN) :: values(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nvalues !< the number of elements in the array + INTEGER*4, INTENT(IN) :: buffer(*) !< the array of data to write into the attribute + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION !> \ingroup h5block_attrib_f @@ -264,5 +264,5 @@ INTEGER*8 FUNCTION h5bl_readfieldattrib_i4 ( filehandle, field_name, attrib_name INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open CHARACTER(LEN=*), INTENT(IN) :: field_name !< the name of the field CHARACTER(LEN=*), INTENT(IN) :: attrib_name !< the name of the attribute - INTEGER*4, INTENT(IN) :: values(*) !< the buffer to read into + INTEGER*4, INTENT(IN) :: buffer(*) !< the buffer to read into END FUNCTION diff --git a/src/Fortran/H5Block_readwrite_F.c b/src/Fortran/H5Block_readwrite_F.c index f01b335..61d60e0 100644 --- a/src/Fortran/H5Block_readwrite_F.c +++ b/src/Fortran/H5Block_readwrite_F.c @@ -21,19 +21,20 @@ h5_err_t h5bl_3d_write_scalar_field_r8 ( - h5_int64_t *f, - const char *field_name, - const h5_float64_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_float64_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_scalar_data ( - filehandle, field_name2, (void*)data, H5T_NATIVE_DOUBLE ); - free ( field_name2 ); - return herr; + fh, name2, (void*)buffer, H5T_NATIVE_DOUBLE ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -44,19 +45,20 @@ h5bl_3d_write_scalar_field_r8 ( h5_err_t h5bl_3d_read_scalar_field_r8 ( - h5_int64_t *f, - const char *field_name, - h5_float64_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_float64_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_scalar_data ( - filehandle, field_name2, data, H5T_NATIVE_DOUBLE ); - free ( field_name2 ); - return herr; + fh, name2, buffer, H5T_NATIVE_DOUBLE ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -67,22 +69,23 @@ h5bl_3d_read_scalar_field_r8 ( h5_err_t h5bl_3d_write_vector3d_field_r8 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - const h5_float64_t *xval, /*!< array of x component data */ - const h5_float64_t *yval, /*!< array of y component data */ - const h5_float64_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_float64_t *x_buf, + const h5_float64_t *y_buf, + const h5_float64_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_DOUBLE ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -93,22 +96,23 @@ h5bl_3d_write_vector3d_field_r8 ( h5_err_t h5bl_3d_read_vector3d_field_r8 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - h5_float64_t *xval, /*!< array of x component data */ - h5_float64_t *yval, /*!< array of y component data */ - h5_float64_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_float64_t *x_buf, + h5_float64_t *y_buf, + h5_float64_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_DOUBLE ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -119,19 +123,20 @@ h5bl_3d_read_vector3d_field_r8 ( h5_err_t h5bl_3d_write_scalar_field_r4 ( - h5_int64_t *f, - const char *field_name, - const h5_float32_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_float32_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_scalar_data ( - filehandle, field_name2, (void*)data, H5T_NATIVE_FLOAT ); - free ( field_name2 ); - return herr; + fh, name2, (void*)buffer, H5T_NATIVE_FLOAT ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -142,19 +147,20 @@ h5bl_3d_write_scalar_field_r4 ( h5_err_t h5bl_3d_read_scalar_field_r4 ( - h5_int64_t *f, - const char *field_name, - h5_float32_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_float32_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_scalar_data ( - filehandle, field_name2, data, H5T_NATIVE_FLOAT ); - free ( field_name2 ); - return herr; + fh, name2, buffer, H5T_NATIVE_FLOAT ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -165,22 +171,23 @@ h5bl_3d_read_scalar_field_r4 ( h5_err_t h5bl_3d_write_vector3d_field_r4 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - const h5_float32_t *xval, /*!< array of x component data */ - const h5_float32_t *yval, /*!< array of y component data */ - const h5_float32_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_float32_t *x_buf, + const h5_float32_t *y_buf, + const h5_float32_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_FLOAT ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -191,22 +198,23 @@ h5bl_3d_write_vector3d_field_r4 ( h5_err_t h5bl_3d_read_vector3d_field_r4 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - h5_float32_t *xval, /*!< array of x component data */ - h5_float32_t *yval, /*!< array of y component data */ - h5_float32_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_float32_t *x_buf, + h5_float32_t *y_buf, + h5_float32_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_FLOAT ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -217,19 +225,20 @@ h5bl_3d_read_vector3d_field_r4 ( h5_err_t h5bl_3d_write_scalar_field_i8 ( - h5_int64_t *f, - const char *field_name, - const h5_int64_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_int64_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_scalar_data ( - filehandle, field_name2, (void*)data, H5T_NATIVE_INT64 ); - free ( field_name2 ); - return herr; + fh, name2, (void*)buffer, H5T_NATIVE_INT64 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -240,19 +249,20 @@ h5bl_3d_write_scalar_field_i8 ( h5_err_t h5bl_3d_read_scalar_field_i8 ( - h5_int64_t *f, - const char *field_name, - h5_int64_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_int64_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_scalar_data ( - filehandle, field_name2, data, H5T_NATIVE_INT64 ); - free ( field_name2 ); - return herr; + fh, name2, buffer, H5T_NATIVE_INT64 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -263,22 +273,23 @@ h5bl_3d_read_scalar_field_i8 ( h5_err_t h5bl_3d_write_vector3d_field_i8 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - const h5_int64_t *xval, /*!< array of x component data */ - const h5_int64_t *yval, /*!< array of y component data */ - const h5_int64_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_int64_t *x_buf, + const h5_int64_t *y_buf, + const h5_int64_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_INT64 ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -289,22 +300,23 @@ h5bl_3d_write_vector3d_field_i8 ( h5_err_t h5bl_3d_read_vector3d_field_i8 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - h5_int64_t *xval, /*!< array of x component data */ - h5_int64_t *yval, /*!< array of y component data */ - h5_int64_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_int64_t *x_buf, + h5_int64_t *y_buf, + h5_int64_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_INT64 ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -315,19 +327,20 @@ h5bl_3d_read_vector3d_field_i8 ( h5_err_t h5bl_3d_write_scalar_field_i4 ( - h5_int64_t *f, - const char *field_name, - const h5_int32_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_int32_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_scalar_data ( - filehandle, field_name2, (void*)data, H5T_NATIVE_INT32 ); - free ( field_name2 ); - return herr; + fh, name2, (void*)buffer, H5T_NATIVE_INT32 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -338,19 +351,20 @@ h5bl_3d_write_scalar_field_i4 ( h5_err_t h5bl_3d_read_scalar_field_i4 ( - h5_int64_t *f, - const char *field_name, - h5_int32_t *data, - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_int32_t *buffer, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4 (h5_err_t, "f=0x%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name, buffer, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_scalar_data ( - filehandle, field_name2, data, H5T_NATIVE_INT32 ); - free ( field_name2 ); - return herr; + fh, name2, buffer, H5T_NATIVE_INT32 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -361,22 +375,23 @@ h5bl_3d_read_scalar_field_i4 ( h5_err_t h5bl_3d_write_vector3d_field_i4 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - const h5_int32_t *xval, /*!< array of x component data */ - const h5_int32_t *yval, /*!< array of y component data */ - const h5_int32_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + const h5_int32_t *x_buf, + const h5_int32_t *y_buf, + const h5_int32_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_write_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_INT32 ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -387,22 +402,23 @@ h5bl_3d_write_vector3d_field_i4 ( h5_err_t h5bl_3d_read_vector3d_field_i4 ( - h5_int64_t *f, /*!< file handle */ - const char *field_name, /*!< name of the data set */ - h5_int32_t *xval, /*!< array of x component data */ - h5_int32_t *yval, /*!< array of y component data */ - h5_int32_t *zval, /*!< array of z component data */ - const int l_field_name + h5_int64_t *const f, + const char *name, + h5_int32_t *x_buf, + h5_int32_t *y_buf, + h5_int32_t *z_buf, + const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, name=\"%s\", x_buf=0x%p, y_buf=0x%p, z_buf=0x%p, l_name=%d", + fh, name, x_buf, y_buf, z_buf, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5b_read_vector3d_data ( - filehandle, field_name2, - (void*)xval, (void*)yval, (void*)zval, H5T_NATIVE_INT32 ); - free ( field_name2 ); - return herr; + fh, name2, + (void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 ); + free ( name2 ); + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -413,25 +429,28 @@ h5bl_3d_read_vector3d_field_i4 ( h5_err_t h5bl_writefieldattrib_r8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const h5_float64_t *values, - const h5_size_t *nvalues, + const h5_float64_t *buffer, + const h5_size_t *nelems, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, (long long)*nelems, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - H5T_NATIVE_DOUBLE, values, *nvalues ); + fh, field_name2, attrib_name2, + H5T_NATIVE_DOUBLE, buffer, *nelems ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -442,23 +461,26 @@ h5bl_writefieldattrib_r8 ( h5_err_t h5bl_readfieldattrib_r8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - h5_float64_t *values, + h5_float64_t *buffer, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "values=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, H5T_NATIVE_DOUBLE, values ); + fh, field_name2, attrib_name2, H5T_NATIVE_DOUBLE, buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -469,25 +491,28 @@ h5bl_readfieldattrib_r8 ( h5_err_t h5bl_writefieldattrib_r4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const h5_float32_t *values, - const h5_size_t *nvalues, + const h5_float32_t *buffer, + const h5_size_t *nelems, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, (long long)*nelems, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - H5T_NATIVE_FLOAT, values, *nvalues ); + fh, field_name2, attrib_name2, + H5T_NATIVE_FLOAT, buffer, *nelems ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -498,23 +523,26 @@ h5bl_writefieldattrib_r4 ( h5_err_t h5bl_readfieldattrib_r4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - h5_float32_t *values, + h5_float32_t *buffer, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "values=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, H5T_NATIVE_FLOAT, values ); + fh, field_name2, attrib_name2, H5T_NATIVE_FLOAT, buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -525,25 +553,28 @@ h5bl_readfieldattrib_r4 ( h5_err_t h5bl_writefieldattrib_i8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const h5_int64_t *values, - const h5_size_t *nvalues, + const h5_int64_t *buffer, + const h5_size_t *nelems, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, (long long)*nelems, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - H5T_NATIVE_INT64, values, *nvalues ); + fh, field_name2, attrib_name2, + H5T_NATIVE_INT64, buffer, *nelems ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -554,23 +585,26 @@ h5bl_writefieldattrib_i8 ( h5_err_t h5bl_readfieldattrib_i8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - h5_int64_t *values, + h5_int64_t *buffer, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "values=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, H5T_NATIVE_INT64, values ); + fh, field_name2, attrib_name2, H5T_NATIVE_INT64, buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -581,25 +615,28 @@ h5bl_readfieldattrib_i8 ( h5_err_t h5bl_writefieldattrib_i4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - const h5_int32_t *values, - const h5_size_t *nvalues, + const h5_int32_t *buffer, + const h5_size_t *nelems, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER7 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "buffer=0x%p, nelems=%lld, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, (long long)*nelems, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_write_field_attrib ( - filehandle, field_name2, attrib_name2, - H5T_NATIVE_INT32, values, *nvalues ); + fh, field_name2, attrib_name2, + H5T_NATIVE_INT32, buffer, *nelems ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) @@ -610,21 +647,24 @@ h5bl_writefieldattrib_i4 ( h5_err_t h5bl_readfieldattrib_i4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *field_name, const char *attrib_name, - h5_int32_t *values, + h5_int32_t *buffer, const int l_field_name, const int l_attrib_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER6 (h5_err_t, "f=0x%p, field_name=\"%s\", attrib_name=\"%s\", " + "values=0x%p, l_field_name=%d, l_attrib_name=%d", + fh, field_name, attrib_name, buffer, + l_field_name, l_attrib_name); char *field_name2 = h5_strdupfor2c ( field_name, l_field_name ); char *attrib_name2 = h5_strdupfor2c ( attrib_name, l_attrib_name ); h5_err_t herr = h5_read_field_attrib ( - filehandle, field_name2, attrib_name2, H5T_NATIVE_INT32, values ); + fh, field_name2, attrib_name2, H5T_NATIVE_INT32, buffer ); free ( field_name2 ); free ( attrib_name2 ); - return herr; + H5_API_RETURN(herr); } diff --git a/src/Fortran/H5Part_F.c b/src/Fortran/H5Part_F.c index 1cab256..718f74e 100755 --- a/src/Fortran/H5Part_F.c +++ b/src/Fortran/H5Part_F.c @@ -77,24 +77,25 @@ h5_err_t h5pt_setnpoints ( const h5_int64_t *f, - h5_int64_t *np + h5_int64_t *n ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_set_num_particles ( filehandle, *np, 1 ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER2(h5_err_t, "f=0x%p, n=%lld", fh, (long long)*n); + H5_API_RETURN(h5u_set_num_particles ( fh, *n, 1 )); } h5_err_t h5pt_setnpoints_strided ( const h5_int64_t *f, - h5_int64_t *np, - h5_int64_t *stride + h5_int64_t *n, + h5_int64_t *stride ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_set_num_particles ( filehandle, *np, *stride ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER3(h5_err_t, "f=0x%p, n=%lld, stride=%lld", + fh, (long long)*n, (long long)*stride); + H5_API_RETURN(h5u_set_num_particles ( fh, *n, *stride )); } /*==============Reading Data Characteristics============*/ @@ -104,9 +105,9 @@ h5pt_getndatasets ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_get_num_datasets ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_int64_t, "f=0x%p", fh); + H5_API_RETURN(h5u_get_num_datasets ( fh )); } h5_int64_t @@ -114,9 +115,9 @@ h5pt_getnpoints ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_get_num_particles ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_int64_t, "f=0x%p", fh); + H5_API_RETURN(h5u_get_num_particles ( fh )); } h5_err_t @@ -127,12 +128,13 @@ h5pt_getdatasetname ( const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, index=%lld, name=\"%s\", l_name=%d", + fh, (long long)*index, name, l_name); h5_err_t herr = h5u_get_dataset_info ( - filehandle, *index, name, l_name, NULL, NULL ); + fh, *index, name, l_name, NULL, NULL ); h5_strc2for ( name, l_name ); - return herr; + H5_API_RETURN(herr); } /*=============Setting and getting views================*/ @@ -144,9 +146,10 @@ h5pt_setview ( const h5_int64_t *end ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_set_view ( filehandle, (*start)-1, (*end)-1 ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER3(h5_err_t, "f=0x%p, start=%lld, end=%lld", + fh, (long long)*start, (long long)*end); + H5_API_RETURN(h5u_set_view ( fh, (*start)-1, (*end)-1 )); } h5_err_t @@ -156,9 +159,10 @@ h5pt_setview_indices ( const h5_int64_t *nelem ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_set_view_indices ( filehandle, indices, *nelem ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER3(h5_err_t, "f=0x%p, indices=0x%p, nelem=%lld", + fh, indices, (long long)*nelem); + H5_API_RETURN(h5u_set_view_indices ( fh, indices, *nelem )); } h5_err_t @@ -166,9 +170,9 @@ h5pt_resetview ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_reset_view ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_err_t, "f=0x%p", fh); + H5_API_RETURN(h5u_reset_view ( fh )); } h5_err_t @@ -176,9 +180,9 @@ h5pt_hasview ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_has_view ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_err_t, "f=0x%p", fh); + H5_API_RETURN(h5u_has_view ( fh )); } h5_err_t @@ -188,9 +192,10 @@ h5pt_getview ( h5_int64_t *end ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5u_get_view ( filehandle, start, end); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER3(h5_err_t, "f=0x%p, start=0x%p, end=0x%p", + fh, start, end); + H5_API_RETURN(h5u_get_view ( fh, start, end)); } @@ -202,13 +207,14 @@ h5pt_writedata_r8 ( const h5_float64_t *data, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_write_data ( - filehandle, name2, (void*)data, H5T_NATIVE_DOUBLE ); + fh, name2, (void*)data, H5T_NATIVE_DOUBLE ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -218,13 +224,14 @@ h5pt_writedata_r4 ( const h5_float32_t *data, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_write_data ( - filehandle, name2, (void*)data, H5T_NATIVE_FLOAT ); + fh, name2, (void*)data, H5T_NATIVE_FLOAT ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -234,13 +241,14 @@ h5pt_writedata_i8 ( const h5_int64_t *data, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_write_data ( - filehandle, name2, (void*)data, H5T_NATIVE_INT64 ); + fh, name2, (void*)data, H5T_NATIVE_INT64 ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -250,13 +258,14 @@ h5pt_writedata_i4 ( const h5_int32_t *data, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_write_data ( - filehandle, name2, (void*)data, H5T_NATIVE_INT32 ); + fh, name2, (void*)data, H5T_NATIVE_INT32 ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } @@ -269,13 +278,14 @@ h5pt_readdata_r8 ( const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_read_data ( - filehandle, name2, data, H5T_NATIVE_DOUBLE ); + fh, name2, data, H5T_NATIVE_DOUBLE ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -286,13 +296,14 @@ h5pt_readdata_r4 ( const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_read_data ( - filehandle, name2, data, H5T_NATIVE_FLOAT ); + fh, name2, data, H5T_NATIVE_FLOAT ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -303,14 +314,15 @@ h5pt_readdata_i8 ( const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_read_data ( - filehandle, name2, data, H5T_NATIVE_INT64 ); + fh, name2, data, H5T_NATIVE_INT64 ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } h5_err_t @@ -321,12 +333,13 @@ h5pt_readdata_i4 ( const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER4(h5_err_t, "f=0x%p, name=\"%s\", data=0x%p, l_name=%d", + fh, name, data, l_name); char *name2 = h5_strdupfor2c ( name, l_name ); h5_err_t herr = h5u_read_data ( - filehandle, name2, data, H5T_NATIVE_INT32 ); + fh, name2, data, H5T_NATIVE_INT32 ); free ( name2 ); - return herr; + H5_API_RETURN(herr); } diff --git a/src/Fortran/H5_F.c b/src/Fortran/H5_F.c index 3c1e7eb..418b36a 100644 --- a/src/Fortran/H5_F.c +++ b/src/Fortran/H5_F.c @@ -73,106 +73,110 @@ _flagsfor2c ( /* open/close interface */ h5_err_t h5_openr ( - const char *file_name, - const int l_file_name + const char *name, + const int l_name ) { - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); - h5_file_t* f = h5_open_file ( file_name2, H5_O_RDONLY, 0 ); - free ( file_name2 ); - return (h5_int64_t)(size_t)f; + H5_API_ENTER2(h5_err_t, "name=\"%s\", l_name=%d", name, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); + h5_file_t* f = h5_open_file ( name2, H5_O_RDONLY, 0 ); + free ( name2 ); + H5_API_RETURN((h5_int64_t)(size_t)f); } h5_err_t h5_openw ( - const char *file_name, - const int l_file_name + const char *name, + const int l_name ) { - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); - h5_file_t* f = h5_open_file ( file_name2, H5_O_WRONLY, 0 ); - free ( file_name2 ); - return (h5_int64_t)(size_t)f; + H5_API_ENTER2(h5_err_t, "name=\"%s\", l_name=%d", name, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); + h5_file_t* f = h5_open_file ( name2, H5_O_WRONLY, 0 ); + free ( name2 ); + H5_API_RETURN((h5_int64_t)(size_t)f); } h5_err_t h5pt_opena ( - const char *file_name, - const int l_file_name + const char *name, + const int l_name ) { - - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); - h5_file_t* f = h5_open_file ( file_name2, H5_O_APPEND, 0 ); - free ( file_name2 ); - return (h5_int64_t)(size_t)f; + + H5_API_ENTER2(h5_err_t, "name=\"%s\", l_name=%d", name, l_name); + char *name2 = h5_strdupfor2c ( name, l_name ); + h5_file_t* f = h5_open_file ( name2, H5_O_APPEND, 0 ); + free ( name2 ); + H5_API_RETURN((h5_int64_t)(size_t)f); } #ifdef PARALLEL_IO h5_err_t h5_openr_par ( - const char *file_name, + const char *name, MPI_Fint *fcomm, const char *flags, - const int l_file_name, + const int l_name, const int l_flags ) { + H5_API_ENTER5(h5_err_t, "name=\"%s\", fcomm=%d, flags=%s, " + "l_name=%d, l_flags=%d", + name, *fcomm, flags, l_name, l_flags); MPI_Comm ccomm = MPI_Comm_f2c (*fcomm); - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); + char *name2 = h5_strdupfor2c ( name, l_name ); char *flags2 = h5_strdupfor2c ( flags, l_flags ); - h5_int32_t fbits = H5_O_RDONLY | _flagsfor2c ( flags2 ); - - h5_file_t* f = h5_open_file ( file_name2, fbits, ccomm ); - - free ( file_name2 ); + h5_file_t* f = h5_open_file ( name2, fbits, ccomm ); + free ( name2 ); free ( flags2 ); - return (h5_int64_t)(size_t)f; + H5_API_RETURN((h5_int64_t)(size_t)f); } h5_err_t h5_openw_par ( - const char *file_name, + const char *name, MPI_Fint *fcomm, const char *flags, - const int l_file_name, + const int l_name, const int l_flags ) { + H5_API_ENTER5(h5_err_t, "name=\"%s\", fcomm=%d, flags=%s, " + "l_name=%d, l_flags=%d", + name, *fcomm, flags, l_name, l_flags); MPI_Comm ccomm = MPI_Comm_f2c (*fcomm); - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); + char *name2 = h5_strdupfor2c ( name, l_name ); char *flags2 = h5_strdupfor2c ( flags, l_flags ); - h5_int32_t fbits = H5_O_WRONLY | _flagsfor2c ( flags2 ); - - h5_file_t* f = h5_open_file ( file_name2, ccomm, fbits ); - - free ( file_name2 ); + h5_file_t* f = h5_open_file ( name2, fbits, ccomm ); + free ( name2 ); free ( flags2 ); - return (h5_int64_t)(size_t)f; + H5_API_RETURN((h5_int64_t)(size_t)f); } h5_err_t h5pt_opena_par_align ( - const char *file_name, + const char *name, MPI_Fint *fcomm, const h5_int64_t *align, const char *flags, - const int l_file_name, + const int l_name, const int l_flags ) { - + + H5_API_ENTER6(h5_err_t, "name=\"%s\", fcomm=%d, align=%lld, flags=%s, " + "l_name=%d, l_flags=%d", + name, *fcomm, (long long)*align, + flags, l_name, l_flags); MPI_Comm ccomm = MPI_Comm_f2c (*fcomm); - char *file_name2 = h5_strdupfor2c ( file_name, l_file_name ); + char *name2 = h5_strdupfor2c ( name, l_name ); char *flags2 = h5_strdupfor2c ( flags, l_flags ); - h5_int32_t fbits = H5_O_APPEND | _flagsfor2c ( flags2 ); - - h5_file_t* f = h5_open_file( file_name2, ccomm, fbits ); - - free ( file_name2 ); + h5_file_t* f = h5_open_file ( name2, fbits, ccomm ); + free ( name2 ); free ( flags2 ); - return (h5_int64_t)(size_t)f; + H5_API_RETURN((h5_int64_t)(size_t)f); } #endif @@ -181,9 +185,9 @@ h5_close ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5_close_file ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_err_t, "f=0x%p", fh); + H5_API_RETURN(h5_close_file ( fh )); } h5_err_t @@ -191,9 +195,9 @@ h5_check ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5_check_filehandle ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_err_t, "f=0x%p", fh); + H5_API_RETURN(h5_check_filehandle ( fh )); } h5_err_t @@ -201,9 +205,9 @@ h5_setstep ( const h5_int64_t *f, h5_int64_t *step ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5_set_step ( filehandle, (*step)-1 ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER2(h5_err_t, "f=0x%p, step=%lld", fh, (long long)*step); + H5_API_RETURN(h5_set_step ( fh, (*step)-1 )); } h5_ssize_t @@ -211,15 +215,17 @@ h5_getnsteps ( const h5_int64_t *f ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - return h5_get_num_steps ( filehandle ); + h5_file_t *fh = h5_filehandlefor2c(f); + H5_API_ENTER1(h5_ssize_t, "f=0x%p", fh); + H5_API_RETURN(h5_get_num_steps ( fh )); } h5_err_t h5_set_verbosity_level ( const h5_int64_t *level ) { - return h5_set_debuglevel ( *level ); + + H5_API_ENTER1(h5_err_t, "level=%lld", (long long)*level); + H5_API_RETURN(h5_set_debuglevel ( *level )); } diff --git a/src/Fortran/H5_attribs.f90 b/src/Fortran/H5_attribs.f90 index a8e49a2..cbb1ac0 100644 --- a/src/Fortran/H5_attribs.f90 +++ b/src/Fortran/H5_attribs.f90 @@ -1,249 +1,208 @@ -!!!!!!!! Reading and Writing Attributes !!!!!!!! !> \ingroup h5hut_attrib_f -!! See \ref H5WriteFileAttribString -!! \return 0 on success or error code +!! See ef H5WriteFileAttribString +!! eturn 0 on success or error code !< -INTEGER*8 FUNCTION h5_writefileattrib_string (filehandle,attrib_name,attrib_value) +INTEGER*8 FUNCTION h5_writefileattrib_string ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store + CHARACTER(LEN=*), INTENT(IN) :: buffer !< the string value to store END FUNCTION !> \ingroup h5hut_attrib_f -!! See \ref H5WriteStepAttribString -!! \return 0 on success or error code +!! See ef H5WriteStepAttribString +!! eturn 0 on success or error code !< -INTEGER*8 FUNCTION h5_writestepattrib_string (filehandle,attrib_name,attrib_value) +INTEGER*8 FUNCTION h5_writestepattrib_string ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - CHARACTER(LEN=*), INTENT(IN) :: value !< the string value to store + CHARACTER(LEN=*), INTENT(IN) :: buffer !< the string value to store END FUNCTION !> \ingroup h5hut_attrib_f -!! See \ref H5ReadFileAttribString -!! \return 0 on success or error code +!! See ef H5ReadFileAttribString +!! eturn 0 on success or error code !< -INTEGER*8 FUNCTION h5_readfileattrib_string (filehandle,attrib_name,attrib_value) +INTEGER*8 FUNCTION h5_readfileattrib_string ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into + CHARACTER(LEN=*), INTENT(OUT) :: buffer !< buffer to read the string value into END FUNCTION !> \ingroup h5hut_attrib_f -!! See \ref H5ReadStepAttribString -!! \return 0 on success or error code +!! See ef H5ReadStepAttribString +!! eturn 0 on success or error code !< -INTEGER*8 FUNCTION h5_readstepattrib_string (filehandle,attrib_name,attrib_value) +INTEGER*8 FUNCTION h5_readstepattrib_string ( filehandle, name, buffer ) INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - CHARACTER(LEN=*), INTENT(OUT) :: value !< buffer to read the string value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteFileAttribFloat64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writefileattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadFileAttribFloat64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readfileattrib_r8 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteFileAttribFloat32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writefileattrib_r4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadFileAttribFloat32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteFileAttribInt64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writefileattrib_i8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadFileAttribInt64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readfileattrib_i8 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteFileAttribInt32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writefileattrib_i4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadFileAttribInt32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readfileattrib_i4 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteStepAttribFloat64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writestepattrib_r8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadStepAttribFloat64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readstepattrib_r8 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*8, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteStepAttribFloat32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writestepattrib_r4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadStepAttribFloat32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readstepattrib_r4 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - REAL*4, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteStepAttribInt64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writestepattrib_i8 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*8, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadStepAttribInt64 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readstepattrib_i8 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*8, INTENT(OUT) :: data(*) !< buffer to read value into -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5WriteStepAttribInt32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_writestepattrib_i4 ( filehandle, field_name, attrib_name, attrib_value, attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*4, INTENT(IN) :: data(*) !< the array of data to write into the attribute - INTEGER*8, INTENT(IN) :: nelem !< the number of elements in the array -END FUNCTION - -!< \ingroup h5hut_attrib_f -!! See \ref H5ReadStepAttribInt32 -!! \return 0 on success or error code -!> -INTEGER*8 FUNCTION h5_readstepattrib_i4 ( filehandle, name, data ) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open - CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute - INTEGER*4, INTENT(OUT) :: data(*) !< buffer to read value into + CHARACTER(LEN=*), INTENT(OUT) :: buffer !< buffer to read the string value into END FUNCTION !> \ingroup h5hut_attrib_f -!! See \ref H5GetNumStepAttribs -!! \return number of attributes or error code -!< -INTEGER*8 FUNCTION h5_getnstepattribs (filehandle) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open -END FUNCTION - -!> \ingroup h5hut_attrib_f -!! See \ref H5GetNumFileAttribs -!! \return number of attributes or error code -!< -INTEGER*8 FUNCTION h5_getnfileattribs (filehandle) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open -END FUNCTION - -!> \ingroup h5hut_attrib_f -!! See \ref H5GetStepAttribInfo +!! See \ref H5Write#Group#AttribFloat64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5_getstepattribinfo (filehandle,idx,attrib_name,attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open - INTEGER*8, INTENT(IN) :: index !< index of the attribute to query (starting from 0) - CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the attribute name into - INTEGER*8, INTENT(OUT) :: nelem !< number of elements in the attribute's array +INTEGER*8 FUNCTION h5bl_writefileattrib_r8 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*8, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array END FUNCTION !> \ingroup h5hut_attrib_f -!! See \ref H5GetFileAttribInfo +!! See \ref H5Write#Group#AttribFloat64 !! \return 0 on success or error code !< -INTEGER*8 FUNCTION h5_getfileattribinfo (filehandle,idx,attrib_name,attrib_nelem) - INTEGER*8, INTENT(IN) :: filehandle !< the handle returned during file open - INTEGER*8, INTENT(IN) :: index !< index of the attribute to query (starting from 0) - CHARACTER(LEN=*), INTENT(OUT) :: name !< buffer to read the attribute name into - INTEGER*8, INTENT(OUT) :: nelem !< number of elements in the attribute's array +INTEGER*8 FUNCTION h5_readfileattrib_r8 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*8, INTENT(IN) :: buffer(*) !< the buffer to read to END FUNCTION +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writefileattrib_r4 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*4, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readfileattrib_r4 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*4, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writefileattrib_i8 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*8, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readfileattrib_i8 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*8, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writefileattrib_i4 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*4, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readfileattrib_i4 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*4, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writestepattrib_r8 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*8, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readstepattrib_r8 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*8, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writestepattrib_r4 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*4, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribFloat32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readstepattrib_r4 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + REAL*4, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writestepattrib_i8 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*8, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt64 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readstepattrib_i8 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*8, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5bl_writestepattrib_i4 ( filehandle, name, buffer, nelems ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*4, INTENT(IN) :: buffer(*) !< the buffer to write from + INTEGER*8, INTENT(IN) :: nelems !< the number of elements in the array +END FUNCTION + +!> \ingroup h5hut_attrib_f +!! See \ref H5Write#Group#AttribInt32 +!! \return 0 on success or error code +!< +INTEGER*8 FUNCTION h5_readstepattrib_i4 ( filehandle, name, buffer ) + INTEGER*8, INTENT(IN) :: filehandle !< the handle returned at file open + CHARACTER(LEN=*), INTENT(IN) :: name !< the name of the attribute + INTEGER*4, INTENT(IN) :: buffer(*) !< the buffer to read to +END FUNCTION diff --git a/src/Fortran/H5_attribs_F.c b/src/Fortran/H5_attribs_F.c index a4a42ee..b933b02 100644 --- a/src/Fortran/H5_attribs_F.c +++ b/src/Fortran/H5_attribs_F.c @@ -1,3 +1,4 @@ + #include #include @@ -15,636 +16,555 @@ #if ! defined(F77_NO_UNDERSCORE) -#define h5_writefileattrib_string F77NAME ( \ - h5_writefileattrib_string_, \ - H5_writefileattrib_string ) -#define h5_writestepattrib_string F77NAME ( \ - h5_writestepattrib_string_, \ - H5_WRITESTEPATTRIB_STRING ) -#define h5_readstepattrib_string F77NAME ( \ - h5_readstepattrib_string_, \ - h5_READSTEPATTRIB_STRING ) -#define h5_readfileattrib_string F77NAME ( \ - h5_readfileattrib_string_, \ - h5_READFILEATTRIB_STRING ) +#define h5_writefileattrib_string F77NAME ( h5_writefileattrib_string_, H5_writefileattrib_string ) +#define h5_writestepattrib_string F77NAME ( h5_writestepattrib_string_, H5_WRITESTEPATTRIB_STRING ) +#define h5_readstepattrib_string F77NAME ( h5_readstepattrib_string_, h5_READSTEPATTRIB_STRING ) +#define h5_readfileattrib_string F77NAME ( h5_readfileattrib_string_, h5_READFILEATTRIB_STRING ) #endif h5_err_t h5_writefileattrib_string ( - const h5_int64_t *f, - const char *attrib_name, - const char *attrib_value, - const int l_attrib_name, - const int l_attrib_value + h5_int64_t *const f, + const char *name, + const char *buffer, + const int l_name, + const int l_buffer ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - char *attrib_name2 = h5_strdupfor2c (attrib_name,l_attrib_name); - char *attrib_value2= h5_strdupfor2c (attrib_value,l_attrib_value); + h5_file_t *fh = h5_filehandlefor2c(f); + char *name2 = h5_strdupfor2c ( name, l_name ); + char *buffer2 = h5_strdupfor2c ( buffer, l_buffer ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=\"%s\", l_name=%d, l_buffer=%d", + fh, name2, buffer2, l_name, l_buffer); h5_err_t herr = h5_write_attrib ( - filehandle, H5_ATTRIB_FILE, attrib_name2, - H5T_NATIVE_CHAR, attrib_value2, strlen(attrib_value2)+1 ); + fh, H5_ATTRIB_FILE, name2, + H5_STRING_T, buffer2, strlen(buffer2)+1 ); - free ( attrib_name2 ); - free ( attrib_value2 ); - return herr; + free ( name2 ); + free ( buffer2 ); + H5_API_RETURN(herr); } h5_err_t h5_writestepattrib_string ( - const h5_int64_t *f, - const char *attrib_name, - const char *attrib_value, - const int l_attrib_name, - const int l_attrib_value + h5_int64_t *const f, + const char *name, + const char *buffer, + const int l_name, + const int l_buffer ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - char *attrib_name2 = h5_strdupfor2c (attrib_name,l_attrib_name); - char *attrib_value2= h5_strdupfor2c (attrib_value,l_attrib_value); + h5_file_t *fh = h5_filehandlefor2c(f); + char *name2 = h5_strdupfor2c ( name, l_name ); + char *buffer2 = h5_strdupfor2c ( buffer, l_buffer ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=\"%s\", l_name=%d, l_buffer=%d", + fh, name2, buffer2, l_name, l_buffer); h5_err_t herr = h5_write_attrib ( - filehandle, H5_ATTRIB_STEP, attrib_name2, - H5T_NATIVE_CHAR, attrib_value2, strlen(attrib_value2)+1 ); + fh, H5_ATTRIB_STEP, name2, + H5_STRING_T, buffer2, strlen(buffer2)+1 ); - free ( attrib_name2 ); - free ( attrib_value2 ); - return herr; + free ( name2 ); + free ( buffer2 ); + H5_API_RETURN(herr); } h5_err_t h5_readfileattrib_string ( - const h5_int64_t *f, - const char *attrib_name, - char *attrib_value, - const int l_attrib_name, - const int l_attrib_value + h5_int64_t *const f, + const char *name, + char *buffer, + const int l_name, + const int l_buffer ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - char * attrib_name2 = h5_strdupfor2c (attrib_name,l_attrib_name); + h5_file_t *fh = h5_filehandlefor2c(f); + char * name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d, l_buffer=%d", + fh, name2, buffer, l_name, l_buffer); h5_err_t herr = h5_read_attrib ( - filehandle, H5_ATTRIB_FILE, attrib_name2, - H5_STRING_T, attrib_value ); + fh, H5_ATTRIB_FILE, name2, H5_STRING_T, buffer ); - h5_strc2for ( attrib_value, l_attrib_value ); + h5_strc2for ( buffer, l_buffer ); - free ( attrib_name2 ); - return herr; + free ( name2 ); + H5_API_RETURN(herr); } h5_err_t -h5_readstepattrib_string ( - const h5_int64_t *f, - const char *attrib_name, - char *attrib_value, - const int l_attrib_name, - const int l_attrib_value +h5_readstepeattrib_string ( + h5_int64_t *const f, + const char *name, + char *buffer, + const int l_name, + const int l_buffer ) { - - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - char * attrib_name2 = h5_strdupfor2c (attrib_name,l_attrib_name); + + h5_file_t *fh = h5_filehandlefor2c(f); + char * name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d, l_buffer=%d", + fh, name2, buffer, l_name, l_buffer); h5_err_t herr = h5_read_attrib ( - filehandle, H5_ATTRIB_STEP, attrib_name2, - H5_STRING_T, attrib_value ); + fh, H5_ATTRIB_STEP, name2, H5_STRING_T, buffer ); - h5_strc2for ( attrib_value, l_attrib_value ); + h5_strc2for ( buffer, l_buffer ); - free ( attrib_name2 ); - return herr; + free ( name2 ); + H5_API_RETURN(herr); } - #if ! defined(F77_NO_UNDERSCORE) #define h5_writefileattrib_r8 F77NAME ( \ h5_writefileattrib_r8_, \ - h5_WRITEFILEATTRIB_R8 ) + H5_WRITEFILEATTRIB_R8 ) #endif h5_err_t h5_writefileattrib_r8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_float64_t *data, + const h5_float64_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_FILE, name2, - H5T_NATIVE_DOUBLE, data, (hsize_t) *nelem); + fh, H5_ATTRIB_FILE, name2, + H5_FLOAT64_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writefileattrib_r8 F77NAME ( \ - h5_writefileattrib_r8_, \ - h5_WRITEFILEATTRIB_R8 ) +#define h5_readfileattrib_r8 F77NAME ( \ + h5_readfileattrib_r8_, \ + H5_READFILEATTRIB_R8 ) #endif h5_err_t -h5_readfileattrib_r8 ( - h5_int64_t *f, +h5bl_readfileattrib_r8 ( + h5_int64_t *const f, const char *name, - h5_float64_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_FILE, name2, H5_FLOAT64_T, data); + fh, H5_ATTRIB_FILE, name2, H5_FLOAT64_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writefileattrib_r4 F77NAME ( \ h5_writefileattrib_r4_, \ - h5_WRITEFILEATTRIB_R4 ) + H5_WRITEFILEATTRIB_R4 ) #endif h5_err_t h5_writefileattrib_r4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_float32_t *data, + const h5_float32_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_FILE, name2, - H5T_NATIVE_FLOAT, data, (hsize_t) *nelem); + fh, H5_ATTRIB_FILE, name2, + H5_FLOAT32_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writefileattrib_r4 F77NAME ( \ - h5_writefileattrib_r4_, \ - h5_WRITEFILEATTRIB_R4 ) +#define h5_readfileattrib_r4 F77NAME ( \ + h5_readfileattrib_r4_, \ + H5_READFILEATTRIB_R4 ) #endif h5_err_t -h5_readfileattrib_r4 ( - h5_int64_t *f, +h5bl_readfileattrib_r4 ( + h5_int64_t *const f, const char *name, - h5_float32_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_FILE, name2, H5_FLOAT32_T, data); + fh, H5_ATTRIB_FILE, name2, H5_FLOAT32_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writefileattrib_i8 F77NAME ( \ h5_writefileattrib_i8_, \ - h5_WRITEFILEATTRIB_I8 ) + H5_WRITEFILEATTRIB_I8 ) #endif h5_err_t h5_writefileattrib_i8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_int64_t *data, + const h5_int64_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_FILE, name2, - H5T_NATIVE_INT64, data, (hsize_t) *nelem); + fh, H5_ATTRIB_FILE, name2, + H5_INT64_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writefileattrib_i8 F77NAME ( \ - h5_writefileattrib_i8_, \ - h5_WRITEFILEATTRIB_I8 ) +#define h5_readfileattrib_i8 F77NAME ( \ + h5_readfileattrib_i8_, \ + H5_READFILEATTRIB_I8 ) #endif h5_err_t -h5_readfileattrib_i8 ( - h5_int64_t *f, +h5bl_readfileattrib_i8 ( + h5_int64_t *const f, const char *name, - h5_int64_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_FILE, name2, H5_INT64_T, data); + fh, H5_ATTRIB_FILE, name2, H5_INT64_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writefileattrib_i4 F77NAME ( \ h5_writefileattrib_i4_, \ - h5_WRITEFILEATTRIB_I4 ) + H5_WRITEFILEATTRIB_I4 ) #endif h5_err_t h5_writefileattrib_i4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_int32_t *data, + const h5_int32_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_FILE, name2, - H5T_NATIVE_INT32, data, (hsize_t) *nelem); + fh, H5_ATTRIB_FILE, name2, + H5_INT32_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writefileattrib_i4 F77NAME ( \ - h5_writefileattrib_i4_, \ - h5_WRITEFILEATTRIB_I4 ) +#define h5_readfileattrib_i4 F77NAME ( \ + h5_readfileattrib_i4_, \ + H5_READFILEATTRIB_I4 ) #endif h5_err_t -h5_readfileattrib_i4 ( - h5_int64_t *f, +h5bl_readfileattrib_i4 ( + h5_int64_t *const f, const char *name, - h5_int32_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_FILE, name2, H5_INT32_T, data); + fh, H5_ATTRIB_FILE, name2, H5_INT32_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writestepattrib_r8 F77NAME ( \ h5_writestepattrib_r8_, \ - h5_WRITESTEPATTRIB_R8 ) + H5_WRITESTEPATTRIB_R8 ) #endif h5_err_t h5_writestepattrib_r8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_float64_t *data, + const h5_float64_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_STEP, name2, - H5T_NATIVE_DOUBLE, data, (hsize_t) *nelem); + fh, H5_ATTRIB_STEP, name2, + H5_FLOAT64_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writestepattrib_r8 F77NAME ( \ - h5_writestepattrib_r8_, \ - h5_WRITESTEPATTRIB_R8 ) +#define h5_readstepattrib_r8 F77NAME ( \ + h5_readstepattrib_r8_, \ + H5_READSTEPATTRIB_R8 ) #endif h5_err_t -h5_readstepattrib_r8 ( - h5_int64_t *f, +h5bl_readstepattrib_r8 ( + h5_int64_t *const f, const char *name, - h5_float64_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_STEP, name2, H5_FLOAT64_T, data); + fh, H5_ATTRIB_STEP, name2, H5_FLOAT64_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writestepattrib_r4 F77NAME ( \ h5_writestepattrib_r4_, \ - h5_WRITESTEPATTRIB_R4 ) + H5_WRITESTEPATTRIB_R4 ) #endif h5_err_t h5_writestepattrib_r4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_float32_t *data, + const h5_float32_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_STEP, name2, - H5T_NATIVE_FLOAT, data, (hsize_t) *nelem); + fh, H5_ATTRIB_STEP, name2, + H5_FLOAT32_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writestepattrib_r4 F77NAME ( \ - h5_writestepattrib_r4_, \ - h5_WRITESTEPATTRIB_R4 ) +#define h5_readstepattrib_r4 F77NAME ( \ + h5_readstepattrib_r4_, \ + H5_READSTEPATTRIB_R4 ) #endif h5_err_t -h5_readstepattrib_r4 ( - h5_int64_t *f, +h5bl_readstepattrib_r4 ( + h5_int64_t *const f, const char *name, - h5_float32_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_STEP, name2, H5_FLOAT32_T, data); + fh, H5_ATTRIB_STEP, name2, H5_FLOAT32_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writestepattrib_i8 F77NAME ( \ h5_writestepattrib_i8_, \ - h5_WRITESTEPATTRIB_I8 ) + H5_WRITESTEPATTRIB_I8 ) #endif h5_err_t h5_writestepattrib_i8 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_int64_t *data, + const h5_int64_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_STEP, name2, - H5T_NATIVE_INT64, data, (hsize_t) *nelem); + fh, H5_ATTRIB_STEP, name2, + H5_INT64_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writestepattrib_i8 F77NAME ( \ - h5_writestepattrib_i8_, \ - h5_WRITESTEPATTRIB_I8 ) +#define h5_readstepattrib_i8 F77NAME ( \ + h5_readstepattrib_i8_, \ + H5_READSTEPATTRIB_I8 ) #endif h5_err_t -h5_readstepattrib_i8 ( - h5_int64_t *f, +h5bl_readstepattrib_i8 ( + h5_int64_t *const f, const char *name, - h5_int64_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_STEP, name2, H5_INT64_T, data); + fh, H5_ATTRIB_STEP, name2, H5_INT64_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) #define h5_writestepattrib_i4 F77NAME ( \ h5_writestepattrib_i4_, \ - h5_WRITESTEPATTRIB_I4 ) + H5_WRITESTEPATTRIB_I4 ) #endif h5_err_t h5_writestepattrib_i4 ( - h5_int64_t *f, + h5_int64_t *const f, const char *name, - const h5_int32_t *data, + const h5_int32_t *buffer, const h5_int64_t *nelem, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER5 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, nelem=%lld, l_name=%d", + fh, name2, buffer, (long long)*nelem, l_name); h5_err_t herr = h5_write_attrib( - filehandle, H5_ATTRIB_STEP, name2, - H5T_NATIVE_INT32, data, (hsize_t) *nelem); + fh, H5_ATTRIB_STEP, name2, + H5_INT32_T, buffer, (hsize_t)*nelem); free ( name2 ); - return herr; + H5_API_RETURN(herr); } #if ! defined(F77_NO_UNDERSCORE) -#define h5_writestepattrib_i4 F77NAME ( \ - h5_writestepattrib_i4_, \ - h5_WRITESTEPATTRIB_I4 ) +#define h5_readstepattrib_i4 F77NAME ( \ + h5_readstepattrib_i4_, \ + H5_READSTEPATTRIB_I4 ) #endif h5_err_t -h5_readstepattrib_i4 ( - h5_int64_t *f, +h5bl_readstepattrib_i4 ( + h5_int64_t *const f, const char *name, - h5_int32_t *data, + h5_float64_t *buffer, const int l_name ) { - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - + h5_file_t *fh = h5_filehandlefor2c(f); char *name2 = h5_strdupfor2c ( name, l_name ); + H5_API_ENTER4 (h5_err_t, + "f=%p, name=\"%s\", buffer=0x%p, l_name=%d", + fh, name2, buffer, l_name); h5_err_t herr = h5_read_attrib( - filehandle, H5_ATTRIB_STEP, name2, H5_INT32_T, data); + fh, H5_ATTRIB_STEP, name2, H5_INT32_T, buffer); free ( name2 ); - return herr; + H5_API_RETURN(herr); } - -/*** QUERY ***/ - -#if ! defined(F77_NO_UNDERSCORE) - -#define h5_getnstepattribs F77NAME ( \ - h5_getnstepattribs_, \ - h5_GETNSTEPATTRIBS ) -#define h5_getnfileattribs F77NAME ( \ - h5_getnfileattribs_, \ - h5_GETNFILEATTRIBS ) -#define h5_getstepattribinfo F77NAME ( \ - h5_getstepattribinfo_, \ - h5_GETSTEPATTRIBINFO ) -#define h5_getfileattribinfo F77NAME ( \ - h5_getfileattribinfo_, \ - h5_GETFILEATTRIBINFO ) - -#endif - -h5_int64_t -h5_getnfileattribs ( - const h5_int64_t *f - ) { - - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - return h5_get_num_attribs ( filehandle, H5_ATTRIB_FILE ); -} - -h5_int64_t -h5_getnstepattribs ( - const h5_int64_t *f - ) { - - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - - return h5_get_num_attribs ( filehandle, H5_ATTRIB_STEP ); -} - -h5_err_t -h5_getfileattribinfo ( - const h5_int64_t *f, - const h5_int64_t *idx, - char *name, - h5_int64_t *nelem, - const int l_name ) { - - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - h5_int64_t type; - h5_size_t nelem2; - - h5_err_t herr = h5_get_attrib_info ( - filehandle, H5_ATTRIB_FILE, (h5_size_t)*idx, - name, l_name, &type, &nelem2); - - *nelem = (h5_int64_t)nelem2; - - h5_strc2for( name, l_name ); - return herr; -} - -h5_err_t -h5_getstepattribinfo ( - const h5_int64_t *f, - const h5_int64_t *idx, - char *name, - h5_int64_t *nelem, - const int l_name - ) { - - h5_file_t *filehandle = (h5_file_t*)(size_t)*f; - h5_set_funcname( filehandle, __func__ ); - h5_int64_t type; - h5_size_t nelem2; - - h5_err_t herr = h5_get_attrib_info ( - filehandle, H5_ATTRIB_STEP, (h5_size_t)*idx, - name, l_name, &type, &nelem2); - - *nelem = (h5_int64_t)nelem2; - - h5_strc2for( name, l_name ); - return herr; -} - - diff --git a/src/h5core/h5_openclose.c b/src/h5core/h5_openclose.c index 1e03745..c44b27e 100644 --- a/src/h5core/h5_openclose.c +++ b/src/h5core/h5_openclose.c @@ -428,7 +428,7 @@ h5_get_hdf5_file( \return Number of steps or error code */ -h5_size_t +h5_ssize_t h5_get_num_steps( h5_file_t* const f /*!< file handle */ ) { @@ -495,3 +495,10 @@ h5_strc2for ( return str; } +h5_file_t * +h5_filehandlefor2c ( + const h5_int64_t *ptr + ) { + return (h5_file_t*)(size_t)*ptr; +} + diff --git a/src/include/H5Block_readwrite.h b/src/include/H5Block_readwrite.h index f421bb3..107dd03 100644 --- a/src/include/H5Block_readwrite.h +++ b/src/include/H5Block_readwrite.h @@ -2,150 +2,146 @@ #ifndef __H5BLOCK_READWRITE_H #define __H5BLOCK_READWRITE_H -#ifdef __cplusplus -extern "C" { -#endif - h5_err_t H5Block3dWriteScalarFieldFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_float64_t *data + const h5_float64_t *buffer ); h5_err_t H5Block3dReadScalarFieldFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_float64_t *data + h5_float64_t *buffer ); h5_err_t H5Block3dWriteVector3dFieldFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_float64_t *x_data, - const h5_float64_t *y_data, - const h5_float64_t *z_data + const h5_float64_t *x_buf, + const h5_float64_t *y_buf, + const h5_float64_t *z_buf ); h5_err_t H5Block3dReadVector3dFieldFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_float64_t *x_data, - h5_float64_t *y_data, - h5_float64_t *z_data + h5_float64_t *x_buf, + h5_float64_t *y_buf, + h5_float64_t *z_buf ); h5_err_t H5Block3dWriteScalarFieldFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_float32_t *data + const h5_float32_t *buffer ); h5_err_t H5Block3dReadScalarFieldFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_float32_t *data + h5_float32_t *buffer ); h5_err_t H5Block3dWriteVector3dFieldFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_float32_t *x_data, - const h5_float32_t *y_data, - const h5_float32_t *z_data + const h5_float32_t *x_buf, + const h5_float32_t *y_buf, + const h5_float32_t *z_buf ); h5_err_t H5Block3dReadVector3dFieldFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_float32_t *x_data, - h5_float32_t *y_data, - h5_float32_t *z_data + h5_float32_t *x_buf, + h5_float32_t *y_buf, + h5_float32_t *z_buf ); h5_err_t H5Block3dWriteScalarFieldInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_int64_t *data + const h5_int64_t *buffer ); h5_err_t H5Block3dReadScalarFieldInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_int64_t *data + h5_int64_t *buffer ); h5_err_t H5Block3dWriteVector3dFieldInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_int64_t *x_data, - const h5_int64_t *y_data, - const h5_int64_t *z_data + const h5_int64_t *x_buf, + const h5_int64_t *y_buf, + const h5_int64_t *z_buf ); h5_err_t H5Block3dReadVector3dFieldInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_int64_t *x_data, - h5_int64_t *y_data, - h5_int64_t *z_data + h5_int64_t *x_buf, + h5_int64_t *y_buf, + h5_int64_t *z_buf ); h5_err_t H5Block3dWriteScalarFieldInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_int32_t *data + const h5_int32_t *buffer ); h5_err_t H5Block3dReadScalarFieldInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_int32_t *data + h5_int32_t *buffer ); h5_err_t H5Block3dWriteVector3dFieldInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - const h5_int32_t *x_data, - const h5_int32_t *y_data, - const h5_int32_t *z_data + const h5_int32_t *x_buf, + const h5_int32_t *y_buf, + const h5_int32_t *z_buf ); h5_err_t H5Block3dReadVector3dFieldInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *name, - h5_int32_t *x_data, - h5_int32_t *y_data, - h5_int32_t *z_data + h5_int32_t *x_buf, + h5_int32_t *y_buf, + h5_int32_t *z_buf ); h5_err_t H5BlockWriteFieldAttribFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, - const h5_float64_t *values, - const h5_size_t nvalues + const h5_float64_t *buffer, + const h5_size_t nelems ); h5_err_t H5BlockReadFieldAttribFloat64 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, h5_float64_t *buffer @@ -153,16 +149,16 @@ H5BlockReadFieldAttribFloat64 ( h5_err_t H5BlockWriteFieldAttribFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, - const h5_float32_t *values, - const h5_size_t nvalues + const h5_float32_t *buffer, + const h5_size_t nelems ); h5_err_t H5BlockReadFieldAttribFloat32 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, h5_float32_t *buffer @@ -170,16 +166,16 @@ H5BlockReadFieldAttribFloat32 ( h5_err_t H5BlockWriteFieldAttribInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, - const h5_int64_t *values, - const h5_size_t nvalues + const h5_int64_t *buffer, + const h5_size_t nelems ); h5_err_t H5BlockReadFieldAttribInt64 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, h5_int64_t *buffer @@ -187,23 +183,19 @@ H5BlockReadFieldAttribInt64 ( h5_err_t H5BlockWriteFieldAttribInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, - const h5_int32_t *values, - const h5_size_t nvalues + const h5_int32_t *buffer, + const h5_size_t nelems ); h5_err_t H5BlockReadFieldAttribInt32 ( - h5_file_t *f, + h5_file_t *const f, const char *field_name, const char *attrib_name, h5_int32_t *buffer ); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/include/h5core/h5_openclose.h b/src/include/h5core/h5_openclose.h index dc2a92b..c218f04 100644 --- a/src/include/h5core/h5_openclose.h +++ b/src/include/h5core/h5_openclose.h @@ -48,7 +48,7 @@ h5_get_hdf5_file( h5_file_t* const f ); -h5_size_t +h5_ssize_t h5_get_num_steps ( h5_file_t* const f ); @@ -85,5 +85,10 @@ h5_strc2for ( char * const str, const ssize_t l_str ); - + +h5_file_t * +h5_filehandlefor2c ( + const h5_int64_t *ptr + ); + #endif