diff options
Diffstat (limited to 'src/H5VLnative_attr.c')
-rw-r--r-- | src/H5VLnative_attr.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c index 3bd2b38..c41496a 100644 --- a/src/H5VLnative_attr.c +++ b/src/H5VLnative_attr.c @@ -88,35 +88,35 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c FUNC_ENTER_PACKAGE if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object"); if (0 == (H5F_INTENT(loc.oloc->file) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, NULL, "no write intent on file") + HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, NULL, "no write intent on file"); if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list"); if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype"); /* If this is a named datatype, get the connector's pointer to the datatype */ type = H5T_get_actual_type(dt); if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data space") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data space"); if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Acreate */ /* Go do the real work for attaching the attribute to the dataset */ if (NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute"); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Acreate_by_name */ if (NULL == (attr = H5A__create_by_name(&loc, loc_params->loc_data.loc_by_name.name, attr_name, type, space, acpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute"); } /* end else-if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute create parameters") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute create parameters"); ret_value = (void *)attr; @@ -151,22 +151,22 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha /* check arguments */ if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object"); if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list"); if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Aopen */ /* Open the attribute */ if (NULL == (attr = H5A__open(&loc, attr_name))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute: '%s'", attr_name) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute: '%s'", attr_name); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Aopen_by_name */ /* Open the attribute on the object header */ if (NULL == (attr = H5A__open_by_name(&loc, loc_params->loc_data.loc_by_name.name, attr_name))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute"); } /* end else-if */ else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Aopen_by_idx */ @@ -174,10 +174,10 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha if (NULL == (attr = H5A__open_by_idx( &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute"); } /* end else-if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute open parameters") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute open parameters"); ret_value = (void *)attr; @@ -204,11 +204,11 @@ H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t H5_ATTR_UNUS FUNC_ENTER_PACKAGE if (NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Go write the actual data to the attribute */ if ((ret_value = H5A__read((H5A_t *)attr, mem_type, buf)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") + HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -233,11 +233,11 @@ H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t H5_AT FUNC_ENTER_PACKAGE if (NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Go write the actual data to the attribute */ if ((ret_value = H5A__write((H5A_t *)attr, mem_type, buf)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") + HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -266,7 +266,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE H5A_t *attr = (H5A_t *)obj; if ((args->args.get_space.space_id = H5A_get_space(attr)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute"); break; } @@ -275,7 +275,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE H5A_t *attr = (H5A_t *)obj; if ((args->args.get_type.type_id = H5A__get_type(attr)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute"); break; } @@ -284,7 +284,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE H5A_t *attr = (H5A_t *)obj; if ((args->args.get_acpl.acpl_id = H5A__get_create_plist(attr)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for attr") + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for attr"); break; } @@ -296,7 +296,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE if (H5VL_OBJECT_BY_SELF == get_name_args->loc_params.type) { if (H5A__get_name((H5A_t *)obj, get_name_args->buf_size, get_name_args->buf, get_name_args->attr_name_len) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get attribute name") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get attribute name"); } else if (H5VL_OBJECT_BY_IDX == get_name_args->loc_params.type) { H5G_loc_t loc; @@ -304,14 +304,14 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE /* check arguments */ if (H5G_loc_real(obj, get_name_args->loc_params.obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Open the attribute on the object header */ if (NULL == (attr = H5A__open_by_idx(&loc, get_name_args->loc_params.loc_data.loc_by_idx.name, get_name_args->loc_params.loc_data.loc_by_idx.idx_type, get_name_args->loc_params.loc_data.loc_by_idx.order, get_name_args->loc_params.loc_data.loc_by_idx.n))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute"); /* Get the length of the name */ *get_name_args->attr_name_len = HDstrlen(attr->shared->name); @@ -326,10 +326,10 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE /* Release resources */ if (attr && H5A__close(attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute"); } else - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr"); break; } @@ -342,53 +342,53 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE if (H5VL_OBJECT_BY_SELF == get_info_args->loc_params.type) { attr = (H5A_t *)obj; if (H5A__get_info(attr, get_info_args->ainfo) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get attribute info") + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get attribute info"); } else if (H5VL_OBJECT_BY_NAME == get_info_args->loc_params.type) { H5G_loc_t loc; /* check arguments */ if (H5G_loc_real(obj, get_info_args->loc_params.obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Open the attribute on the object header */ if (NULL == (attr = H5A__open_by_name(&loc, get_info_args->loc_params.loc_data.loc_by_name.name, get_info_args->attr_name))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute"); /* Get the attribute information */ if (H5A__get_info(attr, get_info_args->ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info"); /* Release resources */ if (attr && H5A__close(attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute"); } else if (H5VL_OBJECT_BY_IDX == get_info_args->loc_params.type) { H5G_loc_t loc; /* check arguments */ if (H5G_loc_real(obj, get_info_args->loc_params.obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Open the attribute on the object header */ if (NULL == (attr = H5A__open_by_idx(&loc, get_info_args->loc_params.loc_data.loc_by_idx.name, get_info_args->loc_params.loc_data.loc_by_idx.idx_type, get_info_args->loc_params.loc_data.loc_by_idx.order, get_info_args->loc_params.loc_data.loc_by_idx.n))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute"); /* Get the attribute information */ if (H5A__get_info(attr, get_info_args->ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info"); /* Release resources */ if (attr && H5A__close(attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute"); } else - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr"); break; } @@ -402,7 +402,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSE } default: - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from attr") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from attr"); } /* end switch */ done: @@ -429,7 +429,7 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* Get location for passed-in object */ if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); switch (args->op_type) { /* H5Adelete/delete_by_name */ @@ -437,15 +437,15 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ if (H5VL_OBJECT_BY_SELF == loc_params->type) { /* Delete the attribute from the location */ if (H5O__attr_remove(loc.oloc, args->args.del.name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute"); } /* end if */ else if (H5VL_OBJECT_BY_NAME == loc_params->type) { /* Delete the attribute */ if (H5A__delete_by_name(&loc, loc_params->loc_data.loc_by_name.name, args->args.del.name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute"); } /* end else-if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete location") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete location"); break; } @@ -458,10 +458,10 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* Delete the attribute from the location */ if (H5A__delete_by_idx(&loc, loc_params->loc_data.loc_by_name.name, del_by_idx_args->idx_type, del_by_idx_args->order, del_by_idx_args->n) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute"); } /* end if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete_by_idx location") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete_by_idx location"); break; } @@ -470,16 +470,16 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* Check if the attribute exists */ if (H5O__attr_exists(loc.oloc, args->args.exists.name, args->args.exists.exists) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists"); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* Check if the attribute exists */ if (H5A__exists_by_name(loc, loc_params->loc_data.loc_by_name.name, args->args.exists.name, args->args.exists.exists) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists"); } /* end else-if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown parameters") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown parameters"); break; } @@ -495,7 +495,7 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ else if (loc_params->type == H5VL_OBJECT_BY_NAME) /* H5Aiterate_by_name */ loc_name = loc_params->loc_data.loc_by_name.name; else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unsupported location type") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unsupported location type"); /* Iterate over attributes */ if ((ret_value = H5A__iterate(&loc, loc_name, iter_args->idx_type, iter_args->order, @@ -509,21 +509,21 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Arename */ /* Call attribute rename routine */ if (H5O__attr_rename(loc.oloc, args->args.rename.old_name, args->args.rename.new_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute"); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Arename_by_name */ /* Call attribute rename routine */ if (H5A__rename_by_name(loc, loc_params->loc_data.loc_by_name.name, args->args.rename.old_name, args->args.rename.new_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute"); } /* end else-if */ else - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute rename parameters") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute rename parameters"); break; } default: - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation"); } /* end switch */ done: @@ -565,7 +565,7 @@ H5VL__native_attr_optional(void H5_ATTR_UNUSED *obj, H5VL_optional_args_t *args, #endif /* H5_NO_DEPRECATED_SYMBOLS */ default: - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation"); } /* end switch */ done: @@ -590,7 +590,7 @@ H5VL__native_attr_close(void *attr, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_U FUNC_ENTER_PACKAGE if (H5A__close((H5A_t *)attr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close attribute"); done: FUNC_LEAVE_NOAPI(ret_value) |