76 IRIS WORKSTATION GUIDE
Version 1.0
Appendix D:
preceded by an underscore, are entirely in upper case, and are a
maximum of six characters. FORTRAN
does not
allow underscores in
identifiers! This is important to note when porting C routines
written to interface to VAX FORTRAN 77 programs. The VAX
FORTRAN 77 compiler
appends
an underscore to external function
names it generates to distinguish them from C function entry points.
C routines that expect to be called from the FORTRAN 77 compiler
on the VAX will often have this underscore affixed.
In addition to the problem discussed above with passing strings, there are
differences between the parameter passing conventions of C and FORTRAN 77.
These include:
• a different order of placing parameters on the stack,
• a different set of registers saved across calls,
• whether
caller
or
callee
removes the parameters from the stack,
• the FORTRAN 77 limitation to passing parameters
by reference
(address). Parameters in C may be passed either by value or by
address.
For the applications programmer, this last difference is the most important.
FORTRAN does not have value parameters. Any time a FORTRAN subroutine
alters one of its parameters, the alteration affects the caller. This may not be
the case when the interface has been modified by a wrapper. Both caller and
callee must agree on that data objects are common.
Wrappers help alleviate these system-level differences by relying on the more
flexible type specifications available in C. By using procedure headers coded in
C, greater semantic meaning can be specified than is possible with FORTRAN
types.
D.2 Generating C/FORTRAN Interface Routines
Assembly-language wrapper files are generated by giving a copy of a C
function to one of the programs
mkf2c
or
mkc2f
. Both programs use C type
declarations for the parameters to generate the correct assembly-language
interface. To generate a FORTRAN entry point for an existing C function, the
function is simply passed through
mkf2c
. To generate a C entry point for an
existing FORTRAN routine, the FORTRAN routine declaration and parameter
list must be coded as if it were a C function and passed through
mkc2f
.
Each function given to
mkf2c
or
mkc2f
must have the standard C function syntax.
The function body must exist but may be empty. Function names will be
transformed as necessary in the output.
The simplest case of a function used as input to
mkf2c
or
mkc2f
would be
Summary of Contents for IRIS Workstation
Page 1: ...IRIS Workstation Guide Version 1 0 Silicon Graphics Inc Mountain View California 94043 ...
Page 6: ...2 IRIS WORKSTATION GUIDE Version 1 0 Introduction ...
Page 24: ...20 IRIS WORKSTATION GUIDE Version 1 0 Hardware Installation ...
Page 30: ...26 IRIS WORKSTATION GUIDE Version 1 0 Operation ...
Page 48: ...44 IRIS WORKSTATION GUIDE Version 1 0 System Administration ...
Page 50: ...46 IRIS WORKSTATION GUIDE Version 1 0 Appendix A ...
Page 74: ...70 IRIS WORKSTATION GUIDE Version 1 0 Appendix B ...
Page 77: ...Version 1 0 IRIS WORKSTATION GUIDE 73 Appendix C e random gr error f wnrepaint ...
Page 78: ...74 IRIS WORKSTATION GUIDE Version 1 0 Appendix C ...
Page 92: ...88 IRIS WORKSTATION GUIDE Version 1 0 Appendix D ...
Page 102: ...98 IRIS WORKSTATION GUIDE Version 1 0 Appendix E ...
Page 103: ...Appendix F Manual Pages ...
Page 104: ......
Page 131: ...Version 1 0 126 IRIS WORKSTATION GUIDE Appendix F ...
Page 132: ......
Page 136: ...130 IRIS WORKSTATION GUIDE Version 1 0 Appendix H ...
Page 152: ...146 IRIS WORKSTATION GUIDE Version 1 0 Appendix J ...