From 9df1a5777868f170013c694d844e6d8d9d4435d9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 1 Apr 2016 19:12:15 +0200 Subject: [PATCH] src/h5core/h5b_model.c: - h5b_has_field() added --- src/h5core/h5b_model.c | 20 ++++++++++++++++++-- src/include/h5core/h5b_model.h | 5 +++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/h5core/h5b_model.c b/src/h5core/h5b_model.c index e7838ed..2140275 100644 --- a/src/h5core/h5b_model.c +++ b/src/h5core/h5b_model.c @@ -924,10 +924,26 @@ h5b_get_num_fields ( H5_CORE_API_RETURN (hdf5_get_num_objs_in_group (f->b->block_gid)); } +h5_err_t +h5b_has_field ( + const h5_file_t fh, ///< [in] file handle + const char *name ///< [in] field name + ) { + h5_file_p f = (h5_file_p)fh; + H5_CORE_API_ENTER (h5_err_t, + "f=%p, name='%s'", + f, name); + CHECK_TIMEGROUP (f); + CHECK_TIMEGROUP (f); + + const char* path[] = { H5BLOCK_GROUPNAME_BLOCK, name }; + H5_CORE_API_RETURN (h5priv_link_exists_(f->step_gid, path, 2)); +} + h5_err_t h5b_get_field_info_by_name ( - const h5_file_t fh, /*!< IN: file handle */ - const char *name, /*!< OUT: field name */ + const h5_file_t fh, /*!< IN: file handle */ + const char *name, /*!< IN: field name */ h5_size_t *field_rank, /*!< OUT: field rank */ h5_size_t *field_dims, /*!< OUT: field dimensions */ h5_size_t *elem_rank, /*!< OUT: element rank */ diff --git a/src/include/h5core/h5b_model.h b/src/include/h5core/h5b_model.h index 5beb339..ddb14f8 100644 --- a/src/include/h5core/h5b_model.h +++ b/src/include/h5core/h5b_model.h @@ -82,6 +82,11 @@ h5_ssize_t h5b_get_num_fields ( const h5_file_t); +h5_err_t +h5b_has_field ( + const h5_file_t, + const char*); + h5_err_t h5b_get_field_info_by_name ( const h5_file_t,