diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 36 | ||||
-rw-r--r-- | src/H5A.c | 72 | ||||
-rw-r--r-- | src/H5D.c | 52 | ||||
-rw-r--r-- | src/H5Dprivate.h | 2 | ||||
-rw-r--r-- | src/H5F.c | 28 | ||||
-rw-r--r-- | src/H5G.c | 52 | ||||
-rw-r--r-- | src/H5I.c | 54 | ||||
-rw-r--r-- | src/H5Iprivate.h | 10 | ||||
-rw-r--r-- | src/H5Ipublic.h | 40 | ||||
-rw-r--r-- | src/H5P.c | 38 | ||||
-rw-r--r-- | src/H5R.c | 20 | ||||
-rw-r--r-- | src/H5S.c | 30 | ||||
-rw-r--r-- | src/H5Shyper.c | 9 | ||||
-rw-r--r-- | src/H5Sselect.c | 12 | ||||
-rw-r--r-- | src/H5T.c | 144 | ||||
-rw-r--r-- | src/H5TB.c | 12 | ||||
-rw-r--r-- | src/H5Tconv.c | 48 | ||||
-rw-r--r-- | src/H5Tpublic.h | 5 | ||||
-rw-r--r-- | src/H5detect.c | 2 |
19 files changed, 339 insertions, 327 deletions
@@ -1530,36 +1530,36 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) } else if (FAIL==obj) { fprintf (out, "FAIL"); } else { - switch (H5I_group (obj)) { - case BADGROUP: + switch (H5I_get_type (obj)) { + case H5I_BADID: fprintf (out, "%ld (error)", (long)obj); break; - case H5_FILE: + case H5I_FILE: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "file")) { fprintf (out, " (file)"); } break; - case H5_TEMPLATE_0: - case H5_TEMPLATE_1: - case H5_TEMPLATE_2: - case H5_TEMPLATE_3: - case H5_TEMPLATE_4: - case H5_TEMPLATE_5: - case H5_TEMPLATE_6: - case H5_TEMPLATE_7: + case H5I_TEMPLATE_0: + case H5I_TEMPLATE_1: + case H5I_TEMPLATE_2: + case H5I_TEMPLATE_3: + case H5I_TEMPLATE_4: + case H5I_TEMPLATE_5: + case H5I_TEMPLATE_6: + case H5I_TEMPLATE_7: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "plist")) { fprintf (out, " (plist)"); } break; - case H5_GROUP: + case H5I_GROUP: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "group")) { fprintf (out, " (group)"); } break; - case H5_DATATYPE: + case H5I_DATATYPE: if (obj==H5T_NATIVE_CHAR_g) { fprintf(out, "H5T_NATIVE_CHAR"); } else if (obj==H5T_NATIVE_UCHAR_g) { @@ -1653,7 +1653,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) } } break; - case H5_DATASPACE: + case H5I_DATASPACE: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "space")) { fprintf (out, " (space)"); @@ -1666,25 +1666,25 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) } } break; - case H5_DATASET: + case H5I_DATASET: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "dset")) { fprintf (out, " (dset)"); } break; - case H5_ATTR: + case H5I_ATTR: fprintf(out, "%ld", (long)obj); if (HDstrcmp (argname, "attr")) { fprintf (out, " (attr)"); } break; - case H5_TEMPBUF: + case H5I_TEMPBUF: fprintf(out, "%ld", (long)obj); if (HDstrcmp(argname, "tbuf")) { fprintf(out, " (tbuf"); } break; - case H5_RAGGED: + case H5I_RAGGED: fprintf(out, "%ld", (long)obj); if (HDstrcmp(argname, "array")) { fprintf(out, " (array)"); @@ -70,7 +70,7 @@ H5A_init_interface(void) /* * Register cleanup function. */ - if ((ret_value = H5I_init_group(H5_ATTR, H5I_ATTRID_HASHSIZE, + if ((ret_value = H5I_init_group(H5I_ATTR, H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (herr_t (*)(void *)) H5A_close)) == FAIL) { HRETURN_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, @@ -106,7 +106,7 @@ H5A_init_interface(void) static void H5A_term_interface(void) { - H5I_destroy_group(H5_ATTR); + H5I_destroy_group(H5I_ATTR); } @@ -162,8 +162,8 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5TRACE5("i","isiii",loc_id,name,type_id,space_id,plist_id); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } @@ -173,11 +173,11 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); } - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type"); } - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -282,7 +282,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, "unable to update attribute header messages"); /* Register the new attribute and get an ID for it */ - if ((ret_value = H5I_register(H5_ATTR, attr)) < 0) { + if ((ret_value = H5I_register(H5I_ATTR, attr)) < 0) { HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID"); } @@ -394,8 +394,8 @@ H5Aopen_name(hid_t loc_id, const char *name) H5TRACE2("i","is",loc_id,name); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } @@ -457,8 +457,8 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) H5TRACE2("i","iIu",loc_id,idx); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } @@ -522,7 +522,7 @@ H5A_open(H5G_entry_t *ent, unsigned idx) attr->ent_opened=1; /* Register the new attribute and get an ID for it */ - if ((ret_value = H5I_register(H5_ATTR, attr)) < 0) { + if ((ret_value = H5I_register(H5I_ATTR, attr)) < 0) { HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID"); } @@ -566,11 +566,11 @@ H5Awrite(hid_t attr_id, hid_t type_id, void *buf) H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || + if (H5I_ATTR != H5I_get_type(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (mem_type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -653,9 +653,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, void *buf) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types"); } else if (H5T_conv_noop!=tconv_func) { - if ((src_id = H5I_register(H5_DATATYPE, + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL)))<0 || - (dst_id = H5I_register(H5_DATATYPE, + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->dt, H5T_COPY_ALL)))<0) { HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); @@ -737,11 +737,11 @@ H5Aread(hid_t attr_id, hid_t type_id, void *buf) H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || + if (H5I_ATTR != H5I_get_type(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (mem_type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -823,9 +823,9 @@ H5A_read(H5A_t *attr, const H5T_t *mem_type, void *buf) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types"); } else if (H5T_conv_noop!=tconv_func) { - if ((src_id = H5I_register(H5_DATATYPE, + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->dt, H5T_COPY_ALL)))<0 || - (dst_id = H5I_register(H5_DATATYPE, + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL)))<0) { HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); @@ -892,7 +892,7 @@ H5Aget_space(hid_t attr_id) H5TRACE1("i","i",attr_id); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || + if (H5I_ATTR != H5I_get_type(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } @@ -904,7 +904,7 @@ H5Aget_space(hid_t attr_id) } /* Atomize */ - if ((ret_value=H5I_register (H5_DATASPACE, dst))<0) { + if ((ret_value=H5I_register (H5I_DATASPACE, dst))<0) { HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom"); } @@ -949,7 +949,7 @@ H5Aget_type(hid_t attr_id) H5TRACE1("i","i",attr_id); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || + if (H5I_ATTR != H5I_get_type(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } @@ -970,7 +970,7 @@ H5Aget_type(hid_t attr_id) } /* Atomize */ - if ((ret_value=H5I_register (H5_DATATYPE, dst))<0) { + if ((ret_value=H5I_register (H5I_DATATYPE, dst))<0) { H5T_close (dst); HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype atom"); @@ -1014,7 +1014,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) H5TRACE3("z","izs",attr_id,buf_size,buf); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || + if (H5I_ATTR != H5I_get_type(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } @@ -1070,25 +1070,25 @@ H5Aget_num_attrs(hid_t loc_id) H5TRACE1("Is","i",loc_id); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } if(NULL == (obj = H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); } - switch (H5I_group (loc_id)) { - case H5_DATASET: + switch (H5I_get_type (loc_id)) { + case H5I_DATASET: ent = H5D_entof ((H5D_t*)obj); break; - case H5_DATATYPE: + case H5I_DATATYPE: if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "target data type is not committed"); } break; - case H5_GROUP: + case H5I_GROUP: ent = H5G_entof ((H5G_t*)obj); break; default: @@ -1161,8 +1161,8 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) H5TRACE4("Is","i*Iuxx",loc_id,attr_num,op,op_data); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } @@ -1232,8 +1232,8 @@ H5Adelete(hid_t loc_id, const char *name) H5TRACE2("e","is",loc_id,name); /* check arguments */ - if (H5_FILE==H5I_group(loc_id) || - H5_ATTR==H5I_group(loc_id)) { + if (H5I_FILE==H5I_get_type(loc_id) || + H5I_ATTR==H5I_get_type(loc_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute"); } @@ -1298,7 +1298,7 @@ H5Aclose(hid_t attr_id) H5TRACE1("e","i",attr_id); /* check arguments */ - if (H5_ATTR != H5I_group(attr_id) || NULL == H5I_object(attr_id)) { + if (H5I_ATTR != H5I_get_type(attr_id) || NULL == H5I_object(attr_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } @@ -121,7 +121,7 @@ H5D_init_interface(void) FUNC_ENTER(H5D_init_interface, FAIL); /* Initialize the atom group for the dataset IDs */ - if ((ret_value = H5I_init_group(H5_DATASET, H5I_DATASETID_HASHSIZE, + if ((ret_value = H5I_init_group(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (herr_t (*)(void *)) H5D_close)) != FAIL) { ret_value = H5_add_exit(H5D_term_interface); @@ -150,7 +150,7 @@ H5D_init_interface(void) static void H5D_term_interface(void) { - H5I_destroy_group(H5_DATASET); + H5I_destroy_group(H5I_DATASET); } /*------------------------------------------------------------------------- @@ -214,11 +214,11 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); } - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type"); } - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -237,7 +237,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, "unable to create dataset"); } /* Register the new dataset to get an ID for it */ - if ((ret_value = H5I_register(H5_DATASET, new_dset)) < 0) { + if ((ret_value = H5I_register(H5I_DATASET, new_dset)) < 0) { H5D_close(new_dset); HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset"); @@ -290,7 +290,7 @@ H5Dopen(hid_t loc_id, const char *name) } /* Create an atom for the dataset */ - if ((ret_value = H5I_register(H5_DATASET, dataset)) < 0) { + if ((ret_value = H5I_register(H5I_DATASET, dataset)) < 0) { H5D_close(dataset); HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset"); @@ -329,7 +329,7 @@ H5Dclose(hid_t dset_id) H5TRACE1("e","i",dset_id); /* Check args */ - if (H5_DATASET != H5I_group(dset_id) || + if (H5I_DATASET != H5I_get_type(dset_id) || NULL == (dset = H5I_object(dset_id)) || NULL == dset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); @@ -375,7 +375,7 @@ H5Dget_space(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dset_id) || + if (H5I_DATASET!=H5I_get_type (dset_id) || NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } @@ -387,7 +387,7 @@ H5Dget_space(hid_t dset_id) } /* Create an atom */ - if ((ret_value=H5I_register (H5_DATASPACE, space))<0) { + if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) { H5S_close (space); HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space"); @@ -465,7 +465,7 @@ H5Dget_type(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dset_id) || + if (H5I_DATASET!=H5I_get_type (dset_id) || NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } @@ -482,7 +482,7 @@ H5Dget_type(hid_t dset_id) } /* Create an atom */ - if ((ret_value=H5I_register (H5_DATATYPE, copied_type))<0) { + if ((ret_value=H5I_register (H5I_DATATYPE, copied_type))<0) { H5T_close (copied_type); HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data type"); @@ -521,7 +521,7 @@ H5Dget_create_plist(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dset_id) || + if (H5I_DATASET!=H5I_get_type (dset_id) || NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } @@ -542,7 +542,7 @@ H5Dget_create_plist(hid_t dset_id) } /* Create an atom */ - if ((ret_value=H5I_register ((H5I_group_t)(H5_TEMPLATE_0+ + if ((ret_value=H5I_register ((H5I_type_t)(H5I_TEMPLATE_0+ H5P_DATASET_CREATE), copied_parms))<0) { HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, @@ -609,17 +609,17 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, plist_id,buf); /* check arguments */ - if (H5_DATASET != H5I_group(dset_id) || + if (H5I_DATASET != H5I_get_type(dset_id) || NULL == (dset = H5I_object(dset_id)) || NULL == dset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } - if (H5_DATATYPE != H5I_group(mem_type_id) || + if (H5I_DATATYPE != H5I_get_type(mem_type_id) || NULL == (mem_type = H5I_object(mem_type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (H5S_ALL != mem_space_id) { - if (H5_DATASPACE != H5I_group(mem_space_id) || + if (H5I_DATASPACE != H5I_get_type(mem_space_id) || NULL == (mem_space = H5I_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -630,7 +630,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, } } if (H5S_ALL != file_space_id) { - if (H5_DATASPACE != H5I_group(file_space_id) || + if (H5I_DATASPACE != H5I_get_type(file_space_id) || NULL == (file_space = H5I_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -710,17 +710,17 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, plist_id,buf); /* check arguments */ - if (H5_DATASET != H5I_group(dset_id) || + if (H5I_DATASET != H5I_get_type(dset_id) || NULL == (dset = H5I_object(dset_id)) || NULL == dset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } - if (H5_DATATYPE != H5I_group(mem_type_id) || + if (H5I_DATATYPE != H5I_get_type(mem_type_id) || NULL == (mem_type = H5I_object(mem_type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (H5S_ALL != mem_space_id) { - if (H5_DATASPACE != H5I_group(mem_space_id) || + if (H5I_DATASPACE != H5I_get_type(mem_space_id) || NULL == (mem_space = H5I_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -731,7 +731,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, } } if (H5S_ALL != file_space_id) { - if (H5_DATASPACE != H5I_group(file_space_id) || + if (H5I_DATASPACE != H5I_get_type(file_space_id) || NULL == (file_space = H5I_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -786,7 +786,7 @@ H5Dextend(hid_t dset_id, const hsize_t *size) H5TRACE2("e","i*h",dset_id,size); /* Check args */ - if (H5_DATASET!=H5I_group (dset_id) || + if (H5I_DATASET!=H5I_get_type (dset_id) || NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } @@ -1394,9 +1394,9 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types"); } else if (H5T_conv_noop!=tconv_func) { - if ((src_id=H5I_register(H5_DATATYPE, + if ((src_id=H5I_register(H5I_DATATYPE, H5T_copy(dataset->type, H5T_COPY_ALL)))<0 || - (dst_id=H5I_register(H5_DATATYPE, + (dst_id=H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL)))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); @@ -1763,9 +1763,9 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types"); } else if (H5T_conv_noop!=tconv_func) { - if ((src_id = H5I_register(H5_DATATYPE, + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL)))<0 || - (dst_id = H5I_register(H5_DATATYPE, + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dataset->type, H5T_COPY_ALL)))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 2f65c7a..4e15bf1 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -77,7 +77,7 @@ herr_t H5D_read (H5D_t *dataset, const H5T_t *mem_type, herr_t H5D_write (H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, const H5D_xfer_t *xfer_parms, const void *buf); -hid_t H5D_find_name (hid_t file_id, H5I_group_t UNUSED, const char *name); +hid_t H5D_find_name (hid_t file_id, H5I_type_t UNUSED, const char *name); herr_t H5D_extend (H5D_t *dataset, const hsize_t *size); H5G_entry_t *H5D_entof (H5D_t *dataset); H5T_t *H5D_typeof (H5D_t *dset); @@ -150,7 +150,7 @@ H5F_init_interface(void) #endif /* Initialize the atom group for the file IDs */ - if (H5I_init_group(H5_FILE, H5I_FILEID_HASHSIZE, 0, + if (H5I_init_group(H5I_FILE, H5I_FILEID_HASHSIZE, 0, (herr_t (*)(void*))H5F_close)<0 || H5_add_exit(H5F_term_interface)<0) { HRETURN_ERROR (H5E_ATOM, H5E_CANTINIT, FAIL, @@ -211,7 +211,7 @@ H5F_init_interface(void) static void H5F_term_interface(void) { - H5I_destroy_group(H5_FILE); + H5I_destroy_group(H5I_FILE); } @@ -282,7 +282,7 @@ H5Fget_create_plist(hid_t file_id) H5TRACE1("i","i",file_id); /* check args */ - if (H5_FILE != H5I_group(file_id) || NULL==(file=H5I_object(file_id))) { + if (H5I_FILE != H5I_get_type(file_id) || NULL==(file=H5I_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } @@ -332,7 +332,7 @@ H5Fget_access_plist(hid_t file_id) H5TRACE1("i","i",file_id); /* Check args */ - if (H5_FILE!=H5I_group(file_id) || NULL==(f=H5I_object(file_id))) { + if (H5I_FILE!=H5I_get_type(file_id) || NULL==(f=H5I_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } @@ -803,7 +803,7 @@ H5F_open(const char *name, uintn flags, HRETURN_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file is not writable"); } - if ((old = H5I_search(H5_FILE, H5F_compare_files, &search))) { + if ((old = H5I_search(H5I_FILE, H5F_compare_files, &search))) { if (flags & H5F_ACC_TRUNC) { HRETURN_ERROR(H5E_FILE, H5E_FILEOPEN, NULL, "file already open - TRUNC failed"); @@ -1207,7 +1207,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t create_id, } /* Get an atom for the file */ - if ((ret_value = H5I_register(H5_FILE, new_file)) < 0) { + if ((ret_value = H5I_register(H5I_FILE, new_file)) < 0) { HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file"); } @@ -1293,7 +1293,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t access_id) } /* Get an atom for the file */ - if ((ret_value = H5I_register(H5_FILE, new_file)) < 0) { + if ((ret_value = H5I_register(H5I_FILE, new_file)) < 0) { HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle"); } @@ -1339,15 +1339,15 @@ H5Fflush(hid_t object_id) FUNC_ENTER(H5Fflush, FAIL); H5TRACE1("e","i",object_id); - switch (H5I_group(object_id)) { - case H5_FILE: + switch (H5I_get_type(object_id)) { + case H5I_FILE: if (NULL==(f=H5I_object(object_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); } break; - case H5_GROUP: + case H5I_GROUP: if (NULL==(grp=H5I_object(object_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid group identifier"); @@ -1355,7 +1355,7 @@ H5Fflush(hid_t object_id) ent = H5G_entof(grp); break; - case H5_DATATYPE: + case H5I_DATATYPE: if (NULL==(type=H5I_object(object_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid type identifier"); @@ -1363,7 +1363,7 @@ H5Fflush(hid_t object_id) ent = H5T_entof(type); break; - case H5_DATASET: + case H5I_DATASET: if (NULL==(dset=H5I_object(object_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier"); @@ -1371,7 +1371,7 @@ H5Fflush(hid_t object_id) ent = H5D_entof(dset); break; - case H5_ATTR: + case H5I_ATTR: if (NULL==(attr=H5I_object(object_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid attribute identifier"); @@ -1643,7 +1643,7 @@ H5Fclose(hid_t file_id) H5TRACE1("e","i",file_id); /* Check/fix arguments. */ - if (H5_FILE != H5I_group(file_id)) { + if (H5I_FILE != H5I_get_type(file_id)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file atom"); } if (NULL == H5I_object(file_id)) { @@ -148,7 +148,7 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) if (NULL == (grp = H5G_create(loc, name, size_hint))) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group"); } - if ((ret_value = H5I_register(H5_GROUP, grp)) < 0) { + if ((ret_value = H5I_register(H5I_GROUP, grp)) < 0) { H5G_close(grp); HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group"); @@ -199,7 +199,7 @@ H5Gopen(hid_t loc_id, const char *name) HRETURN_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); } /* Register an atom for the group */ - if ((ret_value = H5I_register(H5_GROUP, grp)) < 0) { + if ((ret_value = H5I_register(H5I_GROUP, grp)) < 0) { H5G_close(grp); HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group"); @@ -232,7 +232,7 @@ H5Gclose(hid_t group_id) H5TRACE1("e","i",group_id); /* Check args */ - if (H5_GROUP != H5I_group(group_id) || + if (H5I_GROUP != H5I_get_type(group_id) || NULL == H5I_object(group_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group"); } @@ -481,7 +481,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx, if (NULL==(udata.group = H5G_open (loc, name))) { HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to open group"); } - if ((udata.group_id=H5I_register (H5_GROUP, udata.group))<0) { + if ((udata.group_id=H5I_register (H5I_GROUP, udata.group))<0) { H5G_close (udata.group); HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to register group"); @@ -869,7 +869,7 @@ H5G_init_interface(void) FUNC_ENTER(H5G_init_interface, FAIL); /* Initialize the atom group for the group IDs */ - if (H5I_init_group(H5_GROUP, H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, + if (H5I_init_group(H5I_GROUP, H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, (herr_t (*)(void *)) H5G_close) < 0 || H5_add_exit(H5G_term_interface) < 0) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, @@ -896,7 +896,7 @@ H5G_init_interface(void) static void H5G_term_interface(void) { - H5I_destroy_group(H5_GROUP); + H5I_destroy_group(H5I_GROUP); } @@ -1867,8 +1867,8 @@ H5G_loc (hid_t loc_id) FUNC_ENTER (H5G_loc, NULL); - switch (H5I_group(loc_id)) { - case H5_FILE: + switch (H5I_get_type(loc_id)) { + case H5I_FILE: if (NULL==(f=H5I_object (loc_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "invalid file ID"); } @@ -1882,22 +1882,22 @@ H5G_loc (hid_t loc_id) } break; - case H5_TEMPLATE_0: - case H5_TEMPLATE_1: - case H5_TEMPLATE_2: - case H5_TEMPLATE_3: - case H5_TEMPLATE_4: - case H5_TEMPLATE_5: - case H5_TEMPLATE_6: - case H5_TEMPLATE_7: + case H5I_TEMPLATE_0: + case H5I_TEMPLATE_1: + case H5I_TEMPLATE_2: + case H5I_TEMPLATE_3: + case H5I_TEMPLATE_4: + case H5I_TEMPLATE_5: + case H5I_TEMPLATE_6: + case H5I_TEMPLATE_7: #ifndef NDEBUG - case H5_TEMPLATE_MAX: + case H5I_TEMPLATE_MAX: #endif HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of property list"); break; - case H5_GROUP: + case H5I_GROUP: if (NULL==(group=H5I_object (loc_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "invalid group ID"); } @@ -1907,7 +1907,7 @@ H5G_loc (hid_t loc_id) } break; - case H5_DATATYPE: + case H5I_DATATYPE: if (NULL==(dt=H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid type ID"); } @@ -1917,11 +1917,11 @@ H5G_loc (hid_t loc_id) } break; - case H5_DATASPACE: + case H5I_DATASPACE: HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of data space"); - case H5_DATASET: + case H5I_DATASET: if (NULL==(dset=H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid data ID"); } @@ -1931,7 +1931,7 @@ H5G_loc (hid_t loc_id) } break; - case H5_ATTR: + case H5I_ATTR: if (NULL==(attr=H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid attribute ID"); @@ -1942,11 +1942,11 @@ H5G_loc (hid_t loc_id) } break; - case H5_TEMPBUF: + case H5I_TEMPBUF: HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of buffer"); - case H5_RAGGED: + case H5I_RAGGED: if (NULL==(ra=H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid ragged array ID"); @@ -1957,8 +1957,8 @@ H5G_loc (hid_t loc_id) } break; - case MAXGROUP: - case BADGROUP: + case H5I_MAXID: + case H5I_BADID: HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid object ID"); } @@ -41,7 +41,7 @@ static char RcsId[] = "@(#)$Revision$"; ID Functions: H5I_register - Register an object in a group and get an ID for it H5I_object - Get the object for an ID - H5I_group - Get the group for an ID + H5I_get_type - Get the group for an ID H5I_remove - Remove an ID from a group H5I_search - Search a group for a particular object ID Group Functions: @@ -84,7 +84,7 @@ static herr_t H5I_init_interface(void); # define ID_CACHE_SIZE 4 /*# of previous atoms cached */ #endif -/* # of bits to use for Group ID in each atom (change if MAXGROUP>16) */ +/* # of bits to use for Group ID in each atom (change if H5I_MAXID>16) */ #define GROUP_BITS 8 #define GROUP_MASK 0xFF @@ -93,7 +93,7 @@ static herr_t H5I_init_interface(void); #define ID_MASK 0x0FFFFFFF /* Map an atom to a Group number */ -#define H5I_GROUP(a) ((H5I_group_t) \ +#define H5I_GROUP(a) ((H5I_type_t) \ ((((hid_t)(a))>> \ ((sizeof(hid_t)*8)-GROUP_BITS))&GROUP_MASK)) @@ -121,7 +121,7 @@ static void *H5I_obj_cache[ID_CACHE_SIZE]; #endif /* Array of pointers to atomic groups */ -static H5I_id_group_t *id_group_list[MAXGROUP]; +static H5I_id_group_t *id_group_list[H5I_MAXID]; /* Pointer to the atom node free list */ static H5I_id_info_t *id_free_list = NULL; @@ -173,7 +173,7 @@ H5I_init_interface(void) ******************************************************************************/ intn -H5I_init_group(H5I_group_t grp, /* IN: Group to initialize */ +H5I_init_group(H5I_type_t grp, /* IN: Group to initialize */ size_t hash_size, /* IN: Minimum hash table size to use for group */ uintn reserved, /* IN: Number of hash table entries to reserve */ herr_t (*free_func) (void *) /* IN: Function to call when releasing ref counted objects */ @@ -184,7 +184,7 @@ H5I_init_group(H5I_group_t grp, /* IN: Group to initialize */ FUNC_ENTER(H5I_init_group, FAIL); - if ((grp <= BADGROUP || grp >= MAXGROUP) && hash_size > 0) { + if ((grp <= H5I_BADID || grp >= H5I_MAXID) && hash_size > 0) { HGOTO_DONE(FAIL); } @@ -275,7 +275,7 @@ H5I_init_group(H5I_group_t grp, /* IN: Group to initialize */ *------------------------------------------------------------------------- */ herr_t -H5I_destroy_group(H5I_group_t grp) +H5I_destroy_group(H5I_type_t grp) { H5I_id_group_t *grp_ptr = NULL; /* ptr to the atomic group */ H5I_id_info_t *cur=NULL, *next=NULL; @@ -284,7 +284,7 @@ H5I_destroy_group(H5I_group_t grp) FUNC_ENTER(H5I_destroy_group, FAIL); - if (grp <= BADGROUP || grp >= MAXGROUP) + if (grp <= H5I_BADID || grp >= H5I_MAXID) HGOTO_DONE(FAIL); grp_ptr = id_group_list[grp]; @@ -353,7 +353,7 @@ H5I_destroy_group(H5I_group_t grp) *******************************************************************************/ hid_t -H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ +H5I_register(H5I_type_t grp, /* IN: Group to register the object in */ void *object /* IN: Object to attach to atom */ ) { @@ -365,7 +365,7 @@ H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ FUNC_ENTER(H5I_register, FAIL); - if (grp <= BADGROUP || grp >= MAXGROUP) + if (grp <= H5I_BADID || grp >= H5I_MAXID) HGOTO_DONE(FAIL); grp_ptr = id_group_list[grp]; @@ -453,7 +453,7 @@ H5I_register(H5I_group_t grp, /* IN: Group to register the object in */ hid_t H5I_inc_ref(hid_t id) { - H5I_group_t grp = H5I_GROUP(id); /* object's group */ + H5I_type_t grp = H5I_GROUP(id); /* object's group */ H5I_id_group_t *grp_ptr = NULL; /* ptr to the ID group*/ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID */ hid_t ret_value = FAIL; @@ -535,25 +535,25 @@ H5I_object(hid_t id) /****************************************************************************** NAME - H5I_group - Returns to the group for the ID + H5I_get_type - Returns to the group for the ID DESCRIPTION Retrieves the group which is associated with the ID. RETURNS - Returns group if successful and BADGROUP otherwise + Returns group if successful and H5I_BADID otherwise *******************************************************************************/ -H5I_group_t -H5I_group(hid_t id) +H5I_type_t +H5I_get_type(hid_t id) { - H5I_group_t ret_value = BADGROUP; + H5I_type_t ret_value = H5I_BADID; - FUNC_ENTER(H5I_group, BADGROUP); + FUNC_ENTER(H5I_get_type, H5I_BADID); ret_value = H5I_GROUP(id); - if (ret_value <= BADGROUP || ret_value >= MAXGROUP) { - HGOTO_DONE(BADGROUP); + if (ret_value <= H5I_BADID || ret_value >= H5I_MAXID) { + HGOTO_DONE(H5I_BADID); } @@ -578,7 +578,7 @@ H5I_remove(hid_t id) H5I_id_group_t *grp_ptr = NULL;/* ptr to the atomic group */ H5I_id_info_t *curr_id, /* ptr to the current atom */ *last_id; /* ptr to the last atom */ - H5I_group_t grp; /* atom's atomic group */ + H5I_type_t grp; /* atom's atomic group */ uintn hash_loc; /* atom's hash table location */ #ifdef IDS_ARE_CACHED uintn i; /* local counting variable */ @@ -588,7 +588,7 @@ H5I_remove(hid_t id) FUNC_ENTER(H5I_remove, NULL); grp = H5I_GROUP(id); - if (grp <= BADGROUP || grp >= MAXGROUP) HGOTO_DONE(NULL); + if (grp <= H5I_BADID || grp >= H5I_MAXID) HGOTO_DONE(NULL); grp_ptr = id_group_list[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_DONE(NULL); @@ -664,7 +664,7 @@ H5I_remove(hid_t id) intn H5I_dec_ref(hid_t id) { - H5I_group_t grp = H5I_GROUP(id); /* Group the object is in */ + H5I_type_t grp = H5I_GROUP(id); /* Group the object is in */ H5I_id_group_t *grp_ptr = NULL; /* ptr to the group */ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID */ void * obj; /* object to call 'free' function with */ @@ -715,7 +715,7 @@ H5I_dec_ref(hid_t id) *******************************************************************************/ void * -H5I_search(H5I_group_t grp, /* IN: Group to search for the object in */ +H5I_search(H5I_type_t grp, /* IN: Group to search for the object in */ H5I_search_func_t func, /* IN: Ptr to the comparison function */ const void *key /* IN: pointer to key to compare against */ ) @@ -727,7 +727,7 @@ H5I_search(H5I_group_t grp, /* IN: Group to search for the object in */ FUNC_ENTER(H5I_search, NULL); - if (grp <= BADGROUP || grp >= MAXGROUP) + if (grp <= H5I_BADID || grp >= H5I_MAXID) HGOTO_DONE(NULL); grp_ptr = id_group_list[grp]; @@ -764,14 +764,14 @@ H5I_find_id(hid_t id) { H5I_id_group_t *grp_ptr = NULL; /* ptr to the group */ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID */ - H5I_group_t grp; /* ID's group */ + H5I_type_t grp; /* ID's group */ uintn hash_loc; /* ID's hash table location */ H5I_id_info_t *ret_value = NULL; FUNC_ENTER(H5I_find_id, NULL); grp = H5I_GROUP(id); - if (grp <= BADGROUP || grp >= MAXGROUP) + if (grp <= H5I_BADID || grp >= H5I_MAXID) HGOTO_DONE(NULL); grp_ptr = id_group_list[grp]; @@ -885,7 +885,7 @@ H5I_term_interface(void) } /* Release all groups */ - for (i = 0; i < (intn) MAXGROUP; i++) { + for (i = 0; i < (intn) H5I_MAXID; i++) { if (id_group_list[i] != NULL) { HDfree(id_group_list[i]); id_group_list[i] = NULL; diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index f475004..277f6e6 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -61,14 +61,14 @@ typedef struct { typedef intn (*H5I_search_func_t) (void * obj, const void * key); /* Private Functions in H5I.c */ -intn H5I_init_group (H5I_group_t grp, size_t hash_size, uintn reserved, +intn H5I_init_group (H5I_type_t grp, size_t hash_size, uintn reserved, herr_t (*free_func)(void *)); -herr_t H5I_destroy_group (H5I_group_t grp); -hid_t H5I_register (H5I_group_t grp, void *object); +herr_t H5I_destroy_group (H5I_type_t grp); +hid_t H5I_register (H5I_type_t grp, void *object); void *H5I_object (hid_t id); -H5I_group_t H5I_group (hid_t id); +H5I_type_t H5I_get_type (hid_t id); void *H5I_remove (hid_t id); -void *H5I_search (H5I_group_t grp, H5I_search_func_t func, const void *key); +void *H5I_search (H5I_type_t grp, H5I_search_func_t func, const void *key); void H5I_term_interface (void); intn H5I_dec_ref (hid_t id); hid_t H5I_inc_ref (hid_t id); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 88de38e..370cc17 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -25,28 +25,28 @@ * tracing output look better when hid_t values are large numbers. */ typedef enum { - BADGROUP = (-1),/*invalid Group */ - H5_FILE = 1, /*group ID for File objects */ - H5_TEMPLATE_0, /*group ID for Template objects */ - H5_TEMPLATE_1, /*group ID for Template objects */ - H5_TEMPLATE_2, /*group ID for Template objects */ - H5_TEMPLATE_3, /*group ID for Template objects */ - H5_TEMPLATE_4, /*group ID for Template objects */ - H5_TEMPLATE_5, /*group ID for Template objects */ - H5_TEMPLATE_6, /*group ID for Template objects */ - H5_TEMPLATE_7, /*group ID for Template objects */ + H5I_BADID = (-1),/*invalid Group */ + H5I_FILE = 1, /*group ID for File objects */ + H5I_TEMPLATE_0, /*group ID for Template objects */ + H5I_TEMPLATE_1, /*group ID for Template objects */ + H5I_TEMPLATE_2, /*group ID for Template objects */ + H5I_TEMPLATE_3, /*group ID for Template objects */ + H5I_TEMPLATE_4, /*group ID for Template objects */ + H5I_TEMPLATE_5, /*group ID for Template objects */ + H5I_TEMPLATE_6, /*group ID for Template objects */ + H5I_TEMPLATE_7, /*group ID for Template objects */ #ifndef NDEBUG - H5_TEMPLATE_MAX, /*not really a group ID */ + H5I_TEMPLATE_MAX, /*not really a group ID */ #endif - H5_GROUP, /*group ID for Group objects */ - H5_DATATYPE, /*group ID for Datatype objects */ - H5_DATASPACE, /*group ID for Dataspace objects */ - H5_DATASET, /*group ID for Dataset objects */ - H5_ATTR, /*group ID for Attribute objects */ - H5_TEMPBUF, /*group ID for Temporary buffer objects */ - H5_RAGGED, /*group ID for Ragged array objects */ - MAXGROUP /*highest group in group_t (Invalid as true group)*/ -} H5I_group_t; + H5I_GROUP, /*group ID for Group objects */ + H5I_DATATYPE, /*group ID for Datatype objects */ + H5I_DATASPACE, /*group ID for Dataspace objects */ + H5I_DATASET, /*group ID for Dataset objects */ + H5I_ATTR, /*group ID for Attribute objects */ + H5I_TEMPBUF, /*group ID for Temporary buffer objects */ + H5I_RAGGED, /*group ID for Ragged array objects */ + H5I_MAXID /*highest group in group_t (Invalid as true group)*/ +} H5I_type_t; /* Type of atoms to return to users */ typedef int hid_t; @@ -68,7 +68,7 @@ H5P_init_interface(void) "unable to initialize H5F and H5P interfaces"); } - assert(H5P_NCLASSES <= H5_TEMPLATE_MAX - H5_TEMPLATE_0); + assert(H5P_NCLASSES <= H5I_TEMPLATE_MAX - H5I_TEMPLATE_0); /* * Initialize the mappings between property list classes and atom @@ -76,7 +76,7 @@ H5P_init_interface(void) * publicly visible but atom groups aren't. */ for (i = 0; i < H5P_NCLASSES; i++) { - status = H5I_init_group((H5I_group_t)(H5_TEMPLATE_0 +i), + status = H5I_init_group((H5I_type_t)(H5I_TEMPLATE_0 +i), H5I_TEMPID_HASHSIZE, 0, NULL); if (status < 0) ret_value = FAIL; } @@ -119,7 +119,7 @@ H5P_term_interface(void) intn i; for (i = 0; i < H5P_NCLASSES; i++) { - H5I_destroy_group((H5I_group_t)(H5_TEMPLATE_0 + i)); + H5I_destroy_group((H5I_type_t)(H5I_TEMPLATE_0 + i)); } } @@ -232,7 +232,7 @@ H5P_create(H5P_class_t type, void *plist) assert(plist); /* Atomize the new property list */ - if ((ret_value=H5I_register((H5I_group_t)(H5_TEMPLATE_0+type), plist))<0) { + if ((ret_value=H5I_register((H5I_type_t)(H5I_TEMPLATE_0+type), plist))<0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to register property list"); } @@ -385,21 +385,21 @@ H5P_close (H5P_class_t type, void *plist) H5P_class_t H5Pget_class(hid_t plist_id) { - H5I_group_t group; + H5I_type_t group; H5P_class_t ret_value = H5P_NO_CLASS; FUNC_ENTER(H5Pget_class, H5P_NO_CLASS); H5TRACE1("p","i",plist_id); - if ((group = H5I_group(plist_id)) < 0 || + if ((group = H5I_get_type(plist_id)) < 0 || #ifndef NDEBUG - group >= H5_TEMPLATE_MAX || + group >= H5I_TEMPLATE_MAX || #endif - group < H5_TEMPLATE_0) { + group < H5I_TEMPLATE_0) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, H5P_NO_CLASS, "not a property list"); } - ret_value = (H5P_class_t)(group - H5_TEMPLATE_0); + ret_value = (H5P_class_t)(group - H5I_TEMPLATE_0); FUNC_LEAVE(ret_value); } @@ -423,20 +423,20 @@ H5Pget_class(hid_t plist_id) H5P_class_t H5P_get_class(hid_t plist_id) { - H5I_group_t group; + H5I_type_t group; H5P_class_t ret_value = H5P_NO_CLASS; FUNC_ENTER(H5P_get_class, H5P_NO_CLASS); - if ((group = H5I_group(plist_id)) < 0 || + if ((group = H5I_get_type(plist_id)) < 0 || #ifndef NDEBUG - group >= H5_TEMPLATE_MAX || + group >= H5I_TEMPLATE_MAX || #endif - group < H5_TEMPLATE_0) { + group < H5I_TEMPLATE_0) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, H5P_NO_CLASS, "not a property list"); } - ret_value = (H5P_class_t)(group - H5_TEMPLATE_0); + ret_value = (H5P_class_t)(group - H5I_TEMPLATE_0); FUNC_LEAVE(ret_value); } @@ -2658,7 +2658,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } - if (H5_DATATYPE!=H5I_group(type_id) || + if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(type=H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -2726,7 +2726,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation proprety list"); } - if (H5_DATATYPE!=H5I_group(type_id) || + if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(type=H5I_object(type_id))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -2751,7 +2751,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types"); } - src_id = H5I_register(H5_DATATYPE, + src_id = H5I_register(H5I_DATATYPE, H5T_copy (plist->fill.type, H5T_COPY_TRANSIENT)); if (src_id<0) { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, @@ -3076,7 +3076,7 @@ H5Pcopy(hid_t plist_id) void *new_plist = NULL; H5P_class_t type; hid_t ret_value = FAIL; - H5I_group_t group; + H5I_type_t group; FUNC_ENTER(H5Pcopy, FAIL); H5TRACE1("i","i",plist_id); @@ -3084,7 +3084,7 @@ H5Pcopy(hid_t plist_id) /* Check args */ if (NULL == (plist = H5I_object(plist_id)) || (type = H5P_get_class(plist_id)) < 0 || - (group = H5I_group(plist_id)) < 0) { + (group = H5I_get_type(plist_id)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "unable to unatomize property list"); } @@ -82,7 +82,7 @@ H5R_init_interface(void) FUNC_ENTER(H5R_init_interface, FAIL); /* The atom group */ - if ((ret_value=H5I_init_group(H5_RAGGED, H5I_RAGGED_HASHSIZE, 0, + if ((ret_value=H5I_init_group(H5I_RAGGED, H5I_RAGGED_HASHSIZE, 0, (herr_t(*)(void*))H5R_close))>=0) { ret_value = H5_add_exit(H5R_term_interface); } @@ -121,7 +121,7 @@ H5R_init_interface(void) static void H5R_term_interface(void) { - H5I_destroy_group(H5_RAGGED); + H5I_destroy_group(H5I_RAGGED); H5T_close(H5R_meta_type_g); H5R_meta_type_g = NULL; } @@ -176,7 +176,7 @@ H5Rcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t plist_id) if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given"); } - if (H5_DATATYPE!=H5I_group(type_id) || + if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(type=H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -203,7 +203,7 @@ H5Rcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t plist_id) } /* Register the new dataset to get an ID for it */ - if ((ret_value=H5I_register(H5_RAGGED, ra))<0) { + if ((ret_value=H5I_register(H5I_RAGGED, ra))<0) { H5R_close(ra); HRETURN_ERROR(H5E_RAGGED, H5E_CANTREGISTER, FAIL, "unable to register ragged array"); @@ -389,7 +389,7 @@ H5Ropen(hid_t loc_id, const char *name) } /* Turn it into an atom */ - if ((ret_value=H5I_register(H5_RAGGED, ra))<0) { + if ((ret_value=H5I_register(H5I_RAGGED, ra))<0) { H5R_close(ra); HRETURN_ERROR(H5E_RAGGED, H5E_CANTREGISTER, FAIL, "unable to register ragged array"); @@ -489,7 +489,7 @@ H5Rclose(hid_t array_id) H5TRACE1("e","i",array_id); /* Check args */ - if (H5_RAGGED!=H5I_group(array_id) || + if (H5I_RAGGED!=H5I_get_type(array_id) || NULL==(ra=H5I_object(array_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a ragged array"); } @@ -574,11 +574,11 @@ H5Rwrite(hid_t array_id, hssize_t start_row, hsize_t nrows, buf); /* Check args */ - if (H5_RAGGED!=H5I_group(array_id) || + if (H5I_RAGGED!=H5I_get_type(array_id) || NULL==(ra=H5I_object(array_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a ragged array"); } - if (H5_DATATYPE!=H5I_group(type_id) || + if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(type=H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -935,11 +935,11 @@ H5Rread(hid_t array_id, hssize_t start_row, hsize_t nrows, buf); /* Check args */ - if (H5_RAGGED!=H5I_group(array_id) || + if (H5I_RAGGED!=H5I_get_type(array_id) || NULL==(ra=H5I_object(array_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a ragged array"); } - if (H5_DATATYPE!=H5I_group(type_id) || + if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(type=H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -65,7 +65,7 @@ H5S_init_interface(void) FUNC_ENTER(H5S_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5I_init_group(H5_DATASPACE, H5I_DATASPACEID_HASHSIZE, + if ((ret_value = H5I_init_group(H5I_DATASPACE, H5I_DATASPACEID_HASHSIZE, H5S_RESERVED_ATOMS, (herr_t (*)(void *)) H5S_close)) != FAIL) { ret_value = H5_add_exit(&H5S_term_interface); } @@ -199,7 +199,7 @@ H5S_term_interface(void) #endif /* Free data types */ - H5I_destroy_group(H5_DATASPACE); + H5I_destroy_group(H5I_DATASPACE); /* Clear/free conversion table */ HDmemset(H5S_fconv_g, 0, sizeof(H5S_fconv_g)); @@ -327,7 +327,7 @@ H5Screate(H5S_class_t type) } /* Atomize */ - if ((ret_value=H5I_register (H5_DATASPACE, new_ds))<0) { + if ((ret_value=H5I_register (H5I_DATASPACE, new_ds))<0) { HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom"); } @@ -449,7 +449,7 @@ H5Sclose(hid_t space_id) H5TRACE1("e","i",space_id); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == H5I_object(space_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -519,7 +519,7 @@ H5Scopy(hid_t space_id) H5TRACE1("i","i",space_id); /* Check args */ - if (H5_DATASPACE!=H5I_group (space_id) || NULL==(src=H5I_object (space_id))) { + if (H5I_DATASPACE!=H5I_get_type (space_id) || NULL==(src=H5I_object (space_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -529,7 +529,7 @@ H5Scopy(hid_t space_id) } /* Atomize */ - if ((ret_value=H5I_register (H5_DATASPACE, dst))<0) { + if ((ret_value=H5I_register (H5I_DATASPACE, dst))<0) { HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom"); } @@ -562,10 +562,10 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id) H5TRACE2("e","ii",dst_id,src_id); /* Check args */ - if (H5_DATASPACE!=H5I_group (src_id) || NULL==(src=H5I_object (src_id))) { + if (H5I_DATASPACE!=H5I_get_type (src_id) || NULL==(src=H5I_object (src_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } - if (H5_DATASPACE!=H5I_group (dst_id) || NULL==(dst=H5I_object (dst_id))) { + if (H5I_DATASPACE!=H5I_get_type (dst_id) || NULL==(dst=H5I_object (dst_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -756,7 +756,7 @@ H5Sget_simple_extent_npoints(hid_t space_id) H5TRACE1("h","i",space_id); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || NULL == (ds = H5I_object(space_id))) { + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (ds = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); } ret_value = H5S_get_simple_extent_npoints(ds); @@ -858,7 +858,7 @@ H5Sget_simple_extent_ndims(hid_t space_id) H5TRACE1("Is","i",space_id); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (ds = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -949,7 +949,7 @@ H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[]/*out*/, H5TRACE3("Is","ixx",space_id,dims,maxdims); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (ds = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); } @@ -1634,7 +1634,7 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], } /* Atomize */ - if ((ret_value=H5I_register (H5_DATASPACE, space))<0) { + if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) { HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom"); } @@ -1672,7 +1672,7 @@ H5Sget_simple_extent_type(hid_t sid) H5TRACE1("Sc","i",sid); /* Check arguments */ - if (H5_DATASPACE != H5I_group(sid) || NULL == (space = H5I_object(sid))) { + if (H5I_DATASPACE != H5I_get_type(sid) || NULL == (space = H5I_object(sid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace"); } @@ -1705,7 +1705,7 @@ H5Sset_extent_none(hid_t space_id) H5TRACE1("e","i",space_id); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || NULL == (space = H5I_object(space_id))) { + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); } @@ -1743,7 +1743,7 @@ H5Soffset_simple(hid_t space_id, const hssize_t *offset) H5TRACE2("e","i*Hs",space_id,offset); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || NULL == (space = H5I_object(space_id))) { + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); } if (offset == NULL) { diff --git a/src/H5Shyper.c b/src/H5Shyper.c index c27d068..40a157f 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -2115,7 +2115,8 @@ H5S_hyper_clip (H5S_t *space, H5S_hyper_node_t *nodes, H5S_hyper_node_t **uniq, H5S_hyper_node_t *region, /* Temp. hyperslab selection region pointer */ *node, /* Temp. hyperslab node pointer */ *next_node; /* Pointer to next node in node list */ - hsize_t *start, *end=NULL; /* Temporary arrays of start & sizes (for splitting nodes) */ + hssize_t *start; /* Temporary arrays of start & sizes (for splitting nodes) */ + hsize_t *end=NULL; /* Temporary arrays of start & sizes (for splitting nodes) */ intn rank; /* Cached copy of the rank of the dataspace */ intn overlapped; /* Flag for overlapping nodes */ intn non_intersect; /* Flag for non-intersecting nodes */ @@ -2131,7 +2132,7 @@ H5S_hyper_clip (H5S_t *space, H5S_hyper_node_t *nodes, H5S_hyper_node_t **uniq, assert (nodes); /* Allocate space for the temporary starts & sizes */ - if((start = H5MM_malloc(sizeof(hsize_t)*space->extent.u.simple.rank))==NULL) + if((start = H5MM_malloc(sizeof(hssize_t)*space->extent.u.simple.rank))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab start array"); if((end = H5MM_malloc(sizeof(hsize_t)*space->extent.u.simple.rank))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab size array"); @@ -2218,7 +2219,7 @@ H5S_hyper_clip (H5S_t *space, H5S_hyper_node_t *nodes, H5S_hyper_node_t **uniq, /* Clip the existing non-overlapped portion off the current node */ node->start[i]=region->start[i]; /* Add the non-overlapping portion to the list of new nodes */ - if(H5S_hyper_node_add(&nodes,1,rank,(const hsize_t *)start,(const hsize_t *)end)<0) + if(H5S_hyper_node_add(&nodes,1,rank,(const hssize_t *)start,(const hsize_t *)end)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslab"); } /* end if */ @@ -2230,7 +2231,7 @@ H5S_hyper_clip (H5S_t *space, H5S_hyper_node_t *nodes, H5S_hyper_node_t **uniq, /* Clip the existing non-overlapped portion off the current node */ node->end[i]=region->end[i]; /* Add the non-overlapping portion to the list of new nodes */ - if(H5S_hyper_node_add(&nodes,1,rank,(const hsize_t *)start,(const hsize_t *)end)<0) + if(H5S_hyper_node_add(&nodes,1,rank,(const hssize_t *)start,(const hsize_t *)end)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslab"); } /* end if */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 17804e4..3f2493a 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -250,7 +250,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, count,_block); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || + if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space=H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -561,7 +561,7 @@ herr_t H5Sselect_elements (hid_t spaceid, H5S_seloper_t op, size_t num_elem, FUNC_ENTER (H5Sselect_elements, FAIL); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || + if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -639,7 +639,7 @@ herr_t H5Sselect_all (hid_t spaceid) FUNC_ENTER (H5Sselect_all, FAIL); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || + if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -683,7 +683,7 @@ herr_t H5Sselect_none (hid_t spaceid) FUNC_ENTER (H5Sselect_none, FAIL); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || + if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } @@ -729,7 +729,7 @@ H5Sget_select_npoints(hid_t spaceid) H5TRACE1("h","i",spaceid); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || + if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); } @@ -870,7 +870,7 @@ H5Sselect_valid(hid_t spaceid) H5TRACE1("b","i",spaceid); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || + if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); } @@ -91,6 +91,7 @@ hid_t H5T_NATIVE_HSIZE_g = FAIL; hid_t H5T_NATIVE_HSSIZE_g = FAIL; hid_t H5T_NATIVE_HERR_g = FAIL; hid_t H5T_NATIVE_HBOOL_g = FAIL; +hid_t H5T_NATIVE_PTR_OBJ_g = FAIL; /* The path database */ static intn H5T_npath_g = 0; /*num paths defined */ @@ -127,7 +128,7 @@ H5T_init_interface(void) FUNC_ENTER(H5T_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5I_init_group(H5_DATATYPE, H5I_DATATYPEID_HASHSIZE, + if ((ret_value = H5I_init_group(H5I_DATATYPE, H5I_DATATYPEID_HASHSIZE, H5T_RESERVED_ATOMS, (herr_t (*)(void *)) H5T_close)) != FAIL) { ret_value = H5_add_exit(&H5T_term_interface); @@ -186,7 +187,7 @@ H5T_init_interface(void) dt->u.atomic.prec = 8 * dt->size; dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_OPAQUE_g = H5I_register(H5_DATATYPE, dt)) < 0) { + if ((H5T_NATIVE_OPAQUE_g = H5I_register(H5I_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize H5T layer"); } @@ -219,6 +220,13 @@ H5T_init_interface(void) dt->u.atomic.prec = 8*dt->size; dt->u.atomic.offset = 0; + /* Object pointer (i.e. object header address in file) */ + dt = H5I_object (H5T_NATIVE_PTR_OBJ_g = H5Tcopy (H5T_NATIVE_INT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->size = sizeof(haddr_t); + dt->u.atomic.prec = 8*dt->size; + dt->u.atomic.offset = 0; + /*------------------------------------------------------------ * IEEE Types *------------------------------------------------------------ @@ -566,7 +574,7 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.s.cset = H5T_CSET_ASCII; dt->u.atomic.u.s.pad = H5T_STR_NULLTERM; - if ((H5T_C_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) { + if ((H5T_C_S1_g = H5I_register(H5I_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } @@ -592,7 +600,7 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.s.cset = H5T_CSET_ASCII; dt->u.atomic.u.s.pad = H5T_STR_SPACEPAD; - if ((H5T_FORTRAN_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) { + if ((H5T_FORTRAN_S1_g = H5I_register(H5I_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } @@ -818,8 +826,8 @@ H5T_term_interface(void) } /* Unlock all datatypes, then free them */ - H5I_search (H5_DATATYPE, H5T_unlock_cb, NULL); - H5I_destroy_group(H5_DATATYPE); + H5I_search (H5I_DATATYPE, H5T_unlock_cb, NULL); + H5I_destroy_group(H5I_DATATYPE); } @@ -865,7 +873,7 @@ H5Tcreate(H5T_class_t type, size_t size) } /* Make it an atom */ - if ((ret_value = H5I_register(H5_DATATYPE, dt)) < 0) { + if ((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); } @@ -915,7 +923,7 @@ H5Topen(hid_t loc_id, const char *name) } /* Register the type and return the ID */ - if ((ret_value=H5I_register (H5_DATATYPE, type))<0) { + if ((ret_value=H5I_register (H5I_DATATYPE, type))<0) { H5T_close (type); HRETURN_ERROR (H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named data type"); @@ -958,7 +966,7 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) if (!name || !*name) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); } - if (H5_DATATYPE!=H5I_group (type_id) || + if (H5I_DATATYPE!=H5I_get_type (type_id) || NULL==(type=H5I_object (type_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -998,7 +1006,7 @@ H5Tcommitted(hid_t type_id) H5TRACE1("b","i",type_id); /* Check arguments */ - if (H5_DATATYPE!=H5I_group (type_id) || + if (H5I_DATATYPE!=H5I_get_type (type_id) || NULL==(type=H5I_object (type_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1042,15 +1050,15 @@ H5Tcopy(hid_t type_id) FUNC_ENTER(H5Tcopy, FAIL); H5TRACE1("i","i",type_id); - switch (H5I_group (type_id)) { - case H5_DATATYPE: + switch (H5I_get_type (type_id)) { + case H5I_DATATYPE: /* The argument is a data type handle */ if (NULL==(dt=H5I_object (type_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } break; - case H5_DATASET: + case H5I_DATASET: /* The argument is a dataset handle */ if (NULL==(dset=H5I_object (type_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); @@ -1072,7 +1080,7 @@ H5Tcopy(hid_t type_id) } /* Atomize result */ - if ((ret_value = H5I_register(H5_DATATYPE, new_dt)) < 0) { + if ((ret_value = H5I_register(H5I_DATATYPE, new_dt)) < 0) { H5T_close(new_dt); HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); @@ -1107,7 +1115,7 @@ H5Tclose(hid_t type_id) H5TRACE1("e","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1153,9 +1161,9 @@ H5Tequal(hid_t type1_id, hid_t type2_id) H5TRACE2("b","ii",type1_id,type2_id); /* check args */ - if (H5_DATATYPE != H5I_group(type1_id) || + if (H5I_DATATYPE != H5I_get_type(type1_id) || NULL == (dt1 = H5I_object(type1_id)) || - H5_DATATYPE != H5I_group(type2_id) || + H5I_DATATYPE != H5I_get_type(type2_id) || NULL == (dt2 = H5I_object(type2_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1200,7 +1208,7 @@ H5Tlock(hid_t type_id) H5TRACE1("e","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1243,7 +1251,7 @@ H5Tget_class(hid_t type_id) H5TRACE1("Tt","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type"); } @@ -1280,7 +1288,7 @@ H5Tget_size(hid_t type_id) H5TRACE1("z","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data type"); } @@ -1330,7 +1338,7 @@ H5Tset_size(hid_t type_id, size_t size) H5TRACE2("e","iz",type_id,size); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1428,7 +1436,7 @@ H5Tget_order(hid_t type_id) H5TRACE1("To","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, @@ -1467,7 +1475,7 @@ H5Tset_order(hid_t type_id, H5T_order_t order) H5TRACE2("e","iTo",type_id,order); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1515,7 +1523,7 @@ H5Tget_precision(hid_t type_id) H5TRACE1("z","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an atomic data type"); @@ -1567,7 +1575,7 @@ H5Tset_precision(hid_t type_id, size_t prec) H5TRACE2("e","iz",type_id,prec); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1671,7 +1679,7 @@ H5Tget_offset(hid_t type_id) H5TRACE1("z","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an atomic data type"); @@ -1732,7 +1740,7 @@ H5Tset_offset(hid_t type_id, size_t offset) H5TRACE2("e","iz",type_id,offset); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1784,7 +1792,7 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) H5TRACE3("e","ixx",type_id,lsb,msb); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1823,7 +1831,7 @@ H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb) H5TRACE3("e","iTpTp",type_id,lsb,msb); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || !H5T_is_atomic(dt)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type"); @@ -1869,7 +1877,7 @@ H5Tget_sign(hid_t type_id) H5TRACE1("Ts","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_INTEGER != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, @@ -1908,7 +1916,7 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) H5TRACE2("e","iTs",type_id,sign); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_INTEGER != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type"); @@ -1959,7 +1967,7 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/, H5TRACE6("e","ixxxxx",type_id,spos,epos,esize,mpos,msize); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, @@ -2009,7 +2017,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, H5TRACE6("e","izzzzz",type_id,spos,epos,esize,mpos,msize); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, @@ -2083,7 +2091,7 @@ H5Tget_ebias(hid_t type_id) H5TRACE1("z","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, @@ -2122,7 +2130,7 @@ H5Tset_ebias(hid_t type_id, size_t ebias) H5TRACE2("e","iz",type_id,ebias); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, @@ -2166,7 +2174,7 @@ H5Tget_norm(hid_t type_id) H5TRACE1("Tn","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NORM_ERROR, @@ -2206,7 +2214,7 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm) H5TRACE2("e","iTn",type_id,norm); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, @@ -2254,7 +2262,7 @@ H5Tget_inpad(hid_t type_id) H5TRACE1("Tp","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_PAD_ERROR, @@ -2296,7 +2304,7 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad) H5TRACE2("e","iTp",type_id,pad); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_FLOAT != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, @@ -2344,7 +2352,7 @@ H5Tget_cset(hid_t type_id) H5TRACE1("Tc","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, @@ -2385,7 +2393,7 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset) H5TRACE2("e","iTc",type_id,cset); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a string data type"); @@ -2433,7 +2441,7 @@ H5Tget_strpad(hid_t type_id) H5TRACE1("Tz","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, @@ -2485,7 +2493,7 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) H5TRACE2("e","iTz",type_id,strpad); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_STRING != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a string data type"); @@ -2532,7 +2540,7 @@ H5Tget_nmembers(hid_t type_id) H5TRACE1("Is","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2571,7 +2579,7 @@ H5Tget_member_name(hid_t type_id, int membno) FUNC_ENTER(H5Tget_member_name, NULL); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a compound data type"); @@ -2616,7 +2624,7 @@ H5Tget_member_offset(hid_t type_id, int membno) H5TRACE2("z","iIs",type_id,membno); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a compound data type"); @@ -2662,7 +2670,7 @@ H5Tget_member_dims(hid_t type_id, int membno, H5TRACE4("Is","iIsxx",type_id,membno,dims,perm); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2716,7 +2724,7 @@ H5Tget_member_type(hid_t type_id, int membno) H5TRACE2("i","iIs",type_id,membno); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2731,7 +2739,7 @@ H5Tget_member_type(hid_t type_id, int membno) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy member data type"); } - if ((memb_type_id = H5I_register(H5_DATATYPE, memb_dt)) < 0) { + if ((memb_type_id = H5I_register(H5I_DATATYPE, memb_dt)) < 0) { H5T_close(memb_dt); HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register data type atom"); @@ -2779,7 +2787,7 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id) H5TRACE4("e","iszi",parent_id,name,offset,member_id); /* Check args */ - if (H5_DATATYPE != H5I_group(parent_id) || + if (H5I_DATATYPE != H5I_get_type(parent_id) || NULL == (parent = H5I_object(parent_id)) || H5T_COMPOUND != parent->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2790,7 +2798,7 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id) if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no member name"); } - if (H5_DATATYPE != H5I_group(member_id) || + if (H5I_DATATYPE != H5I_get_type(member_id) || NULL == (member = H5I_object(member_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -2841,7 +2849,7 @@ H5Tinsert_array(hid_t parent_id, const char *name, size_t offset, member_id); /* Check args */ - if (H5_DATATYPE != H5I_group(parent_id) || + if (H5I_DATATYPE != H5I_get_type(parent_id) || NULL == (parent = H5I_object(parent_id)) || H5T_COMPOUND != parent->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2863,7 +2871,7 @@ H5Tinsert_array(hid_t parent_id, const char *name, size_t offset, HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimension"); } } - if (H5_DATATYPE != H5I_group(member_id) || + if (H5I_DATATYPE != H5I_get_type(member_id) || NULL == (member = H5I_object(member_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -2904,7 +2912,7 @@ H5Tpack(hid_t type_id) H5TRACE1("e","i",type_id); /* Check args */ - if (H5_DATATYPE != H5I_group(type_id) || + if (H5I_DATATYPE != H5I_get_type(type_id) || NULL == (dt = H5I_object(type_id)) || H5T_COMPOUND != dt->type) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound data type"); @@ -2965,9 +2973,9 @@ H5Tregister_hard(const char *name, hid_t src_id, hid_t dst_id, HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "conversion must have a name for debugging"); } - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -3072,9 +3080,9 @@ H5Tregister_soft(const char *name, H5T_class_t src_cls, H5T_class_t dst_cls, * data type temporarily to an object id before we query the functions * capabilities. */ - if ((src_id = H5I_register(H5_DATATYPE, + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL))) < 0 || - (dst_id = H5I_register(H5_DATATYPE, + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query"); @@ -3202,10 +3210,10 @@ H5Tunregister(H5T_conv_t func) * Conversion functions are app-level, so temporarily create * object id's for the data types. */ - if ((src_id = H5I_register(H5_DATATYPE, + if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL))) < 0 || - (dst_id = H5I_register(H5_DATATYPE, + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, @@ -3271,9 +3279,9 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) H5TRACE3("x","iix",src_id,dst_id,pcdata); /* Check args */ - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); } @@ -3333,9 +3341,9 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, H5TRACE5("e","iizxx",src_id,dst_id,nelmts,buf,background); /* Check args */ - if (H5_DATATYPE!=H5I_group(src_id) || + if (H5I_DATATYPE!=H5I_get_type(src_id) || NULL==(src=H5I_object(src_id)) || - H5_DATATYPE!=H5I_group(dst_id) || + H5I_DATATYPE!=H5I_get_type(dst_id) || NULL==(dst=H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -4487,9 +4495,9 @@ H5T_path_find(const char *name, const H5T_t *src, const H5T_t *dst, HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } - if ((src_id=H5I_register(H5_DATATYPE, + if ((src_id=H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL))) < 0 || - (dst_id=H5I_register(H5_DATATYPE, + (dst_id=H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register conv types for query"); @@ -4512,10 +4520,10 @@ H5T_path_find(const char *name, const H5T_t *src, const H5T_t *dst, dst->type!=H5T_soft_g[i].dst) { continue; } - if ((src_id=H5I_register(H5_DATATYPE, + if ((src_id=H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL))) < 0 || - (dst_id=H5I_register(H5_DATATYPE, + (dst_id=H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL))) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, @@ -84,7 +84,7 @@ H5TB_init_interface(void) FUNC_ENTER(H5TB_init_interface, FAIL); /* Initialize the atom group for the file IDs */ - if ((ret_value = H5I_init_group(H5_TEMPBUF, H5I_TEMPBUFID_HASHSIZE, + if ((ret_value = H5I_init_group(H5I_TEMPBUF, H5I_TEMPBUFID_HASHSIZE, H5TB_RESERVED_ATOMS, NULL)) != FAIL) { ret_value = H5_add_exit(&H5TB_term_interface); } @@ -116,7 +116,7 @@ H5TB_term_interface(void) *next; /* pointer to next temp. buffer */ /* Destroy the atom group */ - H5I_destroy_group(H5_TEMPBUF); + H5I_destroy_group(H5I_TEMPBUF); /* Step through the list and free the buffers */ while(curr!=NULL) { @@ -285,7 +285,7 @@ H5TB_get_buf(hsize_t size, hbool_t resize, void **ptr) } /* end if */ /* Atomize */ - if ((ret_value=H5I_register (H5_TEMPBUF, curr))<0) { + if ((ret_value=H5I_register (H5I_TEMPBUF, curr))<0) { HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register temp. buffer atom"); } @@ -324,7 +324,7 @@ H5TB_buf_ptr(hid_t tbuf_id) FUNC_ENTER (H5TB_buf_ptr, NULL); - if (H5_TEMPBUF != H5I_group(tbuf_id) || + if (H5I_TEMPBUF != H5I_get_type(tbuf_id) || NULL == (tbuf = H5I_object(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a temp. buffer"); } @@ -367,7 +367,7 @@ H5TB_resize_buf(hid_t tbuf_id, hsize_t size) FUNC_ENTER (H5TB_resize_buf, FAIL); - if (H5_TEMPBUF != H5I_group(tbuf_id) || + if (H5I_TEMPBUF != H5I_get_type(tbuf_id) || NULL == (tbuf = H5I_object(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a temp. buffer"); } @@ -522,7 +522,7 @@ H5TB_release_buf(hid_t tbuf_id) FUNC_ENTER (H5TB_release_buf, FAIL); - if (H5_TEMPBUF != H5I_group(tbuf_id) || + if (H5I_TEMPBUF != H5I_get_type(tbuf_id) || NULL == (tbuf = H5I_remove(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a temp. buffer"); } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 76d92c9..695ea30 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -109,9 +109,9 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, switch (cdata->command) { case H5T_CONV_INIT: /* Capability query */ - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -153,9 +153,9 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_CONV_CONV: /* The conversion */ - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -257,13 +257,13 @@ H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) } if (priv->src2dst[i]>=0) { type = H5T_copy (src->u.compnd.memb[i].type, H5T_COPY_ALL); - tid = H5I_register (H5_DATATYPE, type); + tid = H5I_register (H5I_DATATYPE, type); assert (tid>=0); priv->src_memb_id[priv->src2dst[i]] = tid; type = H5T_copy (dst->u.compnd.memb[priv->src2dst[i]].type, H5T_COPY_ALL); - tid = H5I_register (H5_DATATYPE, type); + tid = H5I_register (H5I_DATATYPE, type); assert (tid>=0); priv->dst_memb_id[priv->src2dst[i]] = tid; } @@ -405,9 +405,9 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * otherwise initialize the `priv' field of `cdata' with information * that remains (almost) constant for this conversion path. */ - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -437,9 +437,9 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Conversion. */ - if (H5_DATATYPE != H5I_group(src_id) || + if (H5I_DATATYPE != H5I_get_type(src_id) || NULL == (src = H5I_object(src_id)) || - H5_DATATYPE != H5I_group(dst_id) || + H5I_DATATYPE != H5I_get_type(dst_id) || NULL == (dst = H5I_object(dst_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -599,9 +599,9 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, switch (cdata->command) { case H5T_CONV_INIT: - if (H5_DATATYPE!=H5I_group (src_id) || + if (H5I_DATATYPE!=H5I_get_type (src_id) || NULL==(src=H5I_object (src_id)) || - H5_DATATYPE!=H5I_group (dst_id) || + H5I_DATATYPE!=H5I_get_type (dst_id) || NULL==(dst=H5I_object (dst_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -627,9 +627,9 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, case H5T_CONV_CONV: /* Get the data types */ - if (H5_DATATYPE!=H5I_group (src_id) || + if (H5I_DATATYPE!=H5I_get_type (src_id) || NULL==(src=H5I_object (src_id)) || - H5_DATATYPE!=H5I_group (dst_id) || + H5I_DATATYPE!=H5I_get_type (dst_id) || NULL==(dst=H5I_object (dst_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -968,9 +968,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, switch (cdata->command) { case H5T_CONV_INIT: - if (H5_DATATYPE!=H5I_group (src_id) || + if (H5I_DATATYPE!=H5I_get_type (src_id) || NULL==(src_p=H5I_object (src_id)) || - H5_DATATYPE!=H5I_group (dst_id) || + H5I_DATATYPE!=H5I_get_type (dst_id) || NULL==(dst_p=H5I_object (dst_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1003,9 +1003,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, case H5T_CONV_CONV: /* Get the data types */ - if (H5_DATATYPE!=H5I_group (src_id) || + if (H5I_DATATYPE!=H5I_get_type (src_id) || NULL==(src_p=H5I_object (src_id)) || - H5_DATATYPE!=H5I_group (dst_id) || + H5I_DATATYPE!=H5I_get_type (dst_id) || NULL==(dst_p=H5I_object (dst_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1355,9 +1355,9 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, switch (cdata->command) { case H5T_CONV_INIT: - if (H5_DATATYPE!=H5I_group(src_id) || + if (H5I_DATATYPE!=H5I_get_type(src_id) || NULL==(src=H5I_object(src_id)) || - H5_DATATYPE!=H5I_group(dst_id) || + H5I_DATATYPE!=H5I_get_type(dst_id) || NULL==(dst=H5I_object(dst_id))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1385,9 +1385,9 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_CONV_CONV: /* Get the data types */ - if (H5_DATATYPE!=H5I_group(src_id) || + if (H5I_DATATYPE!=H5I_get_type(src_id) || NULL==(src=H5I_object(src_id)) || - H5_DATATYPE!=H5I_group(dst_id) || + H5I_DATATYPE!=H5I_get_type(dst_id) || NULL==(dst=H5I_object(dst_id))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } @@ -1716,9 +1716,9 @@ H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, case H5T_CONV_CONV: /* The conversion */ - if (H5_DATATYPE!=H5I_group (src_id) || + if (H5I_DATATYPE!=H5I_get_type (src_id) || NULL==(src=H5I_object (src_id)) || - H5_DATATYPE!=H5I_group (dst_id) || + H5I_DATATYPE!=H5I_get_type (dst_id) || NULL==H5I_object (dst_id)) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index fb37ddb..88b2433 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -32,8 +32,9 @@ typedef enum H5T_class_t { H5T_BITFIELD = 4, /*bit field types */ H5T_OPAQUE = 5, /*opaque types */ H5T_COMPOUND = 6, /*compound types */ + H5T_POINTER = 7, /*Pointer types */ - H5T_NCLASSES = 7 /*this must be last */ + H5T_NCLASSES = 8 /*this must be last */ } H5T_class_t; /* Byte orders */ @@ -346,6 +347,7 @@ extern hid_t H5T_FORTRAN_S1_g; #define H5T_NATIVE_HSSIZE (H5open(), H5T_NATIVE_HSSIZE_g) #define H5T_NATIVE_HERR (H5open(), H5T_NATIVE_HERR_g) #define H5T_NATIVE_HBOOL (H5open(), H5T_NATIVE_HBOOL_g) +#define H5T_NATIVE_PTR_OBJ (H5open(), H5T_NATIVE_PTR_OBJ_g) extern hid_t H5T_NATIVE_CHAR_g; extern hid_t H5T_NATIVE_UCHAR_g; extern hid_t H5T_NATIVE_SHORT_g; @@ -368,6 +370,7 @@ extern hid_t H5T_NATIVE_HSIZE_g; extern hid_t H5T_NATIVE_HSSIZE_g; extern hid_t H5T_NATIVE_HERR_g; extern hid_t H5T_NATIVE_HBOOL_g; +extern hid_t H5T_NATIVE_PTR_OBJ_g; /* Operations defined on all data types */ hid_t H5Topen (hid_t loc_id, const char *name); diff --git a/src/H5detect.c b/src/H5detect.c index 944b73f..5c6a23f 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -409,7 +409,7 @@ H5T_init (void)\n\ /* Atomize the type */ printf("\ - if ((H5T_NATIVE_%s_g = H5I_register (H5_DATATYPE, dt))<0) {\n\ + if ((H5T_NATIVE_%s_g = H5I_register (H5I_DATATYPE, dt))<0) {\n\ HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,\n\ \"can't initialize type system (atom registration \"\n\ \"failure\");\n\ |