Technical data

40
Chapter 3: Fortran Program Interfaces
This length is necessary to compute the indexes of the array elements. The
program mkf2c has special constructs for dealing with the lengths of Fortran
character variables.
Reduction of Parameters
The program mkf2c reduces each parameter to one of seven simple objects.
The following list explains each object.
64-bit value The quantity is loaded indirectly from the passed address,
and the result is passed to C. Parameters with the C type
double (or long oat) are reduced to 64-bit values by
converting the 32-bit Fortran REAL parameter to double
precision (see below).
32-bit value mkf2c uses the passed address to retrieve a 32-bit data value,
which is passed to C. Parameters with C types int and long
are reduced to 32-bit values. Any parameter with an
unspecied type is assumed to be int. If the f option is
specied, parameters with the C type oat are reduced to
32-bit values.
16-bit value A 16-bit value is loaded using the passed address. The value
is either extended (if type is signed in the function
parameter list) or masked (if type is unsigned) and passed
to C. Any parameter whose C type is short is reduced to a
16-bit value.
8-bit value The char type in C corresponds to the CHARACTER*1 type
in Fortran 77. (There is no mechanism to pass integer*1
variables to C. A pointer to the value can be passed by
declaring the parameter as int*.) By default the character
value is loaded as an unsigned quantity and passed to C. If
the signed option has been specied when invoking mkf2c,
the character value is sign extended before being passed to
C.
character string A copy is made of the Fortran character variable, and it is
null terminated, and passed as a character pointer to C. Any
modications that C makes to the string will not affect the
corresponding character variable in the Fortran routine.