diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 75 | ||||
-rw-r--r-- | src/H5A.c | 63 | ||||
-rw-r--r-- | src/H5Apublic.h | 16 | ||||
-rw-r--r-- | src/H5D.c | 285 | ||||
-rw-r--r-- | src/H5Dpublic.h | 20 | ||||
-rw-r--r-- | src/H5F.c | 20 | ||||
-rw-r--r-- | src/H5Fpublic.h | 4 | ||||
-rw-r--r-- | src/H5G.c | 10 | ||||
-rw-r--r-- | src/H5Gpublic.h | 14 | ||||
-rw-r--r-- | src/H5P.c | 550 | ||||
-rw-r--r-- | src/H5Ppublic.h | 72 | ||||
-rw-r--r-- | src/H5S.c | 51 | ||||
-rw-r--r-- | src/H5Sall.c | 33 | ||||
-rw-r--r-- | src/H5Shyper.c | 546 | ||||
-rw-r--r-- | src/H5Spoint.c | 150 | ||||
-rw-r--r-- | src/H5Spublic.h | 15 | ||||
-rw-r--r-- | src/H5Sselect.c | 86 | ||||
-rw-r--r-- | src/H5Ssimp.c | 48 | ||||
-rw-r--r-- | src/H5TB.c | 41 | ||||
-rw-r--r-- | src/H5V.c | 19 |
20 files changed, 1205 insertions, 913 deletions
@@ -143,7 +143,7 @@ H5_init_library(void) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5_add_exit(void (*func) (void)) +H5_add_exit(void (*func)(void)) { H5_exit_t *new_exit; @@ -1396,6 +1396,66 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) fprintf(out, "H5T_NATIVE_DOUBLE"); } else if (obj==H5T_NATIVE_LDOUBLE_g) { fprintf(out, "H5T_NATIVE_LDOUBLE"); + } else if (obj==H5T_IEEE_F32BE_g) { + fprintf(out, "H5T_IEEE_F32BE"); + } else if (obj==H5T_IEEE_F32LE_g) { + fprintf(out, "H5T_IEEE_F32LE"); + } else if (obj==H5T_IEEE_F64BE_g) { + fprintf(out, "H5T_IEEE_F64BE"); + } else if (obj==H5T_IEEE_F64LE_g) { + fprintf(out, "H5T_IEEE_F64LE"); + } else if (obj==H5T_STD_I8BE_g) { + fprintf(out, "H5T_STD_I8BE"); + } else if (obj==H5T_STD_I8LE_g) { + fprintf(out, "H5T_STD_I8LE"); + } else if (obj==H5T_STD_I16BE_g) { + fprintf(out, "H5T_STD_I16BE"); + } else if (obj==H5T_STD_I16LE_g) { + fprintf(out, "H5T_STD_I16LE"); + } else if (obj==H5T_STD_I32BE_g) { + fprintf(out, "H5T_STD_I32BE"); + } else if (obj==H5T_STD_I32LE_g) { + fprintf(out, "H5T_STD_I32LE"); + } else if (obj==H5T_STD_I64BE_g) { + fprintf(out, "H5T_STD_I64BE"); + } else if (obj==H5T_STD_I64LE_g) { + fprintf(out, "H5T_STD_I64LE"); + } else if (obj==H5T_STD_U8BE_g) { + fprintf(out, "H5T_STD_U8BE"); + } else if (obj==H5T_STD_U8LE_g) { + fprintf(out, "H5T_STD_U8LE"); + } else if (obj==H5T_STD_U16BE_g) { + fprintf(out, "H5T_STD_U16BE"); + } else if (obj==H5T_STD_U16LE_g) { + fprintf(out, "H5T_STD_U16LE"); + } else if (obj==H5T_STD_U32BE_g) { + fprintf(out, "H5T_STD_U32BE"); + } else if (obj==H5T_STD_U32LE_g) { + fprintf(out, "H5T_STD_U32LE"); + } else if (obj==H5T_STD_U64BE_g) { + fprintf(out, "H5T_STD_U64BE"); + } else if (obj==H5T_STD_U64LE_g) { + fprintf(out, "H5T_STD_U64LE"); + } else if (obj==H5T_STD_B8BE_g) { + fprintf(out, "H5T_STD_B8BE"); + } else if (obj==H5T_STD_B8LE_g) { + fprintf(out, "H5T_STD_B8LE"); + } else if (obj==H5T_STD_B16BE_g) { + fprintf(out, "H5T_STD_B16BE"); + } else if (obj==H5T_STD_B16LE_g) { + fprintf(out, "H5T_STD_B16LE"); + } else if (obj==H5T_STD_B32BE_g) { + fprintf(out, "H5T_STD_B32BE"); + } else if (obj==H5T_STD_B32LE_g) { + fprintf(out, "H5T_STD_B32LE"); + } else if (obj==H5T_STD_B64BE_g) { + fprintf(out, "H5T_STD_B64BE"); + } else if (obj==H5T_STD_B64LE_g) { + fprintf(out, "H5T_STD_B64LE"); + } else if (obj==H5T_C_S1_g) { + fprintf(out, "H5T_C_S1"); + } else if (obj==H5T_FORTRAN_S1_g) { + fprintf(out, "H5T_FORTRAN_S1"); } else { fprintf(out, "%ld", (long)obj); if (strcmp (argname, "type")) { @@ -1408,6 +1468,13 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) if (strcmp (argname, "space")) { fprintf (out, " (space)"); } + /*Save the rank of simple data spaces for arrays*/ + { + H5S_t *space = H5I_object(obj); + if (H5S_SIMPLE==space->extent.type) { + asize[argno] = space->extent.u.simple.rank; + } + } break; case H5_DATASET: fprintf(out, "%ld", (long)obj); @@ -1421,6 +1488,12 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...) fprintf (out, " (attr)"); } break; + case H5_TEMPBUF: + fprintf(out, "%ld", (long)obj); + if (strcmp(argname, "tbuf")) { + fprintf(out, " (tbuf"); + } + break; default: fprintf(out, "%ld", (long)obj); fprintf (out, " (unknown class)"); @@ -116,12 +116,12 @@ H5A_term_interface(void) PURPOSE Creates a dataset as an attribute of another dataset or group USAGE - hid_t H5Acreate (loc_id, name, datatype, dataspace, create_plist) + hid_t H5Acreate (loc_id, name, type_id, space_id, plist_id) hid_t loc_id; IN: Object (dataset or group) to be attached to const char *name; IN: Name of attribute to create - hid_t datatype; IN: ID of datatype for attribute - hid_t dataspace; IN: ID of dataspace for attribute - hid_t create_plist; IN: ID of creation property list (currently not used) + hid_t type_id; IN: ID of datatype for attribute + hid_t space_id; IN: ID of dataspace for attribute + hid_t plist_id; IN: ID of creation property list (currently not used) RETURNS SUCCEED/FAIL @@ -133,7 +133,7 @@ H5A_term_interface(void) attribute for an object must be unique for that object. The 'type_id' and 'space_id' are created with the H5T and H5S interfaces respectively. Currently only simple dataspaces are allowed for attribute dataspaces. - The 'create_plist_id' property list is currently un-used, but will be + The 'plist_id' property list is currently un-used, but will be used int the future for optional properties of attributes. The attribute ID returned from this function must be released with H5Aclose or resource leaks will develop. @@ -150,8 +150,8 @@ H5A_term_interface(void) * --------------------------------------------------------------------------*/ hid_t -H5Acreate (hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace, - hid_t create_plist) +H5Acreate (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, + hid_t plist_id) { void *obj = NULL; H5G_entry_t *ent = NULL; @@ -160,7 +160,7 @@ H5Acreate (hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace, hid_t ret_value = FAIL; FUNC_ENTER(H5Acreate, FAIL); - H5TRACE5("i","isiii",loc_id,name,datatype,dataspace,create_plist); + H5TRACE5("i","isiii",loc_id,name,type_id,space_id,plist_id); /* check arguments */ if (NULL==(obj=H5I_object (loc_id))) { @@ -186,17 +186,17 @@ H5Acreate (hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace, if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); } - if (H5_DATATYPE != H5I_group(datatype) || - NULL == (type = H5I_object(datatype))) { + if (H5_DATATYPE != H5I_group(type_id) || + NULL == (type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type"); } - if (H5_DATASPACE != H5I_group(dataspace) || - NULL == (space = H5I_object(dataspace))) { + if (H5_DATASPACE != H5I_group(space_id) || + NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } - if (H5P_DEFAULT!=create_plist && - (H5P_DATASET_CREATE != H5P_get_class(create_plist) || - NULL == H5I_object(create_plist))) { + if (H5P_DEFAULT!=plist_id && + (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } @@ -262,7 +262,8 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, /* Compute the internal sizes */ attr->dt_size=(H5O_DTYPE[0].raw_size)(attr->ent.file,type); - attr->ds_size=(H5O_SDSPACE[0].raw_size)(attr->ent.file,&(space->extent.u.simple)); + attr->ds_size=(H5O_SDSPACE[0].raw_size)(attr->ent.file, + &(space->extent.u.simple)); attr->data_size=H5S_extent_npoints(space)*H5T_get_size(type); /* Hold the symbol table entry (and file) open */ @@ -581,9 +582,9 @@ done: PURPOSE Write out data to an attribute USAGE - herr_t H5Awrite (attr_id, mem_dt, buf) + herr_t H5Awrite (attr_id, type_id, buf) hid_t attr_id; IN: Attribute to write - hid_t mem_dt; IN: Memory datatype of buffer + hid_t type_id; IN: Memory datatype of buffer void *buf; IN: Buffer of data to write RETURNS SUCCEED/FAIL @@ -594,22 +595,22 @@ done: This function writes a complete attribute to disk. --------------------------------------------------------------------------*/ herr_t -H5Awrite (hid_t attr_id, hid_t mem_dt, void *buf) +H5Awrite (hid_t attr_id, hid_t type_id, void *buf) { H5A_t *attr = NULL; const H5T_t *mem_type = NULL; herr_t ret_value = FAIL; FUNC_ENTER(H5Awrite, FAIL); - H5TRACE3("e","iix",attr_id,mem_dt,buf); + H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ if (H5_ATTR != H5I_group(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } - if (H5_DATATYPE != H5I_group(mem_dt) || - NULL == (mem_type = H5I_object(mem_dt))) { + if (H5_DATATYPE != H5I_group(type_id) || + NULL == (mem_type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (NULL == buf) { @@ -752,9 +753,9 @@ done: PURPOSE Read in data from an attribute USAGE - herr_t H5Aread (attr_id, mem_dt, buf) + herr_t H5Aread (attr_id, type_id, buf) hid_t attr_id; IN: Attribute to read - hid_t mem_dt; IN: Memory datatype of buffer + hid_t type_id; IN: Memory datatype of buffer void *buf; IN: Buffer for data to read RETURNS SUCCEED/FAIL @@ -765,22 +766,22 @@ done: This function reads a complete attribute from disk. --------------------------------------------------------------------------*/ herr_t -H5Aread (hid_t attr_id, hid_t mem_dt, void *buf) +H5Aread (hid_t attr_id, hid_t type_id, void *buf) { - H5A_t *attr = NULL; - const H5T_t *mem_type = NULL; - herr_t ret_value = FAIL; + H5A_t *attr = NULL; + const H5T_t *mem_type = NULL; + herr_t ret_value = FAIL; FUNC_ENTER(H5Aread, FAIL); - H5TRACE3("e","iix",attr_id,mem_dt,buf); + H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ if (H5_ATTR != H5I_group(attr_id) || (NULL == (attr = H5I_object(attr_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute"); } - if (H5_DATATYPE != H5I_group(mem_dt) || - NULL == (mem_type = H5I_object(mem_dt))) { + if (H5_DATATYPE != H5I_group(type_id) || + NULL == (mem_type = H5I_object(type_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); } if (NULL == buf) { diff --git a/src/H5Apublic.h b/src/H5Apublic.h index bf62290..1520564 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -27,17 +27,19 @@ typedef int (*H5A_operator_t)(hid_t location_id/*in*/, const char *attr_name/*in*/, void *operator_data/*in,out*/); /* Public function prototypes */ -hid_t H5Acreate(hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace, hid_t create_plist); +hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, + hid_t plist_id); hid_t H5Aopen_name(hid_t loc_id, const char *name); hid_t H5Aopen_idx(hid_t loc_id, unsigned idx); -herr_t H5Awrite(hid_t attr_id, hid_t mem_dt, void *buf); -herr_t H5Aread(hid_t attr_id, hid_t mem_dt, void *buf); +herr_t H5Awrite(hid_t attr_id, hid_t type_id, void *buf); +herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); herr_t H5Aclose(hid_t attr_id); -hid_t H5Aget_space(hid_t attr); -hid_t H5Aget_type(hid_t attr); -size_t H5Aget_name(hid_t attr, char *buf, size_t buf_size); +hid_t H5Aget_space(hid_t attr_id); +hid_t H5Aget_type(hid_t attr_id); +size_t H5Aget_name(hid_t attr_id, char *buf, size_t buf_size); int H5Anum_attrs(hid_t loc_id); -int H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data); +int H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, + void *op_data); herr_t H5Adelete(hid_t loc_id, const char *name); #ifdef __cplusplus @@ -152,7 +152,7 @@ H5D_term_interface(void) * and initial persistent properties including the type of each * datapoint as stored in the file (TYPE_ID), the size of the * dataset (SPACE_ID), and other initial miscellaneous - * properties (CREATE_PARMS_ID). + * properties (PLIST_ID). * * All arguments are copied into the dataset, so the caller is * allowed to derive new types, data spaces, and creation @@ -186,7 +186,7 @@ H5D_term_interface(void) */ hid_t H5Dcreate (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, - hid_t create_parms_id) + hid_t plist_id) { H5G_t *loc = NULL; H5T_t *type = NULL; @@ -196,7 +196,7 @@ H5Dcreate (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, const H5D_create_t *create_parms = NULL; FUNC_ENTER(H5Dcreate, FAIL); - H5TRACE5("i","isiii",loc_id,name,type_id,space_id,create_parms_id); + H5TRACE5("i","isiii",loc_id,name,type_id,space_id,plist_id); /* Check arguments */ if (NULL == (loc = H5G_loc(loc_id))) { @@ -213,9 +213,9 @@ H5Dcreate (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } - if (create_parms_id >= 0) { - if (H5P_DATASET_CREATE != H5P_get_class(create_parms_id) || - NULL == (create_parms = H5I_object(create_parms_id))) { + if (plist_id >= 0) { + if (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == (create_parms = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } @@ -314,24 +314,24 @@ H5Dopen (hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ herr_t -H5Dclose (hid_t dataset_id) +H5Dclose (hid_t dset_id) { - H5D_t *dataset = NULL; /* dataset object to release */ + H5D_t *dset = NULL; /* dataset object to release */ FUNC_ENTER(H5Dclose, FAIL); - H5TRACE1("e","i",dataset_id); + H5TRACE1("e","i",dset_id); /* Check args */ - if (H5_DATASET != H5I_group(dataset_id) || - NULL == (dataset = H5I_object(dataset_id)) || - NULL == dataset->ent.file) { + if (H5_DATASET != H5I_group(dset_id) || + NULL == (dset = H5I_object(dset_id)) || + NULL == dset->ent.file) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } /* * Decrement the counter on the dataset. It will be freed if the count * reaches zero. */ - if (H5I_dec_ref(dataset_id) < 0) { + if (H5I_dec_ref(dset_id) < 0) { HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't free"); } FUNC_LEAVE(SUCCEED); @@ -358,23 +358,23 @@ H5Dclose (hid_t dataset_id) *------------------------------------------------------------------------- */ hid_t -H5Dget_space (hid_t dataset_id) +H5Dget_space (hid_t dset_id) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; H5S_t *space = NULL; hid_t ret_value = FAIL; FUNC_ENTER (H5Dget_space, FAIL); - H5TRACE1("i","i",dataset_id); + H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dataset_id) || - NULL==(dataset=H5I_object (dataset_id))) { + if (H5_DATASET!=H5I_group (dset_id) || + NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } /* Read the data space message and return a data space object */ - if (NULL==(space=H5S_read (&(dataset->ent)))) { + if (NULL==(space=H5S_read (&(dset->ent)))) { HRETURN_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load space info from dataset header"); } @@ -414,24 +414,24 @@ H5Dget_space (hid_t dataset_id) *------------------------------------------------------------------------- */ hid_t -H5Dget_type (hid_t dataset_id) +H5Dget_type (hid_t dset_id) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; H5T_t *copied_type = NULL; hid_t ret_value = FAIL; FUNC_ENTER (H5Dget_type, FAIL); - H5TRACE1("i","i",dataset_id); + H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dataset_id) || - NULL==(dataset=H5I_object (dataset_id))) { + if (H5_DATASET!=H5I_group (dset_id) || + NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } /* Copy the data type and mark it read-only */ - if (NULL==(copied_type=H5T_copy (dataset->type, H5T_COPY_REOPEN))) { + if (NULL==(copied_type=H5T_copy (dset->type, H5T_COPY_REOPEN))) { HRETURN_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy the data type"); } @@ -471,24 +471,24 @@ H5Dget_type (hid_t dataset_id) *------------------------------------------------------------------------- */ hid_t -H5Dget_create_plist (hid_t dataset_id) +H5Dget_create_plist (hid_t dset_id) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; H5D_create_t *copied_parms = NULL; hid_t ret_value = FAIL; FUNC_ENTER (H5Dget_create_plist, FAIL); - H5TRACE1("i","i",dataset_id); + H5TRACE1("i","i",dset_id); /* Check args */ - if (H5_DATASET!=H5I_group (dataset_id) || - NULL==(dataset=H5I_object (dataset_id))) { + if (H5_DATASET!=H5I_group (dset_id) || + NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } /* Copy the creation property list */ if (NULL==(copied_parms=H5P_copy (H5P_DATASET_CREATE, - dataset->create_parms))) { + dset->create_parms))) { HRETURN_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy the creation property list"); } @@ -507,12 +507,12 @@ H5Dget_create_plist (hid_t dataset_id) /*------------------------------------------------------------------------- * Function: H5Dread * - * Purpose: Reads (part of) a DATASET from the file into application + * Purpose: Reads (part of) a DSET from the file into application * memory BUF. The part of the dataset to read is defined with * MEM_SPACE_ID and FILE_SPACE_ID. The data points are * converted from their file type to the MEM_TYPE_ID specified. * Additional miscellaneous data transfer properties can be - * passed to this function with the XFER_PARMS_ID argument. + * passed to this function with the PLIST_ID argument. * * The FILE_SPACE_ID can be the constant H5S_ALL which indicates * that the entire file data space is to be referenced. @@ -524,7 +524,7 @@ H5Dget_create_plist (hid_t dataset_id) * The number of elements in the memory data space must match * the number of elements in the file data space. * - * The XFER_PARMS_ID can be the constant H5P_DEFAULT in which + * The PLIST_ID can be the constant H5P_DEFAULT in which * case the default data transfer properties are used. * * Return: Success: SUCCEED @@ -547,23 +547,23 @@ H5Dget_create_plist (hid_t dataset_id) *------------------------------------------------------------------------- */ herr_t -H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t xfer_parms_id, void *buf/*out*/) +H5Dread (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; const H5T_t *mem_type = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; const H5D_xfer_t *xfer_parms = NULL; FUNC_ENTER(H5Dread, FAIL); - H5TRACE6("e","iiiiix",dataset_id,mem_type_id,mem_space_id,file_space_id, - xfer_parms_id,buf); + H5TRACE6("e","iiiiix",dset_id,mem_type_id,mem_space_id,file_space_id, + plist_id,buf); /* check arguments */ - if (H5_DATASET != H5I_group(dataset_id) || - NULL == (dataset = H5I_object(dataset_id)) || - NULL == dataset->ent.file) { + if (H5_DATASET != H5I_group(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) || @@ -582,10 +582,10 @@ H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } - if (H5P_DEFAULT == xfer_parms_id) { + if (H5P_DEFAULT == plist_id) { xfer_parms = &H5D_xfer_dflt; - } else if (H5P_DATASET_XFER != H5P_get_class(xfer_parms_id) || - NULL == (xfer_parms = H5I_object(xfer_parms_id))) { + } else if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == (xfer_parms = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); } if (!buf) { @@ -593,7 +593,7 @@ H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, } /* read raw data */ - if (H5D_read(dataset, mem_type, mem_space, file_space, xfer_parms, + if (H5D_read(dset, mem_type, mem_space, file_space, xfer_parms, buf/*out*/) < 0) { HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data"); } @@ -603,13 +603,13 @@ H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, /*------------------------------------------------------------------------- * Function: H5Dwrite * - * Purpose: Writes (part of) a DATASET from application memory BUF to the + * Purpose: Writes (part of) a DSET from application memory BUF to the * file. The part of the dataset to write is defined with the * MEM_SPACE_ID and FILE_SPACE_ID arguments. The data points * are converted from their current type (MEM_TYPE_ID) to their * file data type. Additional miscellaneous data transfer * properties can be passed to this function with the - * XFER_PARMS_ID argument. + * PLIST_ID argument. * * The FILE_SPACE_ID can be the constant H5S_ALL which indicates * that the entire file data space is to be referenced. @@ -621,7 +621,7 @@ H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, * The number of elements in the memory data space must match * the number of elements in the file data space. * - * The XFER_PARMS_ID can be the constant H5P_DEFAULT in which + * The PLIST_ID can be the constant H5P_DEFAULT in which * case the default data transfer properties are used. * * Return: Success: SUCCEED @@ -638,23 +638,23 @@ H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, *------------------------------------------------------------------------- */ herr_t -H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t xfer_parms_id, const void *buf) +H5Dwrite (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t plist_id, const void *buf) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; const H5T_t *mem_type = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; const H5D_xfer_t *xfer_parms = NULL; FUNC_ENTER(H5Dwrite, FAIL); - H5TRACE6("e","iiiiix",dataset_id,mem_type_id,mem_space_id,file_space_id, - xfer_parms_id,buf); + H5TRACE6("e","iiiiix",dset_id,mem_type_id,mem_space_id,file_space_id, + plist_id,buf); /* check arguments */ - if (H5_DATASET != H5I_group(dataset_id) || - NULL == (dataset = H5I_object(dataset_id)) || - NULL == dataset->ent.file) { + if (H5_DATASET != H5I_group(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) || @@ -673,10 +673,10 @@ H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } } - if (H5P_DEFAULT == xfer_parms_id) { + if (H5P_DEFAULT == plist_id) { xfer_parms = &H5D_xfer_dflt; - } else if (H5P_DATASET_XFER != H5P_get_class(xfer_parms_id) || - NULL == (xfer_parms = H5I_object(xfer_parms_id))) { + } else if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == (xfer_parms = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); } if (!buf) { @@ -684,7 +684,7 @@ H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, } /* write raw data */ - if (H5D_write(dataset, mem_type, mem_space, file_space, xfer_parms, + if (H5D_write(dset, mem_type, mem_space, file_space, xfer_parms, buf) < 0) { HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data"); } @@ -710,16 +710,16 @@ H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, *------------------------------------------------------------------------- */ herr_t -H5Dextend (hid_t dataset_id, const hsize_t *size) +H5Dextend (hid_t dset_id, const hsize_t *size) { - H5D_t *dataset = NULL; + H5D_t *dset = NULL; FUNC_ENTER (H5Dextend, FAIL); - H5TRACE2("e","i*h",dataset_id,size); + H5TRACE2("e","i*h",dset_id,size); /* Check args */ - if (H5_DATASET!=H5I_group (dataset_id) || - NULL==(dataset=H5I_object (dataset_id))) { + if (H5_DATASET!=H5I_group (dset_id) || + NULL==(dset=H5I_object (dset_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); } if (!size) { @@ -727,7 +727,7 @@ H5Dextend (hid_t dataset_id, const hsize_t *size) } /* Increase size */ - if (H5D_extend (dataset, size)<0) { + if (H5D_extend (dset, size)<0) { HRETURN_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset"); } @@ -1226,10 +1226,10 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, uint8 *bkg_buf = NULL; /*background buffer */ H5T_conv_t tconv_func = NULL; /*conversion function */ hid_t src_id = -1, dst_id = -1;/*temporary type atoms */ - H5S_conv_t sconv_func={NULL}; /*space conversion funcs*/ - H5S_sel_iter_t mem_iter, /* memory selection iteration information */ - bkg_iter, /* background iteration information */ - file_iter; /* file selection iteration information */ + H5S_conv_t sconv_func={NULL}; /*space conversion funcs*/ + H5S_sel_iter_t mem_iter; /* mem selection iteration info*/ + H5S_sel_iter_t bkg_iter; /*background iteration info*/ + H5S_sel_iter_t file_iter; /*file selection iter info*/ H5T_cdata_t *cdata = NULL; /*type conversion data */ herr_t ret_value = FAIL; herr_t status; @@ -1292,7 +1292,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, * turns off background preservation. */ #ifdef QAK -printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)nelmts); + printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)nelmts); #endif /* QAK */ if (nelmts!=H5S_select_npoints (file_space)) { HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, @@ -1303,8 +1303,10 @@ printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)nelmts); 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, H5T_copy(dataset->type, H5T_COPY_ALL)))<0 || - (dst_id=H5I_register(H5_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL)))<0) { + if ((src_id=H5I_register(H5_DATATYPE, + H5T_copy(dataset->type, H5T_COPY_ALL)))<0 || + (dst_id=H5I_register(H5_DATATYPE, + H5T_copy(mem_type, H5T_COPY_ALL)))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } @@ -1314,7 +1316,7 @@ printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)nelmts); "unable to convert from file to memory data space"); } #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ #ifdef HAVE_PARALLEL @@ -1359,7 +1361,7 @@ printf("%s: check 1.0\n",FUNC); H5E_clear (); } #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ @@ -1374,7 +1376,8 @@ printf("%s: check 2.0\n",FUNC); HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small"); } - if (FAIL == (sconv_func.finit)(&(dataset->layout), file_space, &file_iter)) { + if (FAIL == (sconv_func.finit)(&(dataset->layout), + file_space, &file_iter)) { HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information"); } @@ -1387,7 +1390,7 @@ printf("%s: check 2.0\n",FUNC); "unable to initialize background selection information"); } #ifdef QAK -printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); + printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); #endif /* QAK */ /* @@ -1423,14 +1426,18 @@ printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); #endif #ifdef QAK -printf("%s: check 4.0, nelmts=%d, need_bkg=%d\n",FUNC,(int)nelmts,(int)need_bkg); + printf("%s: check 4.0, nelmts=%d, need_bkg=%d\n", + FUNC,(int)nelmts,(int)need_bkg); #endif /* QAK */ /* Start strip mining... */ for (smine_start=0; smine_start<nelmts; smine_start+=smine_nelmts) { /* Go figure out how many elements to read from the file */ - smine_nelmts = (sconv_func.favail)(file_space,&file_iter, MIN(request_nelmts,(nelmts-smine_start))); + smine_nelmts = (sconv_func.favail)(file_space,&file_iter, + MIN(request_nelmts, + (nelmts-smine_start))); #ifdef QAK -printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n",FUNC,(int)nelmts,(int)smine_start,(int)smine_nelmts); + printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n", + FUNC,(int)nelmts,(int)smine_start,(int)smine_nelmts); #endif /* QAK */ /* @@ -1447,33 +1454,34 @@ printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n",FUNC,(int)n HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed"); } #ifdef QAK -printf("%s: check 6.0\n",FUNC); + printf("%s: check 6.0\n",FUNC); #endif /* QAK */ #ifdef QAK -printf("%s: check 6.5\n",FUNC); - { - int i; - uint16 *b; - - if(qak_debug) { - b=tconv_buf; - printf("\ntconv_buf:"); - for (i=0; i<smine_nelmts; i++,b++) { - printf("(%d)%u ",i,(unsigned)*b); - } - printf("\n"); - } - } + printf("%s: check 6.5\n",FUNC); + { + int i; + uint16 *b; + + if(qak_debug) { + b=tconv_buf; + printf("\ntconv_buf:"); + for (i=0; i<smine_nelmts; i++,b++) { + printf("(%d)%u ",i,(unsigned)*b); + } + printf("\n"); + } + } #endif /* QAK */ if ((H5D_OPTIMIZE_PIPE && H5T_BKG_YES==need_bkg) || (!H5D_OPTIMIZE_PIPE && need_bkg)) { if ((sconv_func.mgath)(buf, H5T_get_size (mem_type), mem_space, - &bkg_iter, smine_nelmts, bkg_buf/*out*/)!=smine_nelmts) { + &bkg_iter, smine_nelmts, + bkg_buf/*out*/)!=smine_nelmts) { HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed"); } } #ifdef QAK -printf("%s: check 7.0\n",FUNC); + printf("%s: check 7.0\n",FUNC); #endif /* QAK */ /* @@ -1494,7 +1502,7 @@ printf("%s: check 7.0\n",FUNC); } #ifdef QAK -printf("%s: check 8.0\n",FUNC); + printf("%s: check 8.0\n",FUNC); #endif /* QAK */ /* * Scatter the data into memory. @@ -1504,7 +1512,7 @@ printf("%s: check 8.0\n",FUNC); HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "scatter failed"); } #ifdef QAK -printf("%s: check 9.0\n",FUNC); + printf("%s: check 9.0\n",FUNC); #endif /* QAK */ } @@ -1560,14 +1568,14 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, uint8 *bkg_buf = NULL; /*background buffer */ H5T_conv_t tconv_func = NULL; /*conversion function */ hid_t src_id = -1, dst_id = -1;/*temporary type atoms */ - H5S_conv_t sconv_func= {NULL}; /*space conversion funcs*/ - H5S_sel_iter_t mem_iter, /* memory selection iteration information */ - bkg_iter, /* background iteration information */ - file_iter; /* file selection iteration information */ + H5S_conv_t sconv_func= {NULL}; /*space conversion funcs*/ + H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ + H5S_sel_iter_t bkg_iter; /*background iteration info*/ + H5S_sel_iter_t file_iter; /*file selection iteration info*/ H5T_cdata_t *cdata = NULL; /*type conversion data */ herr_t ret_value = FAIL, status; size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ + size_t dst_type_size; /*size of destination type*/ size_t target_size; /*desired buffer size */ size_t request_nelmts; /*requested strip mine */ H5T_bkg_t need_bkg; /*type of background buf*/ @@ -1625,7 +1633,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, * turns off background preservation. */ #ifdef QAK -printf("%s: check 0.5, nelmts=%d\n",FUNC,(int)nelmts); + printf("%s: check 0.5, nelmts=%d\n",FUNC,(int)nelmts); #endif /* QAK */ if (nelmts!=H5S_select_npoints (file_space)) { HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, @@ -1649,7 +1657,7 @@ printf("%s: check 0.5, nelmts=%d\n",FUNC,(int)nelmts); "unable to convert from memory to file data space"); } #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ #ifdef HAVE_PARALLEL @@ -1661,12 +1669,12 @@ printf("%s: check 1.0\n",FUNC); if (H5T_conv_noop==tconv_func && NULL!=sconv_func.write) { status = (sconv_func.write)(dataset->ent.file, - &(dataset->layout), - &(dataset->create_parms->compress), - &(dataset->create_parms->efl), - H5T_get_size (dataset->type), - file_space, mem_space, - xfer_parms->xfer_mode, buf); + &(dataset->layout), + &(dataset->create_parms->compress), + &(dataset->create_parms->efl), + H5T_get_size (dataset->type), + file_space, mem_space, + xfer_parms->xfer_mode, buf); if (status>=0) goto succeed; HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "collective write failed"); @@ -1695,7 +1703,7 @@ printf("%s: check 1.0\n",FUNC); H5E_clear (); } #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ @@ -1710,7 +1718,7 @@ printf("%s: check 2.0\n",FUNC); HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small"); } - if (FAIL == (sconv_func.finit)(&(dataset->layout), file_space, &file_iter)) { + if (FAIL==(sconv_func.finit)(&(dataset->layout), file_space, &file_iter)) { HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information"); } @@ -1723,7 +1731,7 @@ printf("%s: check 2.0\n",FUNC); "unable to initialize memory selection information"); } #ifdef QAK -printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); + printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); #endif /* QAK */ /* @@ -1758,15 +1766,19 @@ printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts); } #endif #ifdef QAK -printf("%s: check 4.0, nelmts=%d, need_bkg=%d\n",FUNC,(int)nelmts,(int)need_bkg); + printf("%s: check 4.0, nelmts=%d, need_bkg=%d\n", + FUNC,(int)nelmts,(int)need_bkg); #endif /* QAK */ /* Start strip mining... */ for (smine_start=0; smine_start<nelmts; smine_start+=smine_nelmts) { /* Go figure out how many elements to read from the file */ - smine_nelmts = (sconv_func.favail)(file_space,&file_iter, MIN(request_nelmts,(nelmts-smine_start))); + smine_nelmts = (sconv_func.favail)(file_space,&file_iter, + MIN(request_nelmts, + (nelmts-smine_start))); #ifdef QAK -printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n",FUNC,(int)nelmts,(int)smine_start,(int)smine_nelmts); + printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n", + FUNC,(int)nelmts,(int)smine_start,(int)smine_nelmts); #endif /* QAK */ /* @@ -1779,20 +1791,20 @@ printf("%s: check 5.0, nelmts=%d, smine_start=%d, smine_nelmts=%d\n",FUNC,(int)n HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed"); } #ifdef QAK - { - int i; - uint16 *b; - - if(qak_debug) { - b=tconv_buf; - printf("\ntconv_buf:"); - for (i=0; i<smine_nelmts; i++,b++) { - printf("(%d)%d ",i,(int)*b); - } - printf("\n"); - } - } -printf("%s: check 6.0\n",FUNC); + { + int i; + uint16 *b; + + if(qak_debug) { + b=tconv_buf; + printf("\ntconv_buf:"); + for (i=0; i<smine_nelmts; i++,b++) { + printf("(%d)%d ",i,(int)*b); + } + printf("\n"); + } + } + printf("%s: check 6.0\n",FUNC); #endif /* QAK */ if ((H5D_OPTIMIZE_PIPE && H5T_BKG_YES==need_bkg) || (!H5D_OPTIMIZE_PIPE && need_bkg)) { @@ -1802,7 +1814,8 @@ printf("%s: check 6.0\n",FUNC); H5T_get_size (dataset->type), file_space, &bkg_iter, smine_nelmts, xfer_parms->xfer_mode, bkg_buf/*out*/)!=smine_nelmts) { - HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed"); + HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, + "file gather failed"); } } @@ -1814,7 +1827,7 @@ printf("%s: check 6.0\n",FUNC); #endif cdata->command = H5T_CONV_CONV; status = (tconv_func) (src_id, dst_id, cdata, smine_nelmts, tconv_buf, - bkg_buf); + bkg_buf); #ifdef H5T_DEBUG H5T_timer_end (&timer, cdata, smine_nelmts); #endif @@ -2016,7 +2029,7 @@ H5D_allocate (H5D_t *dataset) FUNC_ENTER(H5D_allocate, FAIL); #ifdef AKC -printf("Enter %s:\n", FUNC); + printf("Enter %s:\n", FUNC); #endif /* Check args */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index a86d865..94f8d9b 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -44,17 +44,17 @@ extern "C" { #endif hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id, - hid_t space_id, hid_t create_parms_id); + hid_t space_id, hid_t plist_id); hid_t H5Dopen (hid_t file_id, const char *name); -herr_t H5Dclose (hid_t dataset_id); -hid_t H5Dget_space (hid_t dataset_id); -hid_t H5Dget_type (hid_t dataset_id); -hid_t H5Dget_create_plist (hid_t dataset_id); -herr_t H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t xfer_parms_id, void *buf/*out*/); -herr_t H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t xfer_parms_id, const void *buf); -herr_t H5Dextend (hid_t dataset_id, const hsize_t *size); +herr_t H5Dclose (hid_t dset_id); +hid_t H5Dget_space (hid_t dset_id); +hid_t H5Dget_type (hid_t dset_id); +hid_t H5Dget_create_plist (hid_t dset_id); +herr_t H5Dread (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t plist_id, void *buf/*out*/); +herr_t H5Dwrite (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t plist_id, const void *buf); +herr_t H5Dextend (hid_t dset_id, const hsize_t *size); #ifdef __cplusplus } @@ -250,17 +250,17 @@ H5F_encode_length_unusual(const H5F_t *f, uint8 **p, uint8 *l) *------------------------------------------------------------------------- */ hid_t -H5Fget_create_template (hid_t fid) +H5Fget_create_template (hid_t file_id) { H5F_t *file = NULL; hid_t ret_value = FAIL; H5F_create_t *tmpl = NULL; FUNC_ENTER(H5Fget_create_template, FAIL); - H5TRACE1("i","i",fid); + H5TRACE1("i","i",file_id); /* check args */ - if (H5_FILE != H5I_group(fid) || NULL==(file=H5I_object (fid))) { + if (H5_FILE != H5I_group(file_id) || NULL==(file=H5I_object (file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } @@ -1474,8 +1474,8 @@ H5F_close(H5F_t *f) Close an open HDF5 file. USAGE - herr_t H5Fclose(fid) - int32 fid; IN: File ID of file to close + herr_t H5Fclose(file_id) + int32 file_id; IN: File ID of file to close ERRORS ARGS BADTYPE Not a file atom. @@ -1500,18 +1500,18 @@ H5F_close(H5F_t *f) changed. --------------------------------------------------------------------------*/ herr_t -H5Fclose (hid_t fid) +H5Fclose (hid_t file_id) { herr_t ret_value = SUCCEED; FUNC_ENTER(H5Fclose, FAIL); - H5TRACE1("e","i",fid); + H5TRACE1("e","i",file_id); /* Check/fix arguments. */ - if (H5_FILE != H5I_group(fid)) { + if (H5_FILE != H5I_group(file_id)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file atom"); } - if (NULL == H5I_object(fid)) { + if (NULL == H5I_object(file_id)) { HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "unable to unatomize file"); } @@ -1519,7 +1519,7 @@ H5Fclose (hid_t fid) * Decrement reference count on atom. When it reaches zero the file will * be closed. */ - if (H5I_dec_ref (fid)<0) { + if (H5I_dec_ref (file_id)<0) { HGOTO_ERROR (H5E_ATOM, H5E_CANTINIT, FAIL, "problems closing file"); } diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index e218ead..b0536e7 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -81,8 +81,8 @@ hbool_t H5Fis_hdf5 (const char *filename); hid_t H5Fcreate (const char *filename, unsigned flags, hid_t create_plist, hid_t access_plist); hid_t H5Fopen (const char *filename, unsigned flags, hid_t access_plist); -herr_t H5Fclose (hid_t fid); -hid_t H5Fget_create_template (hid_t fid); +herr_t H5Fclose (hid_t file_id); +hid_t H5Fget_create_template (hid_t file_id); hid_t H5Fget_access_template (hid_t file_id); #ifdef __cplusplus @@ -224,21 +224,21 @@ H5Gopen (hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ herr_t -H5Gclose (hid_t grp_id) +H5Gclose (hid_t group_id) { FUNC_ENTER(H5Gclose, FAIL); - H5TRACE1("e","i",grp_id); + H5TRACE1("e","i",group_id); /* Check args */ - if (H5_GROUP != H5I_group(grp_id) || - NULL == H5I_object(grp_id)) { + if (H5_GROUP != H5I_group(group_id) || + NULL == H5I_object(group_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group"); } /* * Decrement the counter on the group atom. It will be freed if the count * reaches zero. */ - if (H5I_dec_ref(grp_id) < 0) { + if (H5I_dec_ref(group_id) < 0) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close group"); } FUNC_LEAVE(SUCCEED); diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index d801a31..294166f 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -53,13 +53,13 @@ typedef struct H5G_stat_t { typedef herr_t (*H5G_iterate_t)(hid_t group, const char *group_name, void *op_data); -hid_t H5Gcreate (hid_t file_id, const char *name, size_t size_hint); -hid_t H5Gopen (hid_t file_id, const char *name); -herr_t H5Gclose (hid_t grp_id); -herr_t H5Gset (hid_t file, const char *name); -herr_t H5Gpush (hid_t file, const char *name); -herr_t H5Gpop (hid_t file); -herr_t H5Giterate (hid_t file, const char *name, int *idx, H5G_iterate_t op, +hid_t H5Gcreate (hid_t loc_id, const char *name, size_t size_hint); +hid_t H5Gopen (hid_t loc_id, const char *name); +herr_t H5Gclose (hid_t group_id); +herr_t H5Gset (hid_t loc_id, const char *name); +herr_t H5Gpush (hid_t loc_id, const char *name); +herr_t H5Gpop (hid_t loc_id); +herr_t H5Giterate (hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data); herr_t H5Gmove (hid_t loc_id, const char *src, const char *dst); herr_t H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name, @@ -149,7 +149,7 @@ hid_t H5Pcreate (H5P_class_t type) { hid_t ret_value = FAIL; - void *tmpl = NULL; + void *plist = NULL; FUNC_ENTER(H5Pcreate, FAIL); H5TRACE1("i","p",type); @@ -157,35 +157,35 @@ H5Pcreate (H5P_class_t type) /* Allocate a new property list and initialize it with default values */ switch (type) { case H5P_FILE_CREATE: - if (NULL==(tmpl = H5MM_malloc(sizeof(H5F_create_t)))) { + if (NULL==(plist = H5MM_malloc(sizeof(H5F_create_t)))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(tmpl, &H5F_create_dflt, sizeof(H5F_create_t)); + memcpy(plist, &H5F_create_dflt, sizeof(H5F_create_t)); break; case H5P_FILE_ACCESS: - if (NULL==(tmpl = H5MM_malloc(sizeof(H5F_access_t)))) { + if (NULL==(plist = H5MM_malloc(sizeof(H5F_access_t)))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(tmpl, &H5F_access_dflt, sizeof(H5F_access_t)); + memcpy(plist, &H5F_access_dflt, sizeof(H5F_access_t)); break; case H5P_DATASET_CREATE: - if (NULL==(tmpl = H5MM_malloc(sizeof(H5D_create_t)))) { + if (NULL==(plist = H5MM_malloc(sizeof(H5D_create_t)))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(tmpl, &H5D_create_dflt, sizeof(H5D_create_t)); + memcpy(plist, &H5D_create_dflt, sizeof(H5D_create_t)); break; case H5P_DATASET_XFER: - if (NULL==(tmpl = H5MM_malloc(sizeof(H5D_xfer_t)))) { + if (NULL==(plist = H5MM_malloc(sizeof(H5D_xfer_t)))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - memcpy(tmpl, &H5D_xfer_dflt, sizeof(H5D_xfer_t)); + memcpy(plist, &H5D_xfer_dflt, sizeof(H5D_xfer_t)); break; default: @@ -194,7 +194,7 @@ H5Pcreate (H5P_class_t type) } /* Atomize the new property list */ - if ((ret_value = H5P_create(type, tmpl)) < 0) { + if ((ret_value = H5P_create(type, plist)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to register property list"); } @@ -221,7 +221,7 @@ H5Pcreate (H5P_class_t type) *------------------------------------------------------------------------- */ hid_t -H5P_create(H5P_class_t type, void *tmpl) +H5P_create(H5P_class_t type, void *plist) { hid_t ret_value = FAIL; @@ -229,10 +229,10 @@ H5P_create(H5P_class_t type, void *tmpl) /* check args */ assert(type >= 0 && type < H5P_NCLASSES); - assert(tmpl); + assert(plist); /* Atomize the new property list */ - if ((ret_value=H5I_register((H5I_group_t)(H5_TEMPLATE_0+type), tmpl)) < 0) { + if ((ret_value=H5I_register((H5I_group_t)(H5_TEMPLATE_0+type), plist))<0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to register property list"); } @@ -254,17 +254,17 @@ H5P_create(H5P_class_t type, void *tmpl) This function releases access to a property list object --------------------------------------------------------------------------*/ herr_t -H5Pclose (hid_t tid) +H5Pclose (hid_t plist_id) { H5P_class_t type; - void *tmpl = NULL; + void *plist = NULL; FUNC_ENTER(H5Pclose, FAIL); - H5TRACE1("e","i",tid); + H5TRACE1("e","i",plist_id); /* Check arguments */ - if ((type=H5P_get_class (tid))<0 || - NULL==(tmpl=H5I_object (tid))) { + if ((type=H5P_get_class (plist_id))<0 || + NULL==(plist=H5I_object (plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); } @@ -274,7 +274,7 @@ H5Pclose (hid_t tid) * free function is not registered as part of the group because it takes * an extra argument. */ - if (0==H5I_dec_ref(tid)) H5P_close (type, tmpl); + if (0==H5I_dec_ref(plist_id)) H5P_close (type, plist); FUNC_LEAVE (SUCCEED); } @@ -298,15 +298,15 @@ H5Pclose (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5P_close (H5P_class_t type, void *tmpl) +H5P_close (H5P_class_t type, void *plist) { - H5F_access_t *fa_list = (H5F_access_t*)tmpl; - H5D_create_t *dc_list = (H5D_create_t*)tmpl; + H5F_access_t *fa_list = (H5F_access_t*)plist; + H5D_create_t *dc_list = (H5D_create_t*)plist; FUNC_ENTER (H5P_close, FAIL); /* Check args */ - if (!tmpl) HRETURN (SUCCEED); + if (!plist) HRETURN (SUCCEED); /* Some property lists may need to do special things */ switch (type) { @@ -359,7 +359,7 @@ H5P_close (H5P_class_t type, void *tmpl) } /* Free the property list struct and return */ - H5MM_xfree(tmpl); + H5MM_xfree(plist); FUNC_LEAVE(SUCCEED); } @@ -381,15 +381,15 @@ H5P_close (H5P_class_t type, void *tmpl) *------------------------------------------------------------------------- */ H5P_class_t -H5Pget_class (hid_t tid) +H5Pget_class (hid_t plist_id) { H5I_group_t group; H5P_class_t ret_value = H5P_NO_CLASS; FUNC_ENTER(H5Pget_class, H5P_NO_CLASS); - H5TRACE1("p","i",tid); + H5TRACE1("p","i",plist_id); - if ((group = H5I_group(tid)) < 0 || + if ((group = H5I_group(plist_id)) < 0 || #ifndef NDEBUG group >= H5_TEMPLATE_MAX || #endif @@ -419,14 +419,14 @@ H5Pget_class (hid_t tid) *------------------------------------------------------------------------- */ H5P_class_t -H5P_get_class(hid_t tid) +H5P_get_class(hid_t plist_id) { H5I_group_t group; H5P_class_t ret_value = H5P_NO_CLASS; FUNC_ENTER(H5P_get_class, H5P_NO_CLASS); - if ((group = H5I_group(tid)) < 0 || + if ((group = H5I_group(plist_id)) < 0 || #ifndef NDEBUG group >= H5_TEMPLATE_MAX || #endif @@ -466,25 +466,25 @@ H5P_get_class(hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pget_version (hid_t tid, int *boot/*out*/, int *freelist/*out*/, +H5Pget_version (hid_t plist_id, int *boot/*out*/, int *freelist/*out*/, int *stab/*out*/, int *shhdr/*out*/) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pget_version, FAIL); - H5TRACE5("e","ixxxx",tid,boot,freelist,stab,shhdr); + H5TRACE5("e","ixxxx",plist_id,boot,freelist,stab,shhdr); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Get values */ - if (boot) *boot = tmpl->bootblock_ver; - if (freelist) *freelist = tmpl->freespace_ver; - if (stab) *stab = tmpl->objectdir_ver; - if (shhdr) *shhdr = tmpl->sharedheader_ver; + if (boot) *boot = plist->bootblock_ver; + if (freelist) *freelist = plist->freespace_ver; + if (stab) *stab = plist->objectdir_ver; + if (shhdr) *shhdr = plist->sharedheader_ver; FUNC_LEAVE(SUCCEED); } @@ -507,17 +507,17 @@ H5Pget_version (hid_t tid, int *boot/*out*/, int *freelist/*out*/, *------------------------------------------------------------------------- */ herr_t -H5Pset_userblock (hid_t tid, hsize_t size) +H5Pset_userblock (hid_t plist_id, hsize_t size) { uintn i; - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pset_userblock, FAIL); - H5TRACE2("e","ih",tid,size); + H5TRACE2("e","ih",plist_id,size); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } @@ -530,7 +530,7 @@ H5Pset_userblock (hid_t tid, hsize_t size) "userblock size is not valid"); } /* Set value */ - tmpl->userblock_size = size; + plist->userblock_size = size; FUNC_LEAVE(SUCCEED); } @@ -553,21 +553,21 @@ H5Pset_userblock (hid_t tid, hsize_t size) *------------------------------------------------------------------------- */ herr_t -H5Pget_userblock (hid_t tid, hsize_t *size) +H5Pget_userblock (hid_t plist_id, hsize_t *size) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pget_userblock, FAIL); - H5TRACE2("e","i*h",tid,size); + H5TRACE2("e","i*h",plist_id,size); /* Check args */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Get value */ - if (size) *size = tmpl->userblock_size; + if (size) *size = plist->userblock_size; FUNC_LEAVE(SUCCEED); } @@ -673,9 +673,9 @@ H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/, /*------------------------------------------------------------------------- * Function: H5Pset_sizes * - * Purpose: Sets file size-of addresses and sizes. TID should be a file - * creation property list. A value of zero causes the property - * to not change. + * Purpose: Sets file size-of addresses and sizes. PLIST_ID should be a + * file creation property list. A value of zero causes the + * property to not change. * * Return: Success: SUCCEED * @@ -689,16 +689,16 @@ H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/, *------------------------------------------------------------------------- */ herr_t -H5Pset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size) +H5Pset_sizes (hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pset_sizeof_addr, FAIL); - H5TRACE3("e","izz",tid,sizeof_addr,sizeof_size); + H5TRACE3("e","izz",plist_id,sizeof_addr,sizeof_size); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } @@ -718,9 +718,9 @@ H5Pset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size) } /* Set value */ if (sizeof_addr) - tmpl->sizeof_addr = sizeof_addr; + plist->sizeof_addr = sizeof_addr; if (sizeof_size) - tmpl->sizeof_size = sizeof_size; + plist->sizeof_size = sizeof_size; FUNC_LEAVE(SUCCEED); } @@ -744,25 +744,25 @@ H5Pset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size) *------------------------------------------------------------------------- */ herr_t -H5Pget_sizes (hid_t tid, +H5Pget_sizes (hid_t plist_id, size_t *sizeof_addr /*out */ , size_t *sizeof_size /*out */ ) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pget_sizes, FAIL); - H5TRACE3("e","ixx",tid,sizeof_addr,sizeof_size); + H5TRACE3("e","ixx",plist_id,sizeof_addr,sizeof_size); /* Check args */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Get values */ if (sizeof_addr) - *sizeof_addr = tmpl->sizeof_addr; + *sizeof_addr = plist->sizeof_addr; if (sizeof_size) - *sizeof_size = tmpl->sizeof_size; + *sizeof_size = plist->sizeof_size; FUNC_LEAVE(SUCCEED); } @@ -797,25 +797,25 @@ H5Pget_sizes (hid_t tid, *------------------------------------------------------------------------- */ herr_t -H5Pset_sym_k (hid_t tid, int ik, int lk) +H5Pset_sym_k (hid_t plist_id, int ik, int lk) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pset_sym_k, FAIL); - H5TRACE3("e","iIsIs",tid,ik,lk); + H5TRACE3("e","iIsIs",plist_id,ik,lk); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Set values */ if (ik > 0) { - tmpl->btree_k[H5B_SNODE_ID] = ik; + plist->btree_k[H5B_SNODE_ID] = ik; } if (lk > 0) { - tmpl->sym_leaf_k = lk; + plist->sym_leaf_k = lk; } FUNC_LEAVE(SUCCEED); } @@ -840,24 +840,24 @@ H5Pset_sym_k (hid_t tid, int ik, int lk) *------------------------------------------------------------------------- */ herr_t -H5Pget_sym_k (hid_t tid, int *ik /*out */ , int *lk /*out */ ) +H5Pget_sym_k (hid_t plist_id, int *ik /*out */ , int *lk /*out */ ) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pget_sym_k, FAIL); - H5TRACE3("e","ixx",tid,ik,lk); + H5TRACE3("e","ixx",plist_id,ik,lk); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Get values */ if (ik) - *ik = tmpl->btree_k[H5B_SNODE_ID]; + *ik = plist->btree_k[H5B_SNODE_ID]; if (lk) - *lk = tmpl->sym_leaf_k; + *lk = plist->sym_leaf_k; FUNC_LEAVE(SUCCEED); } @@ -881,16 +881,16 @@ H5Pget_sym_k (hid_t tid, int *ik /*out */ , int *lk /*out */ ) *------------------------------------------------------------------------- */ herr_t -H5Pset_istore_k (hid_t tid, int ik) +H5Pset_istore_k (hid_t plist_id, int ik) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pset_istore_k, FAIL); - H5TRACE2("e","iIs",tid,ik); + H5TRACE2("e","iIs",plist_id,ik); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } @@ -899,7 +899,7 @@ H5Pset_istore_k (hid_t tid, int ik) "istore IK value must be positive"); } /* Set value */ - tmpl->btree_k[H5B_ISTORE_ID] = ik; + plist->btree_k[H5B_ISTORE_ID] = ik; FUNC_LEAVE(SUCCEED); } @@ -923,22 +923,22 @@ H5Pset_istore_k (hid_t tid, int ik) *------------------------------------------------------------------------- */ herr_t -H5Pget_istore_k (hid_t tid, int *ik /*out */ ) +H5Pget_istore_k (hid_t plist_id, int *ik /*out */ ) { - H5F_create_t *tmpl = NULL; + H5F_create_t *plist = NULL; FUNC_ENTER(H5Pget_istore_k, FAIL); - H5TRACE2("e","ix",tid,ik); + H5TRACE2("e","ix",plist_id,ik); /* Check arguments */ - if (H5P_FILE_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file creation property list"); } /* Get value */ if (ik) - *ik = tmpl->btree_k[H5B_ISTORE_ID]; + *ik = plist->btree_k[H5B_ISTORE_ID]; FUNC_LEAVE(SUCCEED); } @@ -960,16 +960,16 @@ H5Pget_istore_k (hid_t tid, int *ik /*out */ ) *------------------------------------------------------------------------- */ herr_t -H5Pset_layout (hid_t tid, H5D_layout_t layout) +H5Pset_layout (hid_t plist_id, H5D_layout_t layout) { - H5D_create_t *tmpl = NULL; + H5D_create_t *plist = NULL; FUNC_ENTER(H5Pset_layout, FAIL); - H5TRACE2("e","iDl",tid,layout); + H5TRACE2("e","iDl",plist_id,layout); /* Check arguments */ - if (H5P_DATASET_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } @@ -978,7 +978,7 @@ H5Pset_layout (hid_t tid, H5D_layout_t layout) "raw data layout method is not valid"); } /* Set value */ - tmpl->layout = layout; + plist->layout = layout; FUNC_LEAVE(SUCCEED); } @@ -1000,20 +1000,20 @@ H5Pset_layout (hid_t tid, H5D_layout_t layout) *------------------------------------------------------------------------- */ H5D_layout_t -H5Pget_layout (hid_t tid) +H5Pget_layout (hid_t plist_id) { - H5D_create_t *tmpl = NULL; + H5D_create_t *plist = NULL; FUNC_ENTER(H5Pget_layout, H5D_LAYOUT_ERROR); - H5TRACE1("Dl","i",tid); + H5TRACE1("Dl","i",plist_id); /* Check arguments */ - if (H5P_DATASET_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, H5D_LAYOUT_ERROR, "not a dataset creation property list"); } - FUNC_LEAVE(tmpl->layout); + FUNC_LEAVE(plist->layout); } /*------------------------------------------------------------------------- @@ -1038,17 +1038,17 @@ H5Pget_layout (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[/*ndims*/]) +H5Pset_chunk (hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) { int i; - H5D_create_t *tmpl = NULL; + H5D_create_t *plist = NULL; FUNC_ENTER(H5Pset_chunk, FAIL); - H5TRACE3("e","iIs*[a1]h",tid,ndims,dim); + H5TRACE3("e","iIs*[a1]h",plist_id,ndims,dim); /* Check arguments */ - if (H5P_DATASET_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } @@ -1056,7 +1056,7 @@ H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[/*ndims*/]) HRETURN_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk dimensionality must be positive"); } - if ((size_t)ndims > NELMTS(tmpl->chunk_size)) { + if ((size_t)ndims > NELMTS(plist->chunk_size)) { HRETURN_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk dimensionality is too large"); } @@ -1072,10 +1072,10 @@ H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[/*ndims*/]) } /* Set value */ - tmpl->layout = H5D_CHUNKED; - tmpl->chunk_ndims = ndims; + plist->layout = H5D_CHUNKED; + plist->chunk_ndims = ndims; for (i = 0; i < ndims; i++) { - tmpl->chunk_size[i] = dim[i]; + plist->chunk_size[i] = dim[i]; } FUNC_LEAVE(SUCCEED); @@ -1101,29 +1101,29 @@ H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[/*ndims*/]) *------------------------------------------------------------------------- */ int -H5Pget_chunk (hid_t tid, int max_ndims, hsize_t dim[]/*out*/) +H5Pget_chunk (hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) { int i; - H5D_create_t *tmpl = NULL; + H5D_create_t *plist = NULL; FUNC_ENTER(H5Pget_chunk, FAIL); - H5TRACE3("Is","iIsx",tid,max_ndims,dim); + H5TRACE3("Is","iIsx",plist_id,max_ndims,dim); /* Check arguments */ - if (H5P_DATASET_CREATE != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_DATASET_CREATE != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); } - if (H5D_CHUNKED != tmpl->layout) { + if (H5D_CHUNKED != plist->layout) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout"); } - for (i=0; i<tmpl->chunk_ndims && i<max_ndims && dim; i++) { - dim[i] = tmpl->chunk_size[i]; + for (i=0; i<plist->chunk_ndims && i<max_ndims && dim; i++) { + dim[i] = plist->chunk_size[i]; } - FUNC_LEAVE(tmpl->chunk_ndims); + FUNC_LEAVE(plist->chunk_ndims); } @@ -1318,8 +1318,8 @@ H5Pget_external (hid_t plist_id, int idx, size_t name_size, char *name/*out*/, /*------------------------------------------------------------------------- * Function: H5Pget_driver * - * Purpose: Return the ID of the low-level file driver. TID should be a - * file access property list. + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. * * Return: Success: A low-level driver ID * @@ -1333,21 +1333,21 @@ H5Pget_external (hid_t plist_id, int idx, size_t name_size, char *name/*out*/, *------------------------------------------------------------------------- */ H5F_driver_t -H5Pget_driver (hid_t tid) +H5Pget_driver (hid_t plist_id) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_driver, H5F_LOW_ERROR); - H5TRACE1("Fd","i",tid); + H5TRACE1("Fd","i",plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, H5F_LOW_ERROR, "not a file access property list"); } - FUNC_LEAVE (tmpl->driver); + FUNC_LEAVE (plist->driver); } @@ -1370,22 +1370,22 @@ H5Pget_driver (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pset_stdio (hid_t tid) +H5Pset_stdio (hid_t plist_id) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pset_stdio, FAIL); - H5TRACE1("e","i",tid); + H5TRACE1("e","i",plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } /* Set driver */ - tmpl->driver = H5F_LOW_STDIO; + plist->driver = H5F_LOW_STDIO; FUNC_LEAVE (SUCCEED); } @@ -1411,20 +1411,20 @@ H5Pset_stdio (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pget_stdio (hid_t tid) +H5Pget_stdio (hid_t plist_id) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_stdio, FAIL); - H5TRACE1("e","i",tid); + H5TRACE1("e","i",plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_STDIO != tmpl->driver) { + if (H5F_LOW_STDIO != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the stdio driver is not set"); } @@ -1452,22 +1452,22 @@ H5Pget_stdio (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pset_sec2 (hid_t tid) +H5Pset_sec2 (hid_t plist_id) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pset_sec2, FAIL); - H5TRACE1("e","i",tid); + H5TRACE1("e","i",plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } /* Set driver */ - tmpl->driver = H5F_LOW_SEC2; + plist->driver = H5F_LOW_SEC2; FUNC_LEAVE (SUCCEED); } @@ -1493,20 +1493,20 @@ H5Pset_sec2 (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pget_sec2 (hid_t tid) +H5Pget_sec2 (hid_t plist_id) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_sec2, FAIL); - H5TRACE1("e","i",tid); + H5TRACE1("e","i",plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_SEC2 != tmpl->driver) { + if (H5F_LOW_SEC2 != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the sec2 driver is not set"); } @@ -1538,16 +1538,16 @@ H5Pget_sec2 (hid_t tid) *------------------------------------------------------------------------- */ herr_t -H5Pset_core (hid_t tid, size_t increment) +H5Pset_core (hid_t plist_id, size_t increment) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pset_core, FAIL); - H5TRACE2("e","iz",tid,increment); + H5TRACE2("e","iz",plist_id,increment); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } @@ -1557,8 +1557,8 @@ H5Pset_core (hid_t tid, size_t increment) } /* Set driver */ - tmpl->driver = H5F_LOW_CORE; - tmpl->u.core.increment = increment; + plist->driver = H5F_LOW_CORE; + plist->u.core.increment = increment; FUNC_LEAVE (SUCCEED); } @@ -1586,27 +1586,27 @@ H5Pset_core (hid_t tid, size_t increment) *------------------------------------------------------------------------- */ herr_t -H5Pget_core (hid_t tid, size_t *increment/*out*/) +H5Pget_core (hid_t plist_id, size_t *increment/*out*/) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_core, FAIL); - H5TRACE2("e","ix",tid,increment); + H5TRACE2("e","ix",plist_id,increment); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_CORE != tmpl->driver) { + if (H5F_LOW_CORE != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the core driver is not set"); } /* Return values */ if (increment) { - *increment = tmpl->u.core.increment; + *increment = plist->u.core.increment; } FUNC_LEAVE (SUCCEED); @@ -1631,41 +1631,41 @@ H5Pget_core (hid_t tid, size_t *increment/*out*/) *------------------------------------------------------------------------- */ herr_t -H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid, - const char *raw_ext, hid_t raw_tid) +H5Pset_split (hid_t plist_id, const char *meta_ext, hid_t meta_plist_id, + const char *raw_ext, hid_t raw_plist_id) { - H5F_access_t *tmpl = NULL; - H5F_access_t *meta_tmpl = &H5F_access_dflt; - H5F_access_t *raw_tmpl = &H5F_access_dflt; + H5F_access_t *plist = NULL; + H5F_access_t *meta_plist = &H5F_access_dflt; + H5F_access_t *raw_plist = &H5F_access_dflt; FUNC_ENTER (H5Pset_split, FAIL); - H5TRACE5("e","isisi",tid,meta_ext,meta_tid,raw_ext,raw_tid); + H5TRACE5("e","isisi",plist_id,meta_ext,meta_plist_id,raw_ext,raw_plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5P_DEFAULT!=meta_tid && - (H5P_FILE_ACCESS != H5P_get_class(meta_tid) || - NULL == (meta_tmpl = H5I_object(meta_tid)))) { + if (H5P_DEFAULT!=meta_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(meta_plist_id) || + NULL == (meta_plist = H5I_object(meta_plist_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5P_DEFAULT!=raw_tid && - (H5P_FILE_ACCESS != H5P_get_class(raw_tid) || - NULL == (raw_tmpl = H5I_object(raw_tid)))) { + if (H5P_DEFAULT!=raw_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(raw_plist_id) || + NULL == (raw_plist = H5I_object(raw_plist_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } /* Set driver */ - tmpl->driver = H5F_LOW_SPLIT; - tmpl->u.split.meta_access = H5P_copy (H5P_FILE_ACCESS, meta_tmpl); - tmpl->u.split.raw_access = H5P_copy (H5P_FILE_ACCESS, raw_tmpl); - tmpl->u.split.meta_ext = H5MM_xstrdup (meta_ext); - tmpl->u.split.raw_ext = H5MM_xstrdup (raw_ext); + plist->driver = H5F_LOW_SPLIT; + plist->u.split.meta_access = H5P_copy (H5P_FILE_ACCESS, meta_plist); + plist->u.split.raw_access = H5P_copy (H5P_FILE_ACCESS, raw_plist); + plist->u.split.meta_ext = H5MM_xstrdup (meta_ext); + plist->u.split.raw_ext = H5MM_xstrdup (raw_ext); FUNC_LEAVE (SUCCEED); } @@ -1700,23 +1700,23 @@ H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid, *------------------------------------------------------------------------- */ herr_t -H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/, +H5Pget_split (hid_t plist_id, size_t meta_ext_size, char *meta_ext/*out*/, hid_t *meta_properties/*out*/, size_t raw_ext_size, char *raw_ext/*out*/, hid_t *raw_properties/*out*/) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_split, FAIL); - H5TRACE7("e","izxxzxx",tid,meta_ext_size,meta_ext,meta_properties, + H5TRACE7("e","izxxzxx",plist_id,meta_ext_size,meta_ext,meta_properties, raw_ext_size,raw_ext,raw_properties); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_SPLIT != tmpl->driver) { + if (H5F_LOW_SPLIT != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the split driver is not set"); } @@ -1729,30 +1729,30 @@ H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/, /* Output arguments */ if (meta_ext && meta_ext_size>0) { - if (tmpl->u.split.meta_ext) { - strncpy (meta_ext, tmpl->u.split.meta_ext, meta_ext_size); + if (plist->u.split.meta_ext) { + strncpy (meta_ext, plist->u.split.meta_ext, meta_ext_size); } else { strncpy (meta_ext, ".meta", meta_ext_size); } } if (raw_ext && raw_ext_size>0) { - if (tmpl->u.split.raw_ext) { - strncpy (raw_ext, tmpl->u.split.raw_ext, raw_ext_size); + if (plist->u.split.raw_ext) { + strncpy (raw_ext, plist->u.split.raw_ext, raw_ext_size); } else { strncpy (raw_ext, ".raw", raw_ext_size); } } if (meta_properties) { - assert (tmpl->u.split.meta_access); + assert (plist->u.split.meta_access); *meta_properties = H5P_create (H5P_FILE_ACCESS, H5P_copy (H5P_FILE_ACCESS, - tmpl->u.split.meta_access)); + plist->u.split.meta_access)); } if (raw_properties) { - assert (tmpl->u.split.raw_access); + assert (plist->u.split.raw_access); *raw_properties = H5P_create (H5P_FILE_ACCESS, H5P_copy (H5P_FILE_ACCESS, - tmpl->u.split.raw_access)); + plist->u.split.raw_access)); } FUNC_LEAVE (SUCCEED); @@ -1780,18 +1780,18 @@ H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/, *------------------------------------------------------------------------- */ herr_t -H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid) +H5Pset_family (hid_t plist_id, hsize_t memb_size, hid_t memb_plist_id) { - H5F_access_t *tmpl = NULL; - H5F_access_t *memb_tmpl = &H5F_access_dflt; + H5F_access_t *plist = NULL; + H5F_access_t *memb_plist = &H5F_access_dflt; FUNC_ENTER (H5Pset_family, FAIL); - H5TRACE3("e","ihi",tid,memb_size,memb_tid); + H5TRACE3("e","ihi",plist_id,memb_size,memb_plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } @@ -1799,18 +1799,18 @@ H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid) HRETURN_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "family member size is too small"); } - if (H5P_DEFAULT!=memb_tid && - (H5P_FILE_ACCESS != H5P_get_class(memb_tid) || - NULL == (tmpl = H5I_object(memb_tid)))) { + if (H5P_DEFAULT!=memb_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(memb_plist_id) || + NULL == (plist = H5I_object(memb_plist_id)))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } /* Set driver */ - tmpl->driver = H5F_LOW_FAMILY; - H5F_addr_reset (&(tmpl->u.fam.memb_size)); - H5F_addr_inc (&(tmpl->u.fam.memb_size), memb_size); - tmpl->u.fam.memb_access = H5P_copy (H5P_FILE_ACCESS, memb_tmpl); + plist->driver = H5F_LOW_FAMILY; + H5F_addr_reset (&(plist->u.fam.memb_size)); + H5F_addr_inc (&(plist->u.fam.memb_size), memb_size); + plist->u.fam.memb_access = H5P_copy (H5P_FILE_ACCESS, memb_plist); FUNC_LEAVE (SUCCEED); } @@ -1821,7 +1821,7 @@ H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid) * * Purpose: If the file access property list is set to the family driver * then this function returns zero; otherwise it returns a - * negative value. On success, if MEMB_TID is a non-null + * negative value. On success, if MEMB_PLIST_ID is a non-null * pointer it will be initialized with the id of an open * property list: the file access property list for the family * members. In the future, additional arguments may be added to @@ -1839,33 +1839,34 @@ H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid) *------------------------------------------------------------------------- */ herr_t -H5Pget_family (hid_t tid, hsize_t *memb_size/*out*/, hid_t *memb_tid/*out*/) +H5Pget_family (hid_t plist_id, hsize_t *memb_size/*out*/, + hid_t *memb_plist_id/*out*/) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_family, FAIL); - H5TRACE3("e","ixx",tid,memb_size,memb_tid); + H5TRACE3("e","ixx",plist_id,memb_size,memb_plist_id); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_FAMILY != tmpl->driver) { + if (H5F_LOW_FAMILY != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the family driver is not set"); } /* Output args */ if (memb_size) { - *memb_size = tmpl->u.fam.memb_size.offset; + *memb_size = plist->u.fam.memb_size.offset; } - if (memb_tid) { - assert (tmpl->u.fam.memb_access); - *memb_tid = H5P_create (H5P_FILE_ACCESS, + if (memb_plist_id) { + assert (plist->u.fam.memb_access); + *memb_plist_id = H5P_create (H5P_FILE_ACCESS, H5P_copy (H5P_FILE_ACCESS, - tmpl->u.fam.memb_access)); + plist->u.fam.memb_access)); } FUNC_LEAVE (SUCCEED); @@ -1897,17 +1898,17 @@ H5Pget_family (hid_t tid, hsize_t *memb_size/*out*/, hid_t *memb_tid/*out*/) *------------------------------------------------------------------------- */ herr_t -H5Pset_cache (hid_t tid, int mdc_nelmts, size_t rdcc_nbytes, +H5Pset_cache (hid_t plist_id, int mdc_nelmts, size_t rdcc_nbytes, double rdcc_w0) { H5F_access_t *fapl = NULL; FUNC_ENTER (H5Pset_cache, FAIL); - H5TRACE4("e","iIszd",tid,mdc_nelmts,rdcc_nbytes,rdcc_w0); + H5TRACE4("e","iIszd",plist_id,mdc_nelmts,rdcc_nbytes,rdcc_w0); /* Check arguments */ - if (H5P_FILE_ACCESS!=H5P_get_class (tid) || - NULL==(fapl=H5I_object (tid))) { + if (H5P_FILE_ACCESS!=H5P_get_class (plist_id) || + NULL==(fapl=H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } @@ -1951,17 +1952,17 @@ H5Pset_cache (hid_t tid, int mdc_nelmts, size_t rdcc_nbytes, *------------------------------------------------------------------------- */ herr_t -H5Pget_cache (hid_t tid, int *mdc_nelmts, size_t *rdcc_nbytes, +H5Pget_cache (hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nbytes, double *rdcc_w0) { H5F_access_t *fapl = NULL; FUNC_ENTER (H5Pget_cache, FAIL); - H5TRACE4("e","i*Is*z*d",tid,mdc_nelmts,rdcc_nbytes,rdcc_w0); + H5TRACE4("e","i*Is*z*d",plist_id,mdc_nelmts,rdcc_nbytes,rdcc_w0); /* Check arguments */ - if (H5P_FILE_ACCESS!=H5P_get_class (tid) || - NULL==(fapl=H5I_object (tid))) { + if (H5P_FILE_ACCESS!=H5P_get_class (plist_id) || + NULL==(fapl=H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } @@ -2356,7 +2357,7 @@ H5Pget_deflate (hid_t plist_id) /*------------------------------------------------------------------------- * Function: H5Pset_mpi * - * Signature: herr_t H5Pset_mpi(hid_t tid, MPI_Comm comm, MPI_Info info) + * Signature: herr_t H5Pset_mpi(hid_t plist_id, MPI_Comm comm, MPI_Info info) * * Purpose: Store the access mode for MPIO call and the user supplied * communicator and info in the access property list which can @@ -2365,7 +2366,7 @@ H5Pget_deflate (hid_t plist_id) * function. * * Parameters: - * hid_t tid + * hid_t plist_id * ID of property list to modify * MPI_Comm comm * MPI communicator to be used for file open as defined in @@ -2406,16 +2407,16 @@ H5Pget_deflate (hid_t plist_id) *------------------------------------------------------------------------- */ herr_t -H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info) +H5Pset_mpi (hid_t plist_id, MPI_Comm comm, MPI_Info info) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER(H5Pset_mpi, FAIL); - H5TRACE3("e","iMcMi",tid,comm,info); + H5TRACE3("e","iMcMi",plist_id,comm,info); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class(tid) || - NULL == (tmpl = H5I_object(tid))) { + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } @@ -2426,9 +2427,9 @@ H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info) */ #endif - tmpl->driver = H5F_LOW_MPIO; - tmpl->u.mpio.comm = comm; - tmpl->u.mpio.info = info; + plist->driver = H5F_LOW_MPIO; + plist->u.mpio.comm = comm; + plist->u.mpio.info = info; FUNC_LEAVE(SUCCEED); } @@ -2461,25 +2462,25 @@ H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info) *------------------------------------------------------------------------- */ herr_t -H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info) +H5Pget_mpi (hid_t plist_id, MPI_Comm *comm, MPI_Info *info) { - H5F_access_t *tmpl = NULL; + H5F_access_t *plist = NULL; FUNC_ENTER (H5Pget_mpi, FAIL); - H5TRACE3("e","i*Mc*Mi",tid,comm,info); + H5TRACE3("e","i*Mc*Mi",plist_id,comm,info); /* Check arguments */ - if (H5P_FILE_ACCESS != H5P_get_class (tid) || - NULL == (tmpl = H5I_object (tid))) { + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); } - if (H5F_LOW_MPIO != tmpl->driver) { + if (H5F_LOW_MPIO != plist->driver) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "the mpi driver is not set"); } - *comm = tmpl->u.mpio.comm; - *info = tmpl->u.mpio.info; + *comm = plist->u.mpio.comm; + *info = plist->u.mpio.info; FUNC_LEAVE (SUCCEED); } @@ -2490,7 +2491,8 @@ H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info) /*------------------------------------------------------------------------- * Function: H5Pset_xfer * - * Signature: herr_t H5Pset_xfer(hid_t tid, H5D_transfer_t data_xfer_mode) + * Signature: herr_t H5Pset_xfer(hid_t plist_id, + * H5D_transfer_t data_xfer_mode) * * Purpose: Set the transfer mode of the dataset transfer property list. * The list can then be used to control the I/O transfer mode @@ -2498,7 +2500,7 @@ H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info) * in the parallel HDF5 library and is not a collective function. * * Parameters: - * hid_t tid + * hid_t plist_id * ID of a dataset transfer property list * H5D_transfer_t data_xfer_mode * Data transfer modes: @@ -2523,16 +2525,16 @@ H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info) *------------------------------------------------------------------------- */ herr_t -H5Pset_xfer (hid_t tid, H5D_transfer_t data_xfer_mode) +H5Pset_xfer (hid_t plist_id, H5D_transfer_t data_xfer_mode) { H5D_xfer_t *plist = NULL; FUNC_ENTER(H5Pset_xfer, FAIL); - H5TRACE2("e","iDt",tid,data_xfer_mode); + H5TRACE2("e","iDt",plist_id,data_xfer_mode); /* Check arguments */ - if (H5P_DATASET_XFER != H5P_get_class(tid) || - NULL == (plist = H5I_object(tid))) { + if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); } @@ -2573,16 +2575,16 @@ H5Pset_xfer (hid_t tid, H5D_transfer_t data_xfer_mode) *------------------------------------------------------------------------- */ herr_t -H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode) +H5Pget_xfer (hid_t plist_id, H5D_transfer_t *data_xfer_mode) { H5D_xfer_t *plist = NULL; FUNC_ENTER (H5Pget_xfer, FAIL); - H5TRACE2("e","i*Dt",tid,data_xfer_mode); + H5TRACE2("e","i*Dt",plist_id,data_xfer_mode); /* Check arguments */ - if (H5P_DATASET_XFER != H5P_get_class(tid) || - NULL == (plist = H5I_object(tid))) { + if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == (plist = H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); } @@ -2600,8 +2602,8 @@ H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode) PURPOSE Copy a property list USAGE - hid_t H5P_copy(tid) - hid_t tid; IN: property list object to copy + hid_t H5P_copy(plist_id) + hid_t plist_id; IN: property list object to copy RETURNS Returns property list ID (atom) on success, FAIL on failure @@ -2618,33 +2620,33 @@ H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode) * parameter settings. --------------------------------------------------------------------------*/ hid_t -H5Pcopy (hid_t tid) +H5Pcopy (hid_t plist_id) { - const void *tmpl = NULL; - void *new_tmpl = NULL; + const void *plist = NULL; + void *new_plist = NULL; H5P_class_t type; hid_t ret_value = FAIL; H5I_group_t group; FUNC_ENTER(H5Pcopy, FAIL); - H5TRACE1("i","i",tid); + H5TRACE1("i","i",plist_id); /* Check args */ - if (NULL == (tmpl = H5I_object(tid)) || - (type = H5P_get_class(tid)) < 0 || - (group = H5I_group(tid)) < 0) { + if (NULL == (plist = H5I_object(plist_id)) || + (type = H5P_get_class(plist_id)) < 0 || + (group = H5I_group(plist_id)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "unable to unatomize property list"); } /* Copy it */ - if (NULL==(new_tmpl=H5P_copy (type, tmpl))) { + if (NULL==(new_plist=H5P_copy (type, plist))) { HRETURN_ERROR (H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to copy property list"); } /* Register the atom for the new property list */ - if ((ret_value = H5I_register(group, new_tmpl)) < 0) { + if ((ret_value = H5I_register(group, new_plist)) < 0) { HRETURN_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize property list pointer"); } diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 220073f..f39be45 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -44,49 +44,50 @@ extern "C" { /* Public functions */ hid_t H5Pcreate (H5P_class_t type); -herr_t H5Pclose (hid_t tid); -hid_t H5Pcopy (hid_t tid); -H5P_class_t H5Pget_class (hid_t tid); -herr_t H5Pget_version (hid_t tid, int *boot/*out*/, int *freelist/*out*/, +herr_t H5Pclose (hid_t plist_id); +hid_t H5Pcopy (hid_t plist_id); +H5P_class_t H5Pget_class (hid_t plist_id); +herr_t H5Pget_version (hid_t plist_id, int *boot/*out*/, int *freelist/*out*/, int *stab/*out*/, int *shhdr/*out*/); -herr_t H5Pset_userblock (hid_t tid, hsize_t size); -herr_t H5Pget_userblock (hid_t tid, hsize_t *size); +herr_t H5Pset_userblock (hid_t plist_id, hsize_t size); +herr_t H5Pget_userblock (hid_t plist_id, hsize_t *size); herr_t H5Pset_alignment (hid_t fapl_id, hsize_t threshold, hsize_t alignment); herr_t H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/, hsize_t *alignment/*out*/); -herr_t H5Pset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size); -herr_t H5Pget_sizes (hid_t tid, size_t *sizeof_addr/*out*/, +herr_t H5Pset_sizes (hid_t plist_id, size_t sizeof_addr, size_t sizeof_size); +herr_t H5Pget_sizes (hid_t plist_id, size_t *sizeof_addr/*out*/, size_t *sizeof_size/*out*/); -herr_t H5Pset_sym_k (hid_t tid, int ik, int lk); -herr_t H5Pget_sym_k (hid_t tid, int *ik/*out*/, int *lk/*out*/); -herr_t H5Pset_istore_k (hid_t tid, int ik); -herr_t H5Pget_istore_k (hid_t tid, int *ik/*out*/); -herr_t H5Pset_layout (hid_t tid, H5D_layout_t layout); -H5D_layout_t H5Pget_layout (hid_t tid); -herr_t H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[]); -int H5Pget_chunk (hid_t tid, int max_ndims, hsize_t dim[]/*out*/); +herr_t H5Pset_sym_k (hid_t plist_id, int ik, int lk); +herr_t H5Pget_sym_k (hid_t plist_id, int *ik/*out*/, int *lk/*out*/); +herr_t H5Pset_istore_k (hid_t plist_id, int ik); +herr_t H5Pget_istore_k (hid_t plist_id, int *ik/*out*/); +herr_t H5Pset_layout (hid_t plist_id, H5D_layout_t layout); +H5D_layout_t H5Pget_layout (hid_t plist_id); +herr_t H5Pset_chunk (hid_t plist_id, int ndims, const hsize_t dim[]); +int H5Pget_chunk (hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/); herr_t H5Pset_external (hid_t plist_id, const char *name, off_t offset, hsize_t size); int H5Pget_external_count (hid_t plist_id); herr_t H5Pget_external (hid_t plist_id, int idx, size_t name_size, char *name/*out*/, off_t *offset/*out*/, hsize_t *size/*out*/); -H5F_driver_t H5Pget_driver (hid_t tid); -herr_t H5Pset_stdio (hid_t tid); -herr_t H5Pget_stdio (hid_t tid); -herr_t H5Pset_sec2 (hid_t tid); -herr_t H5Pget_sec2 (hid_t tid); -herr_t H5Pset_core (hid_t tid, size_t increment); -herr_t H5Pget_core (hid_t tid, size_t *increment/*out*/); -herr_t H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid, - const char *raw_ext, hid_t raw_tid); -herr_t H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/, - hid_t *meta_properties/*out*/, size_t raw_ext_size, - char *raw_ext/*out*/, hid_t *raw_properties/*out*/); +H5F_driver_t H5Pget_driver (hid_t plist_id); +herr_t H5Pset_stdio (hid_t plist_id); +herr_t H5Pget_stdio (hid_t plist_id); +herr_t H5Pset_sec2 (hid_t plist_id); +herr_t H5Pget_sec2 (hid_t plist_id); +herr_t H5Pset_core (hid_t plist_id, size_t increment); +herr_t H5Pget_core (hid_t plist_id, size_t *increment/*out*/); +herr_t H5Pset_split (hid_t plist_id, const char *meta_ext, hid_t meta_plist_id, + const char *raw_ext, hid_t raw_plist_id); +herr_t H5Pget_split (hid_t plist_id, size_t meta_ext_size, + char *meta_ext/*out*/, hid_t *meta_properties/*out*/, + size_t raw_ext_size, char *raw_ext/*out*/, + hid_t *raw_properties/*out*/); -herr_t H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid); -herr_t H5Pget_family (hid_t tid, hsize_t *memb_size/*out*/, - hid_t *memb_tid/*out*/); +herr_t H5Pset_family (hid_t plist_id, hsize_t memb_size, hid_t memb_plist_id); +herr_t H5Pget_family (hid_t plist_id, hsize_t *memb_size/*out*/, + hid_t *memb_plist_id/*out*/); herr_t H5Pset_buffer (hid_t plist_id, size_t size, void *tconv, void *bkg); size_t H5Pget_buffer (hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/); herr_t H5Pset_preserve (hid_t plist_id, hbool_t status); @@ -105,10 +106,11 @@ herr_t H5Pget_cache (hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nbytes, double *rdcc_w0); #ifdef HAVE_PARALLEL -herr_t H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info); -herr_t H5Pget_mpi (hid_t tid, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/); -herr_t H5Pset_xfer (hid_t tid, H5D_transfer_t data_xfer_mode); -herr_t H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode/*out*/); +herr_t H5Pset_mpi (hid_t plist_id, MPI_Comm comm, MPI_Info info); +herr_t H5Pget_mpi (hid_t plist_id, MPI_Comm *comm/*out*/, + MPI_Info *info/*out*/); +herr_t H5Pset_xfer (hid_t plist_id, H5D_transfer_t data_xfer_mode); +herr_t H5Pget_xfer (hid_t plist_id, H5D_transfer_t *data_xfer_mode/*out*/); #endif #ifdef __cplusplus @@ -616,7 +616,8 @@ H5Sextent_ndims (hid_t space_id) H5TRACE1("Is","i",space_id); /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || NULL == (ds = H5I_object(space_id))) { + if (H5_DATASPACE != H5I_group(space_id) || + NULL == (ds = H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } ret_value = H5S_extent_ndims(ds); @@ -973,8 +974,8 @@ H5S_is_simple(const H5S_t *sdim) PURPOSE Check if a dataspace is simple USAGE - hbool_t H5Sis_simple(sid) - hid_t sid; IN: ID of dataspace object to query + hbool_t H5Sis_simple(space_id) + hid_t space_id; IN: ID of dataspace object to query RETURNS TRUE/FALSE/FAIL DESCRIPTION @@ -982,16 +983,16 @@ H5S_is_simple(const H5S_t *sdim) has orthogonal, evenly spaced dimensions. --------------------------------------------------------------------------*/ hbool_t -H5Sis_simple (hid_t sid) +H5Sis_simple (hid_t space_id) { H5S_t *space = NULL; /* dataspace to modify */ hbool_t ret_value = FAIL; FUNC_ENTER(H5Sis_simple, FAIL); - H5TRACE1("b","i",sid); + H5TRACE1("b","i",space_id); /* Check args and all the boring stuff. */ - if ((space = H5I_object(sid)) == NULL) + if ((space = H5I_object(space_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); ret_value = H5S_is_simple(space); @@ -1011,8 +1012,8 @@ H5Sis_simple (hid_t sid) PURPOSE Sets the size of a simple dataspace USAGE - herr_t H5Sset_extent_simple(sid, rank, dims, max) - hid_t sid; IN: Dataspace object to query + herr_t H5Sset_extent_simple(space_id, rank, dims, max) + hid_t space_id; IN: Dataspace object to query intn rank; IN: # of dimensions for the dataspace const size_t *dims; IN: Size of each dimension for the dataspace const size_t *max; IN: Maximum size of each dimension for the dataspace @@ -1029,17 +1030,17 @@ H5Sis_simple (hid_t sid) dimension in the array (the slowest) may be unlimited in size. --------------------------------------------------------------------------*/ herr_t -H5Sset_extent_simple (hid_t sid, int rank, const hsize_t dims[/*rank*/], +H5Sset_extent_simple (hid_t space_id, int rank, const hsize_t dims[/*rank*/], const hsize_t max[/*rank*/]) { H5S_t *space = NULL; /* dataspace to modify */ intn u; /* local counting variable */ FUNC_ENTER(H5Sset_extent_simple, FAIL); - H5TRACE4("e","iIs*[a1]h*[a1]h",sid,rank,dims,max); + H5TRACE4("e","iIs*[a1]h*[a1]h",space_id,rank,dims,max); /* Check args */ - if ((space = H5I_object(sid)) == NULL) { + if ((space = H5I_object(space_id)) == NULL) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); } if (rank > 0 && dims == NULL) { @@ -1051,8 +1052,10 @@ H5Sset_extent_simple (hid_t sid, int rank, const hsize_t dims[/*rank*/], #ifdef OLD_WAY if (dims) { for (u=0; u<rank; u++) { - if (((max!=NULL && max[u]!=H5S_UNLIMITED) || max==NULL) && dims[u]==0) { - HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimension size"); + if (((max!=NULL && max[u]!=H5S_UNLIMITED) || max==NULL) && + dims[u]==0) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "invalid dimension size"); } } } @@ -1178,8 +1181,10 @@ H5S_find (H5S_conv_t *conv, const H5S_t *mem_space, const H5S_t *file_space) /* Check args */ assert (conv); - assert (mem_space && (H5S_SIMPLE==mem_space->extent.type || H5S_SCALAR==mem_space->extent.type)); - assert (file_space && (H5S_SIMPLE==file_space->extent.type || H5S_SCALAR==mem_space->extent.type)); + assert (mem_space && (H5S_SIMPLE==mem_space->extent.type || + H5S_SCALAR==mem_space->extent.type)); + assert (file_space && (H5S_SIMPLE==file_space->extent.type || + H5S_SCALAR==mem_space->extent.type)); /* * We can't do conversion if the source and destination select a @@ -1211,7 +1216,7 @@ H5S_find (H5S_conv_t *conv, const H5S_t *mem_space, const H5S_t *file_space) switch(file_space->select.type) { case H5S_SEL_POINTS: #ifdef QAK -printf("%s: file space has point selection\n",FUNC); + printf("%s: file space has point selection\n",FUNC); #endif /* QAK */ conv->finit = H5S_point_init; conv->favail = H5S_point_favail; @@ -1223,7 +1228,7 @@ printf("%s: file space has point selection\n",FUNC); case H5S_SEL_ALL: #ifdef QAK -printf("%s: file space has all selection\n",FUNC); + printf("%s: file space has all selection\n",FUNC); #endif /* QAK */ conv->finit = H5S_all_init; conv->favail = H5S_all_favail; @@ -1235,7 +1240,7 @@ printf("%s: file space has all selection\n",FUNC); case H5S_SEL_HYPERSLABS: #ifdef QAK -printf("%s: file space has hyperslab selection\n",FUNC); + printf("%s: file space has hyperslab selection\n",FUNC); #endif /* QAK */ conv->finit = H5S_hyper_init; conv->favail = H5S_hyper_favail; @@ -1248,7 +1253,7 @@ printf("%s: file space has hyperslab selection\n",FUNC); case H5S_SEL_NONE: default: #ifdef QAK -printf("%s: file space has unknown selection\n",FUNC); + printf("%s: file space has unknown selection\n",FUNC); #endif /* QAK */ HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid file dataspace selection type"); @@ -1258,7 +1263,7 @@ printf("%s: file space has unknown selection\n",FUNC); switch(mem_space->select.type) { case H5S_SEL_POINTS: #ifdef QAK -printf("%s: memory space has point selection\n",FUNC); + printf("%s: memory space has point selection\n",FUNC); #endif /* QAK */ conv->minit = H5S_point_init; conv->binit = H5S_point_init; @@ -1270,7 +1275,7 @@ printf("%s: memory space has point selection\n",FUNC); case H5S_SEL_ALL: #ifdef QAK -printf("%s: memory space has all selection\n",FUNC); + printf("%s: memory space has all selection\n",FUNC); #endif /* QAK */ conv->minit = H5S_all_init; conv->binit = H5S_all_init; @@ -1282,7 +1287,7 @@ printf("%s: memory space has all selection\n",FUNC); case H5S_SEL_HYPERSLABS: #ifdef QAK -printf("%s: memory space has hyperslab selection\n",FUNC); + printf("%s: memory space has hyperslab selection\n",FUNC); #endif /* QAK */ conv->minit = H5S_hyper_init; conv->binit = H5S_hyper_init; @@ -1295,7 +1300,7 @@ printf("%s: memory space has hyperslab selection\n",FUNC); case H5S_SEL_NONE: default: #ifdef QAK -printf("%s: memory space has unknown selection\n",FUNC); + printf("%s: memory space has unknown selection\n",FUNC); #endif /* QAK */ HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid file dataspace selection type"); diff --git a/src/H5Sall.c b/src/H5Sall.c index 076e8ee..08d01c5 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -54,9 +54,11 @@ H5S_all_init (const struct H5O_layout_t __unused__ *layout, /*------------------------------------------------------------------------- * Function: H5S_all_favail * - * Purpose: Figure out the optimal number of elements to transfer to/from the file + * Purpose: Figure out the optimal number of elements to transfer to/from + * the file. * - * Return: non-negative number of elements on success, negative on failure + * Return: non-negative number of elements on success, negative on + * failure. * * Programmer: Quincey Koziol * Tuesday, June 16, 1998 @@ -107,7 +109,8 @@ H5S_all_favail (const H5S_t *space, const H5S_sel_iter_t *sel_iter, size_t max) * bytes of a datum which this function treats as opaque. * FILE_SPACE describes the data space of the dataset on disk * and the elements that have been selected for reading (via - * hyperslab, etc). This function will copy at most NELMTS elements. + * hyperslab, etc). This function will copy at most NELMTS + * elements. * * Return: Success: Number of elements copied. * @@ -122,10 +125,10 @@ H5S_all_favail (const H5S_t *space, const H5S_sel_iter_t *sel_iter, size_t max) */ size_t H5S_all_fgath (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, void *_buf/*out*/) + const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, + size_t elmt_size, const H5S_t *file_space, + H5S_sel_iter_t *file_iter, size_t nelmts, + const H5D_transfer_t xfer_mode, void *_buf/*out*/) { hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of slab in file*/ hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ @@ -212,10 +215,10 @@ H5S_all_fgath (H5F_t *f, const struct H5O_layout_t *layout, */ herr_t H5S_all_fscat (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, const void *_buf) + const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, + size_t elmt_size, const H5S_t *file_space, + H5S_sel_iter_t *file_iter, size_t nelmts, + const H5D_transfer_t xfer_mode, const void *_buf) { hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of hyperslab */ hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ @@ -298,8 +301,8 @@ H5S_all_fscat (H5F_t *f, const struct H5O_layout_t *layout, */ size_t H5S_all_mgath (const void *_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_tconv_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_tconv_buf/*out*/) { hssize_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ @@ -388,8 +391,8 @@ H5S_all_mgath (const void *_buf, size_t elmt_size, */ herr_t H5S_all_mscat (const void *_tconv_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_buf/*out*/) { hssize_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 9ff2cce..bd69f91 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -37,12 +37,15 @@ typedef struct { } H5S_hyper_fhyper_info_t; /* Static function prototypes */ -static intn H5S_hyper_bsearch(hssize_t size, H5S_hyper_bound_t *barr, size_t count); -static H5S_hyper_region_t *H5S_hyper_get_regions (size_t *num_regions, intn dim, - size_t bound_count, H5S_hyper_bound_t **lo_bounds, - H5S_hyper_bound_t **hi_bounds, hssize_t *pos); +static intn H5S_hyper_bsearch(hssize_t size, H5S_hyper_bound_t *barr, + size_t count); +static H5S_hyper_region_t * +H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, + H5S_hyper_bound_t **lo_bounds, + H5S_hyper_bound_t **hi_bounds, hssize_t *pos); static size_t H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info); -static size_t H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info); +static size_t H5S_hyper_fwrite (intn dim, + H5S_hyper_fhyper_info_t *fhyper_info); /*------------------------------------------------------------------------- @@ -74,9 +77,11 @@ H5S_hyper_init (const struct H5O_layout_t __unused__ *layout, sel_iter->hyp.elmt_left=space->select.num_elem; /* Allocate the position & initialize to invalid location */ - sel_iter->hyp.pos = H5MM_malloc(space->extent.u.simple.rank*sizeof(hssize_t)); + sel_iter->hyp.pos = H5MM_malloc(space->extent.u.simple.rank * + sizeof(hssize_t)); sel_iter->hyp.pos[0]=(-1); - H5V_array_fill(sel_iter->hyp.pos,sel_iter->hyp.pos,sizeof(hssize_t),space->extent.u.simple.rank); + H5V_array_fill(sel_iter->hyp.pos, sel_iter->hyp.pos, sizeof(hssize_t), + space->extent.u.simple.rank); FUNC_LEAVE (SUCCEED); } /* H5S_hyper_init() */ @@ -96,7 +101,8 @@ H5S_hyper_init (const struct H5O_layout_t __unused__ *layout, *------------------------------------------------------------------------- */ size_t -H5S_hyper_favail (const H5S_t __unused__ *space, const H5S_sel_iter_t *sel_iter, size_t max) +H5S_hyper_favail (const H5S_t __unused__ *space, + const H5S_sel_iter_t *sel_iter, size_t max) { FUNC_ENTER (H5S_hyper_favail, FAIL); @@ -105,7 +111,7 @@ H5S_hyper_favail (const H5S_t __unused__ *space, const H5S_sel_iter_t *sel_iter, assert (sel_iter); #ifdef QAK -printf("%s: max=%d\n",FUNC,(int)max); + printf("%s: max=%d\n",FUNC,(int)max); #endif /* QAK */ FUNC_LEAVE (MIN(sel_iter->hyp.elmt_left,max)); } /* H5S_hyper_favail() */ @@ -115,9 +121,9 @@ printf("%s: max=%d\n",FUNC,(int)max); * * Purpose: Compares two regions for equality (regions must not overlap!) * - * Return: an integer less than, equal to, or greater than zero if the first - * region is considered to be respectively less than, equal to, or - * greater than the second + * Return: an integer less than, equal to, or greater than zero if the + * first region is considered to be respectively less than, + * equal to, or greater than the second * * Programmer: Quincey Koziol * Friday, July 17, 1998 @@ -129,13 +135,14 @@ printf("%s: max=%d\n",FUNC,(int)max); int H5S_hyper_compare_regions (const void *r1, const void *r2) { - if(((const H5S_hyper_region_t *)r1)->start<((const H5S_hyper_region_t *)r2)->start) + if (((const H5S_hyper_region_t *)r1)->start < + ((const H5S_hyper_region_t *)r2)->start) return(-1); + else if (((const H5S_hyper_region_t *)r1)->start > + ((const H5S_hyper_region_t *)r2)->start) + return(1); else - if(((const H5S_hyper_region_t *)r1)->start>((const H5S_hyper_region_t *)r2)->start) - return(1); - else - return(0); + return(0); } /* end H5S_hyper_compare_regions */ /*------------------------------------------------------------------------- @@ -143,8 +150,8 @@ H5S_hyper_compare_regions (const void *r1, const void *r2) * * Purpose: Builds a sorted array of the overlaps in a dimension * - * Return: Success: Pointer to valid array (num_regions parameter set to - * array size) + * Return: Success: Pointer to valid array (num_regions parameter + * set to array size) * * Failure: 0 * @@ -157,15 +164,16 @@ H5S_hyper_compare_regions (const void *r1, const void *r2) */ static H5S_hyper_region_t * H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, - H5S_hyper_bound_t **lo_bounds, H5S_hyper_bound_t **hi_bounds, hssize_t *pos) + H5S_hyper_bound_t **lo_bounds, + H5S_hyper_bound_t **hi_bounds, hssize_t *pos) { - H5S_hyper_region_t *ret_value=NULL; /* Pointer to array to return */ + H5S_hyper_region_t *ret_value=NULL; /* Pointer to array to return */ H5S_hyper_node_t *node; /* Region node for a given boundary */ - size_t num_reg=0, /* Number of regions in array */ - curr_reg=0, /* The current region we are working with */ - uniq_reg; /* The number of unique regions */ - intn next_dim, /* Next fastest dimension */ - temp_dim; /* Temporary dim. holder */ + size_t num_reg=0; /* Number of regions in array */ + size_t curr_reg=0; /* The current region we are working with */ + size_t uniq_reg; /* The number of unique regions */ + intn next_dim; /* Next fastest dimension */ + intn temp_dim; /* Temporary dim. holder */ size_t i; /* Counters */ FUNC_ENTER (H5S_hyper_get_regions, NULL); @@ -176,19 +184,21 @@ H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, assert(pos); #ifdef QAK -printf("%s: check 1.0, dim=%d\n",FUNC,dim); -for(i=0; i<2; i++) - printf("%s: %d - pos=%d\n",FUNC,i,(int)pos[i]); + printf("%s: check 1.0, dim=%d\n",FUNC,dim); + for(i=0; i<2; i++) + printf("%s: %d - pos=%d\n",FUNC,i,(int)pos[i]); #endif /* QAK */ /* Check if we need to generate a list of regions for the 0th dim. */ if(dim<0) { #ifdef QAK -printf("%s: check 1.1, bound_count=%d\n",FUNC,bound_count); + printf("%s: check 1.1, bound_count=%d\n",FUNC,bound_count); #endif /* QAK */ for(i=0; i<bound_count; i++) { /* Skip past already iterated regions */ - if(pos[0]==(-1) || (pos[0]>=lo_bounds[0][i].bound && pos[0]<=hi_bounds[0][i].bound)) { + if(pos[0]==(-1) || + (pos[0]>=lo_bounds[0][i].bound && pos[0] <= + hi_bounds[0][i].bound)) { /* Check if we've allocated the array yet */ if(num_reg==0) { /* Allocate array */ @@ -201,22 +211,32 @@ printf("%s: check 1.1, bound_count=%d\n",FUNC,bound_count); /* Increment the number of regions */ num_reg++; } else { - /* Check if we should merge this region into the current region */ - if(lo_bounds[0][i].bound<ret_value[curr_reg].end) - ret_value[curr_reg].end=MAX(hi_bounds[0][i].bound,ret_value[curr_reg].end); - else { /* no overlap with previous region, add new region */ + /* + * Check if we should merge this region into the current + * region. + */ + if(lo_bounds[0][i].bound<ret_value[curr_reg].end) { + ret_value[curr_reg].end=MAX(hi_bounds[0][i].bound, + ret_value[curr_reg].end); + } else { + /* no overlap with previous region, add new region */ /* Check if this is actually a different region */ if(lo_bounds[0][i].bound!=ret_value[curr_reg].start && hi_bounds[0][i].bound!=ret_value[curr_reg].end) { /* Enlarge array */ - ret_value=H5MM_realloc(ret_value,sizeof(H5S_hyper_region_t)*(num_reg+1)); + ret_value=H5MM_realloc(ret_value, + (sizeof(H5S_hyper_region_t)* + (num_reg+1))); /* Initialize with new region */ ret_value[num_reg].start=lo_bounds[0][i].bound; ret_value[num_reg].end=hi_bounds[0][i].bound; - /* Increment the number of regions & the current region */ + /* + * Increment the number of regions & the current + * region. + */ num_reg++; curr_reg++; } /* end if */ @@ -224,9 +244,10 @@ printf("%s: check 1.1, bound_count=%d\n",FUNC,bound_count); } /* end else */ } /* end if */ } /* end for */ - } else { /* Generate list of regions based on the current position */ + } else { + /* Generate list of regions based on the current position */ #ifdef QAK -printf("%s: check 2.0, bound_count=%d\n",FUNC,bound_count); + printf("%s: check 2.0, bound_count=%d\n",FUNC,bound_count); #endif /* QAK */ next_dim=dim+1; /* Skip past bounds which don't overlap */ @@ -236,31 +257,32 @@ printf("%s: check 2.0, bound_count=%d\n",FUNC,bound_count); for(; pos[dim]>=lo_bounds[dim][i].bound && i<bound_count; i++) { #ifdef QAK -printf("%s: check 2.1, i=%d, num_reg=%d, pos[%d]=%d\n",FUNC,i,(int)num_reg,dim,(int)pos[dim]); - { - intn j; - node=lo_bounds[dim][i].node; - for(j=next_dim; j>=0; j--) - printf("%s: lo_bound[%d]=%d, hi_bound[%d]=%d\n", - FUNC,j,(int)node->start[j],j,(int)node->end[j]); - } + printf("%s: check 2.1, i=%d, num_reg=%d, pos[%d]=%d\n", + FUNC,i,(int)num_reg,dim,(int)pos[dim]); + { + intn j; + node=lo_bounds[dim][i].node; + for(j=next_dim; j>=0; j--) + printf("%s: lo_bound[%d]=%d, hi_bound[%d]=%d\n", + FUNC,j,(int)node->start[j],j,(int)node->end[j]); + } #endif /* QAK */ /* Check if each boundary overlaps in the higher dimensions */ node=lo_bounds[dim][i].node; temp_dim=dim; while(temp_dim>=0 && pos[temp_dim]>=node->start[temp_dim] && - pos[temp_dim]<=node->end[temp_dim]) + pos[temp_dim]<=node->end[temp_dim]) temp_dim--; /* Yes, all previous positions match, this is a valid region */ if(temp_dim<0) { #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ /* Check if we've allocated the array yet */ if(num_reg==0) { #ifdef QAK -printf("%s: check 3.1\n", FUNC); + printf("%s: check 3.1\n", FUNC); #endif /* QAK */ /* Allocate array */ ret_value=H5MM_malloc(sizeof(H5S_hyper_region_t)); @@ -269,19 +291,29 @@ printf("%s: check 3.1\n", FUNC); ret_value[0].start=MAX(node->start[next_dim],pos[next_dim]); ret_value[0].end=node->end[next_dim]; #ifdef QAK -printf("%s: check 3.2, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n",FUNC, - (int)node->start[next_dim],(int)ret_value[curr_reg].start,(int)node->end[next_dim],(int)ret_value[curr_reg].end); + printf("%s: check 3.2, lo_bounds=%d, start=%d, " + "hi_bounds=%d, end=%d\n", + FUNC, (int)node->start[next_dim], + (int)ret_value[curr_reg].start, + (int)node->end[next_dim], + (int)ret_value[curr_reg].end); #endif /* QAK */ /* Increment the number of regions */ num_reg++; } else { #ifdef QAK -printf("%s: check 4.0, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n",FUNC, - (int)node->start[next_dim],(int)ret_value[curr_reg].start,(int)node->end[next_dim],(int)ret_value[curr_reg].end); + printf("%s: check 4.0, lo_bounds=%d, start=%d, " + "hi_bounds=%d, end=%d\n", + FUNC, (int)node->start[next_dim], + (int)ret_value[curr_reg].start, + (int)node->end[next_dim], + (int)ret_value[curr_reg].end); #endif /* QAK */ /* Enlarge array */ - ret_value=H5MM_realloc(ret_value,sizeof(H5S_hyper_region_t)*(num_reg+1)); + ret_value=H5MM_realloc(ret_value, + (sizeof(H5S_hyper_region_t)* + (num_reg+1))); /* Initialize with new region */ ret_value[num_reg].start=node->start[next_dim]; @@ -296,7 +328,8 @@ printf("%s: check 4.0, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n",FUNC, /* Sort region list and eliminate duplicates if necessary */ if(num_reg>1) { - qsort(ret_value,num_reg,sizeof(H5S_hyper_region_t),H5S_hyper_compare_regions); + qsort(ret_value,num_reg,sizeof(H5S_hyper_region_t), + H5S_hyper_compare_regions); for(i=1,curr_reg=0,uniq_reg=1; i<num_reg; i++) { if(ret_value[curr_reg].start!=ret_value[i].start && ret_value[curr_reg].end!=ret_value[i].end) { @@ -314,9 +347,11 @@ printf("%s: check 4.0, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n",FUNC, *num_regions=num_reg; #ifdef QAK -printf("%s: check 10.0, ret_value=%p, num_reg=%d\n",FUNC,ret_value,num_reg); + printf("%s: check 10.0, ret_value=%p, num_reg=%d\n", + FUNC,ret_value,num_reg); for(i=0; i<num_reg; i++) - printf("%s: start[%d]=%d, end[%d]=%d\n",FUNC,i,(int)ret_value[i].start,i,(int)ret_value[i].end); + printf("%s: start[%d]=%d, end[%d]=%d\n", + FUNC,i,(int)ret_value[i].start,i,(int)ret_value[i].end); #endif /* QAK */ FUNC_LEAVE (ret_value); @@ -325,8 +360,8 @@ printf("%s: check 10.0, ret_value=%p, num_reg=%d\n",FUNC,ret_value,num_reg); /*------------------------------------------------------------------------- * Function: H5S_hyper_fread * - * Purpose: Recursively gathers data points from a file using the parameters - * passed to H5S_hyper_fgath. + * Purpose: Recursively gathers data points from a file using the + * parameters passed to H5S_hyper_fgath. * * Return: Success: Number of elements copied. * @@ -357,7 +392,7 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) assert(fhyper_info); #ifdef QAK -printf("%s: check 1.0, dim=%d\n",FUNC,dim); + printf("%s: check 1.0, dim=%d\n",FUNC,dim); #endif /* QAK */ /* Get a sorted list (in the next dimension down) of the regions which */ @@ -367,25 +402,32 @@ printf("%s: check 1.0, dim=%d\n",FUNC,dim); fhyper_info->lo_bounds, fhyper_info->hi_bounds, fhyper_info->iter->hyp.pos))!=NULL) { - /* Check if this is the second to last dimension in dataset */ - /* (Which means that we've got a list of the regions in the fastest */ - /* changing dimension and should input those regions) */ + /* + * Check if this is the second to last dimension in dataset (Which + * means that we've got a list of the regions in the fastest changing + * dimension and should input those regions). + */ #ifdef QAK -printf("%s: check 2.0, rank=%d\n",FUNC,(int)fhyper_info->space->extent.u.simple.rank); -for(i=0; i<num_regions; i++) - printf("%s: check 2.1, region #%d: start=%d, end=%d\n",FUNC,i,(int)regions[i].start,(int)regions[i].end); + printf("%s: check 2.0, rank=%d\n", + FUNC,(int)fhyper_info->space->extent.u.simple.rank); + for(i=0; i<num_regions; i++) + printf("%s: check 2.1, region #%d: start=%d, end=%d\n", + FUNC,i,(int)regions[i].start,(int)regions[i].end); #endif /* QAK */ if((dim+2)==fhyper_info->space->extent.u.simple.rank) { /* Set up hyperslab I/O parameters which apply to all regions */ /* Copy the location of the region in the file */ - HDmemcpy(file_offset,fhyper_info->iter->hyp.pos,fhyper_info->space->extent.u.simple.rank*sizeof(hssize_t)); + HDmemcpy(file_offset, fhyper_info->iter->hyp.pos, + (fhyper_info->space->extent.u.simple.rank * + sizeof(hssize_t))); file_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize,hsize,sizeof(hsize[0]),fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), + fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ @@ -394,9 +436,10 @@ for(i=0; i<num_regions; i++) /* perform I/O on data from regions */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { #ifdef QAK -printf("%s: check 2.2, i=%d\n",FUNC,(int)i); + printf("%s: check 2.2, i=%d\n",FUNC,(int)i); #endif /* QAK */ - region_size=MIN(fhyper_info->nelmts,(regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, + (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; file_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; @@ -404,19 +447,23 @@ printf("%s: check 2.2, i=%d\n",FUNC,(int)i); * Gather from file. */ if (H5F_arr_read (fhyper_info->f, fhyper_info->layout, - fhyper_info->comp, fhyper_info->efl, hsize, hsize, zero, - file_offset, fhyper_info->xfer_mode, - fhyper_info->dst/*out*/)<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "read error"); + fhyper_info->comp, fhyper_info->efl, + hsize, hsize, zero, file_offset, + fhyper_info->xfer_mode, + fhyper_info->dst/*out*/)<0) { + HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, + "read error"); } #ifdef QAK -printf("%s: check 2.3, region #%d\n",FUNC,(int)i); -for(j=0; j<fhyper_info->space->extent.u.simple.rank; j++) - printf("%s: %d - pos=%d\n",FUNC,j,(int)fhyper_info->iter->hyp.pos[j]); + printf("%s: check 2.3, region #%d\n",FUNC,(int)i); + for(j=0; j<fhyper_info->space->extent.u.simple.rank; j++) + printf("%s: %d - pos=%d\n", + FUNC,j,(int)fhyper_info->iter->hyp.pos[j]); #endif /* QAK */ /* Advance the pointer in the buffer */ - fhyper_info->dst=((uint8 *)fhyper_info->dst)+region_size*fhyper_info->elmt_size; + fhyper_info->dst = ((uint8 *)fhyper_info->dst) + + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_read+=region_size; @@ -428,14 +475,15 @@ for(j=0; j<fhyper_info->space->extent.u.simple.rank; j++) if(region_size==(hsize_t)((regions[i].end-regions[i].start)+1)) fhyper_info->iter->hyp.pos[dim+1]=(-1); else - fhyper_info->iter->hyp.pos[dim+1]=regions[i].start+region_size; + fhyper_info->iter->hyp.pos[dim+1] = regions[i].start + + region_size; /* Decrement the iterator count */ fhyper_info->iter->hyp.elmt_left-=region_size; } /* end for */ } else { /* recurse on each region to next dimension down */ #ifdef QAK -printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); + printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); #endif /* QAK */ /* Increment the dimension we are working with */ @@ -444,12 +492,17 @@ printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); /* Step through each region in this dimension */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { /* Step through each location in each region */ - for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { + for(j=regions[i].start; + j<=regions[i].end && fhyper_info->nelmts>0; + j++) { #ifdef QAK -printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); + printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); #endif /* QAK */ - /* If we are moving to a new position in this dim, reset the next lower dim. location */ + /* + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -494,10 +547,11 @@ printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); */ size_t H5S_hyper_fgath (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, void *_buf/*out*/) + const struct H5O_compress_t *comp, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, + size_t nelmts, const H5D_transfer_t xfer_mode, + void *_buf/*out*/) { H5S_hyper_bound_t **lo_bounds; /* Lower (closest to the origin) bound array for each dimension */ H5S_hyper_bound_t **hi_bounds; /* Upper (farthest from the origin) bound array for each dimension */ @@ -517,11 +571,13 @@ H5S_hyper_fgath (H5F_t *f, const struct H5O_layout_t *layout, assert (_buf); #ifdef QAK -printf("%s: check 1.0\n", FUNC); + printf("%s: check 1.0\n", FUNC); #endif /* QAK */ /* Allocate space for the low & high bound arrays */ - lo_bounds = H5MM_malloc(file_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - hi_bounds = H5MM_malloc(file_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); + lo_bounds = H5MM_malloc(file_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + hi_bounds = H5MM_malloc(file_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); /* Initialize to correct order to walk through arrays. (When another iteration order besides the default 'C' order is chosen, @@ -550,11 +606,11 @@ printf("%s: check 1.0\n", FUNC); /* Recursively input the hyperslabs currently defined */ /* starting with the slowest changing dimension */ #ifdef QAK -printf("%s: check 4.0\n",FUNC); + printf("%s: check 4.0\n",FUNC); #endif /* QAK */ num_read=H5S_hyper_fread(-1,&fhyper_info); #ifdef QAK -printf("%s: check 5.0, num_read=%d\n",FUNC,(int)num_read); + printf("%s: check 5.0, num_read=%d\n",FUNC,(int)num_read); #endif /* QAK */ /* Release the memory we allocated */ @@ -613,12 +669,15 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Set up hyperslab I/O parameters which apply to all regions */ /* Copy the location of the region in the file */ - HDmemcpy(file_offset,fhyper_info->iter->hyp.pos,fhyper_info->space->extent.u.simple.rank*sizeof(hssize_t)); + HDmemcpy(file_offset, fhyper_info->iter->hyp.pos, + (fhyper_info->space->extent.u.simple.rank * + sizeof(hssize_t))); file_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize,hsize,sizeof(hsize[0]),fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), + fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ @@ -626,7 +685,8 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* perform I/O on data from regions */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { - region_size=MIN(fhyper_info->nelmts,(regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, + (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; file_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; @@ -634,14 +694,16 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) * Scatter from file. */ if (H5F_arr_write (fhyper_info->f, fhyper_info->layout, - fhyper_info->comp, fhyper_info->efl, hsize, hsize, zero, - file_offset, fhyper_info->xfer_mode, - fhyper_info->src)<0) { + fhyper_info->comp, fhyper_info->efl, + hsize, hsize, zero, file_offset, + fhyper_info->xfer_mode, + fhyper_info->src)<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_WRITEERROR, 0, "write error"); } /* Advance the pointer in the buffer */ - fhyper_info->src=((const uint8 *)fhyper_info->src)+region_size*fhyper_info->elmt_size; + fhyper_info->src = ((const uint8 *)fhyper_info->src) + + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_written+=region_size; @@ -653,7 +715,8 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) if(region_size==(hsize_t)((regions[i].end-regions[i].start)+1)) fhyper_info->iter->hyp.pos[dim+1]=(-1); else - fhyper_info->iter->hyp.pos[dim+1]=regions[i].start+region_size; + fhyper_info->iter->hyp.pos[dim+1] = regions[i].start + + region_size; /* Decrement the iterator count */ fhyper_info->iter->hyp.elmt_left-=region_size; @@ -666,9 +729,14 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Step through each region in this dimension */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { /* Step through each location in each region */ - for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { - - /* If we are moving to a new position in this dim, reset the next lower dim. location */ + for(j=regions[i].start; + j<=regions[i].end && fhyper_info->nelmts>0; + j++) { + + /* + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -710,10 +778,11 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) */ herr_t H5S_hyper_fscat (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, const void *_buf) + const struct H5O_compress_t *comp, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, + size_t nelmts, const H5D_transfer_t xfer_mode, + const void *_buf) { H5S_hyper_bound_t **lo_bounds; /* Lower (closest to the origin) bound array for each dimension */ H5S_hyper_bound_t **hi_bounds; /* Upper (farthest from the origin) bound array for each dimension */ @@ -733,16 +802,19 @@ H5S_hyper_fscat (H5F_t *f, const struct H5O_layout_t *layout, assert (_buf); #ifdef QAK -printf("%s: check 1.0\n", FUNC); + printf("%s: check 1.0\n", FUNC); #endif /* QAK */ /* Allocate space for the low & high bound arrays */ - lo_bounds = H5MM_malloc(file_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - hi_bounds = H5MM_malloc(file_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - - /* Initialize to correct order to walk through arrays. - (When another iteration order besides the default 'C' order is chosen, - this is the correct place to change the order of the array iterations) - */ + lo_bounds = H5MM_malloc(file_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + hi_bounds = H5MM_malloc(file_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + + /* + * Initialize to correct order to walk through arrays. (When another + * iteration order besides the default 'C' order is chosen, this is the + * correct place to change the order of the array iterations) + */ for(i=0; i<file_space->extent.u.simple.rank; i++) { lo_bounds[i]=file_space->select.sel_info.hyper_lst->lo_bounds[i]; hi_bounds[i]=file_space->select.sel_info.hyper_lst->hi_bounds[i]; @@ -777,8 +849,8 @@ printf("%s: check 1.0\n", FUNC); /*------------------------------------------------------------------------- * Function: H5S_hyper_mread * - * Purpose: Recursively gathers data points from memory using the parameters - * passed to H5S_hyper_mgath. + * Purpose: Recursively gathers data points from memory using the + * parameters passed to H5S_hyper_mgath. * * Return: Success: Number of elements copied. * @@ -810,7 +882,7 @@ H5S_hyper_mread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) assert(fhyper_info); #ifdef QAK -printf("%s: check 1.0, dim=%d\n",FUNC,dim); + printf("%s: check 1.0, dim=%d\n",FUNC,dim); #endif /* QAK */ /* Get a sorted list (in the next dimension down) of the regions which */ @@ -824,9 +896,12 @@ printf("%s: check 1.0, dim=%d\n",FUNC,dim); /* (Which means that we've got a list of the regions in the fastest */ /* changing dimension and should input those regions) */ #ifdef QAK -printf("%s: check 2.0, rank=%d, num_regions=%d\n",FUNC,(int)fhyper_info->space->extent.u.simple.rank,(int)num_regions); -for(i=0; i<num_regions; i++) - printf("%s: check 2.1, region #%d: start=%d, end=%d\n",FUNC,i,(int)regions[i].start,(int)regions[i].end); + printf("%s: check 2.0, rank=%d, num_regions=%d\n", + FUNC, (int)fhyper_info->space->extent.u.simple.rank, + (int)num_regions); + for(i=0; i<num_regions; i++) + printf("%s: check 2.1, region #%d: start=%d, end=%d\n", + FUNC,i,(int)regions[i].start,(int)regions[i].end); #endif /* QAK */ if((dim+2)==fhyper_info->space->extent.u.simple.rank) { @@ -834,28 +909,35 @@ for(i=0; i<num_regions; i++) /* Set up hyperslab I/O parameters which apply to all regions */ /* Set up the size of the memory space */ - HDmemcpy(mem_size,fhyper_info->space->extent.u.simple.size,fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); + HDmemcpy(mem_size, fhyper_info->space->extent.u.simple.size, + fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); mem_size[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Copy the location of the region in the file */ - HDmemcpy(mem_offset,fhyper_info->iter->hyp.pos,fhyper_info->space->extent.u.simple.rank*sizeof(hssize_t)); + HDmemcpy(mem_offset, fhyper_info->iter->hyp.pos, + (fhyper_info->space->extent.u.simple.rank * + sizeof(hssize_t))); mem_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize,hsize,sizeof(hsize[0]),fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), + fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ - HDmemset (zero, 0, (fhyper_info->space->extent.u.simple.rank+1)*sizeof(*zero)); + HDmemset (zero, 0, ((fhyper_info->space->extent.u.simple.rank+1)* + sizeof(*zero))); /* perform I/O on data from regions */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { - region_size=MIN(fhyper_info->nelmts,(regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, + (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; mem_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; #ifdef QAK -printf("%s: check 2.1, i=%d, region_size=%d\n",FUNC,(int)i,(int)region_size); + printf("%s: check 2.1, i=%d, region_size=%d\n", + FUNC,(int)i,(int)region_size); #endif /* QAK */ /* @@ -864,11 +946,13 @@ printf("%s: check 2.1, i=%d, region_size=%d\n",FUNC,(int)i,(int)region_size); if (H5V_hyper_copy (fhyper_info->space->extent.u.simple.rank+1, hsize, hsize, zero, fhyper_info->dst, mem_size, mem_offset, fhyper_info->src)<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "unable to gather data from memory"); + HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, + "unable to gather data from memory"); } /* Advance the pointer in the buffer */ - fhyper_info->dst=((uint8 *)fhyper_info->dst)+region_size*fhyper_info->elmt_size; + fhyper_info->dst = ((uint8 *)fhyper_info->dst) + + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_read+=region_size; @@ -880,14 +964,15 @@ printf("%s: check 2.1, i=%d, region_size=%d\n",FUNC,(int)i,(int)region_size); if(region_size==(hsize_t)((regions[i].end-regions[i].start)+1)) fhyper_info->iter->hyp.pos[dim+1]=(-1); else - fhyper_info->iter->hyp.pos[dim+1]=regions[i].start+region_size; + fhyper_info->iter->hyp.pos[dim+1] =regions[i].start + + region_size; /* Decrement the iterator count */ fhyper_info->iter->hyp.elmt_left-=region_size; } /* end for */ } else { /* recurse on each region to next dimension down */ #ifdef QAK -printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); + printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); #endif /* QAK */ /* Increment the dimension we are working with */ @@ -896,12 +981,17 @@ printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions); /* Step through each region in this dimension */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { /* Step through each location in each region */ - for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { + for(j=regions[i].start; + j<=regions[i].end && fhyper_info->nelmts>0; + j++) { #ifdef QAK -printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); + printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); #endif /* QAK */ - /* If we are moving to a new position in this dim, reset the next lower dim. location */ + /* + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -943,8 +1033,8 @@ printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); */ size_t H5S_hyper_mgath (const void *_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_tconv_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_tconv_buf/*out*/) { H5S_hyper_bound_t **lo_bounds; /* Lower (closest to the origin) bound array for each dimension */ H5S_hyper_bound_t **hi_bounds; /* Upper (farthest from the origin) bound array for each dimension */ @@ -958,9 +1048,10 @@ H5S_hyper_mgath (const void *_buf, size_t elmt_size, FUNC_ENTER (H5S_hyper_mgath, 0); #ifdef QAK -printf("%s: check 1.0, elmt_size=%d, mem_space=%p\n",FUNC,(int)elmt_size,mem_space); -printf("%s: check 1.0, mem_iter=%p, nelmts=%d\n",FUNC,mem_iter,nelmts); -printf("%s: check 1.0, _buf=%p, _tconv_buf=%p\n",FUNC,_buf,_tconv_buf); + printf("%s: check 1.0, elmt_size=%d, mem_space=%p\n", + FUNC,(int)elmt_size,mem_space); + printf("%s: check 1.0, mem_iter=%p, nelmts=%d\n",FUNC,mem_iter,nelmts); + printf("%s: check 1.0, _buf=%p, _tconv_buf=%p\n",FUNC,_buf,_tconv_buf); #endif /* QAK */ /* Check args */ @@ -972,27 +1063,34 @@ printf("%s: check 1.0, _buf=%p, _tconv_buf=%p\n",FUNC,_buf,_tconv_buf); assert (_tconv_buf); #ifdef QAK -printf("%s: check 2.0, mem_space->extent.u.simple.rank=%d\n",FUNC, (int)mem_space->extent.u.simple.rank); + printf("%s: check 2.0, mem_space->extent.u.simple.rank=%d\n", + FUNC, (int)mem_space->extent.u.simple.rank); #endif /* QAK */ /* Allocate space for the low & high bound arrays */ - lo_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - hi_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - - /* Initialize to correct order to walk through arrays. - (When another iteration order besides the default 'C' order is chosen, - this is the correct place to change the order of the array iterations) - */ + lo_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + hi_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + + /* + * Initialize to correct order to walk through arrays. (When another + * iteration order besides the default 'C' order is chosen, this is the + * correct place to change the order of the array iterations) + */ #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ for(i=0; i<mem_space->extent.u.simple.rank; i++) { lo_bounds[i]=mem_space->select.sel_info.hyper_lst->lo_bounds[i]; hi_bounds[i]=mem_space->select.sel_info.hyper_lst->hi_bounds[i]; #ifdef QAK -printf("%s: check 3.1, lo[%d]=%p, hi[%d]=%p\n",FUNC,i,lo_bounds[i],i,hi_bounds[i]); + printf("%s: check 3.1, lo[%d]=%p, hi[%d]=%p\n", + FUNC,i,lo_bounds[i],i,hi_bounds[i]); for(j=0; j<(int)mem_space->select.sel_info.hyper_lst->count; j++) -printf("%s: check 3.2, lo[%d][%d]=%d, hi[%d][%d]=%d\n",FUNC,i,j,(int)lo_bounds[i][j].bound,i,j,(int)hi_bounds[i][j].bound); + printf("%s: check 3.2, lo[%d][%d]=%d, hi[%d][%d]=%d\n", + FUNC, i, j, (int)lo_bounds[i][j].bound, i, j, + (int)hi_bounds[i][j].bound); #endif /* QAK */ } /* end for */ @@ -1009,11 +1107,11 @@ printf("%s: check 3.2, lo[%d][%d]=%d, hi[%d][%d]=%d\n",FUNC,i,j,(int)lo_bounds[i /* Recursively input the hyperslabs currently defined */ /* starting with the slowest changing dimension */ #ifdef QAK -printf("%s: check 4.0\n",FUNC); + printf("%s: check 4.0\n",FUNC); #endif /* QAK */ num_read=H5S_hyper_mread(-1,&fhyper_info); #ifdef QAK -printf("%s: check 5.0, num_read=%d\n",FUNC,(int)num_read); + printf("%s: check 5.0, num_read=%d\n",FUNC,(int)num_read); #endif /* QAK */ /* Release the memory we allocated */ @@ -1058,7 +1156,7 @@ H5S_hyper_mwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) assert(fhyper_info); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* Get a sorted list (in the next dimension down) of the regions which */ @@ -1069,9 +1167,11 @@ printf("%s: check 1.0\n",FUNC); fhyper_info->iter->hyp.pos))!=NULL) { #ifdef QAK -printf("%s: check 2.0, rank=%d\n",FUNC,(int)fhyper_info->space->extent.u.simple.rank); -for(i=0; i<num_regions; i++) - printf("%s: check 2.1, region #%d: start=%d, end=%d\n",FUNC,i,(int)regions[i].start,(int)regions[i].end); + printf("%s: check 2.0, rank=%d\n", + FUNC,(int)fhyper_info->space->extent.u.simple.rank); + for(i=0; i<num_regions; i++) + printf("%s: check 2.1, region #%d: start=%d, end=%d\n", + FUNC,i,(int)regions[i].start,(int)regions[i].end); #endif /* QAK */ /* Check if this is the second to last dimension in dataset */ /* (Which means that we've got a list of the regions in the fastest */ @@ -1081,27 +1181,33 @@ for(i=0; i<num_regions; i++) /* Set up hyperslab I/O parameters which apply to all regions */ /* Set up the size of the memory space */ - HDmemcpy(mem_size,fhyper_info->space->extent.u.simple.size,fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); + HDmemcpy(mem_size, fhyper_info->space->extent.u.simple.size, + fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); mem_size[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Copy the location of the region in the file */ - HDmemcpy(mem_offset,fhyper_info->iter->hyp.pos,fhyper_info->space->extent.u.simple.rank*sizeof(hssize_t)); + HDmemcpy(mem_offset, fhyper_info->iter->hyp.pos, + (fhyper_info->space->extent.u.simple.rank* + sizeof(hssize_t))); mem_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize,hsize,sizeof(hsize[0]),fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), + fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ - HDmemset (zero, 0, (fhyper_info->space->extent.u.simple.rank+1)*sizeof(*zero)); + HDmemset (zero, 0, ((fhyper_info->space->extent.u.simple.rank+1)* + sizeof(*zero))); #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ /* perform I/O on data from regions */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { - region_size=MIN(fhyper_info->nelmts,(regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, + (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; mem_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; @@ -1109,13 +1215,16 @@ printf("%s: check 3.0\n",FUNC); * Gather from memory. */ if (H5V_hyper_copy (fhyper_info->space->extent.u.simple.rank+1, - hsize, mem_size, mem_offset, fhyper_info->dst, - hsize, zero, fhyper_info->src)<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "unable to gather data from memory"); + hsize, mem_size, mem_offset, + fhyper_info->dst, hsize, zero, + fhyper_info->src)<0) { + HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, + "unable to gather data from memory"); } /* Advance the pointer in the buffer */ - fhyper_info->src=((const uint8 *)fhyper_info->src)+region_size*fhyper_info->elmt_size; + fhyper_info->src = ((const uint8 *)fhyper_info->src) + + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_read+=region_size; @@ -1127,7 +1236,8 @@ printf("%s: check 3.0\n",FUNC); if(region_size==(hsize_t)((regions[i].end-regions[i].start)+1)) fhyper_info->iter->hyp.pos[dim+1]=(-1); else - fhyper_info->iter->hyp.pos[dim+1]=regions[i].start+region_size; + fhyper_info->iter->hyp.pos[dim+1] = regions[i].start + + region_size; /* Decrement the iterator count */ fhyper_info->iter->hyp.elmt_left-=region_size; @@ -1138,17 +1248,24 @@ printf("%s: check 3.0\n",FUNC); dim++; #ifdef QAK -printf("%s: check 6.0, num_regions=%d\n",FUNC,(int)num_regions); + printf("%s: check 6.0, num_regions=%d\n",FUNC,(int)num_regions); #endif /* QAK */ /* Step through each region in this dimension */ for(i=0; i<num_regions && fhyper_info->nelmts>0; i++) { /* Step through each location in each region */ #ifdef QAK -printf("%s: check 7.0, start[%d]=%d, end[%d]=%d, nelmts=%d\n",FUNC,i,(int)regions[i].start,i,(int)regions[i].end,(int)fhyper_info->nelmts); + printf("%s: check 7.0, start[%d]=%d, end[%d]=%d, nelmts=%d\n", + FUNC, i, (int)regions[i].start, i, + (int)regions[i].end, (int)fhyper_info->nelmts); #endif /* QAK */ - for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { - - /* If we are moving to a new position in this dim, reset the next lower dim. location */ + for(j=regions[i].start; + j<=regions[i].end && fhyper_info->nelmts>0; + j++) { + + /* + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -1189,8 +1306,8 @@ printf("%s: check 7.0, start[%d]=%d, end[%d]=%d, nelmts=%d\n",FUNC,i,(int)region */ herr_t H5S_hyper_mscat (const void *_tconv_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_buf/*out*/) { H5S_hyper_bound_t **lo_bounds; /* Lower (closest to the origin) bound array for each dimension */ H5S_hyper_bound_t **hi_bounds; /* Upper (farthest from the origin) bound array for each dimension */ @@ -1209,13 +1326,16 @@ H5S_hyper_mscat (const void *_tconv_buf, size_t elmt_size, assert (_tconv_buf); /* Allocate space for the low & high bound arrays */ - lo_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - hi_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * sizeof(H5S_hyper_bound_t *)); - - /* Initialize to correct order to walk through arrays. - (When another iteration order besides the default 'C' order is chosen, - this is the correct place to change the order of the array iterations) - */ + lo_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + hi_bounds = H5MM_malloc(mem_space->extent.u.simple.rank * + sizeof(H5S_hyper_bound_t *)); + + /* + * Initialize to correct order to walk through arrays. (When another + * iteration order besides the default 'C' order is chosen, this is the + * correct place to change the order of the array iterations) + */ for(i=0; i<mem_space->extent.u.simple.rank; i++) { lo_bounds[i]=mem_space->select.sel_info.hyper_lst->lo_bounds[i]; hi_bounds[i]=mem_space->select.sel_info.hyper_lst->hi_bounds[i]; @@ -1234,11 +1354,11 @@ H5S_hyper_mscat (const void *_tconv_buf, size_t elmt_size, /* Recursively input the hyperslabs currently defined */ /* starting with the slowest changing dimension */ #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ num_read=H5S_hyper_mwrite(-1,&fhyper_info); #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Release the memory we allocated */ @@ -1336,7 +1456,7 @@ H5S_hyper_add (H5S_t *space, const hssize_t *start, const hsize_t *size) intn i; /* Counters */ herr_t ret_value=FAIL; #ifdef QAK -extern int qak_debug; + extern int qak_debug; #endif /* QAK */ FUNC_ENTER (H5S_hyper_add, FAIL); @@ -1347,30 +1467,33 @@ extern int qak_debug; assert (size); #ifdef QAK -qak_debug=1; + qak_debug=1; #endif /* QAK */ #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* Create new hyperslab node to insert */ if((slab = H5MM_malloc(sizeof(H5S_hyper_node_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab node"); - if((slab->start = H5MM_malloc(sizeof(hsize_t)*space->extent.u.simple.rank))==NULL) + if((slab->start = H5MM_malloc(sizeof(hsize_t)* + space->extent.u.simple.rank))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab start boundary"); - if((slab->end = H5MM_malloc(sizeof(hsize_t)*space->extent.u.simple.rank))==NULL) + if((slab->end = H5MM_malloc(sizeof(hsize_t)* + space->extent.u.simple.rank))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab end boundary"); #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Set boundary on new node */ for(i=0,elem_count=1; i<space->extent.u.simple.rank; i++) { #ifdef QAK -printf("%s: check 2.1, %d: start=%d, size=%d, elem_count=%d\n",FUNC,(int)i,(int)start[i],(int)size[i],(int)elem_count); + printf("%s: check 2.1, %d: start=%d, size=%d, elem_count=%d\n", + FUNC,(int)i,(int)start[i],(int)size[i],(int)elem_count); #endif /* QAK */ slab->start[i]=start[i]; slab->end[i]=start[i]+size[i]-1; @@ -1378,13 +1501,14 @@ printf("%s: check 2.1, %d: start=%d, size=%d, elem_count=%d\n",FUNC,(int)i,(int) } /* end for */ #ifdef QAK -printf("%s: check 3.0, lo_bounds=%p, hi_bounds=%p\n",FUNC, - space->select.sel_info.hyper_lst->lo_bounds, space->select.sel_info.hyper_lst->hi_bounds); + printf("%s: check 3.0, lo_bounds=%p, hi_bounds=%p\n", + FUNC, space->select.sel_info.hyper_lst->lo_bounds, + space->select.sel_info.hyper_lst->hi_bounds); #endif /* QAK */ /* Increase size of boundary arrays for dataspace's selection */ for(i=0; i<space->extent.u.simple.rank; i++) { #ifdef QAK -printf("%s: check 3.1, i=%d\n",FUNC,(int)i); + printf("%s: check 3.1, i=%d\n",FUNC,(int)i); #endif /* QAK */ tmp=space->select.sel_info.hyper_lst->lo_bounds[i]; if((space->select.sel_info.hyper_lst->lo_bounds[i]=H5MM_realloc(tmp,sizeof(H5S_hyper_bound_t)*(space->select.sel_info.hyper_lst->count+1)))==NULL) { @@ -1393,7 +1517,7 @@ printf("%s: check 3.1, i=%d\n",FUNC,(int)i); "can't allocate hyperslab lo boundary array"); } /* end if */ #ifdef QAK -printf("%s: check 3.2, i=%d\n",FUNC,(int)i); + printf("%s: check 3.2, i=%d\n",FUNC,(int)i); #endif /* QAK */ tmp=space->select.sel_info.hyper_lst->hi_bounds[i]; if((space->select.sel_info.hyper_lst->hi_bounds[i]=H5MM_realloc(tmp,sizeof(H5S_hyper_bound_t)*(space->select.sel_info.hyper_lst->count+1)))==NULL) { @@ -1404,13 +1528,14 @@ printf("%s: check 3.2, i=%d\n",FUNC,(int)i); } /* end for */ #ifdef QAK -printf("%s: check 4.0\n",FUNC); + printf("%s: check 4.0\n",FUNC); { intn j; for(i=0; i<space->extent.u.simple.rank; i++) { for(j=0; j<(int)space->select.sel_info.hyper_lst->count; j++) { -printf("%s: lo_bound[%d][%d]=%d(%p), hi_bound[%d][%d]=%d(%p)\n",FUNC, + printf("%s: lo_bound[%d][%d]=%d(%p), " + "hi_bound[%d][%d]=%d(%p)\n",FUNC, i,j,(int)space->select.sel_info.hyper_lst->lo_bounds[i][j].bound, space->select.sel_info.hyper_lst->lo_bounds[i][j].node, i,j,(int)space->select.sel_info.hyper_lst->hi_bounds[i][j].bound, @@ -1424,8 +1549,10 @@ printf("%s: lo_bound[%d][%d]=%d(%p), hi_bound[%d][%d]=%d(%p)\n",FUNC, /* Check if this is the first hyperslab inserted */ if(space->select.sel_info.hyper_lst->count==0) { #ifdef QAK -printf("%s: check 4.1, start[%d]=%d, end[%d]=%d\n",FUNC,i,(int)slab->start[i],i,(int)slab->end[i]); -printf("%s: check 4.1, hyper_lst->count=%d\n",FUNC,(int)space->select.sel_info.hyper_lst->count); + printf("%s: check 4.1, start[%d]=%d, end[%d]=%d\n", + FUNC, i, (int)slab->start[i],i,(int)slab->end[i]); + printf("%s: check 4.1, hyper_lst->count=%d\n", + FUNC,(int)space->select.sel_info.hyper_lst->count); #endif /* QAK */ space->select.sel_info.hyper_lst->lo_bounds[i][0].bound=slab->start[i]; space->select.sel_info.hyper_lst->lo_bounds[i][0].node=slab; @@ -1434,8 +1561,10 @@ printf("%s: check 4.1, hyper_lst->count=%d\n",FUNC,(int)space->select.sel_info.h } /* end if */ else { #ifdef QAK -printf("%s: check 4.3, start[%d]=%d, end[%d]=%d\n",FUNC,i,(int)slab->start[i],i,(int)slab->end[i]); -printf("%s: check 4.3, hyper_lst->count=%d\n",FUNC,(int)space->select.sel_info.hyper_lst->count); + printf("%s: check 4.3, start[%d]=%d, end[%d]=%d\n", + FUNC,i,(int)slab->start[i],i,(int)slab->end[i]); + printf("%s: check 4.3, hyper_lst->count=%d\n", + FUNC,(int)space->select.sel_info.hyper_lst->count); #endif /* QAK */ /* Take care of the low boundary first */ /* Find the location to insert in front of */ @@ -1445,7 +1574,7 @@ printf("%s: check 4.3, hyper_lst->count=%d\n",FUNC,(int)space->select.sel_info.h "can't find location to insert hyperslab boundary"); #ifdef QAK -printf("%s: check 4.5, bound_loc=%d\n",FUNC,(int)bound_loc); + printf("%s: check 4.5, bound_loc=%d\n",FUNC,(int)bound_loc); #endif /* QAK */ /* Check if we need to move boundary elements */ if(bound_loc!=(intn)space->select.sel_info.hyper_lst->count) { @@ -1474,7 +1603,7 @@ printf("%s: check 4.5, bound_loc=%d\n",FUNC,(int)bound_loc); } /* end else */ } /* end for */ #ifdef QAK -printf("%s: check 5.0\n",FUNC); + printf("%s: check 5.0\n",FUNC); #endif /* QAK */ /* Increment the number of bounds in the array */ @@ -1487,13 +1616,14 @@ printf("%s: check 5.0\n",FUNC); /* Increment the number of elements in the hyperslab selection */ space->select.num_elem+=elem_count; #ifdef QAK -printf("%s: check 6.0\n",FUNC); + printf("%s: check 6.0\n",FUNC); { intn j; for(i=0; i<space->extent.u.simple.rank; i++) { for(j=0; j<(int)space->select.sel_info.hyper_lst->count; j++) { -printf("%s: lo_bound[%d][%d]=%d, hi_bound[%d][%d]=%d\n",FUNC,i,j, + printf("%s: lo_bound[%d][%d]=%d, hi_bound[%d][%d]=%d\n", + FUNC,i,j, (int)space->select.sel_info.hyper_lst->lo_bounds[i][j].bound,i,j, (int)space->select.sel_info.hyper_lst->hi_bounds[i][j].bound); } @@ -1533,7 +1663,7 @@ H5S_hyper_release (H5S_t *space) /* Check args */ assert (space && H5S_SEL_HYPERSLABS==space->select.type); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* Reset the number of points selected */ @@ -1562,7 +1692,7 @@ printf("%s: check 1.0\n",FUNC); space->select.sel_info.hyper_lst=NULL; #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ FUNC_LEAVE (SUCCEED); @@ -1594,7 +1724,7 @@ H5S_point_npoints (const H5S_t *space) assert (space); #ifdef QAK -printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)space->select.num_elem); + printf("%s: check 1.0, nelmts=%d\n",FUNC,(int)space->select.num_elem); #endif /* QAK */ FUNC_LEAVE (space->select.num_elem); } /* H5S_point_npoints() */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 925f7b4..a291d8a 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -34,7 +34,7 @@ static intn interface_initialize_g = FALSE; */ herr_t H5S_point_init (const struct H5O_layout_t __unused__ *layout, - const H5S_t *space, H5S_sel_iter_t *sel_iter) + const H5S_t *space, H5S_sel_iter_t *sel_iter) { FUNC_ENTER (H5S_point_init, FAIL); @@ -44,7 +44,7 @@ H5S_point_init (const struct H5O_layout_t __unused__ *layout, assert (sel_iter); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* Initialize the number of points to iterate over */ sel_iter->pnt.elmt_left=space->select.num_elem; @@ -88,7 +88,7 @@ herr_t H5S_point_add (H5S_t *space, size_t num_elem, const hssize_t **_coord) assert(coord); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ top=curr=NULL; for(i=0; i<num_elem; i++) { @@ -98,27 +98,30 @@ printf("%s: check 1.0\n",FUNC); "can't allocate point node"); #ifdef QAK -printf("%s: check 1.1, rank=%d\n",FUNC,(int)space->extent.u.simple.rank); + printf("%s: check 1.1, rank=%d\n", + FUNC,(int)space->extent.u.simple.rank); #endif /* QAK */ if((new->pnt = H5MM_malloc(space->extent.u.simple.rank*sizeof(hssize_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate coordinate information"); #ifdef QAK -printf("%s: check 1.2\n",FUNC); + printf("%s: check 1.2\n",FUNC); #endif /* QAK */ /* Copy over the coordinates */ HDmemcpy(new->pnt,coord+(i*space->extent.u.simple.rank),(space->extent.u.simple.rank*sizeof(hssize_t))); #ifdef QAK -printf("%s: check 1.3\n",FUNC); - { - intn j; - - for(j=0; j<space->extent.u.simple.rank; j++) { - printf("%s: pnt[%d]=%d\n",FUNC,(int)j,(int)new->pnt[j]); - printf("%s: coord[%d][%d]=%d\n",FUNC,(int)i,(int)j,(int)*(coord+(i*space->extent.u.simple.rank)+j)); - } - } + printf("%s: check 1.3\n",FUNC); + { + intn j; + + for(j=0; j<space->extent.u.simple.rank; j++) { + printf("%s: pnt[%d]=%d\n",FUNC,(int)j,(int)new->pnt[j]); + printf("%s: coord[%d][%d]=%d\n", + FUNC, (int)i, (int)j, + (int)*(coord+(i*space->extent.u.simple.rank)+j)); + } + } #endif /* QAK */ /* Link into list */ @@ -130,7 +133,7 @@ printf("%s: check 1.3\n",FUNC); curr=new; } /* end for */ #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Append current list, if there is one */ @@ -145,7 +148,7 @@ printf("%s: check 2.0\n",FUNC); ret_value=SUCCEED; #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ done: @@ -176,7 +179,8 @@ H5S_point_favail (const H5S_t __unused__ *space, const H5S_sel_iter_t *sel_iter, assert (sel_iter); #ifdef QAK -printf("%s: check 1.0, ret=%d\n",FUNC,(int)MIN(sel_iter->pnt.elmt_left,max)); + printf("%s: check 1.0, ret=%d\n", + FUNC,(int)MIN(sel_iter->pnt.elmt_left,max)); #endif /* QAK */ FUNC_LEAVE (MIN(sel_iter->pnt.elmt_left,max)); } /* H5S_point_favail() */ @@ -191,7 +195,8 @@ printf("%s: check 1.0, ret=%d\n",FUNC,(int)MIN(sel_iter->pnt.elmt_left,max)); * bytes of a datum which this function treats as opaque. * FILE_SPACE describes the data space of the dataset on disk * and the elements that have been selected for reading (via - * hyperslab, etc). This function will copy at most NELMTS elements. + * hyperslab, etc). This function will copy at most NELMTS + * elements. * * Notes: This could be optimized by gathering selected elements near (how * near?) each other into one I/O request and then moving the correct @@ -210,10 +215,11 @@ printf("%s: check 1.0, ret=%d\n",FUNC,(int)MIN(sel_iter->pnt.elmt_left,max)); */ size_t H5S_point_fgath (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, void *_buf/*out*/) + const struct H5O_compress_t *comp, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, + size_t nelmts, const H5D_transfer_t xfer_mode, + void *_buf/*out*/) { hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of slab in file*/ hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ @@ -235,7 +241,7 @@ H5S_point_fgath (H5F_t *f, const struct H5O_layout_t *layout, assert (buf); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ ndims=file_space->extent.u.simple.rank; /* initialize hyperslab size and offset in memory buffer */ @@ -245,29 +251,35 @@ printf("%s: check 1.0\n",FUNC); } /* end for */ hsize[ndims] = elmt_size; - /* Walk though and request each element we need and put it into the buffer */ + /* + * Walk though and request each element we need and put it into the + * buffer. + */ num_read=0; while(num_read<nelmts) { if(file_iter->pnt.elmt_left>0) { /* Copy the location of the point to get */ - HDmemcpy(file_offset,file_iter->pnt.curr->pnt,ndims*sizeof(hssize_t)); + HDmemcpy(file_offset, file_iter->pnt.curr->pnt, + ndims*sizeof(hssize_t)); file_offset[ndims] = 0; /* Go read the point */ - if (H5F_arr_read (f, layout, comp, efl, hsize, hsize, zero, file_offset, - xfer_mode, buf/*out*/)<0) { + if (H5F_arr_read (f, layout, comp, efl, hsize, hsize, zero, + file_offset, xfer_mode, buf/*out*/)<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "read error"); } #ifdef QAK -printf("%s: check 3.0\n",FUNC); - { - for(i=0; i<ndims; i++) { - printf("%s: %d - pnt=%d\n",FUNC,(int)i,(int)file_iter->pnt.curr->pnt[i]); - printf("%s: %d - file_offset=%d\n",FUNC,(int)i,(int)file_offset[i]); - } -printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); - } + printf("%s: check 3.0\n",FUNC); + { + for(i=0; i<ndims; i++) { + printf("%s: %d - pnt=%d\n", + FUNC, (int)i, (int)file_iter->pnt.curr->pnt[i]); + printf("%s: %d - file_offset=%d\n", + FUNC, (int)i, (int)file_offset[i]); + } + printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); + } #endif /* QAK */ /* Increment the offset of the buffer */ buf+=elmt_size; @@ -308,10 +320,11 @@ printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); */ herr_t H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout, - const struct H5O_compress_t *comp, const struct H5O_efl_t *efl, - size_t elmt_size, const H5S_t *file_space, H5S_sel_iter_t *file_iter, - size_t nelmts, - const H5D_transfer_t xfer_mode, const void *_buf) + const struct H5O_compress_t *comp, + const struct H5O_efl_t *efl, size_t elmt_size, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, + size_t nelmts, const H5D_transfer_t xfer_mode, + const void *_buf) { hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of hyperslab */ hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ @@ -333,7 +346,7 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout, assert (buf); #ifdef QAK -printf("%s: check 1.0, layout->ndims=%d\n",FUNC,(int)layout->ndims); + printf("%s: check 1.0, layout->ndims=%d\n",FUNC,(int)layout->ndims); #endif /* QAK */ ndims=file_space->extent.u.simple.rank; /* initialize hyperslab size and offset in memory buffer */ @@ -343,34 +356,40 @@ printf("%s: check 1.0, layout->ndims=%d\n",FUNC,(int)layout->ndims); } /* end for */ hsize[ndims] = elmt_size; - /* Walk though and request each element we need and put it into the buffer */ + /* + * Walk though and request each element we need and put it into the + * buffer. + */ num_written=0; while(num_written<nelmts && file_iter->pnt.elmt_left>0) { #ifdef QAK -printf("%s: check 2.0\n",FUNC); - { - for(i=0; i<ndims; i++) { - printf("%s: %d - pnt=%d\n",FUNC,(int)i,(int)file_iter->pnt.curr->pnt[i]); - } - } + printf("%s: check 2.0\n",FUNC); + { + for(i=0; i<ndims; i++) { + printf("%s: %d - pnt=%d\n", + FUNC, (int)i, (int)file_iter->pnt.curr->pnt[i]); + } + } #endif /* QAK */ /* Copy the location of the point to get */ HDmemcpy(file_offset,file_iter->pnt.curr->pnt,ndims*sizeof(hssize_t)); file_offset[ndims] = 0; #ifdef QAK -printf("%s: check 3.0\n",FUNC); - { - for(i=0; i<ndims; i++) { - printf("%s: %d - pnt=%d\n",FUNC,(int)i,(int)file_iter->pnt.curr->pnt[i]); - printf("%s: %d - file_offset=%d\n",FUNC,(int)i,(int)file_offset[i]); - } -printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); - } + printf("%s: check 3.0\n",FUNC); + { + for(i=0; i<ndims; i++) { + printf("%s: %d - pnt=%d\n", + FUNC,(int)i,(int)file_iter->pnt.curr->pnt[i]); + printf("%s: %d - file_offset=%d\n", + FUNC,(int)i,(int)file_offset[i]); + } + printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); + } #endif /* QAK */ /* Go write the point */ - if (H5F_arr_write (f, layout, comp, efl, hsize, hsize, zero, file_offset, - xfer_mode, buf)<0) { + if (H5F_arr_write (f, layout, comp, efl, hsize, hsize, zero, + file_offset, xfer_mode, buf)<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_WRITEERROR, 0, "write error"); } @@ -384,7 +403,8 @@ printf("%s: *buf=%u\n",FUNC,(unsigned)*buf); file_iter->pnt.elmt_left--; file_iter->pnt.curr=file_iter->pnt.curr->next; #ifdef QAK -printf("%s: check 5.0, file_iter->pnt.curr=%p\n",FUNC,file_iter->pnt.curr); + printf("%s: check 5.0, file_iter->pnt.curr=%p\n", + FUNC,file_iter->pnt.curr); #endif } /* end while */ @@ -413,8 +433,8 @@ printf("%s: check 5.0, file_iter->pnt.curr=%p\n",FUNC,file_iter->pnt.curr); */ size_t H5S_point_mgath (const void *_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_tconv_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_tconv_buf/*out*/) { hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ const uint8 *buf=(const uint8 *)_buf; /* Get local copies for address arithmetic */ @@ -435,7 +455,7 @@ H5S_point_mgath (const void *_buf, size_t elmt_size, assert (tconv_buf); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ if ((space_ndims=H5S_extent_dims (mem_space, mem_size, NULL))<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0, @@ -451,7 +471,7 @@ printf("%s: check 1.0\n",FUNC); } /* end for */ #ifdef QAK -printf("%s: check 2.0, acc=%d, off=%d\n",FUNC,(int)acc,(int)off); + printf("%s: check 2.0, acc=%d, off=%d\n",FUNC,(int)acc,(int)off); #endif /* QAK */ /* Copy the elements into the type conversion buffer */ HDmemcpy(tconv_buf,buf+off,elmt_size); @@ -491,8 +511,8 @@ printf("%s: check 2.0, acc=%d, off=%d\n",FUNC,(int)acc,(int)off); */ herr_t H5S_point_mscat (const void *_tconv_buf, size_t elmt_size, - const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, - size_t nelmts, void *_buf/*out*/) + const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, + size_t nelmts, void *_buf/*out*/) { hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ uint8 *buf=(uint8 *)_buf; /* Get local copies for address arithmetic */ @@ -513,7 +533,7 @@ H5S_point_mscat (const void *_tconv_buf, size_t elmt_size, assert (buf); #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* * Retrieve hyperslab information to determine what elements are being diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 68a5fd1..6a842de 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -44,8 +44,9 @@ extern "C" { /* Functions in H5S.c */ hid_t H5Screate(H5S_class_t type); -hid_t H5Screate_simple (int rank, const hsize_t dims[], const hsize_t maxdims[]); -herr_t H5Sset_extent_simple (hid_t sid, int rank, const hsize_t dims[], +hid_t H5Screate_simple (int rank, const hsize_t dims[], + const hsize_t maxdims[]); +herr_t H5Sset_extent_simple (hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]); hid_t H5Scopy (hid_t space_id); herr_t H5Sclose (hid_t space_id); @@ -55,11 +56,11 @@ int H5Sextent_dims (hid_t space_id, hsize_t dims[], hsize_t maxdims[]); hbool_t H5Sis_simple (hid_t space_id); herr_t H5Sset_space (hid_t space_id, int rank, const hsize_t *dims); hsize_t H5Sselect_npoints (hid_t spaceid); -herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, - const hssize_t *start, const hsize_t *_stride, const hsize_t *count, - const hsize_t *_block); -herr_t H5Sselect_elements (hid_t spaceid, H5S_seloper_t op, size_t num_elemn, - const hssize_t **coord); +herr_t H5Sselect_hyperslab (hid_t space_id, H5S_seloper_t op, + const hssize_t start[], const hsize_t _stride[], + const hsize_t count[], const hsize_t _block[]); +herr_t H5Sselect_elements (hid_t space_id, H5S_seloper_t op, size_t num_elemn, + const hssize_t **coord); #ifdef __cplusplus } diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 658529e..af3dbcd 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -19,8 +19,8 @@ #define PABLO_MASK H5S_select_mask #define INTERFACE_INIT H5S_select_init static intn interface_initialize_g = FALSE; -static herr_t H5S_select_init(void); -static void H5S_select_term(void); +static herr_t H5S_select_init(void); +static void H5S_select_term(void); /*-------------------------------------------------------------------------- @@ -180,9 +180,11 @@ H5S_select_release (H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, - const hssize_t *start, const hsize_t *_stride, const hsize_t *count, - const hsize_t *_block) +H5Sselect_hyperslab (hid_t space_id, H5S_seloper_t op, + const hssize_t start[/*space_id*/], + const hsize_t _stride[/*space_id*/], + const hsize_t count[/*space_id*/], + const hsize_t _block[/*space_id*/]) { H5S_t *space = NULL; /* Dataspace to modify selection of */ hsize_t *stride, /* Stride array */ @@ -195,11 +197,12 @@ H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, herr_t ret_value=FAIL; /* return value */ FUNC_ENTER (H5Sselect_hyperslab, FAIL); - H5TRACE6("e","iSs*Hs*h*h*h",spaceid,op,start,_stride,count,_block); + H5TRACE6("e","iSs*[a0]Hs*[a0]h*[a0]h*[a0]h",space_id,op,start,_stride, + count,_block); /* Check args */ - if (H5_DATASPACE != H5I_group(spaceid) || - NULL == (space=H5I_object(spaceid))) { + if (H5_DATASPACE != H5I_group(space_id) || + NULL == (space=H5I_object(space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } if(start==NULL || count==NULL) { @@ -234,18 +237,22 @@ H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, block=(hsize_t *)_block; } /* end else */ -/* Check for overlapping blocks (remove when real block-merging algorithm is in place) */ -if(op==H5S_SELECT_SET && _block!=NULL) { - for(i=0; i<space->extent.u.simple.rank; i++) { - if(stride[i]<block[i]) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hyperslab blocks overlap"); - } /* end if */ - } /* end for */ -} /* end if */ + /* + * Check for overlapping blocks (remove when real block-merging algorithm + * is in place). + */ + if(op==H5S_SELECT_SET && _block!=NULL) { + for(i=0; i<space->extent.u.simple.rank; i++) { + if(stride[i]<block[i]) { + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, + "hyperslab blocks overlap"); + } /* end if */ + } /* end for */ + } /* end if */ /* Determine if selection is contiguous */ - contig=1; /* assume hyperslab is contiguous, until proven otherwise */ + /* assume hyperslab is contiguous, until proven otherwise */ + contig=1; for(i=0; i<space->extent.u.simple.rank; i++) { /* contiguous hyperslabs have the block size equal to the stride */ if(stride[i]!=block[i]) { @@ -255,7 +262,7 @@ if(op==H5S_SELECT_SET && _block!=NULL) { } /* end for */ #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* If we are setting a new selection, remove current selection first */ if(op==H5S_SELECT_SET) { @@ -266,25 +273,31 @@ printf("%s: check 1.0\n",FUNC); } /* end if */ #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Allocate space for the hyperslab selection information if necessary */ - if(space->select.type!=H5S_SEL_HYPERSLABS || space->select.sel_info.hyper_lst==NULL) { - if((space->select.sel_info.hyper_lst = H5MM_calloc(sizeof(H5S_hyper_list_t)))==NULL) + if(space->select.type!=H5S_SEL_HYPERSLABS || + space->select.sel_info.hyper_lst==NULL) { + if((space->select.sel_info.hyper_lst = + H5MM_calloc(sizeof(H5S_hyper_list_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "can't allocate hyperslab information"); - if((space->select.sel_info.hyper_lst->lo_bounds = H5MM_calloc(space->extent.u.simple.rank*sizeof(H5S_hyper_bound_t *)))==NULL) + "can't allocate hyperslab information"); + if((space->select.sel_info.hyper_lst->lo_bounds = + H5MM_calloc(space->extent.u.simple.rank* + sizeof(H5S_hyper_bound_t *)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "can't allocate hyperslab lo bound information"); - if((space->select.sel_info.hyper_lst->hi_bounds = H5MM_calloc(space->extent.u.simple.rank*sizeof(H5S_hyper_bound_t *)))==NULL) + "can't allocate hyperslab lo bound information"); + if((space->select.sel_info.hyper_lst->hi_bounds = + H5MM_calloc(space->extent.u.simple.rank* + sizeof(H5S_hyper_bound_t *)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "can't allocate hyperslab lo bound information"); + "can't allocate hyperslab lo bound information"); } /* end if */ -/* Generate list of blocks to add/remove based on selection operation */ + /* Generate list of blocks to add/remove based on selection operation */ #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ /* Add hyperslab to selection */ if(contig) { /* Check for trivial case */ @@ -314,9 +327,10 @@ printf("%s: check 3.0\n",FUNC); slab[j]=start[j]+((i/slice[j])%count[j])*stride[j]; /* Add the block to the list of hyperslab selections */ - if(H5S_hyper_add(space,(const hssize_t *)slab,(const hsize_t *)block)<0) { + if(H5S_hyper_add(space,(const hssize_t *)slab, + (const hsize_t *)block)<0) { HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, - "can't insert hyperslab"); + "can't insert hyperslab"); } /* end if */ } /* end for */ } /* end if */ @@ -325,7 +339,7 @@ printf("%s: check 3.0\n",FUNC); space->select.type=H5S_SEL_HYPERSLABS; ret_value=SUCCEED; #ifdef QAK -printf("%s: check 4.0\n",FUNC); + printf("%s: check 4.0\n",FUNC); #endif /* QAK */ done: @@ -389,7 +403,7 @@ herr_t H5Sselect_elements (hid_t spaceid, H5S_seloper_t op, size_t num_elem, } /* end if */ #ifdef QAK -printf("%s: check 1.0\n",FUNC); + printf("%s: check 1.0\n",FUNC); #endif /* QAK */ /* If we are setting a new selection, remove current selection first */ if(op==H5S_SELECT_SET) { @@ -400,7 +414,7 @@ printf("%s: check 1.0\n",FUNC); } /* end if */ #ifdef QAK -printf("%s: check 2.0\n",FUNC); + printf("%s: check 2.0\n",FUNC); #endif /* QAK */ /* Allocate space for the point selection information if necessary */ if(space->select.type!=H5S_SEL_POINTS || space->select.sel_info.pnt_lst==NULL) { @@ -410,7 +424,7 @@ printf("%s: check 2.0\n",FUNC); } /* end if */ #ifdef QAK -printf("%s: check 3.0\n",FUNC); + printf("%s: check 3.0\n",FUNC); #endif /* QAK */ /* Add points to selection */ if(H5S_point_add(space,num_elem,coord)<0) { @@ -422,7 +436,7 @@ printf("%s: check 3.0\n",FUNC); space->select.type=H5S_SEL_POINTS; ret_value=SUCCEED; #ifdef QAK -printf("%s: check 4.0\n",FUNC); + printf("%s: check 4.0\n",FUNC); #endif /* QAK */ done: diff --git a/src/H5Ssimp.c b/src/H5Ssimp.c index 6c4d63c..e4a7c05 100644 --- a/src/H5Ssimp.c +++ b/src/H5Ssimp.c @@ -537,11 +537,13 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, */ switch(file_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<file_space->extent.u.simple.rank; i++) @@ -551,11 +553,13 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, switch(mem_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<mem_space->extent.u.simple.rank; i++) @@ -565,7 +569,8 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, switch(file_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ @@ -573,7 +578,8 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, for (i=0; i<file_space->u.simple.rank; i++) file_offset[i] = file_space->h.start[i]; #endif - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<file_space->extent.u.simple.rank; i++) @@ -583,7 +589,8 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, switch(mem_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ @@ -591,7 +598,8 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, for (i=0; i<mem_space->u.simple.rank; i++) mem_offset[i] = mem_space->h.start[i]; #endif - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<mem_space->extent.u.simple.rank; i++) @@ -681,11 +689,13 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, */ switch(file_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<file_space->extent.u.simple.rank; i++) @@ -695,11 +705,13 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, switch(mem_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<mem_space->extent.u.simple.rank; i++) @@ -709,7 +721,8 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, switch(file_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ @@ -717,7 +730,8 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, for (i=0; i<file_space->u.simple.rank; i++) file_offset[i] = file_space->h.start[i]; #endif - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<file_space->extent.u.simple.rank; i++) @@ -727,7 +741,8 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, switch(mem_space->select.type) { case H5S_SEL_NONE: /* no selection defined */ - HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, "selection not defined"); + HRETURN_ERROR (H5E_DATASPACE, H5E_BADVALUE, FAIL, + "selection not defined"); case H5S_SEL_POINTS: /* point sequence selection defined */ case H5S_SEL_HYPERSLABS: /* hyperslab selection defined */ @@ -735,7 +750,8 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, for (i=0; i<mem_space->u.simple.rank; i++) mem_offset[i] = mem_space->h.start[i]; #endif - HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "selection type not supprted currently"); + HRETURN_ERROR (H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, + "selection type not supprted currently"); case H5S_SEL_ALL: /* entire dataspace selection */ for (i=0; i<mem_space->extent.u.simple.rank; i++) @@ -282,8 +282,8 @@ done: PURPOSE Get the pointer to a temp. buffer memory USAGE - void *H5TBbuf_ptr(tbid) - hid_t tbid; IN: Temp. buffer ID + void *H5TBbuf_ptr(tbuf_id) + hid_t tbuf_id; IN: Temp. buffer ID RETURNS Non-NULL pointer to buffer memory on success, NULL on failure DESCRIPTION @@ -294,15 +294,15 @@ done: REVISION LOG --------------------------------------------------------------------------*/ void * -H5TBbuf_ptr(hid_t tbid) +H5TBbuf_ptr(hid_t tbuf_id) { void *ret_value = NULL; H5TB_t *tbuf; /* Pointer to temporary buffer */ FUNC_ENTER (H5TBbuf_ptr, NULL); - if (H5_TEMPBUF != H5I_group(tbid) || - NULL == (tbuf = H5I_object(tbid))) { + if (H5_TEMPBUF != H5I_group(tbuf_id) || + NULL == (tbuf = H5I_object(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a temp. buffer"); } @@ -335,7 +335,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5TBresize_ptr (hid_t tbid, hsize_t size) +H5TBresize_ptr (hid_t tbuf_id, hsize_t size) { herr_t ret_value = FAIL; H5TB_t *tbuf, /* Pointer to temporary buffer */ @@ -343,10 +343,10 @@ H5TBresize_ptr (hid_t tbid, hsize_t size) void * old_ptr; /* Pointer to the previous buffer */ FUNC_ENTER (H5TBresize_ptr, FAIL); - H5TRACE2("e","ih",tbid,size); + H5TRACE2("e","ih",tbuf_id,size); - if (H5_TEMPBUF != H5I_group(tbid) || - NULL == (tbuf = H5I_object(tbid))) { + if (H5_TEMPBUF != H5I_group(tbuf_id) || + NULL == (tbuf = H5I_object(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a temp. buffer"); } @@ -387,7 +387,11 @@ H5TBresize_ptr (hid_t tbid, hsize_t size) } /* end while */ /* Insert into correct position in list */ - if(curr!=NULL) { /* can't be adding to the beginning of list, so this is in the middle somewhere */ + if(curr!=NULL) { + /* + * Can't be adding to the beginning of list, so this is in the + * middle somewhere. + */ curr->prev->next=tbuf; tbuf->prev=curr->prev; curr->prev=tbuf; @@ -434,7 +438,10 @@ H5TBgarbage_coll (void) FUNC_ENTER (H5TBgarbage_coll, FAIL); H5TRACE0("e",""); - /* Step through the list, remove each unused node, repair the list and free the node */ + /* + * Step through the list, remove each unused node, repair the list and + * free the node. + */ curr=H5TB_list_head; while(curr!=NULL) { next=curr->next; @@ -475,8 +482,8 @@ done: PURPOSE Release a temp. buffer back to the list of unused ones. USAGE - herr_t H5TBrelease_buf(tbid) - hid_t tbid; IN: Temp. buffer ID to release + herr_t H5TBrelease_buf(tbuf_id) + hid_t tbuf_id; IN: Temp. buffer ID to release RETURNS non-negative on success, negative on failure DESCRIPTION @@ -487,16 +494,16 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5TBrelease_buf (hid_t tbid) +H5TBrelease_buf (hid_t tbuf_id) { herr_t ret_value = FAIL; H5TB_t *tbuf; /* Pointer to temporary buffer */ FUNC_ENTER (H5TBresize_ptr, FAIL); - H5TRACE1("e","i",tbid); + H5TRACE1("e","i",tbuf_id); - if (H5_TEMPBUF != H5I_group(tbid) || - NULL == (tbuf = H5I_object(tbid))) { + if (H5_TEMPBUF != H5I_group(tbuf_id) || + NULL == (tbuf = H5I_object(tbuf_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a temp. buffer"); } @@ -411,14 +411,17 @@ H5V_hyper_copy(intn n, const hsize_t *_size, } #endif #ifdef QAK -{ - intn i; - - printf("%s: n=%d, _dst=%p, _src=%p\n",FUNC,(int)n,_dst,_src); - for(i=0; i<n; i++) { - printf("%d: size=%d, dst_size=%d, dst_offset=%d, src_size=%d, src_offset=%d\n",i,(int)size[i],(int)dst_size[i],(int)dst_offset[i],(int)src_size[i],(int)src_offset[i]); - } /* end for */ -} + { + intn i; + + printf("%s: n=%d, _dst=%p, _src=%p\n",FUNC,(int)n,_dst,_src); + for(i=0; i<n; i++) { + printf("%d: size=%d, dst_size=%d, dst_offset=%d, src_size=%d, " + "src_offset=%d\n", + i, (int)size[i], (int)dst_size[i], (int)dst_offset[i], + (int)src_size[i], (int)src_offset[i]); + } /* end for */ + } #endif /* QAK */ /* Copy the size vector so we can modify it */ |