diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /hl/fortran/src/H5DSfc.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'hl/fortran/src/H5DSfc.c')
-rw-r--r-- | hl/fortran/src/H5DSfc.c | 510 |
1 files changed, 254 insertions, 256 deletions
diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index f99fa4d..398e2b3 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.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,354 +18,352 @@ #include "H5Eprivate.h" /*------------------------------------------------------------------------- -* Function: h5dsset_scale_c -* -* Purpose: Calls H5DSset_scale -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 17, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: h5dsset_scale_c + * + * Purpose: Calls H5DSset_scale + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 17, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) { - char *c_dimname = NULL; - int_f ret_value = 0; + char *c_dimname = NULL; + int_f ret_value = 0; - /* - * convert FORTRAN name to C name - */ + /* + * convert FORTRAN name to C name + */ - if(*dimnamelen != 0) - if(NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen))) - HGOTO_DONE(FAIL) + if (*dimnamelen != 0) + if (NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen))) + HGOTO_DONE(FAIL) - /* - * call H5DSset_scale function. - */ + /* + * call H5DSset_scale function. + */ - if(H5DSset_scale( (hid_t)*dsid, c_dimname) < 0) - HGOTO_DONE(FAIL) + if (H5DSset_scale((hid_t)*dsid, c_dimname) < 0) + HGOTO_DONE(FAIL) - done: - if(c_dimname) - HDfree(c_dimname); +done: + if (c_dimname) + HDfree(c_dimname); - return ret_value; + return ret_value; } /* end h5dsset_scale_c() */ - /*------------------------------------------------------------------------- -* Function: H5DSattach_scale_c -* -* Purpose: Calls H5DSattach_scale -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 17, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: H5DSattach_scale_c + * + * Purpose: Calls H5DSattach_scale + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 17, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f -h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsattach_scale_c(hid_t_f *did, hid_t_f *dsid, int_f *idx) { - int_f ret_value = 0; + int_f ret_value = 0; - /* - * call H5DSset_scale function. - */ + /* + * call H5DSset_scale function. + */ - if(H5DSattach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) - HGOTO_DONE(FAIL) + if (H5DSattach_scale((hid_t)*did, (hid_t)*dsid, (unsigned)*idx) < 0) + HGOTO_DONE(FAIL) - done: +done: return ret_value; } /* end h5dsattach_scale_c() */ - /*------------------------------------------------------------------------- -* Function: H5DSdetach_scale_c -* -* Purpose: Calls H5DSdetach_scale -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 17, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: H5DSdetach_scale_c + * + * Purpose: Calls H5DSdetach_scale + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 17, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f -h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsdetach_scale_c(hid_t_f *did, hid_t_f *dsid, int_f *idx) { - int_f ret_value = 0; + int_f ret_value = 0; - /* - * call H5DSset_scale function. - */ + /* + * call H5DSset_scale function. + */ - if(H5DSdetach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) - HGOTO_DONE(FAIL) + if (H5DSdetach_scale((hid_t)*did, (hid_t)*dsid, (unsigned)*idx) < 0) + HGOTO_DONE(FAIL) - done: +done: return ret_value; } /* end h5dsdetach_scale_c() */ - /*------------------------------------------------------------------------- -* Function: H5DSis_attached_c -* -* Purpose: Calls H5DSis_attached -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 17, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: H5DSis_attached_c + * + * Purpose: Calls H5DSis_attached + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 17, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f -h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) +h5dsis_attached_c(hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) { - int_f ret_value = 0; - htri_t c_is_attached; + int_f ret_value = 0; + htri_t c_is_attached; - /* - * call H5DSis_attached function. - */ + /* + * call H5DSis_attached function. + */ - if((c_is_attached = H5DSis_attached( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx )) < 0) - HGOTO_DONE(FAIL) + if ((c_is_attached = H5DSis_attached((hid_t)*did, (hid_t)*dsid, (unsigned)*idx)) < 0) + HGOTO_DONE(FAIL) - *is_attached = (int_f)c_is_attached; + *is_attached = (int_f)c_is_attached; - done: - return ret_value; +done: + return ret_value; } /* end h5dsis_attached_c() */ /*------------------------------------------------------------------------- -* Function: H5DSis_scale_c -* -* Purpose: Calls H5DSis_scale -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 18, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: H5DSis_scale_c + * + * Purpose: Calls H5DSis_scale + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 18, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f -h5dsis_scale_c( hid_t_f *did, int_f *is_scale) +h5dsis_scale_c(hid_t_f *did, int_f *is_scale) { - int_f ret_value = 0; - htri_t c_is_scale; + int_f ret_value = 0; + htri_t c_is_scale; - /* - * call H5DSis_scale function. - */ + /* + * call H5DSis_scale function. + */ - if((c_is_scale=H5DSis_scale( (hid_t)*did )) < 0) - HGOTO_DONE(FAIL) + if ((c_is_scale = H5DSis_scale((hid_t)*did)) < 0) + HGOTO_DONE(FAIL) - *is_scale = (int_f)c_is_scale; + *is_scale = (int_f)c_is_scale; - done: +done: return ret_value; } /* end h5dsis_scale_c() */ - /*------------------------------------------------------------------------- -* Function: h5dsset_label_c -* -* Purpose: Calls H5DSset_label -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 18, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: h5dsset_label_c + * + * Purpose: Calls H5DSset_label + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 18, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) { - char *c_label = NULL; - int_f ret_value = 0; + char *c_label = NULL; + int_f ret_value = 0; - /* - * convert FORTRAN name to C name - */ + /* + * convert FORTRAN name to C name + */ - if(NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen))) - HGOTO_DONE(FAIL) + if (NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen))) + HGOTO_DONE(FAIL) - /* - * call H5DSset_label function. - */ + /* + * call H5DSset_label function. + */ - if(H5DSset_label( (hid_t)*did, (unsigned)*idx, c_label) < 0) - HGOTO_DONE(FAIL) + if (H5DSset_label((hid_t)*did, (unsigned)*idx, c_label) < 0) + HGOTO_DONE(FAIL) - done: - if(c_label) - HDfree(c_label); +done: + if (c_label) + HDfree(c_label); - return ret_value; + return ret_value; } /* end h5dsset_label_c() */ /*------------------------------------------------------------------------- -* Function: h5dsget_label_c -* -* Purpose: Calls H5DSget_label -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 18, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: h5dsget_label_c + * + * Purpose: Calls H5DSget_label + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 18, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) { - char *c_label = NULL; - ssize_t size_c = -1; - int_f ret_value = 0; + char * c_label = NULL; + ssize_t size_c = -1; + int_f ret_value = 0; - /* - * Allocate buffer to hold label - */ - if ((c_label = (char *)HDmalloc((size_t)*size + 1)) == NULL) - HGOTO_DONE(FAIL); + /* + * Allocate buffer to hold label + */ + if ((c_label = (char *)HDmalloc((size_t)*size + 1)) == NULL) + HGOTO_DONE(FAIL); - /* - * call H5DSget_label function. - */ + /* + * call H5DSget_label function. + */ - if( (size_c = H5DSget_label( (hid_t)*did, (unsigned)*idx, c_label, (size_t)*size+1)) < 0) - HGOTO_DONE(FAIL) + if ((size_c = H5DSget_label((hid_t)*did, (unsigned)*idx, c_label, (size_t)*size + 1)) < 0) + HGOTO_DONE(FAIL) - /* - * Convert C name to FORTRAN and place it in the given buffer - */ + /* + * Convert C name to FORTRAN and place it in the given buffer + */ - HD5packFstring(c_label, _fcdtocp(label), (size_t)*size); + HD5packFstring(c_label, _fcdtocp(label), (size_t)*size); done: - *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the - * trailing NULL in the length calculation, Ref. HDFFV-7596 */ - if(c_label) HDfree(c_label); - return ret_value; + *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the + * trailing NULL in the length calculation, Ref. HDFFV-7596 */ + if (c_label) + HDfree(c_label); + return ret_value; } /* end h5dsget_label_c() */ /*------------------------------------------------------------------------- -* Function: h5dsget_scale_name_c -* -* Purpose: Calls H5DSget_scale_name -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 18, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: h5dsget_scale_name_c + * + * Purpose: Calls H5DSget_scale_name + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 18, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) { - char *c_scale_name = NULL; - ssize_t size_c = -1; - int_f ret_value = 0; + char * c_scale_name = NULL; + ssize_t size_c = -1; + int_f ret_value = 0; - /* - * Allocate buffer to hold name - */ - if ((c_scale_name = (char *)HDmalloc((size_t)*size + 1)) == NULL) - HGOTO_DONE(FAIL); + /* + * Allocate buffer to hold name + */ + if ((c_scale_name = (char *)HDmalloc((size_t)*size + 1)) == NULL) + HGOTO_DONE(FAIL); - /* - * call H5DSget_scale_name function. - */ + /* + * call H5DSget_scale_name function. + */ - if( (size_c = H5DSget_scale_name( (hid_t)*did, c_scale_name, (size_t)*size+1)) < 0) - HGOTO_DONE(FAIL) + if ((size_c = H5DSget_scale_name((hid_t)*did, c_scale_name, (size_t)*size + 1)) < 0) + HGOTO_DONE(FAIL) - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size); - *size = (size_t_f)size_c; + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size); + *size = (size_t_f)size_c; done: - if(c_scale_name) HDfree(c_scale_name); - return ret_value; + if (c_scale_name) + HDfree(c_scale_name); + return ret_value; } /* end h5dsget_scale_name_c() */ /*------------------------------------------------------------------------- -* Function: H5DSget_num_scales_c -* -* Purpose: Calls H5DSget_num_scales -* -* Return: Success: 0, Failure: -1 -* -* Programmer: M. Scot Breitenfeld -* -* Date: April 18, 2011 -* -* Comments: -* -*------------------------------------------------------------------------- -*/ + * Function: H5DSget_num_scales_c + * + * Purpose: Calls H5DSget_num_scales + * + * Return: Success: 0, Failure: -1 + * + * Programmer: M. Scot Breitenfeld + * + * Date: April 18, 2011 + * + * Comments: + * + *------------------------------------------------------------------------- + */ int_f -h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) +h5dsget_num_scales_c(hid_t_f *did, int_f *idx, int_f *num_scales) { - int_f ret_value = 0; + int_f ret_value = 0; - /* - * call H5DSset_scale function. - */ + /* + * call H5DSset_scale function. + */ - if( (*num_scales = (int_f)H5DSget_num_scales( (hid_t)*did, (unsigned)*idx)) < 0) - HGOTO_DONE(FAIL) + if ((*num_scales = (int_f)H5DSget_num_scales((hid_t)*did, (unsigned)*idx)) < 0) + HGOTO_DONE(FAIL) - done: +done: return ret_value; } /* end h5dsget_num_scales_c() */ |