diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-08-18 14:32:47 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2011-08-18 14:32:47 (GMT) |
commit | a9c065c5ce65bb7dca560d53642574dba608dc78 (patch) | |
tree | 2d36b7afd3f3a83314db25aba081e95254d28841 /fortran/src/H5f90kit.c | |
parent | a968e2d409d975ac5b584680620d2589b0409f88 (diff) | |
download | hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.zip hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.tar.gz hdf5-a9c065c5ce65bb7dca560d53642574dba608dc78.tar.bz2 |
[svn-r21248] Mereged the F2003 branch into the trunk.
Items merged: fortran directory,
src/libhdf5.settings.in
configure.in configure
MANIFEST
Tested: (all platforms used by daily tests, both with --enable-fortran and --enable-fortran2003)
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 */ |