diff options
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r-- | src/H5VLint.c | 291 |
1 files changed, 147 insertions, 144 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c index dabbc0a..9cf55c9 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -149,7 +149,7 @@ H5VL_init_phase1(void) /* Initialize the ID group for the VL IDs */ if (H5I_register_type(H5I_VOL_CLS) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize H5VL interface") + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize H5VL interface"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -198,7 +198,7 @@ H5VL_init_phase2(void) for (i = 0; i < NELMTS(initializer); i++) { if (initializer[i].func() < 0) { HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, - "unable to initialize %s interface", initializer[i].descr) + "unable to initialize %s interface", initializer[i].descr); } } @@ -210,7 +210,7 @@ H5VL_init_phase2(void) /* Set up the default VOL connector in the default FAPL */ if (H5VL__set_def_conn() < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to set default VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to set default VOL connector"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -287,7 +287,7 @@ H5VL__free_cls(H5VL_class_t *cls, void H5_ATTR_UNUSED **request) /* Shut down the VOL connector */ if (cls->terminate && cls->terminate() < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly") + HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly"); /* Release the class */ H5MM_xfree_const(cls->name); @@ -381,47 +381,48 @@ H5VL__set_def_conn(void) /* Duplicate the string to parse, as it is modified as we go */ if (NULL == (buf = H5MM_strdup(env_var))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "can't allocate memory for environment variable string") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, + "can't allocate memory for environment variable string"); /* Get the first 'word' of the environment variable. * If it's nothing (environment variable was whitespace) return error. */ if (NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts))) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "VOL connector environment variable set empty?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "VOL connector environment variable set empty?"); /* First, check to see if the connector is already registered */ if ((connector_is_registered = H5VL__is_connector_registered_by_name(tok)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check if VOL connector already registered") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't check if VOL connector already registered"); else if (connector_is_registered) { /* Retrieve the ID of the already-registered VOL connector */ if ((connector_id = H5VL__get_connector_id_by_name(tok, FALSE)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector ID"); } /* end else-if */ else { /* Check for VOL connectors that ship with the library */ if (!HDstrcmp(tok, "native")) { connector_id = H5VL_NATIVE; if (H5I_inc_ref(connector_id, FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount") + HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end if */ else if (!HDstrcmp(tok, "pass_through")) { connector_id = H5VL_PASSTHRU; if (H5I_inc_ref(connector_id, FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount") + HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end else-if */ else { /* Register the VOL connector */ /* (NOTE: No provisions for vipl_id currently) */ if ((connector_id = H5VL__register_connector_by_name(tok, TRUE, H5P_VOL_INITIALIZE_DEFAULT)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register connector"); } /* end else */ } /* end else */ /* Was there any connector info specified in the environment variable? */ if (NULL != (tok = HDstrtok_r(NULL, "\n\r", &lasts))) if (H5VL__connector_str_to_info(tok, connector_id, &vol_info) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDECODE, FAIL, "can't deserialize connector info") + HGOTO_ERROR(H5E_VOL, H5E_CANTDECODE, FAIL, "can't deserialize connector info"); /* Set the default VOL connector */ H5VL_def_conn_s.connector_id = connector_id; @@ -434,25 +435,25 @@ H5VL__set_def_conn(void) /* Increment the ref count on the default connector */ if (H5I_inc_ref(H5VL_def_conn_s.connector_id, FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount") + HGOTO_ERROR(H5E_VOL, H5E_CANTINC, FAIL, "can't increment VOL connector refcount"); } /* end else */ /* Get default file access pclass */ if (NULL == (def_fapclass = (H5P_genclass_t *)H5I_object(H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default file access property class ID") + HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default file access property class ID"); /* Change the default VOL for the default file access pclass */ if (H5P_reset_vol_class(def_fapclass, &H5VL_def_conn_s) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, - "can't set default VOL connector for default file access property class") + "can't set default VOL connector for default file access property class"); /* Get default file access plist */ if (NULL == (def_fapl = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT))) - HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default fapl ID") + HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default fapl ID"); /* Change the default VOL for the default FAPL */ if (H5P_set_vol(def_fapl, H5VL_def_conn_s.connector_id, H5VL_def_conn_s.connector_info) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set default VOL connector for default FAPL") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set default VOL connector for default FAPL"); done: /* Clean up on error */ @@ -496,14 +497,14 @@ H5VL__wrap_obj(void *obj, H5I_type_t obj_type) /* Retrieve the VOL object wrapping context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't get VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't get VOL object wrap context"); /* If there is a VOL object wrapping context, wrap the object */ if (vol_wrap_ctx) { /* Wrap object, using the VOL callback */ if (NULL == (ret_value = H5VL_wrap_object(vol_wrap_ctx->connector->cls, vol_wrap_ctx->obj_wrap_ctx, obj, obj_type))) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object"); } /* end if */ else ret_value = obj; @@ -538,15 +539,15 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t /* Make sure type number is valid */ if (type != H5I_ATTR && type != H5I_DATASET && type != H5I_DATATYPE && type != H5I_FILE && type != H5I_GROUP && type != H5I_MAP) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, NULL, "invalid type number") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, NULL, "invalid type number"); /* Create the new VOL object */ if (NULL == (new_vol_obj = H5FL_CALLOC(H5VL_object_t))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object"); new_vol_obj->connector = vol_connector; if (wrap_obj) { if (NULL == (new_vol_obj->data = H5VL__wrap_obj(object, type))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't wrap library object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't wrap library object"); } /* end if */ else new_vol_obj->data = object; @@ -559,7 +560,7 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t /* If this is a datatype, we have to hide the VOL object under the H5T_t pointer */ if (H5I_DATATYPE == type) { if (NULL == (ret_value = (H5VL_object_t *)H5T_construct_datatype(new_vol_obj))) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "can't construct datatype object") + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, NULL, "can't construct datatype object"); } /* end if */ else ret_value = (H5VL_object_t *)new_vol_obj; @@ -598,7 +599,8 @@ H5VL_conn_copy(H5VL_connector_prop_t *connector_prop) if (connector_prop->connector_id > 0) { /* Increment the reference count on connector ID and copy connector info */ if (H5I_inc_ref(connector_prop->connector_id, FALSE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, "unable to increment ref count on VOL connector ID") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINC, FAIL, + "unable to increment ref count on VOL connector ID"); /* Copy connector info, if it exists */ if (connector_prop->connector_info) { @@ -607,12 +609,12 @@ H5VL_conn_copy(H5VL_connector_prop_t *connector_prop) /* Retrieve the connector for the ID */ if (NULL == (connector = (H5VL_class_t *)H5I_object(connector_prop->connector_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID") + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID"); /* Allocate and copy connector info */ if (H5VL_copy_connector_info(connector, &new_connector_info, connector_prop->connector_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "connector info copy failed") + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "connector info copy failed"); /* Set the connector info to the copy */ connector_prop->connector_info = new_connector_info; @@ -648,11 +650,12 @@ H5VL_conn_free(const H5VL_connector_prop_t *connector_prop) /* Free the connector info */ if (H5VL_free_connector_info(connector_prop->connector_id, connector_prop->connector_info) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL connector info object") + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, + "unable to release VOL connector info object"); /* Decrement reference count for connector ID */ if (H5I_dec_ref(connector_prop->connector_id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "can't decrement reference count for connector ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "can't decrement reference count for connector ID"); } } @@ -687,11 +690,11 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ /* Set up VOL object for the passed-in data */ /* (Does not wrap object, since it's from a VOL callback) */ if (NULL == (vol_obj = H5VL__new_vol_obj(type, object, vol_connector, FALSE))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object"); /* Register VOL object as _object_ type, for future object API calls */ if ((ret_value = H5I_register(type, vol_obj, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register handle") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register handle"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -731,11 +734,11 @@ H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_conne /* Set up VOL object for the passed-in data */ /* (Wraps object, since it's a library object) */ if (NULL == (new_vol_obj = H5VL__new_vol_obj(type, object, vol_connector, TRUE))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object"); /* Call the underlying H5I function to complete the registration */ if (H5I_register_using_existing_id(type, new_vol_obj, app_ref, existing_id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register object under existing ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register object under existing ID"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -763,15 +766,15 @@ H5VL_new_connector(hid_t connector_id) /* Get the VOL class object from the connector's ID */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, NULL, "not a VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, NULL, "not a VOL connector ID"); /* Setup VOL info struct */ if (NULL == (connector = H5FL_CALLOC(H5VL_t))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL connector struct") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL connector struct"); connector->cls = cls; connector->id = connector_id; if (H5I_inc_ref(connector->id, FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector"); conn_id_incr = TRUE; /* Set return value */ @@ -814,11 +817,11 @@ H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool /* Create new VOL connector object, using the connector ID */ if (NULL == (connector = H5VL_new_connector(connector_id))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't create VOL connector object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't create VOL connector object"); /* Get an ID for the VOL object */ if ((ret_value = H5VL_register(type, obj, connector, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle"); done: /* Clean up on error */ @@ -859,7 +862,7 @@ H5VL_create_object(void *object, H5VL_t *vol_connector) /* Set up VOL object for the passed-in data */ /* (Does not wrap object, since it's from a VOL callback) */ if (NULL == (ret_value = H5FL_CALLOC(H5VL_object_t))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object"); ret_value->connector = vol_connector; ret_value->data = object; ret_value->rc = 1; @@ -895,21 +898,21 @@ H5VL_create_object_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id) /* Get the VOL class object from the connector's ID */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, NULL, "not a VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, NULL, "not a VOL connector ID"); /* Setup VOL info struct */ if (NULL == (connector = H5FL_CALLOC(H5VL_t))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL info struct") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL info struct"); connector->cls = cls; connector->id = connector_id; if (H5I_inc_ref(connector->id, FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector"); conn_id_incr = TRUE; /* Set up VOL object for the passed-in data */ /* (Wraps object, since it's a library object) */ if (NULL == (ret_value = H5VL__new_vol_obj(type, obj, connector, TRUE))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't create VOL object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't create VOL object"); done: /* Clean up on error */ @@ -978,7 +981,7 @@ H5VL_conn_dec_rc(H5VL_t *connector) /* Check for last reference */ if (0 == connector->nrefs) { if (H5I_dec_ref(connector->id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector"); H5FL_FREE(H5VL_t, connector); /* Set return value */ @@ -1036,7 +1039,7 @@ H5VL_free_object(H5VL_object_t *vol_obj) if (--vol_obj->rc == 0) { /* Decrement refcount on connector */ if (H5VL_conn_dec_rc(vol_obj->connector) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector"); vol_obj = H5FL_FREE(H5VL_object_t, vol_obj); } /* end if */ @@ -1072,15 +1075,15 @@ H5VL_object_is_native(const H5VL_object_t *obj, hbool_t *is_native) /* Retrieve the terminal connector class for the object */ cls = NULL; if (H5VL_introspect_get_conn_cls(obj, H5VL_GET_CONN_LVL_TERM, &cls) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class"); /* Retrieve the native connector class */ if (NULL == (native_cls = (H5VL_class_t *)H5I_object_verify(H5VL_NATIVE, H5I_VOL))) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve native VOL connector class") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve native VOL connector class"); /* Compare connector classes */ if (H5VL_cmp_connector_cls(&cmp_value, cls, native_cls) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector classes") + HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector classes"); /* If classes compare equal, then the object is / is in a native connector's file */ *is_native = (cmp_value == 0); @@ -1116,14 +1119,14 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, /* Retrieve the terminal connectors for each object */ cls1 = NULL; if (H5VL_introspect_get_conn_cls(vol_obj1, H5VL_GET_CONN_LVL_TERM, &cls1) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class"); cls2 = NULL; if (H5VL_introspect_get_conn_cls(vol_obj2, H5VL_GET_CONN_LVL_TERM, &cls2) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector class"); /* Compare connector classes */ if (H5VL_cmp_connector_cls(&cmp_value, cls1, cls2) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector classes") + HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector classes"); /* If the connector classes are different, the files are different */ if (cmp_value) @@ -1134,7 +1137,7 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, /* Get unwrapped (terminal) object for vol_obj2 */ if (NULL == (obj2 = H5VL_object_data(vol_obj2))) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get unwrapped object") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get unwrapped object"); /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_FILE_IS_EQUAL; @@ -1143,7 +1146,7 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, /* Make 'are files equal' callback */ if (H5VL_file_specific(vol_obj1, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed") + HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed"); } /* end else */ done: @@ -1178,19 +1181,19 @@ H5VL__register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id) /* Copy the class structure so the caller can reuse or free it */ if (NULL == (saved = H5FL_MALLOC(H5VL_class_t))) HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, - "memory allocation failed for VOL connector class struct") + "memory allocation failed for VOL connector class struct"); H5MM_memcpy(saved, cls, sizeof(H5VL_class_t)); if (NULL == (saved->name = H5MM_strdup(cls->name))) HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, - "memory allocation failed for VOL connector name") + "memory allocation failed for VOL connector name"); /* Initialize the VOL connector */ if (cls->initialize && cls->initialize(vipl_id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to init VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to init VOL connector"); /* Create the new class ID */ if ((ret_value = H5I_register(H5I_VOL, saved, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID"); done: if (ret_value < 0 && saved) { @@ -1228,23 +1231,23 @@ H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_ /* Check arguments */ if (!cls) HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, - "VOL connector class pointer cannot be NULL") + "VOL connector class pointer cannot be NULL"); if (H5VL_VERSION != cls->version) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector has incompatible version") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector has incompatible version"); if (!cls->name) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, - "VOL connector class name cannot be the NULL pointer") + "VOL connector class name cannot be the NULL pointer"); if (0 == HDstrlen(cls->name)) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, - "VOL connector class name cannot be the empty string") + "VOL connector class name cannot be the empty string"); if (cls->info_cls.copy && !cls->info_cls.free) HGOTO_ERROR( H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, - "VOL connector must provide free callback for VOL info objects when a copy callback is provided") + "VOL connector must provide free callback for VOL info objects when a copy callback is provided"); if (cls->wrap_cls.get_wrap_ctx && !cls->wrap_cls.free_wrap_ctx) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "VOL connector must provide free callback for object wrapping contexts when a get " - "callback is provided") + "callback is provided"); /* Set up op data for iteration */ op_data.key.kind = H5VL_GET_CONNECTOR_BY_NAME; @@ -1253,19 +1256,19 @@ H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_ /* Check if connector is already registered */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL IDs") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL IDs"); /* Increment the ref count on the existing VOL connector ID, if it's already registered */ if (op_data.found_id != H5I_INVALID_HID) { if (H5I_inc_ref(op_data.found_id, app_ref) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, - "unable to increment ref count on VOL connector") + "unable to increment ref count on VOL connector"); ret_value = op_data.found_id; } /* end if */ else { /* Create a new class ID */ if ((ret_value = H5VL__register_connector(cls, app_ref, vipl_id)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector"); } /* end else */ done: @@ -1301,13 +1304,13 @@ H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_i /* Check if connector is already registered */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, app_ref) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL ids") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL ids"); /* If connector already registered, increment ref count on ID and return ID */ if (op_data.found_id != H5I_INVALID_HID) { if (H5I_inc_ref(op_data.found_id, app_ref) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, - "unable to increment ref count on VOL connector") + "unable to increment ref count on VOL connector"); ret_value = op_data.found_id; } /* end if */ else { @@ -1318,11 +1321,11 @@ H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_i key.vol.kind = H5VL_GET_CONNECTOR_BY_NAME; key.vol.u.name = name; if (NULL == (cls = (const H5VL_class_t *)H5PL_load(H5PL_TYPE_VOL, &key))) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector"); /* Register the connector we loaded */ if ((ret_value = H5VL__register_connector(cls, app_ref, vipl_id)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID"); } /* end else */ done: @@ -1358,13 +1361,13 @@ H5VL__register_connector_by_value(H5VL_class_value_t value, hbool_t app_ref, hid /* Check if connector is already registered */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, app_ref) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL ids") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL ids"); /* If connector already registered, increment ref count on ID and return ID */ if (op_data.found_id != H5I_INVALID_HID) { if (H5I_inc_ref(op_data.found_id, app_ref) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, - "unable to increment ref count on VOL connector") + "unable to increment ref count on VOL connector"); ret_value = op_data.found_id; } /* end if */ else { @@ -1375,11 +1378,11 @@ H5VL__register_connector_by_value(H5VL_class_value_t value, hbool_t app_ref, hid key.vol.kind = H5VL_GET_CONNECTOR_BY_VALUE; key.vol.u.value = value; if (NULL == (cls = (const H5VL_class_t *)H5PL_load(H5PL_TYPE_VOL, &key))) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector"); /* Register the connector we loaded */ if ((ret_value = H5VL__register_connector(cls, app_ref, vipl_id)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register VOL connector ID"); } /* end else */ done: @@ -1412,7 +1415,7 @@ H5VL__is_connector_registered_by_name(const char *name) /* Find connector with name */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors"); /* Found a connector with that name */ if (op_data.found_id != H5I_INVALID_HID) @@ -1449,7 +1452,7 @@ H5VL__is_connector_registered_by_value(H5VL_class_value_t value) /* Find connector with value */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, FAIL, "can't iterate over VOL connectors"); /* Found a connector with that name */ if (op_data.found_id != H5I_INVALID_HID) @@ -1479,12 +1482,12 @@ H5VL__get_connector_id(hid_t obj_id, hbool_t is_api) /* Get the underlying VOL object for the object ID */ if (NULL == (vol_obj = H5VL_vol_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier"); /* Return the VOL object's VOL class ID */ ret_value = vol_obj->connector->id; if (H5I_inc_ref(ret_value, is_api) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector") + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1509,11 +1512,11 @@ H5VL__get_connector_id_by_name(const char *name, hbool_t is_api) /* Find connector with name */ if ((ret_value = H5VL__peek_connector_id_by_name(name)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector"); /* Found a connector with that name */ if (H5I_inc_ref(ret_value, is_api) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector") + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1539,11 +1542,11 @@ H5VL__get_connector_id_by_value(H5VL_class_value_t value, hbool_t is_api) /* Find connector with value */ if ((ret_value = H5VL__peek_connector_id_by_value(value)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't find VOL connector"); /* Found a connector with that value */ if (H5I_inc_ref(ret_value, is_api) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector") + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1576,7 +1579,7 @@ H5VL__peek_connector_id_by_name(const char *name) /* Find connector with name */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors"); /* Set return value */ ret_value = op_data.found_id; @@ -1612,7 +1615,7 @@ H5VL__peek_connector_id_by_value(H5VL_class_value_t value) /* Find connector with value */ if (H5I_iterate(H5I_VOL, H5VL__get_connector_cb, &op_data, TRUE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors") + HGOTO_ERROR(H5E_VOL, H5E_BADITER, H5I_INVALID_HID, "can't iterate over VOL connectors"); /* Set return value */ ret_value = op_data.found_id; @@ -1644,12 +1647,12 @@ H5VL__connector_str_to_info(const char *str, hid_t connector_id, void **info) /* Check args and get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector ID") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not a VOL connector ID"); /* Allow the connector to deserialize info */ if (cls->info_cls.from_str) { if ((cls->info_cls.from_str)(str, info) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize connector info") + HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize connector info"); } /* end if */ else *info = NULL; @@ -1683,7 +1686,7 @@ H5VL__get_connector_name(hid_t id, char *name /*out*/, size_t size) /* get the object pointer */ if (NULL == (vol_obj = H5VL_vol_object(id))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "invalid VOL identifier") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "invalid VOL identifier"); cls = vol_obj->connector->cls; @@ -1728,15 +1731,15 @@ H5VL_vol_object(hid_t id) H5I_DATATYPE == obj_type || H5I_MAP == obj_type) { /* Get the object */ if (NULL == (obj = H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier"); /* If this is a datatype, get the VOL object attached to the H5T_t struct */ if (H5I_DATATYPE == obj_type) if (NULL == (obj = H5T_get_named_type((H5T_t *)obj))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype"); } /* end if */ else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier type to function") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier type to function"); ret_value = (H5VL_object_t *)obj; @@ -1790,7 +1793,7 @@ H5VL_object_unwrap(const H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI(NULL) if (NULL == (ret_value = H5VL_unwrap_object(vol_obj->connector->cls, vol_obj->data))) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't unwrap object") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't unwrap object"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1824,7 +1827,7 @@ H5VL__object(hid_t id, H5I_type_t obj_type) case H5I_MAP: /* get the object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier"); break; case H5I_DATATYPE: { @@ -1832,11 +1835,11 @@ H5VL__object(hid_t id, H5I_type_t obj_type) /* get the object */ if (NULL == (dt = (H5T_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier"); /* Get the actual datatype object that should be the vol_obj */ if (NULL == (vol_obj = H5T_get_named_type(dt))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a named datatype"); break; } @@ -1854,7 +1857,7 @@ H5VL__object(hid_t id, H5I_type_t obj_type) case H5I_EVENTSET: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unknown data object type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unknown data object type"); } /* end switch */ /* Set the return value */ @@ -1884,7 +1887,7 @@ H5VL_object(hid_t id) /* Get the underlying object */ if (NULL == (ret_value = H5VL__object(id, H5I_get_type(id)))) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't retrieve object for ID") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't retrieve object for ID"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1910,11 +1913,11 @@ H5VL_object_verify(hid_t id, H5I_type_t obj_type) /* Check of ID of correct type */ if (obj_type != H5I_get_type(id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "invalid identifier"); /* Get the underlying object */ if (NULL == (ret_value = H5VL__object(id, obj_type))) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, NULL, "can't retrieve object for ID") + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, NULL, "can't retrieve object for ID"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2027,7 +2030,7 @@ H5VL_retrieve_lib_state(void **state) /* Retrieve the API context state */ if (H5CX_retrieve_state((H5CX_state_t **)state) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get API context state") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get API context state"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2054,7 +2057,7 @@ H5VL_start_lib_state(void) /* Push a new API context on the stack */ if (H5CX_push() < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't push API context") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't push API context"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2084,7 +2087,7 @@ H5VL_restore_lib_state(const void *state) /* Restore the API context state */ if (H5CX_restore_state((const H5CX_state_t *)state) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set API context state") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set API context state"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2116,7 +2119,7 @@ H5VL_finish_lib_state(void) /* Pop the API context off the stack */ if (H5CX_pop(FALSE) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't pop API context") + HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't pop API context"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2146,7 +2149,7 @@ H5VL_free_lib_state(void *state) /* Free the API context state */ if (H5CX_free_state((H5CX_state_t *)state) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "can't free API context state") + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "can't free API context state"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2179,11 +2182,11 @@ H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx) /* Release the VOL connector's object wrapping context */ if ((*vol_wrap_ctx->connector->cls->wrap_cls.free_wrap_ctx)(vol_wrap_ctx->obj_wrap_ctx) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, - "unable to release connector's object wrapping context") + "unable to release connector's object wrapping context"); /* Decrement refcount on connector */ if (H5VL_conn_dec_rc(vol_wrap_ctx->connector) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector") + HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector"); /* Release object wrapping context */ H5FL_FREE(H5VL_wrap_ctx_t, vol_wrap_ctx); @@ -2214,7 +2217,7 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) /* Retrieve the VOL object wrap context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context"); /* Check for existing wrapping context */ if (NULL == vol_wrap_ctx) { @@ -2231,12 +2234,12 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) /* Get the wrap context from the connector */ if ((vol_obj->connector->cls->wrap_cls.get_wrap_ctx)(vol_obj->data, &obj_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve VOL connector's object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve VOL connector's object wrap context"); } /* end if */ /* Allocate VOL object wrapper context */ if (NULL == (vol_wrap_ctx = H5FL_MALLOC(H5VL_wrap_ctx_t))) - HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "can't allocate VOL wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "can't allocate VOL wrap context"); /* Increment the outstanding objects that are using the connector */ H5VL_conn_inc_rc(vol_obj->connector); @@ -2252,7 +2255,7 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) /* Save the wrapper context */ if (H5CX_set_vol_wrap_ctx(vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context"); done: if (ret_value < 0 && vol_wrap_ctx) @@ -2281,9 +2284,9 @@ H5VL_inc_vol_wrapper(void *_vol_wrap_ctx) /* Check for valid, active VOL object wrap context */ if (NULL == vol_wrap_ctx) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?"); if (0 == vol_wrap_ctx->rc) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "bad VOL object wrap context refcount?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "bad VOL object wrap context refcount?"); /* Increment ref count on wrapping context */ vol_wrap_ctx->rc++; @@ -2312,9 +2315,9 @@ H5VL_dec_vol_wrapper(void *_vol_wrap_ctx) /* Check for valid, active VOL object wrap context */ if (NULL == vol_wrap_ctx) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?"); if (0 == vol_wrap_ctx->rc) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "bad VOL object wrap context refcount?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "bad VOL object wrap context refcount?"); /* Decrement ref count on wrapping context */ vol_wrap_ctx->rc--; @@ -2322,7 +2325,7 @@ H5VL_dec_vol_wrapper(void *_vol_wrap_ctx) /* Release context if the ref count drops to zero */ if (0 == vol_wrap_ctx->rc) if (H5VL__free_vol_wrapper(vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL object wrapping context") + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL object wrapping context"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2347,11 +2350,11 @@ H5VL_reset_vol_wrapper(void) /* Retrieve the VOL object wrap context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL object wrap context"); /* Check for VOL object wrap context */ if (NULL == vol_wrap_ctx) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?") + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, FAIL, "no VOL object wrap context?"); /* Decrement ref count on wrapping context */ vol_wrap_ctx->rc--; @@ -2360,16 +2363,16 @@ H5VL_reset_vol_wrapper(void) if (0 == vol_wrap_ctx->rc) { /* Release object wrapping context */ if (H5VL__free_vol_wrapper(vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL object wrapping context") + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL object wrapping context"); /* Reset the wrapper context */ if (H5CX_set_vol_wrap_ctx(NULL) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context"); } /* end if */ else /* Save the updated wrapper context */ if (H5CX_set_vol_wrap_ctx(vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL object wrap context"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2398,10 +2401,10 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) /* Retrieve the VOL object wrapping context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context"); if (NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector) HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, - "VOL object wrap context or its connector is NULL???") + "VOL object wrap context or its connector is NULL???"); /* If the datatype is already VOL-managed, the datatype's vol_obj * field will get clobbered later, so disallow this. @@ -2409,15 +2412,15 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) if (type == H5I_DATATYPE) if (vol_wrap_ctx->connector->id == H5VL_NATIVE) if (TRUE == H5T_already_vol_managed((const H5T_t *)obj)) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype"); /* Wrap the object with VOL connector info */ if (NULL == (new_obj = H5VL__wrap_obj(obj, type))) - HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object") + HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object"); /* Get an ID for the object */ if ((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2522,11 +2525,11 @@ H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj) /* Get attribute pointer */ if (NULL == (*vol_obj = (H5VL_object_t *)H5I_object_verify(loc_id, id_type))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID"); /* Set up collective metadata (if appropriate) */ if (H5CX_set_loc(loc_id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2554,11 +2557,11 @@ H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *lo /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID") + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID"); /* Set up collective metadata (if appropriate */ if (H5CX_set_loc(loc_id) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read"); /* Set location parameters */ loc_params->type = H5VL_OBJECT_BY_SELF; @@ -2593,11 +2596,11 @@ H5VL_setup_acc_args(hid_t loc_id, const H5P_libclass_t *libclass, hbool_t is_col /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(acspl_id, libclass, loc_id, is_collective) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Set location parameters */ loc_params->type = H5VL_OBJECT_BY_SELF; @@ -2629,7 +2632,7 @@ H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *l /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Set location parameters */ loc_params->type = H5VL_OBJECT_BY_SELF; @@ -2662,17 +2665,17 @@ H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_ /* Check args */ if (!name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL"); if (!*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string"); /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, is_collective) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Set up location parameters */ loc_params->type = H5VL_OBJECT_BY_NAME; @@ -2708,21 +2711,21 @@ H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter /* Check args */ if (!name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL"); if (!*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string"); if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified"); if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified"); /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, is_collective) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info") + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info"); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Set location parameters */ loc_params->type = H5VL_OBJECT_BY_IDX; @@ -2760,7 +2763,7 @@ H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_ /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Set location parameters */ loc_params->type = H5VL_OBJECT_BY_TOKEN; @@ -2800,14 +2803,14 @@ H5VL_get_cap_flags(const H5VL_connector_prop_t *connector_prop, uint64_t *cap_fl /* Retrieve the connector for the ID */ if (NULL == (connector = (H5VL_class_t *)H5I_object(connector_prop->connector_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID") + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID"); /* Query the connector's capability flags */ if (H5VL_introspect_get_cap_flags(connector_prop->connector_info, connector, cap_flags) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector's capability flags") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector's capability flags"); } /* end if */ else - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "connector ID not set?") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "connector ID not set?"); done: FUNC_LEAVE_NOAPI(ret_value) |