diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
commit | 1ba1f2f3222cbe8df0bf601929a4bffd478d7e02 (patch) | |
tree | ae51dfc33cf40432dad25a5088767115a98f195e /src/H5P.c | |
parent | 8eef7d295cc3dd134aef0a826f1de4287629996d (diff) | |
download | hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.zip hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.gz hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5P.c')
-rw-r--r-- | src/H5P.c | 509 |
1 files changed, 237 insertions, 272 deletions
@@ -20,57 +20,50 @@ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ +#define H5P_PACKAGE /*suppress error about including H5Ppkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5P__init_pub_interface - +#define H5_INTERFACE_INIT_FUNC H5P__init_pub_interface /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Ppkg.h" /* Property lists */ /****************/ /* Local Macros */ /****************/ - /******************/ /* Local Typedefs */ /******************/ /* Typedef for property iterator callback */ typedef struct { - H5P_iterate_t iter_func; /* Iterator callback */ - hid_t id; /* Property list or class ID */ - void *iter_data; /* Iterator callback pointer */ + H5P_iterate_t iter_func; /* Iterator callback */ + hid_t id; /* Property list or class ID */ + void * iter_data; /* Iterator callback pointer */ } H5P_iter_ud_t; - /********************/ /* Local Prototypes */ /********************/ - /*********************/ /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ - /*******************/ /* Local Variables */ /*******************/ - /*-------------------------------------------------------------------------- NAME H5P__init_pub_interface -- Initialize interface-specific information @@ -91,7 +84,6 @@ H5P__init_pub_interface(void) FUNC_LEAVE_NOAPI(H5P_init()) } /* H5P__init_pub_interface() */ - /*-------------------------------------------------------------------------- NAME H5P__term_pub_interface -- Terminate interface @@ -115,7 +107,6 @@ H5P__term_pub_interface(void) FUNC_LEAVE_NOAPI(0) } /* H5P__term_pub_interface() */ - /*-------------------------------------------------------------------------- NAME H5Pcopy @@ -140,46 +131,45 @@ H5P__term_pub_interface(void) hid_t H5Pcopy(hid_t id) { - void *obj; /* Property object to copy */ - hid_t ret_value=FALSE; /* return value */ + void *obj; /* Property object to copy */ + hid_t ret_value = FALSE; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", id); - if(H5P_DEFAULT==id) + if (H5P_DEFAULT == id) HGOTO_DONE(H5P_DEFAULT); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) + if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); - if(NULL == (obj = H5I_object(id))) + if (NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); /* Compare property lists */ - if(H5I_GENPROP_LST == H5I_get_type(id)) { - if((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, TRUE)) < 0) + if (H5I_GENPROP_LST == H5I_get_type(id)) { + if ((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ /* Must be property classes */ else { - H5P_genclass_t *copy_class; /* Copy of class */ + H5P_genclass_t *copy_class; /* Copy of class */ /* Copy the class */ - if((copy_class = H5P_copy_pclass((H5P_genclass_t *)obj)) == NULL) + if ((copy_class = H5P_copy_pclass((H5P_genclass_t *)obj)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property class"); /* Get an atom for the copied class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) { + if ((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) { H5P_close_class(copy_class); HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); } /* end if */ - } /* end else */ + } /* end else */ done: FUNC_LEAVE_API(ret_value) -} /* H5Pcopy() */ +} /* H5Pcopy() */ - /*-------------------------------------------------------------------------- NAME H5Pcreate_class @@ -215,52 +205,49 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5Pcreate_class(hid_t parent, const char *name, - H5P_cls_create_func_t cls_create, void *create_data, - H5P_cls_copy_func_t cls_copy, void *copy_data, - H5P_cls_close_func_t cls_close, void *close_data - ) +H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, + H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, + void *close_data) { - H5P_genclass_t *par_class = NULL; /* Pointer to the parent class */ - H5P_genclass_t *pclass = NULL; /* Property list class created */ - hid_t ret_value; /* Return value */ + H5P_genclass_t *par_class = NULL; /* Pointer to the parent class */ + H5P_genclass_t *pclass = NULL; /* Property list class created */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, - copy_data, cls_close, close_data); + H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, + close_data); /* Check arguments. */ - if(H5P_DEFAULT!=parent && (H5I_GENPROP_CLS!=H5I_get_type(parent))) + if (H5P_DEFAULT != parent && (H5I_GENPROP_CLS != H5I_get_type(parent))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid class name") - if((create_data != NULL && cls_create == NULL) - || (copy_data != NULL && cls_copy == NULL) - || (close_data != NULL && cls_close == NULL)) + if ((create_data != NULL && cls_create == NULL) || (copy_data != NULL && cls_copy == NULL) || + (close_data != NULL && cls_close == NULL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided") /* Get the pointer to the parent class */ - if(parent == H5P_DEFAULT) + if (parent == H5P_DEFAULT) par_class = NULL; - else if(NULL == (par_class = (H5P_genclass_t *)H5I_object(parent))) + else if (NULL == (par_class = (H5P_genclass_t *)H5I_object(parent))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't retrieve parent class") /* Create the new property list class */ - if(NULL == (pclass = H5P_create_class(par_class, name, H5P_TYPE_USER, cls_create, create_data, cls_copy, copy_data, cls_close, close_data))) + if (NULL == (pclass = H5P_create_class(par_class, name, H5P_TYPE_USER, cls_create, create_data, cls_copy, + copy_data, cls_close, close_data))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list class") /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class") done: - if(ret_value < 0 && pclass) + if (ret_value < 0 && pclass) H5P_close_class(pclass); FUNC_LEAVE_API(ret_value) -} /* H5Pcreate_class() */ +} /* H5Pcreate_class() */ - /*-------------------------------------------------------------------------- NAME H5Pcreate @@ -286,25 +273,24 @@ done: hid_t H5Pcreate(hid_t cls_id) { - H5P_genclass_t *pclass; /* Property list class to modify */ - hid_t ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property list class to modify */ + hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", cls_id); /* Check arguments. */ - if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class"); /* Create the new property list */ - if((ret_value = H5P_create_id(pclass, TRUE)) < 0) + if ((ret_value = H5P_create_id(pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pcreate() */ +} /* H5Pcreate() */ - /*-------------------------------------------------------------------------- NAME H5Pregister2 @@ -460,52 +446,51 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, - H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, - H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, - H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, - H5P_prp_close_func_t prp_close) +H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, + H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, + H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { - H5P_genclass_t *pclass; /* Property list class to modify */ + H5P_genclass_t *pclass; /* Property list class to modify */ H5P_genclass_t *orig_pclass; /* Original property class */ - herr_t ret_value; /* Return value */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE11("e", "i*sz*xxxxxxxx", cls_id, name, size, def_value, prp_create, - prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close); + H5TRACE11("e", "i*sz*xxxxxxxx", cls_id, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, + prp_copy, prp_cmp, prp_close); /* Check arguments. */ - if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid class name") - if(size > 0 && def_value == NULL) + if (size > 0 && def_value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "properties >0 size must have default") /* Create the new property list class */ orig_pclass = pclass; - if((ret_value = H5P_register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close)) < 0) + if ((ret_value = H5P_register(&pclass, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, + prp_copy, prp_cmp, prp_close)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in class") /* Check if the property class changed and needs to be substituted in the ID */ - if(pclass != orig_pclass) { - H5P_genclass_t *old_pclass; /* Old property class */ + if (pclass != orig_pclass) { + H5P_genclass_t *old_pclass; /* Old property class */ /* Substitute the new property class in the ID */ - if(NULL == (old_pclass = (H5P_genclass_t *)H5I_subst(cls_id, pclass))) + if (NULL == (old_pclass = (H5P_genclass_t *)H5I_subst(cls_id, pclass))) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to substitute property class in ID") HDassert(old_pclass == orig_pclass); /* Close the previous class */ - if(H5P_close_class(old_pclass) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close original property class after substitution") + if (H5P_close_class(old_pclass) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, + "unable to close original property class after substitution") } /* end if */ done: FUNC_LEAVE_API(ret_value) -} /* H5Pregister2() */ +} /* H5Pregister2() */ - /*-------------------------------------------------------------------------- NAME H5Pinsert2 @@ -646,35 +631,34 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, - H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, - H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) +H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, + H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { - H5P_genplist_t *plist; /* Property list to modify */ - herr_t ret_value; /* return value */ + H5P_genplist_t *plist; /* Property list to modify */ + herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "i*sz*xxxxxxx", plist_id, name, size, value, prp_set, prp_get, - prp_delete, prp_copy, prp_cmp, prp_close); + H5TRACE10("e", "i*sz*xxxxxxx", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, + prp_cmp, prp_close); /* Check arguments. */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name") - if(size > 0 && value == NULL) + if (size > 0 && value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "properties >0 size must have default") /* Create the new property list class */ - if((ret_value = H5P_insert(plist, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close)) < 0) + if ((ret_value = H5P_insert(plist, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, + prp_close)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist") done: FUNC_LEAVE_API(ret_value) -} /* H5Pinsert2() */ +} /* H5Pinsert2() */ - /*-------------------------------------------------------------------------- NAME H5Pset @@ -709,29 +693,28 @@ done: herr_t H5Pset(hid_t plist_id, const char *name, void *value) { - H5P_genplist_t *plist; /* Property list to modify */ - herr_t ret_value=SUCCEED; /* return value */ + H5P_genplist_t *plist; /* Property list to modify */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*x", plist_id, name, value); /* Check arguments. */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); - if(value==NULL) + if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalied property value"); /* Go set the value */ - if(H5P_set(plist,name,value) < 0) + if (H5P_set(plist, name, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to set value in plist"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pset() */ +} /* H5Pset() */ - /*-------------------------------------------------------------------------- NAME H5Pexist @@ -757,41 +740,39 @@ done: htri_t H5Pexist(hid_t id, const char *name) { - H5P_genplist_t *plist; /* Property list to query */ - H5P_genclass_t *pclass; /* Property class to query */ - htri_t ret_value; /* return value */ + H5P_genplist_t *plist; /* Property list to query */ + H5P_genclass_t *pclass; /* Property class to query */ + htri_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "i*s", id, name); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) + if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); /* Check for the existance of the property in the list or class */ - if(H5I_GENPROP_LST == H5I_get_type(id)) { - if(NULL == (plist = (H5P_genplist_t *)H5I_object(id))) + if (H5I_GENPROP_LST == H5I_get_type(id)) { + if (NULL == (plist = (H5P_genplist_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if((ret_value = H5P_exist_plist(plist, name)) < 0) + if ((ret_value = H5P_exist_plist(plist, name)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in list"); } /* end if */ + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { + if (NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); + if ((ret_value = H5P_exist_pclass(pclass, name)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in class"); + } /* end if */ else - if(H5I_GENPROP_CLS == H5I_get_type(id)) { - if(NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); - if((ret_value = H5P_exist_pclass(pclass, name)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in class"); - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pexist() */ +} /* H5Pexist() */ - /*-------------------------------------------------------------------------- NAME H5Pget_size @@ -818,46 +799,44 @@ done: herr_t H5Pget_size(hid_t id, const char *name, size_t *size) { - H5P_genclass_t *pclass; /* Property class to query */ - H5P_genplist_t *plist; /* Property list to query */ - herr_t ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property class to query */ + H5P_genplist_t *plist; /* Property list to query */ + herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*z", id, name, size); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) + if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); - if(size==NULL) + if (size == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property size"); - if(H5I_GENPROP_LST == H5I_get_type(id)) { - if(NULL == (plist = (H5P_genplist_t *)H5I_object(id))) + if (H5I_GENPROP_LST == H5I_get_type(id)) { + if (NULL == (plist = (H5P_genplist_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Check the property size */ - if((ret_value = H5P_get_size_plist(plist, name, size)) < 0) + if ((ret_value = H5P_get_size_plist(plist, name, size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else - if(H5I_GENPROP_CLS == H5I_get_type(id)) { - if(NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { + if (NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Check the property size */ - if((ret_value = H5P_get_size_pclass(pclass, name, size)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); + /* Check the property size */ + if ((ret_value = H5P_get_size_pclass(pclass, name, size)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); + } /* end if */ + else + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pget_size() */ +} /* H5Pget_size() */ - /*-------------------------------------------------------------------------- NAME H5Pget_class @@ -881,37 +860,36 @@ done: hid_t H5Pget_class(hid_t plist_id) { - H5P_genplist_t *plist; /* Property list to query */ - H5P_genclass_t *pclass=NULL; /* Property list class */ - hid_t ret_value=FAIL; /* return value */ + H5P_genplist_t *plist; /* Property list to query */ + H5P_genclass_t *pclass = NULL; /* Property list class */ + hid_t ret_value = FAIL; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); /* Check arguments. */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Retrieve the property list class */ - if((pclass = H5P_get_class(plist)) == NULL) + if ((pclass = H5P_get_class(plist)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list"); /* Increment the outstanding references to the class object */ - if(H5P_access_class(pclass, H5P_MOD_INC_REF) < 0) - HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count"); + if (H5P_access_class(pclass, H5P_MOD_INC_REF) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ID ref count"); /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); done: - if(ret_value<0 && pclass) + if (ret_value < 0 && pclass) H5P_close_class(pclass); FUNC_LEAVE_API(ret_value) -} /* H5Pget_class() */ +} /* H5Pget_class() */ - /*-------------------------------------------------------------------------- NAME H5Pget_nprops @@ -938,40 +916,38 @@ done: herr_t H5Pget_nprops(hid_t id, size_t *nprops) { - H5P_genplist_t *plist; /* Property list to query */ - H5P_genclass_t *pclass; /* Property class to query */ - herr_t ret_value=SUCCEED; /* return value */ + H5P_genplist_t *plist; /* Property list to query */ + H5P_genclass_t *pclass; /* Property class to query */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*z", id, nprops); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) + if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); - if(nprops==NULL) + if (nprops == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property nprops pointer"); - if(H5I_GENPROP_LST == H5I_get_type(id)) { - if(NULL == (plist = (H5P_genplist_t *)H5I_object(id))) + if (H5I_GENPROP_LST == H5I_get_type(id)) { + if (NULL == (plist = (H5P_genplist_t *)H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(H5P_get_nprops_plist(plist, nprops) < 0) + if (H5P_get_nprops_plist(plist, nprops) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in plist"); } /* end if */ + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { + if (NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); + if (H5P_get_nprops_pclass(pclass, nprops, FALSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in pclass"); + } /* end if */ else - if(H5I_GENPROP_CLS == H5I_get_type(id)) { - if(NULL == (pclass = (H5P_genclass_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); - if(H5P_get_nprops_pclass(pclass, nprops, FALSE) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in pclass"); - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pget_nprops() */ +} /* H5Pget_nprops() */ - /*-------------------------------------------------------------------------- NAME H5Pequal @@ -995,26 +971,26 @@ done: htri_t H5Pequal(hid_t id1, hid_t id2) { - void *obj1, *obj2; /* Property objects to compare */ - htri_t ret_value = FALSE; /* return value */ + void * obj1, *obj2; /* Property objects to compare */ + htri_t ret_value = FALSE; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", id1, id2); /* Check arguments. */ - if((H5I_GENPROP_LST != H5I_get_type(id1) && H5I_GENPROP_CLS != H5I_get_type(id1)) - || (H5I_GENPROP_LST != H5I_get_type(id2) && H5I_GENPROP_CLS != H5I_get_type(id2))) + if ((H5I_GENPROP_LST != H5I_get_type(id1) && H5I_GENPROP_CLS != H5I_get_type(id1)) || + (H5I_GENPROP_LST != H5I_get_type(id2) && H5I_GENPROP_CLS != H5I_get_type(id2))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property objects") - if(H5I_get_type(id1) != H5I_get_type(id2)) + if (H5I_get_type(id1) != H5I_get_type(id2)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not the same kind of property objects") - if(NULL == (obj1 = H5I_object(id1)) || NULL == (obj2 = H5I_object(id2))) + if (NULL == (obj1 = H5I_object(id1)) || NULL == (obj2 = H5I_object(id2))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist") /* Compare property lists */ - if(H5I_GENPROP_LST == H5I_get_type(id1)) { + if (H5I_GENPROP_LST == H5I_get_type(id1)) { int cmp_ret = 0; - if(H5P_cmp_plist((const H5P_genplist_t *)obj1, (const H5P_genplist_t *)obj2, &cmp_ret) < 0) + if (H5P_cmp_plist((const H5P_genplist_t *)obj1, (const H5P_genplist_t *)obj2, &cmp_ret) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, FAIL, "can't compare property lists") /* Set return value */ @@ -1022,15 +998,14 @@ H5Pequal(hid_t id1, hid_t id2) } /* end if */ /* Must be property classes */ else { - if(H5P_cmp_class((const H5P_genclass_t *)obj1, (const H5P_genclass_t *)obj2) == 0) + if (H5P_cmp_class((const H5P_genclass_t *)obj1, (const H5P_genclass_t *)obj2) == 0) ret_value = TRUE; } /* end else */ done: FUNC_LEAVE_API(ret_value) -} /* H5Pequal() */ +} /* H5Pequal() */ - /*-------------------------------------------------------------------------- NAME H5Pisa_class @@ -1057,26 +1032,25 @@ done: htri_t H5Pisa_class(hid_t plist_id, hid_t pclass_id) { - htri_t ret_value; /* return value */ + htri_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", plist_id, pclass_id); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(plist_id)) + if (H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(H5I_GENPROP_CLS != H5I_get_type(pclass_id)) + if (H5I_GENPROP_CLS != H5I_get_type(pclass_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); /* Compare the property list's class against the other class */ - if((ret_value = H5P_isa_class(plist_id, pclass_id)) < 0) + if ((ret_value = H5P_isa_class(plist_id, pclass_id)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to compare property list classes"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pisa_class() */ +} /* H5Pisa_class() */ - /*-------------------------------------------------------------------------- NAME H5P__iterate_cb @@ -1101,8 +1075,8 @@ property list or class. static int H5P__iterate_cb(H5P_genprop_t *prop, void *_udata) { - H5P_iter_ud_t *udata = (H5P_iter_ud_t *)_udata; /* Pointer to user data */ - int ret_value = 0; /* Return value */ + H5P_iter_ud_t *udata = (H5P_iter_ud_t *)_udata; /* Pointer to user data */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1116,7 +1090,6 @@ H5P__iterate_cb(H5P_genprop_t *prop, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__iterate_cb() */ - /*-------------------------------------------------------------------------- NAME H5Piterate @@ -1173,46 +1146,46 @@ iteration, the function's behavior is undefined. int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) { - H5P_iter_ud_t udata; /* User data for internal iterator callback */ - int fake_idx = 0; /* Index when user doesn't provide one */ - void *obj; /* Property object to copy */ - int ret_value; /* return value */ + H5P_iter_ud_t udata; /* User data for internal iterator callback */ + int fake_idx = 0; /* Index when user doesn't provide one */ + void * obj; /* Property object to copy */ + int ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE4("Is", "i*Isx*x", id, idx, iter_func, iter_data); /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) + if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); - if(NULL == (obj = H5I_object(id))) + if (NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); - if(iter_func == NULL) + if (iter_func == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration callback"); /* Set up user data */ udata.iter_func = iter_func; - udata.id = id; + udata.id = id; udata.iter_data = iter_data; - if(H5I_GENPROP_LST == H5I_get_type(id)) { + if (H5I_GENPROP_LST == H5I_get_type(id)) { /* Iterate over a property list */ - if((ret_value = H5P_iterate_plist((H5P_genplist_t *)obj, TRUE, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) + if ((ret_value = H5P_iterate_plist((H5P_genplist_t *)obj, TRUE, (idx ? idx : &fake_idx), + H5P__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { + /* Iterate over a property class */ + if ((ret_value = H5P_iterate_pclass((H5P_genclass_t *)obj, (idx ? idx : &fake_idx), H5P__iterate_cb, + &udata)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); + } /* end if */ else - if(H5I_GENPROP_CLS == H5I_get_type(id)) { - /* Iterate over a property class */ - if((ret_value = H5P_iterate_pclass((H5P_genclass_t *)obj, (idx ? idx : &fake_idx), H5P__iterate_cb, &udata)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: FUNC_LEAVE_API(ret_value) -} /* H5Piterate() */ +} /* H5Piterate() */ - /*-------------------------------------------------------------------------- NAME H5Pget @@ -1244,29 +1217,28 @@ done: herr_t H5Pget(hid_t plist_id, const char *name, void *value) { - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*x", plist_id, name, value); /* Check arguments. */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); - if(value==NULL) + if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalied property value"); /* Go get the value */ - if(H5P_get(plist,name,value) < 0) + if (H5P_get(plist, name, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pget() */ +} /* H5Pget() */ - /*-------------------------------------------------------------------------- NAME H5Premove @@ -1296,27 +1268,26 @@ done: herr_t H5Premove(hid_t plist_id, const char *name) { - H5P_genplist_t *plist; /* Property list to modify */ - herr_t ret_value; /* return value */ + H5P_genplist_t *plist; /* Property list to modify */ + herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", plist_id, name); /* Check arguments. */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); /* Create the new property list class */ - if((ret_value = H5P_remove(plist_id,plist,name)) < 0) + if ((ret_value = H5P_remove(plist_id, plist, name)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "unable to remove property"); done: FUNC_LEAVE_API(ret_value) -} /* H5Premove() */ +} /* H5Premove() */ - /*-------------------------------------------------------------------------- NAME H5Pcopy_prop @@ -1358,41 +1329,40 @@ done: herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name) { - H5I_type_t src_id_type, dst_id_type; /* ID types */ - herr_t ret_value = SUCCEED; /* return value */ + H5I_type_t src_id_type, dst_id_type; /* ID types */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*s", dst_id, src_id, name); /* Check arguments. */ - if((src_id_type = H5I_get_type(src_id)) < 0) + if ((src_id_type = H5I_get_type(src_id)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid source ID") - if((dst_id_type = H5I_get_type(dst_id)) < 0) + if ((dst_id_type = H5I_get_type(dst_id)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid destination ID") - if((H5I_GENPROP_LST != src_id_type && H5I_GENPROP_CLS != src_id_type) - || (H5I_GENPROP_LST != dst_id_type && H5I_GENPROP_CLS != dst_id_type)) + if ((H5I_GENPROP_LST != src_id_type && H5I_GENPROP_CLS != src_id_type) || + (H5I_GENPROP_LST != dst_id_type && H5I_GENPROP_CLS != dst_id_type)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property objects") - if(src_id_type != dst_id_type) + if (src_id_type != dst_id_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not the same kind of property objects") - if(!name || !*name) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") + if (!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") /* Compare property lists */ - if(H5I_GENPROP_LST == src_id_type) { - if(H5P_copy_prop_plist(dst_id, src_id, name) < 0) + if (H5I_GENPROP_LST == src_id_type) { + if (H5P_copy_prop_plist(dst_id, src_id, name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property between lists") } /* end if */ /* Must be property classes */ else { - if(H5P_copy_prop_pclass(dst_id, src_id, name) < 0) + if (H5P_copy_prop_pclass(dst_id, src_id, name) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property between classes") } /* end else */ done: FUNC_LEAVE_API(ret_value) -} /* H5Pcopy_prop() */ +} /* H5Pcopy_prop() */ - /*-------------------------------------------------------------------------- NAME H5Punregister @@ -1417,27 +1387,26 @@ done: herr_t H5Punregister(hid_t pclass_id, const char *name) { - H5P_genclass_t *pclass; /* Property list class to modify */ - herr_t ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property list class to modify */ + herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", pclass_id, name); /* Check arguments. */ - if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class"); - if(!name || !*name) + if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); /* Remove the property list from class */ - if((ret_value = H5P_unregister(pclass, name)) < 0) + if ((ret_value = H5P_unregister(pclass, name)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to remove property from class"); done: FUNC_LEAVE_API(ret_value) -} /* H5Punregister() */ +} /* H5Punregister() */ - /*-------------------------------------------------------------------------- NAME H5Pclose @@ -1462,27 +1431,26 @@ done: herr_t H5Pclose(hid_t plist_id) { - herr_t ret_value = SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", plist_id); /* Allow default property lists to pass through without throwing an error */ - if(H5P_DEFAULT != plist_id) { + if (H5P_DEFAULT != plist_id) { /* Check arguments. */ - if(H5I_GENPROP_LST != H5I_get_type(plist_id)) + if (H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") /* Close the property list */ - if(H5I_dec_app_ref(plist_id) < 0) + if (H5I_dec_app_ref(plist_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close") } /* end if */ done: FUNC_LEAVE_API(ret_value) -} /* H5Pclose() */ +} /* H5Pclose() */ - /*-------------------------------------------------------------------------- NAME H5Pget_class_name @@ -1506,25 +1474,24 @@ done: char * H5Pget_class_name(hid_t pclass_id) { - H5P_genclass_t *pclass; /* Property class to query */ - char *ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property class to query */ + char * ret_value; /* return value */ FUNC_ENTER_API(NULL) H5TRACE1("*s", "i", pclass_id); /* Check arguments. */ - if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property class"); /* Get the property list class name */ - if((ret_value = H5P_get_class_name(pclass)) == NULL) + if ((ret_value = H5P_get_class_name(pclass)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "unable to query name of class"); done: FUNC_LEAVE_API(ret_value) -} /* H5Pget_class_name() */ +} /* H5Pget_class_name() */ - /*-------------------------------------------------------------------------- NAME H5Pget_class_parent @@ -1547,37 +1514,36 @@ done: hid_t H5Pget_class_parent(hid_t pclass_id) { - H5P_genclass_t *pclass; /* Property class to query */ - H5P_genclass_t *parent = NULL; /* Parent's property class */ - hid_t ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property class to query */ + H5P_genclass_t *parent = NULL; /* Parent's property class */ + hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", pclass_id); /* Check arguments. */ - if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class") /* Retrieve the property class's parent */ - if(NULL == (parent = H5P_get_class_parent(pclass))) + if (NULL == (parent = H5P_get_class_parent(pclass))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list") /* Increment the outstanding references to the class object */ - if(H5P_access_class(parent, H5P_MOD_INC_REF) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count") + if (H5P_access_class(parent, H5P_MOD_INC_REF) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ID ref count") /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class") done: - if(ret_value < 0 && parent) + if (ret_value < 0 && parent) H5P_close_class(parent); FUNC_LEAVE_API(ret_value) -} /* H5Pget_class_parent() */ +} /* H5Pget_class_parent() */ - /*-------------------------------------------------------------------------- NAME H5Pclose_class @@ -1599,20 +1565,19 @@ done: herr_t H5Pclose_class(hid_t cls_id) { - hid_t ret_value = SUCCEED; /* Return value */ + hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", cls_id); /* Check arguments */ - if(H5I_GENPROP_CLS != H5I_get_type(cls_id)) + if (H5I_GENPROP_CLS != H5I_get_type(cls_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") /* Close the property list class */ - if(H5I_dec_app_ref(cls_id) < 0) + if (H5I_dec_app_ref(cls_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close") done: FUNC_LEAVE_API(ret_value) -} /* H5Pclose_class() */ - +} /* H5Pclose_class() */ |