diff options
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r-- | src/H5Pdcpl.c | 763 |
1 files changed, 584 insertions, 179 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 98c00f9..29f92ec 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -77,16 +77,26 @@ /* Definitions for storage layout property */ #define H5D_CRT_LAYOUT_SIZE sizeof(H5O_layout_t) #define H5D_CRT_LAYOUT_DEF H5D_DEF_LAYOUT_CONTIG +#define H5D_CRT_LAYOUT_SET H5P__dcrt_layout_set +#define H5D_CRT_LAYOUT_GET H5P__dcrt_layout_get #define H5D_CRT_LAYOUT_ENC H5P__dcrt_layout_enc #define H5D_CRT_LAYOUT_DEC H5P__dcrt_layout_dec +#define H5D_CRT_LAYOUT_DEL H5P__dcrt_layout_del +#define H5D_CRT_LAYOUT_COPY H5P__dcrt_layout_copy #define H5D_CRT_LAYOUT_CMP H5P__dcrt_layout_cmp +#define H5D_CRT_LAYOUT_CLOSE H5P__dcrt_layout_close /* Definitions for fill value. size=0 means fill value will be 0 as * library default; size=-1 means fill value is undefined. */ #define H5D_CRT_FILL_VALUE_SIZE sizeof(H5O_fill_t) #define H5D_CRT_FILL_VALUE_DEF {{0, NULL, H5O_NULL_ID, {{0, HADDR_UNDEF}}}, H5O_FILL_VERSION_2, NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_FILL_TIME_IFSET, FALSE} -#define H5D_CRT_FILL_VALUE_ENC H5P__fill_value_enc -#define H5D_CRT_FILL_VALUE_DEC H5P__fill_value_dec +#define H5D_CRT_FILL_VALUE_SET H5P__dcrt_fill_value_set +#define H5D_CRT_FILL_VALUE_GET H5P__dcrt_fill_value_get +#define H5D_CRT_FILL_VALUE_ENC H5P__dcrt_fill_value_enc +#define H5D_CRT_FILL_VALUE_DEC H5P__dcrt_fill_value_dec +#define H5D_CRT_FILL_VALUE_DEL H5P__dcrt_fill_value_del +#define H5D_CRT_FILL_VALUE_COPY H5P__dcrt_fill_value_copy #define H5D_CRT_FILL_VALUE_CMP H5P_fill_value_cmp +#define H5D_CRT_FILL_VALUE_CLOSE H5P__dcrt_fill_value_close /* Definitions for space allocation time state */ #define H5D_CRT_ALLOC_TIME_STATE_SIZE sizeof(unsigned) #define H5D_CRT_ALLOC_TIME_STATE_DEF 1 @@ -95,9 +105,14 @@ /* Definitions for external file list */ #define H5D_CRT_EXT_FILE_LIST_SIZE sizeof(H5O_efl_t) #define H5D_CRT_EXT_FILE_LIST_DEF {HADDR_UNDEF, 0, 0, NULL} +#define H5D_CRT_EXT_FILE_LIST_SET H5P__dcrt_ext_file_list_set +#define H5D_CRT_EXT_FILE_LIST_GET H5P__dcrt_ext_file_list_get #define H5D_CRT_EXT_FILE_LIST_ENC H5P__dcrt_ext_file_list_enc #define H5D_CRT_EXT_FILE_LIST_DEC H5P__dcrt_ext_file_list_dec +#define H5D_CRT_EXT_FILE_LIST_DEL H5P__dcrt_ext_file_list_del +#define H5D_CRT_EXT_FILE_LIST_COPY H5P__dcrt_ext_file_list_copy #define H5D_CRT_EXT_FILE_LIST_CMP H5P__dcrt_ext_file_list_cmp +#define H5D_CRT_EXT_FILE_LIST_CLOSE H5P__dcrt_ext_file_list_close /******************/ @@ -122,18 +137,31 @@ static herr_t H5P__init_def_layout(void); /* Property class callbacks */ static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass); -static herr_t H5P__dcrt_copy(hid_t new_plist_t, hid_t old_plist_t, void *copy_data); -static herr_t H5P__dcrt_close(hid_t dxpl_id, void *close_data); /* Property callbacks */ +static herr_t H5P__dcrt_layout_set(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_layout_get(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_layout_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dcrt_layout_dec(const void **pp, void *value); +static herr_t H5P__dcrt_layout_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_layout_copy(const char *name, size_t size, void *value); static int H5P__dcrt_layout_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P__fill_value_enc(const void *value, void **pp, size_t *size); -static herr_t H5P__fill_value_dec(const void **pp, void *value); +static herr_t H5P__dcrt_layout_close(const char *name, size_t size, void *value); +static herr_t H5P__dcrt_fill_value_set(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_fill_value_get(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_fill_value_enc(const void *value, void **pp, size_t *size); +static herr_t H5P__dcrt_fill_value_dec(const void **pp, void *value); +static herr_t H5P__dcrt_fill_value_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_fill_value_copy(const char *name, size_t size, void *value); +static herr_t H5P__dcrt_fill_value_close(const char *name, size_t size, void *value); +static herr_t H5P__dcrt_ext_file_list_set(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_ext_file_list_get(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_ext_file_list_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dcrt_ext_file_list_dec(const void **pp, void *value); +static herr_t H5P__dcrt_ext_file_list_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__dcrt_ext_file_list_copy(const char *name, size_t size, void *value); static int H5P__dcrt_ext_file_list_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__dcrt_ext_file_list_close(const char *name, size_t size, void *value); /*********************/ @@ -153,9 +181,9 @@ const H5P_libclass_t H5P_CLS_DCRT[1] = {{ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ - H5P__dcrt_copy, /* Class copy callback */ + NULL, /* Class copy callback */ NULL, /* Class copy callback info */ - H5P__dcrt_close, /* Class close callback */ + NULL, /* Class close callback */ NULL /* Class close callback info */ }}; @@ -212,14 +240,14 @@ H5P__dcrt_reg_prop(H5P_genclass_t *pclass) /* Register the storage layout property */ if(H5P_register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, - NULL, NULL, NULL, H5D_CRT_LAYOUT_ENC, H5D_CRT_LAYOUT_DEC, - NULL, NULL, H5D_CRT_LAYOUT_CMP, NULL) < 0) + NULL, H5D_CRT_LAYOUT_SET, H5D_CRT_LAYOUT_GET, H5D_CRT_LAYOUT_ENC, H5D_CRT_LAYOUT_DEC, + H5D_CRT_LAYOUT_DEL, H5D_CRT_LAYOUT_COPY, H5D_CRT_LAYOUT_CMP, H5D_CRT_LAYOUT_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the fill value property */ if(H5P_register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, - NULL, NULL, NULL, H5D_CRT_FILL_VALUE_ENC, H5D_CRT_FILL_VALUE_DEC, - NULL, NULL, H5D_CRT_FILL_VALUE_CMP, NULL) < 0) + NULL, H5D_CRT_FILL_VALUE_SET, H5D_CRT_FILL_VALUE_GET, H5D_CRT_FILL_VALUE_ENC, H5D_CRT_FILL_VALUE_DEC, + H5D_CRT_FILL_VALUE_DEL, H5D_CRT_FILL_VALUE_COPY, H5D_CRT_FILL_VALUE_CMP, H5D_CRT_FILL_VALUE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the space allocation time state property */ @@ -230,8 +258,8 @@ H5P__dcrt_reg_prop(H5P_genclass_t *pclass) /* Register the external file list property */ if(H5P_register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, - NULL, NULL, NULL, H5D_CRT_EXT_FILE_LIST_ENC, H5D_CRT_EXT_FILE_LIST_DEC, - NULL, NULL, H5D_CRT_EXT_FILE_LIST_CMP, NULL) < 0) + NULL, H5D_CRT_EXT_FILE_LIST_SET, H5D_CRT_EXT_FILE_LIST_GET, H5D_CRT_EXT_FILE_LIST_ENC, H5D_CRT_EXT_FILE_LIST_DEC, + H5D_CRT_EXT_FILE_LIST_DEL, H5D_CRT_EXT_FILE_LIST_COPY, H5D_CRT_EXT_FILE_LIST_CMP, H5D_CRT_EXT_FILE_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") done: @@ -240,165 +268,79 @@ done: /*------------------------------------------------------------------------- - * Function: H5P__dcrt_copy + * Function: H5P__dcrt_layout_set * - * Purpose: Callback routine which is called whenever any dataset - * creation property list is copied. This routine copies - * the properties from the old list to the new list. + * Purpose: Copies a layout property when it's set for a property list * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Raymond Lu - * Tuesday, October 2, 2001 + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5P__dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void H5_ATTR_UNUSED *copy_data) +H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) { - H5O_fill_t src_fill, dst_fill; /* Source & destination fill values */ - H5O_efl_t src_efl, dst_efl; /* Source & destination external file lists */ - H5O_layout_t src_layout, dst_layout; /* Source & destination layout */ - H5P_genplist_t *src_plist; /* Pointer to source property list */ - H5P_genplist_t *dst_plist; /* Pointer to destination property list */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ + H5O_layout_t new_layout; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Verify property list IDs */ - if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_plist_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - if(NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_plist_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - - /* Get the layout, fill value, external file list, and data pipeline - * properties from the old property list - */ - if(H5P_get(src_plist, H5D_CRT_LAYOUT_NAME, &src_layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") - if(H5P_get(src_plist, H5D_CRT_FILL_VALUE_NAME, &src_fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") - if(H5P_get(src_plist, H5D_CRT_EXT_FILE_LIST_NAME, &src_efl) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") + /* Sanity check */ + HDassert(value); /* Make copy of layout */ - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, &src_layout, &dst_layout)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy layout") + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") - /* Reset layout values set when dataset is created */ - dst_layout.ops = NULL; - switch(dst_layout.type) { - case H5D_COMPACT: - dst_layout.storage.u.compact.buf = H5MM_xfree(dst_layout.storage.u.compact.buf); - HDmemset(&dst_layout.storage.u.compact, 0, sizeof(dst_layout.storage.u.compact)); - break; - - case H5D_CONTIGUOUS: - dst_layout.storage.u.contig.addr = HADDR_UNDEF; - dst_layout.storage.u.contig.size = 0; - break; - - case H5D_CHUNKED: - /* Reset chunk size */ - dst_layout.u.chunk.size = 0; - - /* Reset index info, if the chunk ops are set */ - if(dst_layout.storage.u.chunk.ops) - /* Reset address and pointer of the array struct for the chunked storage index */ - if(H5D_chunk_idx_reset(&dst_layout.storage.u.chunk, TRUE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest") - - /* Reset chunk index ops */ - dst_layout.storage.u.chunk.ops = NULL; - break; - - case H5D_LAYOUT_ERROR: - case H5D_NLAYOUTS: - default: - HDassert(0 && "Unknown layout type!"); - } /* end switch */ - - /* Make copy of fill value */ - if(NULL == H5O_msg_copy(H5O_FILL_ID, &src_fill, &dst_fill)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy fill value") - - /* Make copy of external file list */ - HDmemset(&dst_efl, 0, sizeof(H5O_efl_t)); - if(NULL == H5O_msg_copy(H5O_EFL_ID, &src_efl, &dst_efl)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy external file list") - - /* Reset efl name_offset and heap_addr, these are the values when the dataset is created */ - if(dst_efl.slot) { - unsigned int i; - - dst_efl.heap_addr = HADDR_UNDEF; - for(i = 0; i < dst_efl.nused; i++) - dst_efl.slot[i].name_offset = 0; - } /* end if */ - - /* Set the layout, fill value, external file list, and data pipeline - * properties for the destination property list - */ - if(H5P_set(dst_plist, H5D_CRT_LAYOUT_NAME, &dst_layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout") - if(H5P_set(dst_plist, H5D_CRT_FILL_VALUE_NAME, &dst_fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value") - if(H5P_set(dst_plist, H5D_CRT_EXT_FILE_LIST_NAME, &dst_efl) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file list") + /* Copy new layout message over old one */ + *layout = new_layout; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dcrt_copy() */ +} /* end H5P__dcrt_layout_set() */ /*------------------------------------------------------------------------- - * Function: H5P__dcrt_close + * Function: H5P__dcrt_layout_get * - * Purpose: Callback routine which is called whenever any dataset create - * property list is closed. This routine performs any generic - * cleanup needed on the properties the library put into the list. + * Purpose: Copies a layout property when it's retrieved from a property list * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol - * Wednesday, July 11, 2001 + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5P__dcrt_close(hid_t dcpl_id, void H5_ATTR_UNUSED *close_data) +H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) { - H5O_fill_t fill; /* Fill value */ - H5O_efl_t efl; /* External file list */ - H5P_genplist_t *plist; /* Property list */ + H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ + H5O_layout_t new_layout; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Check arguments */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") + /* Sanity check */ + HDassert(value); - /* Get the fill value, external file list, and data pipeline properties - * from the old property list */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") - if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") + /* Make copy of layout */ + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") - /* Clean up any values set for the fill-value and external file-list */ - if(H5O_msg_reset(H5O_FILL_ID, &fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release fill info") - if(H5O_msg_reset(H5O_EFL_ID, &efl) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release external file list info") + /* Copy new layout message over old one */ + *layout = new_layout; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__dcrt_close() */ +} /* end H5P__dcrt_layout_get() */ /*------------------------------------------------------------------------- @@ -546,6 +488,76 @@ done: /*------------------------------------------------------------------------- + * Function: H5P__dcrt_layout_del + * + * Purpose: Frees memory used to store the layout property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Tuesday, Feb 10, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_layout_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old layout */ + if(H5O_msg_reset(H5O_LAYOUT_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release layout message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_layout_del() */ + + +/*-------------------------------------------------------------------------- + * Function: H5P__dcrt_layout_copy + * + * Purpose: Copy the layout property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Monday, Feb 9, 2015 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ + H5O_layout_t new_layout; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(layout); + + /* Make copy of layout */ + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") + + /* Set new layout message directly into property list */ + *layout = new_layout; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_layout_copy() */ + + +/*------------------------------------------------------------------------- * Function: H5P__dcrt_layout_cmp * * Purpose: Callback routine which is called whenever the layout @@ -562,7 +574,8 @@ done: *------------------------------------------------------------------------- */ static int -H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t H5_ATTR_UNUSED size) +H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, + size_t H5_ATTR_UNUSED size) { const H5O_layout_t *layout1 = (const H5O_layout_t *)_layout1, /* Create local aliases for values */ *layout2 = (const H5O_layout_t *)_layout2; @@ -617,7 +630,116 @@ done: /*------------------------------------------------------------------------- - * Function: H5P__fill_value_enc + * Function: H5P__dcrt_layout_close + * + * Purpose: Frees memory used to store the layout property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Tuesday, Feb 10, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_layout_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old layout */ + if(H5O_msg_reset(H5O_LAYOUT_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release layout message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_layout_close() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_set + * + * Purpose: Copies a fill value property when it's set for a property list + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_fill_value_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + H5O_fill_t *fill = (H5O_fill_t *)value; /* Create local aliases for values */ + H5O_fill_t new_fill; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Make copy of fill value */ + if(NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy fill value") + + /* Copy new fill value message over old one */ + *fill = new_fill; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_fill_value_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_get + * + * Purpose: Copies a fill value property when it's retrieved from a property list + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_fill_value_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + H5O_fill_t *fill = (H5O_fill_t *)value; /* Create local aliases for values */ + H5O_fill_t new_fill; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Make copy of fill value */ + if(NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy fill value") + + /* Copy new fill value message over old one */ + *fill = new_fill; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_fill_value_get() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_enc * * Purpose: Callback routine which is called whenever the fill value * property in the dataset creation property list is @@ -632,7 +754,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fill_value_enc(const void *value, void **_pp, size_t *size) +H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) { const H5O_fill_t *fill = (const H5O_fill_t *)value; /* Create local aliases for values */ size_t dt_size = 0; /* Size of encoded datatype */ @@ -708,11 +830,11 @@ H5P__fill_value_enc(const void *value, void **_pp, size_t *size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__fill_value_enc() */ +} /* end H5P__dcrt_fill_value_enc() */ /*------------------------------------------------------------------------- - * Function: H5P__fill_value_dec + * Function: H5P__dcrt_fill_value_dec * * Purpose: Callback routine which is called whenever the fill value * property in the dataset creation property list is @@ -727,7 +849,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fill_value_dec(const void **_pp, void *_value) +H5P__dcrt_fill_value_dec(const void **_pp, void *_value) { H5O_fill_t *fill = (H5O_fill_t *)_value; /* Fill value */ const uint8_t **pp = (const uint8_t **)_pp; @@ -775,7 +897,77 @@ H5P__fill_value_dec(const void **_pp, void *_value) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__fill_value_dec() */ +} /* end H5P__dcrt_fill_value_dec() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_del + * + * Purpose: Frees memory used to store the fill value property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thursday, Feb 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_fill_value_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old fill value message */ + if(H5O_msg_reset(H5O_FILL_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release fill value message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_fill_value_del() */ + + +/*-------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_copy + * + * Purpose: Copy the fill value property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thursday, Feb 26, 2015 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_fill_value_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + H5O_fill_t *fill = (H5O_fill_t *)value; /* Create local aliases for values */ + H5O_fill_t new_fill; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(fill); + + /* Make copy of fill value message */ + if(NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy fill value") + + /* Set new fill value message directly into property list */ + *fill = new_fill; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_fill_value_copy() */ /*------------------------------------------------------------------------- @@ -794,7 +986,8 @@ done: *------------------------------------------------------------------------- */ int -H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t H5_ATTR_UNUSED size) +H5P_fill_value_cmp(const void *_fill1, const void *_fill2, + size_t H5_ATTR_UNUSED size) { const H5O_fill_t *fill1 = (const H5O_fill_t *)_fill1, /* Create local aliases for values */ *fill2 = (const H5O_fill_t *)_fill2; @@ -840,6 +1033,115 @@ done: /*------------------------------------------------------------------------- + * Function: H5P__dcrt_fill_value_close + * + * Purpose: Frees memory used to store the fill value property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thursday, Feb 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_fill_value_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old fill value message */ + if(H5O_msg_reset(H5O_FILL_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release fill value message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_fill_value_close() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_ext_file_list_set + * + * Purpose: Copies an external file list property when it's set for a property list + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_ext_file_list_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + H5O_efl_t *efl = (H5O_efl_t *)value; /* Create local aliases for values */ + H5O_efl_t new_efl; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Make copy of external file list */ + if(NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy external file list") + + /* Copy new external file list message over old one */ + *efl = new_efl; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_ext_file_list_set() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__dcrt_ext_file_list_get + * + * Purpose: Copies an external file lsit property when it's retrieved from a property list + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, Sept 1, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_ext_file_list_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + H5O_efl_t *efl = (H5O_efl_t *)value; /* Create local aliases for values */ + H5O_efl_t new_efl; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Make copy of external file list */ + if(NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy external file list") + + /* Copy new external file list message over old one */ + *efl = new_efl; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_ext_file_list_get() */ + + +/*------------------------------------------------------------------------- * Function: H5P__dcrt_ext_file_list_enc * * Purpose: Callback routine which is called whenever the efl @@ -1015,6 +1317,76 @@ done: /*------------------------------------------------------------------------- + * Function: H5P__dcrt_ext_file_list_del + * + * Purpose: Frees memory used to store the efl property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thursday, Feb 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_ext_file_list_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old efl message */ + if(H5O_msg_reset(H5O_EFL_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release external file list message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_ext_file_list_del() */ + + +/*-------------------------------------------------------------------------- + * Function: H5P__dcrt_ext_file_list_copy + * + * Purpose: Copy the efl property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thurday, Feb 26, 2015 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_ext_file_list_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + H5O_efl_t *efl = (H5O_efl_t *)value; /* Create local aliases for values */ + H5O_efl_t new_efl; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(efl); + + /* Make copy of efl message */ + if(NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy external file list") + + /* Set new efl message directly into property list */ + *efl = new_efl; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_ext_file_list_copy() */ + + +/*------------------------------------------------------------------------- * Function: H5P__dcrt_ext_file_list_cmp * * Purpose: Callback routine which is called whenever the external file @@ -1031,7 +1403,8 @@ done: *------------------------------------------------------------------------- */ static int -H5P__dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, size_t H5_ATTR_UNUSED size) +H5P__dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, + size_t H5_ATTR_UNUSED size) { const H5O_efl_t *efl1 = (const H5O_efl_t *)_efl1, /* Create local aliases for values */ *efl2 = (const H5O_efl_t *)_efl2; @@ -1096,6 +1469,39 @@ done: /*------------------------------------------------------------------------- + * Function: H5P__dcrt_ext_file_list_close + * + * Purpose: Frees memory used to store the efl property + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Thursday, Feb 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__dcrt_ext_file_list_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, + void *value) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(value); + + /* Reset the old efl message */ + if(H5O_msg_reset(H5O_EFL_ID, value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release external file list message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__dcrt_ext_file_list_close() */ + + +/*------------------------------------------------------------------------- * Function: H5P__set_layout * * Purpose: Sets the layout of raw data in the file. @@ -1121,10 +1527,10 @@ H5P__set_layout(H5P_genplist_t *plist, const H5O_layout_t *layout) /* If we still have the "default" allocation time, change it according to the new layout */ if(alloc_time_state) { - H5O_fill_t fill; /* Fill value */ + H5O_fill_t fill; /* Fill value */ /* Get current fill value info */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Set the default based on layout */ @@ -1148,7 +1554,7 @@ H5P__set_layout(H5P_genplist_t *plist, const H5O_layout_t *layout) } /* end switch */ /* Set updated fill value info */ - if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_poke(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time") } /* end if */ @@ -1309,8 +1715,8 @@ H5Pget_layout(hid_t plist_id) if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_LAYOUT_ERROR, "can't find object for ID") - /* Get layout property */ - if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + /* Peek at layout property */ + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5D_LAYOUT_ERROR, "can't get layout") /* Set return value */ @@ -1441,8 +1847,8 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Retrieve the layout property */ - if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + /* Peek at the layout property */ + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") if(H5D_CHUNKED != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") @@ -1508,7 +1914,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) + if(H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") if(efl.nused > 0 && H5O_EFL_UNLIMITED == efl.slot[efl.nused - 1].size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "previous file size is unlimited") @@ -1521,7 +1927,6 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) } /* end for */ } /* end if */ - /* Add to the list */ if(efl.nused >= efl.nalloc) { size_t na = efl.nalloc + H5O_EFL_ALLOC; @@ -1539,7 +1944,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) efl.slot[idx].size = size; efl.nused++; - if(H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) + if(H5P_poke(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set external file list") done: @@ -1583,7 +1988,7 @@ H5Pget_external_count(hid_t plist_id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get value */ - if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) + if(H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") /* Set return value */ @@ -1641,7 +2046,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get value */ - if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) + if(H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") if(idx >= efl.nused) @@ -1720,11 +2125,11 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) cd_values[1]=pixels_per_block; /* Add the filter */ - if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") if(H5Z_append(&pline, H5Z_FILTER_SZIP, H5Z_FLAG_OPTIONAL, (size_t)2, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add szip filter to pipeline") - if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_poke(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline") done: @@ -1767,11 +2172,11 @@ H5Pset_shuffle(hid_t plist_id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Add the filter */ - if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") if(H5Z_append(&pline, H5Z_FILTER_SHUFFLE, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to shuffle the data") - if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_poke(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline") done: @@ -1813,11 +2218,11 @@ H5Pset_nbit(hid_t plist_id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Add the nbit filter */ - if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") if(H5Z_append(&pline, H5Z_FILTER_NBIT, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add nbit filter to pipeline") - if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_poke(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline") done: @@ -1892,11 +2297,11 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac cd_values[1] = (unsigned)scale_factor; /* Add the scaleoffset filter */ - if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") if(H5Z_append(&pline, H5Z_FILTER_SCALEOFFSET, H5Z_FLAG_OPTIONAL, (size_t)2, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add scaleoffset filter to pipeline") - if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_poke(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline") done: @@ -1936,7 +2341,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get the current fill value */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Release the dynamic fill value components */ @@ -1986,7 +2391,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) fill.size = (-1); /* Update fill value in property list */ - if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_poke(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value") done: @@ -2030,7 +2435,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, * datatype conversion might not have resulted in zero. If fill value * is undefined, also return error. */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") if(fill.size == -1) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "fill value is undefined") @@ -2042,8 +2447,8 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, } /* end if */ /* - * Can we convert between the source and destination datatypes? - */ + * Can we convert between the source and destination datatypes? + */ if(NULL == (tpath = H5T_path_find(fill.type, type, NULL, NULL, dxpl_id, FALSE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), FALSE)) < 0) @@ -2198,7 +2603,7 @@ H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status) HDassert(status); /* Get the fill value struct */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Get the fill-value status */ @@ -2286,8 +2691,8 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) if(alloc_time == H5D_ALLOC_TIME_DEFAULT) { H5O_layout_t layout; /* Type of storage layout */ - /* Retrieve the storage layout */ - if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + /* Peek at the storage layout */ + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") /* Set the default based on layout */ @@ -2318,14 +2723,14 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) alloc_time_state = 0; /* Retrieve previous fill value settings */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Update property value */ fill.alloc_time = alloc_time; /* Set values */ - if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_poke(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value") if(H5P_set(plist, H5D_CRT_ALLOC_TIME_STATE_NAME, &alloc_time_state) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time") @@ -2367,7 +2772,7 @@ H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve fill value settings */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Set user's value */ @@ -2411,14 +2816,14 @@ H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve previous fill value settings */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Update property value */ fill.fill_time = fill_time; /* Set values */ - if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_poke(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value") done: @@ -2460,7 +2865,7 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve fill value settings */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") /* Set user's value */ |