Next: References
Up: CNF FORTRAN Function Description
Previous: CNF_PVAL - Expand a FORTRAN pointer to its full value
CNF_CVAL
- Convert a Fortran INTEGER into the same type as used in the TRAIL macro.
- Description:
- When passing dynamically allocated character strings to Fortran
or C routines the character string length is passed as a hidden
argument after the visible ones (see TRAIL). With some
compilers this
length is a 64bit long (INTEGER*8), whereas for others it is more
typically a 32bit int (INTEGER*4). Using this function avoids the need
to know which size is used for the configured compiler.
- Invocation:
- CALL DOIT( %VAL( CNF_PVAL( FPTR ) ),..., %VAL( CNF_CVAL( FINT ) ) )
- Arguments:
-
-
FINT = INTEGER (Given)
-
The FORTRAN integer value giving the expected length of the strings.
- Returned Value:
-
-
CNF_CVAL
-
The string length in the correct type for the configured compiler.
Fortran equivalent of the type used by the TRAIL macro.
- Notes:
- The data type of this function will depend on the platform in
use and is declared in the include file CNF_PAR.
- When mixing calls that pass locally declared character strings
and dynamically allocated ones, all the declared strings
must preceed all the dynamic ones in the argument list so that
the order of the TRAIL arguments is known.
Next: References
Up: CNF FORTRAN Function Description
Previous: CNF_PVAL - Expand a FORTRAN pointer to its full value
CNF and F77 Mixed Language Programming -- FORTRAN and C
Starlink User Note 209
P.M. Allan
A.J. Chipperfield
R.F. Warren-Smith
P.W. Draper
18 April 2008
E-mail:starlink@jiscmail.ac.uk
Copyright © 2013 Science and Technology Facilities Council