Commit ad83c384 authored by gsell's avatar gsell

C-API:

- declare more args as const
- H5GetFileAttribName() added
parent 73fabd04
......@@ -99,7 +99,7 @@ static inline h5_err_t
H5PartGetDatasetInfo (
const h5_file_t f, ///< [in] file handle
const h5_id_t idx, ///< [in] index of the dataset
char* name, ///< [out] name of dataset
char* const name, ///< [out] name of dataset
const h5_size_t len_name, ///< [in] size of buffer \c name
h5_int64_t* type, ///< [out] type of data in dataset
h5_size_t* nelems ///< [out] number of elements
......
......@@ -161,8 +161,8 @@ H5SetPropFileMPIOPosix (
*/
static inline h5_err_t
H5SetPropFileCoreVFD (
h5_prop_t prop, ///< [in,out] identifier for file property list
h5_int64_t increment ///< [in] size, in bytes, of memory increments.
h5_prop_t prop, ///< [in,out] identifier for file property list
const h5_int64_t increment ///< [in] size, in bytes, of memory increments.
) {
H5_API_ENTER (h5_err_t, "prop=%p", (void*)prop);
H5_API_RETURN (h5_set_prop_file_core_vfd (prop, increment));
......@@ -195,8 +195,8 @@ H5SetPropFileCoreVFD (
*/
static inline h5_err_t
H5SetPropFileAlign (
h5_prop_t prop, ///< [in,out] identifier for file property list
h5_int64_t align ///< [in] alignment
h5_prop_t prop, ///< [in,out] identifier for file property list
const h5_int64_t align ///< [in] alignment
) {
H5_API_ENTER (h5_err_t, "prop=%p, align=%lld",
(void*)prop, (long long int)align);
......@@ -225,8 +225,8 @@ H5SetPropFileAlign (
*/
static inline h5_err_t
H5SetPropFileThrottle (
h5_prop_t prop, ///< [in,out] identifier for file property list
h5_int64_t throttle ///< [in] throttle factor
h5_prop_t prop, ///< [in,out] identifier for file property list
const h5_int64_t throttle ///< [in] throttle factor
) {
H5_API_ENTER (h5_err_t, "prop=%p, throttle=%lld",
(void*)prop, (long long int)throttle);
......@@ -279,9 +279,9 @@ H5CloseProp (
*/
static inline h5_file_t
H5OpenFile2 (
const char* filename, ///< [in] name of file
h5_int64_t mode, ///< [in] file mode
h5_prop_t props ///< [in] identifier for file property list
const char* const filename, ///< [in] name of file
const h5_int64_t mode, ///< [in] file mode
const h5_prop_t props ///< [in] identifier for file property list
) {
H5_API_ENTER (h5_file_t,
"filename='%s', mode=%lld, props=%p",
......@@ -316,9 +316,9 @@ H5OpenFile2 (
*/
static inline h5_file_p
H5OpenFile1 (
const char* filename, ///< [in] file name
h5_int32_t flags, ///< [in] file open flags
MPI_Comm comm ///< [in] MPI communicator
const char* filename, ///< [in] file name
const h5_int32_t flags, ///< [in] file open flags
MPI_Comm comm ///< [in] MPI communicator
) {
H5_API_ENTER (h5_file_p, "filename='%s', flags=%d, ...",filename,flags);
H5_API_RETURN (h5_open_file1 (filename, flags, comm, 0));
......@@ -332,7 +332,7 @@ H5OpenFile1 (
*/
static inline h5_err_t
H5CloseFile (
const h5_file_t f ///< [in] file handle.
const h5_file_t f ///< [in] file handle.
) {
H5_API_ENTER (h5_err_t,
"f=%p",
......@@ -348,7 +348,7 @@ H5CloseFile (
*/
static inline h5_err_t
H5CheckFile (
const h5_file_t f ///< [in] file handle.
const h5_file_t f ///< [in] file handle.
) {
H5_API_ENTER (h5_err_t,
"f=%p",
......@@ -364,7 +364,7 @@ H5CheckFile (
*/
static inline h5_err_t
H5FlushStep (
const h5_file_t f ///< [in] file handle.
const h5_file_t f ///< [in] file handle.
) {
H5_API_ENTER (h5_err_t,
"f=%p",
......@@ -380,7 +380,7 @@ H5FlushStep (
*/
static inline h5_err_t
H5FlushFile (
const h5_file_t f ///< [in] file handle.
const h5_file_t f ///< [in] file handle.
) {
H5_API_ENTER (h5_err_t,
"f=%p",
......
......@@ -68,10 +68,10 @@ static inline h5_err_t
H5GetFileAttribInfo (
const h5_file_t f, ///< [in] file handle
const h5_size_t idx, ///< [in] index of attribute to query
char* attrib_name, ///< [out] name of attribute
char* const attrib_name, ///< [out] name of attribute
const h5_size_t len_attrib_name,///< [in] size of buffer \c attrib_name
h5_int64_t* attrib_type, ///< [out] type of value
h5_size_t* nelems ///< [out] number of elements
h5_int64_t* const attrib_type, ///< [out] type of value
h5_size_t* const nelems ///< [out] number of elements
) {
H5_API_ENTER (h5_err_t,
"f=%p, "
......@@ -92,6 +92,29 @@ H5GetFileAttribInfo (
nelems));
}
static inline h5_err_t
H5GetFileAttribName (
const h5_file_t f, ///< [in] file handle
const h5_size_t idx, ///< [in] index of attribute to query
char* const attrib_name, ///< [out] name of attribute
const h5_size_t len_attrib_name ///< [in] size of buffer \c attrib_name
) {
H5_API_ENTER (h5_err_t,
"f=%p, "
"idx=%llu, attrib_name=%p, len_attrib_name=%llu, ",
(h5_file_p)f,
(long long unsigned)idx,
attrib_name,
(long long unsigned)len_attrib_name);
H5_API_RETURN (
h5_get_file_attrib_info_by_idx (
f,
idx,
attrib_name, len_attrib_name,
NULL,
NULL));
}
/**
Determines whether a file attribute with a given name exists.
......@@ -126,8 +149,8 @@ static inline h5_err_t
H5GetFileAttribInfoByName (
const h5_file_t f, ///< [in] file handle.
const char* const attrib_name, ///< [in] name of attribute.
h5_int64_t* attrib_type, ///< [out] type of value..
h5_size_t* nelems ///< [out] number of elements.
h5_int64_t* const attrib_type, ///< [out] type of value..
h5_size_t* const nelems ///< [out] number of elements.
) {
H5_API_ENTER (h5_err_t,
"f=%p, "
......@@ -213,8 +236,8 @@ H5GetFileAttribInfoByName (
static inline h5_err_t
H5WriteFileAttribString (
const h5_file_t f,
const char* attrib_name,
const char* buffer
const char* const attrib_name,
const char* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer='%s'",
......@@ -230,10 +253,10 @@ H5WriteFileAttribString (
static inline h5_err_t
H5WriteFileAttribFloat64 (
const h5_file_t f, ///< [in] file handle.
const char *attrib_name, ///< [in] name of attribute to create.
const h5_float64_t *buffers, ///< [in] buffers of attribute.
const h5_size_t nelems ///< [in] number of buffers.
const h5_file_t f,
const char* const attrib_name,
const h5_float64_t* const buffers,
const h5_size_t nelems
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffers=%p, nelems=%llu",
......@@ -250,8 +273,8 @@ H5WriteFileAttribFloat64 (
static inline h5_err_t
H5WriteFileAttribFloat32 (
const h5_file_t f,
const char* attrib_name,
const h5_float32_t* buffers,
const char* const attrib_name,
const h5_float32_t* const buffers,
const h5_size_t nelems
) {
H5_API_ENTER (h5_err_t,
......@@ -269,8 +292,8 @@ H5WriteFileAttribFloat32 (
static inline h5_err_t
H5WriteFileAttribInt64 (
const h5_file_t f,
const char* attrib_name,
const h5_int64_t* buffers,
const char* const attrib_name,
const h5_int64_t* const buffers,
const h5_size_t nelems
) {
H5_API_ENTER (h5_err_t,
......@@ -288,8 +311,8 @@ H5WriteFileAttribInt64 (
static inline h5_err_t
H5WriteFileAttribInt32 (
const h5_file_t f,
const char* attrib_name,
const h5_int32_t* buffers,
const char* const attrib_name,
const h5_int32_t* const buffers,
const h5_size_t nelems
) {
H5_API_ENTER (h5_err_t,
......@@ -366,8 +389,8 @@ H5WriteFileAttribInt32 (
static inline h5_err_t
H5ReadFileAttribString (
const h5_file_t f,
const char* attrib_name,
char* buffer
const char* const attrib_name,
char* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer='%s'",
......@@ -383,8 +406,8 @@ H5ReadFileAttribString (
static inline h5_err_t
H5ReadFileAttribFloat64 (
const h5_file_t f,
const char* attrib_name,
h5_float64_t* buffer
const char* const attrib_name,
h5_float64_t* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer=%p",
......@@ -400,8 +423,8 @@ H5ReadFileAttribFloat64 (
static inline h5_err_t
H5ReadFileAttribFloat32 (
const h5_file_t f,
const char* attrib_name,
h5_float32_t* buffer
const char* const attrib_name,
h5_float32_t* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer=%p",
......@@ -417,8 +440,8 @@ H5ReadFileAttribFloat32 (
static inline h5_err_t
H5ReadFileAttribInt64 (
const h5_file_t f,
const char* attrib_name,
h5_int64_t* buffer
const char* const attrib_name,
h5_int64_t* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer=%p",
......@@ -434,8 +457,8 @@ H5ReadFileAttribInt64 (
static inline h5_err_t
H5ReadFileAttribInt32 (
const h5_file_t f,
const char* attrib_name,
h5_int32_t* buffer
const char* const attrib_name,
h5_int32_t* const buffer
) {
H5_API_ENTER (h5_err_t,
"f=%p, attrib_name='%s', buffer=%p",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment