MKF2C(1)
NAME
mkf2c, mkc2f - generate C-FORTRAN interface routines
SYNOPSIS
mkc2f dummyfortran.cf dummyfortran.s
mkf2c cprog.tc cprog.s
DESCRIPTION
mkf2c and mkc2f are used to generate assembly-language routines to interface
C functions to FORTRAN routines. mkc2f generates an interface for C func-
tions to call FORTRAN routines. mkf2c generates an interface for FORTRAN
routines to call C functions.
Both programs accept as input a set of C functions, and produce an
assembly-language interface routine in the output file. In the case ot mkc2f;
the input may be a copy of the actual C file being interfaced, perhaps fil-
tered by the program extcentry(1). In the case of mkf2c, the FORTRAN rou-tines
must have their parameter lists coded in C for input to the program. (This
must be done manually. Refer to Appendix D of the IRIS Workstation Guide.) In
all cases, mkf2c and mkc2f generate a .s file that must be assembled with as(1),
and loaded with the FORTRAN and C routines that are to be interfaced.
mkc2f and mkf2c use the parameter declarations in the C function headers to
transform each parameter of the calling language to that of the receiving
language. The standard basic C types attached to the parameters are used to
determine the object each parameter represents - i.e., whether it is a value or
pointer, its size, whether it is unsigned, etc. (Character strings are handled
specially - the reader is referred to the paper on the programs.) Only the
opening and closing brace of the function body must be present. Informa-
tion in the body of the function is ignored. fhe programs cannot understand
C constructs other than functions and comments (e.g., external declarations,
typedefs, C preprocessor constructs, etc.). Such unrecognized constructs
must be eliminated from the input (this is the purpose of extcentry(1)).
EXAMPLE
A sample C function given to the programs as input might be
test(i,s,c,ptr1,ptr2,ar1,f,d,d1,str1,str2,str3,u)
short s;
unsigned char c;
int *ptr1;
char *ptr2[];
short ar1[];
float f;
long float d,*d1;
char *str1;
char str2[],str3[30];
Version 1.0
Silicon Graphics
- 1 -
MKF2C(1)
October 1984
Need help?
Do you have a question about the IRIS Workstation and is the answer not in the manual?