diff options
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Af.c | 75 | ||||
-rw-r--r-- | fortran/src/H5Df.c | 136 | ||||
-rw-r--r-- | fortran/src/H5Rf.c | 248 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 10 |
4 files changed, 0 insertions, 469 deletions
diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 7d343a2..d0ed250f 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -73,81 +73,6 @@ done: return ret_value; } -/****if* H5Af/h5aopen_name_c - * NAME - * h5aopen_name_c - * PURPOSE - * Call H5Aopen to open an attribute - * INPUTS - * obj_id - object identifier - * name - name of the attribute - * namelen - name length - * OUTPUTS - * attr_id - dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -h5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id) -/*******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Aopen function. - */ - if((*attr_id = (hid_t_f)H5Aopen((hid_t)*obj_id, c_name, H5P_DEFAULT)) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Af/h5aclose_c - * NAME - * h5aclose_c - * PURPOSE - * Call H5Aclose to close an attribute - * INPUTS - * attr_id - identifier of an attribute to be closed - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ - -int_f -h5aclose_c ( hid_t_f *attr_id ) -/******/ -{ - int_f ret_value=0; /* Return value */ - - if (H5Aclose((hid_t)*attr_id) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - /****if* H5Af/h5adelete_c * NAME * h5adelete_c diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 5845cf8..050d7e0 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -128,74 +128,6 @@ DONE: return ret_value; } - -/****if* H5Df/h5dwrite_ref_obj_c - * NAME - * h5dwrite_ref_obj_c - * PURPOSE - * Call H5Dwrite to write a dataset of object references - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer with references to the objects. - * n - number of references to be stored. - * RETURNS - * 0 on success,e-1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 14, 2002 - * HISTORY - * This function was added to accomodate h5dwrite_f with the - * dims argumnet being of INTEGER(HSIZE_T) type. - * SOURCE -*/ -int_f -h5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f *buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - herr_t ret; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - hobj_ref_t *buf_c; - unsigned int i, n; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Allocate temporary buffer and copy references from Fortran. - */ - n = (unsigned int)*dims; - buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*n); - if ( buf_c != NULL ) { - for (i = 0; i < n; i++) - HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t)); - } - else return ret_value; - - /* - * Call H5Dwrite function. - */ - c_dset_id = (hid_t)*dset_id; - c_mem_type_id = (hid_t)*mem_type_id; - c_mem_space_id = (hid_t)*mem_space_id; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); - HDfree(buf_c); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - /****if* H5Df/h5dwrite_ref_reg_c * NAME * h5dwrite_ref_reg_c @@ -266,74 +198,6 @@ h5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i return ret_value; } - -/****if* H5Df/h5dread_ref_obj_c - * NAME - * h5dread_ref_obj_c - * PURPOSE - * Call H5Dread to read a dataset of object references - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer to store references to the objects. - * n - number of references to be stored. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, May 15, 2002 - * HISTORY - * This function was added to accomodate h5dread_f subroutine - * with the dims parameter being of INTEGER(HSIZE_T_F) size. - * SOURCE -*/ -int_f -h5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f * buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - herr_t ret = -1; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - hobj_ref_t *buf_c = NULL; - hsize_t i,n; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Allocate temporary buffer. - */ - n = (hsize_t)*dims; - buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(size_t)n); - if ( buf_c != NULL ) { - /* - * Call H5Dread function. - */ - c_dset_id = (hid_t)*dset_id; - c_mem_type_id = (hid_t)*mem_type_id; - c_mem_space_id = (hid_t)*mem_space_id; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); - if (ret >=0) { - for (i = 0; i < n; i++) - HDmemcpy(&buf[i], &buf_c[i], sizeof(haddr_t)); - } - if ( buf_c != NULL ) HDfree(buf_c); - } - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - /****if* H5Df/h5dread_ref_reg_c * NAME * h5dread_ref_reg_c diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 271bfee..b196c71 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -24,53 +24,6 @@ #include "H5f90.h" #include "H5Eprivate.h" -/****if* H5Rf/h5rcreate_object_c - * NAME - * h5rcreate_object_c - * PURPOSE - * Call H5Rcreate to create a reference to an object - * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * OUTPUTS - * ref - reference to the object - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * SOURCE -*/ -int_f -h5rcreate_object_c(haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) -/******/ -{ - char *c_name = NULL; - hobj_ref_t ref_c; - int_f ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rcreate function. - */ - if(H5Rcreate(&ref_c, *loc_id, c_name, H5R_OBJECT, (hid_t)-1) < 0) - HGOTO_DONE(FAIL) - - /* Copy the reference created */ - *ref = (haddr_t_f)ref_c; - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} /* h5rcreate_object_c() */ - /****if* H5Rf/h5rcreate_region_c * NAME * h5rcreate_region_c @@ -165,89 +118,6 @@ h5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *r return ret_value; } -/****if* H5Rf/h5rdereference_region_c - * NAME - * h5rdereference_region_c - * PURPOSE - * Call H5Rdereference to dereference to dataset region - * INPUTS - * dset_id - dataset identifier - * ref - reference to the dataset region - * OUTPUTS - * obj_id - dereferenced dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -h5rdereference_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) -/******/ -{ - hdset_reg_ref_t ref_c; - hid_t c_obj_id; - int_f ret_value = 0; - - /* Copy the reference to dereference */ - HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); - - /* - * Call H5Rdereference function. - */ - if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_c)) < 0) - HGOTO_DONE(FAIL) - - /* Copy the object's ID */ - *obj_id = (hid_t_f)c_obj_id; - -done: - return ret_value; -} /* end h5rdereference_region_c() */ - -/****if* H5Rf/h5rdereference_object_c - * NAME - * h5rdereference_object_c - * PURPOSE - * Call H5Rdereference to dereference an object - * INPUTS - * dset_id - dataset identifier - * ref - reference to an object - * OUTPUTS - * obj_id - dereferenced object identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -h5rdereference_object_c(hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) -/******/ -{ - hid_t c_obj_id; - hobj_ref_t ref_c = (hobj_ref_t)*ref; - int_f ret_value = 0; - - /* - * Call H5Rdereference function. - */ - if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_OBJECT, &ref_c)) < 0) - HGOTO_DONE(FAIL) - - /* Copy the object's ID */ - *obj_id = (hid_t_f)c_obj_id; - -done: - return ret_value; -} /* end h5rdereference_object_c() */ - /****if* H5Rf/h5rdereference_ptr_c * NAME * h5rdereference_ptr_c @@ -410,124 +280,6 @@ done: return ret_value; } /* end h5rget_object_type_obj_c() */ -/****if* H5Rf/h5rget_name_object_c - * NAME - * h5rget_name_object_c - * PURPOSE - * Call H5Rget_name for an object - * INPUTS - * - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * OUTPUTS - * name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * March 31, 2008 - * HISTORY - * - * SOURCE -*/ -int_f -h5rget_name_object_c(hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -/******/ -{ - hobj_ref_t ref_c = (hobj_ref_t)*ref; - ssize_t c_size; - size_t c_bufsize = (size_t)*name_len + 1; - char *c_buf = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; - - - /* - * Allocate buffer to hold name of an attribute - */ - if(NULL == (c_buf = (char *)HDmalloc(c_bufsize))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rget_name function. - */ - if((c_size = H5Rget_name((hid_t)*loc_id, H5R_OBJECT, &ref_c, c_buf, c_bufsize)) < 0) - HGOTO_DONE(FAIL) - - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1); - *size_default = (size_t_f)c_size; - -done: - if(c_buf) - HDfree(c_buf); - return ret_value; -} /* end h5rget_name_object_c() */ - -/****if* H5Rf/h5rget_name_region_c - * NAME - * h5rget_name_region_c - * PURPOSE - * Call H5Rget_name for a dataset region - * INPUTS - * - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * OUTPUTS - * name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * March 31, 2008 - * HISTORY - * - * SOURCE -*/ -int_f -h5rget_name_region_c(hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -/******/ -{ - hdset_reg_ref_t ref_c; - ssize_t c_size; - size_t c_bufsize = (size_t)*name_len + 1; - char *c_buf = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; - - /* Copy the reference to query */ - HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); - - /* - * Allocate buffer to hold name of an attribute - */ - if(NULL == (c_buf = (char *)HDmalloc(c_bufsize))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rget_name function. - */ - if((c_size = H5Rget_name((hid_t)*loc_id, H5R_DATASET_REGION, &ref_c, c_buf, c_bufsize)) < 0) - HGOTO_DONE(FAIL) - - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize - 1); - *size_default = (size_t_f)c_size; - -done: - if(c_buf) - HDfree(c_buf); - return ret_value; -} - /****if* H5Rf/h5rget_name_ptr_c * NAME * h5rget_name_ptr_c diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 2b3ca0a..e77219d 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -146,12 +146,10 @@ H5_FCDLL int_f h5dclose_c ( hid_t_f *dset_id ); H5_FCDLL int_f h5dwrite_vl_integer_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); H5_FCDLL int_f h5dwrite_vl_real_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); H5_FCDLL int_f h5dwrite_vl_string_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f h5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f *buf, hsize_t_f *dims); H5_FCDLL int_f h5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims); H5_FCDLL int_f h5dread_vl_integer_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); H5_FCDLL int_f h5dread_vl_real_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); H5_FCDLL int_f h5dread_vl_string_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f h5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f * buf, hsize_t_f *dims); H5_FCDLL int_f h5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f * buf, hsize_t_f *dims); H5_FCDLL int_f h5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id); H5_FCDLL int_f h5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id); @@ -201,10 +199,8 @@ H5_FCDLL int_f h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f */ H5_FCDLL int_f h5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id); -H5_FCDLL int_f h5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id); H5_FCDLL int_f h5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); H5_FCDLL int_f h5aread_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); -H5_FCDLL int_f h5aclose_c ( hid_t_f *attr_id ); H5_FCDLL int_f h5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); H5_FCDLL int_f h5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id); H5_FCDLL int_f h5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id); @@ -426,7 +422,6 @@ H5_FCDLL int_f h5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hi H5P_cls_create_func_t create, void *create_data, H5P_cls_copy_func_t copy, void *copy_data, H5P_cls_close_func_t close, void *close_data); -H5_FCDLL int_f h5pcreate_class_f90_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls); H5_FCDLL int_f h5pregister_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value); H5_FCDLL int_f h5pregisterc_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); H5_FCDLL int_f h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); @@ -496,17 +491,12 @@ H5_FCDLL int_f h5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); /* * Functions frome H5Rf.c */ -H5_FCDLL int_f h5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen); H5_FCDLL int_f h5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id); H5_FCDLL int_f h5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *ref_type, hid_t_f *space_id); -H5_FCDLL int_f h5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id); -H5_FCDLL int_f h5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id); H5_FCDLL int_f h5rdereference_ptr_c (hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_obj_id); H5_FCDLL int_f h5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id); H5_FCDLL int_f h5rget_region_ptr_c(hid_t_f *dset_id, void *ref, hid_t_f *space_id); H5_FCDLL int_f h5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type); -H5_FCDLL int_f h5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); -H5_FCDLL int_f h5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); H5_FCDLL int_f h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); H5_FCDLL int_f h5rget_obj_type_c (hid_t_f *loc_id, int_f *ref_type, void *ref, int_f *obj_type); /* |