summaryrefslogtreecommitdiffstats
path: root/hl/fortran/src/H5LTfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rw-r--r--hl/fortran/src/H5LTfc.c1004
1 files changed, 475 insertions, 529 deletions
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index 2c4f274..0813f66 100644
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -1,15 +1,15 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-* Copyright by The HDF Group. *
-* Copyright by the Board of Trustees of the University of Illinois. *
-* All rights reserved. *
-* *
-* This file is part of HDF5. The full HDF5 copyright notice, including *
-* terms governing use, modification, and redistribution, is contained in *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* This files contains C stubs for H5D Fortran APIs */
@@ -18,121 +18,111 @@
#include "H5Eprivate.h"
/*-------------------------------------------------------------------------
-* Function: H5LTmake_dataset_c
-*
-* Purpose: Call H5LTmake_dataset
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTmake_dataset_c
+ *
+ * Purpose: Call H5LTmake_dataset
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltmake_dataset_c (hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- int_f *rank,
- hsize_t_f *dims,
- hid_t_f *type_id,
- void *buf)
+h5ltmake_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, hsize_t_f *dims,
+ hid_t_f *type_id, void *buf)
{
- int ret_value = -1;
- herr_t ret;
- char *c_name = NULL;
+ int ret_value = -1;
+ herr_t ret;
+ char * c_name = NULL;
hsize_t *c_dims = NULL;
- int i;
+ int i;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
- c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * ( (size_t)*rank ));
+ c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * ((size_t)*rank));
if (c_dims == NULL)
goto done;
/*
- * transpose dimension arrays because of C-FORTRAN storage order
- */
- for (i = 0; i < *rank ; i++)
- {
- c_dims[i] = dims[*rank - i - 1];
+ * transpose dimension arrays because of C-FORTRAN storage order
+ */
+ for (i = 0; i < *rank; i++) {
+ c_dims[i] = dims[*rank - i - 1];
}
/*
- * call H5LTmake_dataset function.
- */
+ * call H5LTmake_dataset function.
+ */
- ret = H5LTmake_dataset((hid_t)*loc_id, c_name, (int)*rank, c_dims, (hid_t)*type_id, buf );
+ ret = H5LTmake_dataset((hid_t)*loc_id, c_name, (int)*rank, c_dims, (hid_t)*type_id, buf);
if (ret < 0)
goto done;
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_dims!=NULL)
+ if (c_dims != NULL)
HDfree(c_dims);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: H5LTread_dataset_c
-*
-* Purpose: Call H5LTmake_dataset
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTread_dataset_c
+ *
+ * Purpose: Call H5LTmake_dataset
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltread_dataset_c (hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- hid_t_f *type_id,
- void *buf)
+h5ltread_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hid_t_f *type_id, void *buf)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- hid_t c_type_id;
- char *c_name = NULL;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ hid_t c_type_id;
+ char * c_name = NULL;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
/*
- * call H5LTread_dataset function.
- */
- c_loc_id = (hid_t)*loc_id;
+ * call H5LTread_dataset function.
+ */
+ c_loc_id = (hid_t)*loc_id;
c_type_id = (hid_t)*type_id;
- ret = H5LTread_dataset(c_loc_id, c_name, c_type_id, buf );
+ ret = H5LTread_dataset(c_loc_id, c_name, c_type_id, buf);
if (ret < 0)
goto done;
@@ -140,47 +130,43 @@ h5ltread_dataset_c (hid_t_f *loc_id,
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: H5LTmake_dataset_string_c
-*
-* Purpose: Call H5LTmake_dataset
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTmake_dataset_string_c
+ *
+ * Purpose: Call H5LTmake_dataset
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltmake_dataset_string_c (hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- size_t_f *buflen,
- char *buf)
+h5ltmake_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *buflen, char *buf)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
- char *c_buf = NULL;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ char * c_buf = NULL;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -190,11 +176,11 @@ h5ltmake_dataset_string_c (hid_t_f *loc_id,
goto done;
/*
- * call H5LTmake_dataset_string function.
- */
+ * call H5LTmake_dataset_string function.
+ */
c_loc_id = (hid_t)*loc_id;
- ret = H5LTmake_dataset_string(c_loc_id,c_name,c_buf);
+ ret = H5LTmake_dataset_string(c_loc_id, c_name, c_buf);
if (ret < 0)
goto done;
@@ -202,58 +188,54 @@ h5ltmake_dataset_string_c (hid_t_f *loc_id,
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_buf!=NULL)
+ if (c_buf != NULL)
HDfree(c_buf);
return ret_value;
}
-
/*-------------------------------------------------------------------------
-* Function: H5LTread_dataset_string_c
-*
-* Purpose: Call H5LTread_dataset_string
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTread_dataset_string_c
+ *
+ * Purpose: Call H5LTread_dataset_string
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltread_dataset_string_c (hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- char *buf)
+h5ltread_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, char *buf)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
/*
- * call H5LTread_dataset_string function.
- */
+ * call H5LTread_dataset_string function.
+ */
c_loc_id = (hid_t)*loc_id;
- ret = H5LTread_dataset_string(c_loc_id,c_name,buf);
+ ret = H5LTread_dataset_string(c_loc_id, c_name, buf);
if (ret < 0)
goto done;
@@ -261,51 +243,46 @@ h5ltread_dataset_string_c (hid_t_f *loc_id,
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: H5LTset_attribute_int_c
-*
-* Purpose: Call H5LTset_attribute_int
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: October 05, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTset_attribute_int_c
+ *
+ * Purpose: Call H5LTset_attribute_int
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: October 05, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltset_attribute_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd dsetname,
- size_t_f *attrnamelen,
- _fcd attrname,
- size_t_f *size,
- void *buf, char *dtype, size_t_f *sizeof_val)
+h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, _fcd attrname,
+ size_t_f *size, void *buf, char *dtype, size_t_f *sizeof_val)
{
- int ret_value = -1;
- herr_t ret = SUCCEED;
- hid_t c_loc_id;
- char *c_name = NULL;
- char *c_attrname = NULL;
- char *c_buf = NULL;
- size_t c_size;
+ int ret_value = -1;
+ herr_t ret = SUCCEED;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ char * c_attrname = NULL;
+ char * c_buf = NULL;
+ size_t c_size;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -315,93 +292,97 @@ h5ltset_attribute_c(hid_t_f *loc_id,
goto done;
/*
- * call H5LTset_attribute_int function.
- */
+ * call H5LTset_attribute_int function.
+ */
c_loc_id = (hid_t)*loc_id;
c_size = (size_t)*size;
- if( HDstrncmp(dtype,"I",1) == 0 ) {
- if ((size_t)*sizeof_val == sizeof(int))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_INT, (const int *)buf);
- else if ((size_t)*sizeof_val == sizeof(long))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LONG, (const long *)buf);
+ if (HDstrncmp(dtype, "I", 1) == 0) {
+ if ((size_t)*sizeof_val == sizeof(int))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_INT,
+ (const int *)buf);
+ else if ((size_t)*sizeof_val == sizeof(long))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_LONG,
+ (const long *)buf);
#if H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG
- else if ((size_t)*sizeof_val == sizeof(long long))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LLONG, (const long long *)buf);
+ else if ((size_t)*sizeof_val == sizeof(long long))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_LLONG,
+ (const long long *)buf);
#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */
- else
- goto done;
- } else if ( HDstrncmp(dtype,"R",1) == 0 ) {
- if((size_t)*sizeof_val == sizeof(float))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_FLOAT, (const float *)buf);
- else if((size_t)*sizeof_val == sizeof(double))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_DOUBLE, (const double *)buf);
-#if H5_SIZEOF_LONG_DOUBLE !=0
- else if((size_t)*sizeof_val == sizeof(long double))
- ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LDOUBLE, (const long double *)buf);
+ else
+ goto done;
+ }
+ else if (HDstrncmp(dtype, "R", 1) == 0) {
+ if ((size_t)*sizeof_val == sizeof(float))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_FLOAT,
+ (const float *)buf);
+ else if ((size_t)*sizeof_val == sizeof(double))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_DOUBLE,
+ (const double *)buf);
+#if H5_SIZEOF_LONG_DOUBLE != 0
+ else if ((size_t)*sizeof_val == sizeof(long double))
+ ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_LDOUBLE,
+ (const long double *)buf);
#endif
- else
- goto done;
- } else if ( HDstrncmp(dtype,"C",1) == 0 ) {
+ else
+ goto done;
+ }
+ else if (HDstrncmp(dtype, "C", 1) == 0) {
- c_buf = (char *)HD5f2cstring((_fcd)buf, c_size);
- if (c_buf == NULL)
- goto done;
+ c_buf = (char *)HD5f2cstring((_fcd)buf, c_size);
+ if (c_buf == NULL)
+ goto done;
- ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,c_buf);
+ ret = H5LTset_attribute_string(c_loc_id, c_name, c_attrname, c_buf);
}
if (ret < 0)
- goto done;
+ goto done;
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_attrname!=NULL)
+ if (c_attrname != NULL)
HDfree(c_attrname);
- if(c_buf!=NULL)
+ if (c_buf != NULL)
HDfree(c_buf);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: H5LTget_attribute_c
-*
-* Purpose: Call H5LTget_attribute_int
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: October 05, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTget_attribute_c
+ *
+ * Purpose: Call H5LTget_attribute_int
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: October 05, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_attribute_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd dsetname,
- size_t_f *attrnamelen,
- _fcd attrname,
- void *buf, char *dtype, size_t_f *sizeof_val)
+h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, _fcd attrname,
+ void *buf, char *dtype, size_t_f *sizeof_val)
{
- int ret_value = -1;
- herr_t ret = SUCCEED;
- hid_t c_loc_id;
- char *c_name = NULL;
- char *c_attrname = NULL;
+ int ret_value = -1;
+ herr_t ret = SUCCEED;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ char * c_attrname = NULL;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -411,32 +392,33 @@ h5ltget_attribute_c(hid_t_f *loc_id,
goto done;
/*
- * call H5LTget_attribute_int function.
- */
+ * call H5LTget_attribute_int function.
+ */
c_loc_id = (hid_t)*loc_id;
- if( HDstrncmp(dtype,"I",1) == 0) {
- if((size_t)*sizeof_val == sizeof(int))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_INT,buf);
- else if ((size_t)*sizeof_val == sizeof(long))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LONG,buf);
+ if (HDstrncmp(dtype, "I", 1) == 0) {
+ if ((size_t)*sizeof_val == sizeof(int))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_INT, buf);
+ else if ((size_t)*sizeof_val == sizeof(long))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_LONG, buf);
#if H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG
- else if ((size_t)*sizeof_val == sizeof(long long))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LLONG,buf);
+ else if ((size_t)*sizeof_val == sizeof(long long))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_LLONG, buf);
#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */
- else
- goto done;
- } else if ( HDstrncmp(dtype,"R",1) == 0 ) {
- if((size_t)*sizeof_val == sizeof(float))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_FLOAT,buf);
- else if((size_t)*sizeof_val == sizeof(double))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_DOUBLE,buf);
-#if H5_SIZEOF_LONG_DOUBLE !=0
- else if((size_t)*sizeof_val == sizeof(long double))
- ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LDOUBLE,buf);
+ else
+ goto done;
+ }
+ else if (HDstrncmp(dtype, "R", 1) == 0) {
+ if ((size_t)*sizeof_val == sizeof(float))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_FLOAT, buf);
+ else if ((size_t)*sizeof_val == sizeof(double))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_DOUBLE, buf);
+#if H5_SIZEOF_LONG_DOUBLE != 0
+ else if ((size_t)*sizeof_val == sizeof(long double))
+ ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_LDOUBLE, buf);
#endif
- else
- goto done;
+ else
+ goto done;
}
if (ret < 0)
@@ -445,50 +427,46 @@ h5ltget_attribute_c(hid_t_f *loc_id,
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_attrname!=NULL)
+ if (c_attrname != NULL)
HDfree(c_attrname);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: H5LTget_attribute_string_c
-*
-* Purpose: Call H5LTget_attribute_string
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: October 05, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTget_attribute_string_c
+ *
+ * Purpose: Call H5LTget_attribute_string
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: October 05, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_attribute_string_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd dsetname,
- size_t_f *attrnamelen,
- _fcd attrname,
- _fcd buf, size_t_f *buf_size)
+h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen,
+ _fcd attrname, _fcd buf, size_t_f *buf_size)
{
- int ret_value = -1;
- herr_t ret;
- char *c_name = NULL;
- char *c_attrname = NULL;
- char *c_buf = NULL;
+ int ret_value = -1;
+ herr_t ret;
+ char * c_name = NULL;
+ char * c_attrname = NULL;
+ char * c_buf = NULL;
/*
- * Convert FORTRAN name to C name
- */
+ * Convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -500,12 +478,12 @@ h5ltget_attribute_string_c(hid_t_f *loc_id,
* Allocate buffer to hold C attribute string
*/
if ((c_buf = (char *)HDmalloc((size_t)*buf_size + 1)) == NULL)
- goto done;
+ goto done;
/*
* Call H5LTget_attribute_int function.
*/
- ret = H5LTget_attribute_string((hid_t)*loc_id,c_name,c_attrname,c_buf);
+ ret = H5LTget_attribute_string((hid_t)*loc_id, c_name, c_attrname, c_buf);
if (ret < 0)
goto done;
@@ -517,58 +495,54 @@ h5ltget_attribute_string_c(hid_t_f *loc_id,
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_attrname!=NULL)
+ if (c_attrname != NULL)
HDfree(c_attrname);
- if(c_buf!=NULL)
+ if (c_buf != NULL)
HDfree(c_buf);
return ret_value;
}
-
/*-------------------------------------------------------------------------
-* Function: H5LTget_dataset_ndims_c
-*
-* Purpose: Call H5LTget_dataset_ndims
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: H5LTget_dataset_ndims_c
+ *
+ * Purpose: Call H5LTget_dataset_ndims
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_dataset_ndims_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- int_f *rank)
+h5ltget_dataset_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
- int c_rank;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ int c_rank;
/*
- * Convert FORTRAN name to C name
- */
+ * Convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
/*
- * Call H5LTget_dataset_ndims function.
- */
+ * Call H5LTget_dataset_ndims function.
+ */
c_loc_id = (hid_t)*loc_id;
ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank);
@@ -576,113 +550,105 @@ h5ltget_dataset_ndims_c(hid_t_f *loc_id,
if (ret < 0)
goto done;
- *rank = (int_f)c_rank;
+ *rank = (int_f)c_rank;
ret_value = 0;
-
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
return ret_value;
}
-
/*-------------------------------------------------------------------------
-* Function: h5ltfind_dataset_c
-*
-* Purpose: Call H5LTfind_dataset
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: h5ltfind_dataset_c
+ *
+ * Purpose: Call H5LTfind_dataset
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltfind_dataset_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name)
+h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name)
{
- hid_t c_loc_id;
- char *c_name = NULL;
- herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ herr_t ret;
/*
- * Convert FORTRAN name to C name
- */
+ * Convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
- if (c_name == NULL) return -1;
+ if (c_name == NULL)
+ return -1;
/*
- * Call H5LTget_dataset_ndims function.
- */
+ * Call H5LTget_dataset_ndims function.
+ */
c_loc_id = (hid_t)*loc_id;
ret = H5LTfind_dataset(c_loc_id, c_name);
- if(c_name!=NULL)
- HDfree(c_name);
+ if (c_name != NULL)
+ HDfree(c_name);
return ret;
-
}
/*-------------------------------------------------------------------------
-* Function: h5ltget_dataset_info_c
-*
-* Purpose: Call H5LTget_dataset_info
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: h5ltget_dataset_info_c
+ *
+ * Purpose: Call H5LTget_dataset_info
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_dataset_info_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- hsize_t_f *dims,
- int_f *type_class,
- size_t_f *type_size)
+h5ltget_dataset_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dims, int_f *type_class,
+ size_t_f *type_size)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
- H5T_class_t c_classtype;
- size_t c_type_size;
- hsize_t c_dims[32];
- int i;
- int c_rank;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ H5T_class_t c_classtype;
+ size_t c_type_size;
+ hsize_t c_dims[32];
+ int i;
+ int c_rank;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
/*
- * call H5LTget_dataset_ndims function.
- */
+ * call H5LTget_dataset_ndims function.
+ */
c_loc_id = (hid_t)*loc_id;
ret = H5LTget_dataset_info(c_loc_id, c_name, c_dims, &c_classtype, &c_type_size);
@@ -690,68 +656,62 @@ h5ltget_dataset_info_c(hid_t_f *loc_id,
goto done;
*type_class = c_classtype;
- *type_size = (size_t_f)c_type_size;
+ *type_size = (size_t_f)c_type_size;
/*
- * transpose dimension arrays because of C-FORTRAN storage order
- */
+ * transpose dimension arrays because of C-FORTRAN storage order
+ */
ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank);
if (ret < 0)
goto done;
- for (i = 0; i < c_rank ; i++)
- {
- dims[i] = (hsize_t_f) c_dims[c_rank - i - 1];
+ for (i = 0; i < c_rank; i++) {
+ dims[i] = (hsize_t_f)c_dims[c_rank - i - 1];
}
-
ret_value = 0;
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: h5ltget_attribute_ndims_c
-*
-* Purpose: Call H5LTget_attribute_ndims
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: October 05, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: h5ltget_attribute_ndims_c
+ *
+ * Purpose: Call H5LTget_attribute_ndims
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: October 05, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_attribute_ndims_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd dsetname,
- size_t_f *attrnamelen,
- _fcd attrname,
- int_f *rank)
+h5ltget_attribute_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen,
+ _fcd attrname, int_f *rank)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
- char *c_attrname = NULL;
- int c_rank;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ char * c_attrname = NULL;
+ int c_rank;
/*
- * Convert FORTRAN name to C name
- */
+ * Convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -761,72 +721,64 @@ h5ltget_attribute_ndims_c(hid_t_f *loc_id,
goto done;
/*
- * Call H5LTset_attribute_ndims function.
- */
+ * Call H5LTset_attribute_ndims function.
+ */
c_loc_id = (hid_t)*loc_id;
- ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank);
+ ret = H5LTget_attribute_ndims(c_loc_id, c_name, c_attrname, &c_rank);
if (ret < 0)
goto done;
- *rank = (int_f)c_rank;
+ *rank = (int_f)c_rank;
ret_value = 0;
-
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_attrname!=NULL)
+ if (c_attrname != NULL)
HDfree(c_attrname);
return ret_value;
}
-
/*-------------------------------------------------------------------------
-* Function: h5ltget_attribute_info_c
-*
-* Purpose: Call H5LTget_attribute_info
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: Pedro Vicente
-*
-* Date: September 09, 2004
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: h5ltget_attribute_info_c
+ *
+ * Purpose: Call H5LTget_attribute_info
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ *
+ * Date: September 09, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltget_attribute_info_c(hid_t_f *loc_id,
- size_t_f *namelen,
- _fcd name,
- size_t_f *attrnamelen,
- _fcd attrname,
- hsize_t_f *dims,
- int_f *type_class,
- size_t_f *type_size)
+h5ltget_attribute_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *attrnamelen, _fcd attrname,
+ hsize_t_f *dims, int_f *type_class, size_t_f *type_size)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_loc_id;
- char *c_name = NULL;
- char *c_attrname = NULL;
- H5T_class_t c_classtype;
- size_t c_type_size;
- hsize_t c_dims[32];
- int i;
- int c_rank;
+ int ret_value = -1;
+ herr_t ret;
+ hid_t c_loc_id;
+ char * c_name = NULL;
+ char * c_attrname = NULL;
+ H5T_class_t c_classtype;
+ size_t c_type_size;
+ hsize_t c_dims[32];
+ int i;
+ int c_rank;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL)
goto done;
@@ -836,90 +788,84 @@ h5ltget_attribute_info_c(hid_t_f *loc_id,
goto done;
/*
- * call H5LTget_attribute_info function.
- */
+ * call H5LTget_attribute_info function.
+ */
c_loc_id = (hid_t)*loc_id;
- ret = H5LTget_attribute_info(c_loc_id,c_name,c_attrname,c_dims,&c_classtype,&c_type_size);
+ ret = H5LTget_attribute_info(c_loc_id, c_name, c_attrname, c_dims, &c_classtype, &c_type_size);
if (ret < 0)
goto done;
*type_class = c_classtype;
- *type_size = (size_t_f)c_type_size;
+ *type_size = (size_t_f)c_type_size;
/*
- * transpose dimension arrays because of C-FORTRAN storage order
- */
+ * transpose dimension arrays because of C-FORTRAN storage order
+ */
- ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank);
+ ret = H5LTget_attribute_ndims(c_loc_id, c_name, c_attrname, &c_rank);
if (ret < 0)
goto done;
- for (i = 0; i < c_rank ; i++)
- {
- dims[i] = (hsize_t_f) c_dims[c_rank - i - 1];
+ for (i = 0; i < c_rank; i++) {
+ dims[i] = (hsize_t_f)c_dims[c_rank - i - 1];
}
ret_value = 0;
-
done:
- if(c_name!=NULL)
+ if (c_name != NULL)
HDfree(c_name);
- if(c_attrname!=NULL)
+ if (c_attrname != NULL)
HDfree(c_attrname);
-
return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: h5ltpath_valid_c
-*
-* Purpose: Calls h5ltpath_valid
-*
-* Return: Success: 0, Failure: -1
-*
-* Programmer: M. Scot Breitenfeld
-*
-* Date: February 18, 2012
-*
-* Comments:
-*
-* Modifications:
-*
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: h5ltpath_valid_c
+ *
+ * Purpose: Calls h5ltpath_valid
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: M. Scot Breitenfeld
+ *
+ * Date: February 18, 2012
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
int_f
-h5ltpath_valid_c(hid_t_f *loc_id,
- _fcd path,
- size_t_f *pathlen,
- int_f *check_object_valid_c)
+h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_object_valid_c)
{
- htri_t ret = -1;
- char *c_path = NULL;
+ htri_t ret = -1;
+ char * c_path = NULL;
hbool_t check_object_valid;
/*
* convert FORTRAN name to C name
*/
- if( NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen)))
- goto done;
+ if (NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen)))
+ goto done;
check_object_valid = FALSE;
- if(*check_object_valid_c == 1)
- check_object_valid = TRUE;
+ if (*check_object_valid_c == 1)
+ check_object_valid = TRUE;
/*
* call H5LTpath_valid function.
*/
- ret = H5LTpath_valid( (hid_t)*loc_id, c_path, check_object_valid );
+ ret = H5LTpath_valid((hid_t)*loc_id, c_path, check_object_valid);
done:
- if(c_path != NULL)
- HDfree(c_path);
+ if (c_path != NULL)
+ HDfree(c_path);
return (int_f)ret;
}