diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-09-27 05:02:38 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-09-27 05:02:38 (GMT) |
commit | 4af3cd2b7a89b2eeed05d5ec0b0641ca7c2545bc (patch) | |
tree | 01f90619962c447280074bb8d10ae5c7b2b9acbc /fortran/src/H5f90kit.c | |
parent | a07004c825e3a4e4b61269fd3e5f2b57092f073c (diff) | |
download | hdf5-4af3cd2b7a89b2eeed05d5ec0b0641ca7c2545bc.zip hdf5-4af3cd2b7a89b2eeed05d5ec0b0641ca7c2545bc.tar.gz hdf5-4af3cd2b7a89b2eeed05d5ec0b0641ca7c2545bc.tar.bz2 |
[svn-r21421] Merged the Fortran 2003 changes from the trunk into the 1.8 branch, used:
svn merge -r 20506:21414 https://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran
Tested: jam (gnu, intel, pgi compilers)
Also merged effected non-Fortran files:
svn merge -r21247:r21248 https://svn.hdfgroup.uiuc.edu/hdf5/trunk/src/libhdf5.settings.in
Diffstat (limited to 'fortran/src/H5f90kit.c')
-rw-r--r-- | fortran/src/H5f90kit.c | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index a809229..059685e 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -1,4 +1,12 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5f90kit/H5f90kit + * PURPOSE + * Routines from HDF4 to deal with C-FORTRAN issues: + * + * HD5f2cstring -- convert a Fortran string to a C string + * HD5packFstring -- convert a C string into a Fortran string + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,39 +19,33 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include <ctype.h> #include <stddef.h> #include "H5f90.h" - -/* - * Routines from HDF4 to deal with C-FORTRAN issues. - * - * HD5f2cstring -- convert a Fortran string to a C string - * HD5packFstring -- convert a C string into a Fortran string +/****if* H5f90kit/HDf2cstring + * NAME + * HD5f2cstring -- convert a Fortran string to a C string + * char * HDf2cstring(fdesc, len) + * INPUTS + * _fcd fdesc; IN: Fortran string descriptor + * int len; IN: length of Fortran string + * RETURNS + * Pointer to the C string if success, else NULL + * PURPOSE + * Chop off trailing blanks off of a Fortran string and + * move it into a newly allocated C string. It is up + * to the user to free this string. + * SOURCE */ - -/* ----------------------------- HDf2cstring ------------------------------ */ -/* -NAME - HD5f2cstring -- convert a Fortran string to a C string -USAGE - char * HDf2cstring(fdesc, len) - _fcd fdesc; IN: Fortran string descriptor - int len; IN: length of Fortran string -RETURNS - Pointer to the C string if success, else NULL -DESCRIPTION - Chop off trailing blanks off of a Fortran string and - move it into a newly allocated C string. It is up - to the user to free this string. - ----------------------------------------------------------------------------*/ char * HD5f2cstring(_fcd fdesc, size_t len) +/******/ { char *cstr; /* C string to return */ char *str; /* Pointer to FORTRAN string */ @@ -67,28 +69,29 @@ HD5f2cstring(_fcd fdesc, size_t len) return cstr; } /* HD5f2cstring */ -/* ---------------------------- HD5packFstring ----------------------------- */ -/* -NAME - HD5packFstring -- convert a C string into a Fortran string -USAGE - int HD5packFstring(src, dest, len) - char * src; IN: source string - char * dest; OUT: destination - int len; IN: length of string -RETURNS - SUCCEED / FAIL -DESCRIPTION - given a NULL terminated C string 'src' convert it to - a space padded Fortran string 'dest' of length 'len' - - This is very similar to HDc2fstr except that function does - it in place and this one copies. We should probably only - support one of these. - ----------------------------------------------------------------------------*/ +/****if* H5f90kit/HD5packFstring + * NAME + * HD5packFstring -- convert a C string into a Fortran string + * int HD5packFstring(src, dest, len) + * INPUTS + * char * src; IN: source string + * int len; IN: length of string + * OUTPUTS + * char * dest; OUT: destination + * RETURNS + * SUCCEED / FAIL + * PURPOSE + * given a NULL terminated C string 'src' convert it to + * a space padded Fortran string 'dest' of length 'len' + * + * This is very similar to HDc2fstr except that function does + * it in place and this one copies. We should probably only + * support one of these. + * SOURCE + */ void HD5packFstring(char *src, char *dest, size_t dst_len) +/******/ { size_t src_len=HDstrlen(src); @@ -99,5 +102,6 @@ HD5packFstring(char *src, char *dest, size_t dst_len) /* Pad out any remaining space in the FORTRAN string with ' 's */ if(src_len<dst_len) HDmemset(&dest[src_len],' ',dst_len-src_len); + } /* HD5packFstring */ |