diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-03-09 22:57:54 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-03-09 22:57:54 (GMT) |
commit | a5d95ec0832d8b24e44277b3bdb90b21ea16ff2d (patch) | |
tree | ab4a705acd06c1df3aa6f54652804ce5ddb7e4f2 /src/H5Olayout.c | |
parent | 3093cb5bbac5d91d16787f998346dc0270322597 (diff) | |
parent | 2a5d608f7bf5f99fb61898a331fde2ccc170117e (diff) | |
download | hdf5-a5d95ec0832d8b24e44277b3bdb90b21ea16ff2d.zip hdf5-a5d95ec0832d8b24e44277b3bdb90b21ea16ff2d.tar.gz hdf5-a5d95ec0832d8b24e44277b3bdb90b21ea16ff2d.tar.bz2 |
Merge branch 'develop' into hdf5_1_10_merge
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 0994ef8..2c4c4ce 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -47,6 +47,8 @@ static herr_t H5O__layout_reset(void *_mesg); static herr_t H5O__layout_free(void *_mesg); static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); +static herr_t H5O__layout_pre_copy_file(H5F_t *file_src, const void *mesg_src, + hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); @@ -69,7 +71,7 @@ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{ NULL, /* link method */ NULL, /* set share method */ NULL, /* can share method */ - NULL, /* pre copy native value to file */ + H5O__layout_pre_copy_file, /* pre copy native value to file */ H5O__layout_copy_file, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ @@ -99,7 +101,7 @@ H5FL_DEFINE(H5O_layout_t); */ static void * H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_layout_t *mesg = NULL; @@ -1057,6 +1059,42 @@ done: /*------------------------------------------------------------------------- + * Function: H5O__layout_pre_copy_file + * + * Purpose: Perform any necessary actions before copying message between + * files. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Vailin Choi; Dec 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, + hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) +{ + const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* check args */ + HDassert(cpy_info); + HDassert(cpy_info->file_dst); + + /* Check to ensure that the version of the message to be copied does not exceed + the message version allowed by the destination file's high bound */ + if(layout_src->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(cpy_info->file_dst)]) + HGOTO_ERROR(H5E_OHDR, H5E_BADRANGE, FAIL, "layout message version out of bounds") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O__layout_pre_copy_file() */ + + +/*------------------------------------------------------------------------- * Function: H5O__layout_copy_file * * Purpose: Copies a message from _MESG to _DEST in file |