Appendix D:
Invoking mkf2c and mkc2f
mkc2f and mkf2c are invoked by a command line as
mkc2f <input file> <output file>
The output file contains assembly language routines that must be assembled
and linked with the FORTRAN and C routines.
Input for mkf2c and mkc2f
mkf2c and mkc2f understand common C syntax for function entry points, will
ignore C style comments, and will pass over function bodies. They cannot
understand constructs such as typedefs or external function definitions. It is
necessary to exclude these constructs from the wrapper input. This can be
accomplished by placing special comments in the code to designate those
functions for which FORTRAN-to-C wrappers are to be generated. The code is
then passed through the program extcentry(1). extcentry will place in its output file
only those portions of its input that are surrounded by the special C comments
/* CENTRY */ and /* ENDCENTRY */.
extcentry is invoked simply by typing
extcentry <input file> <output file>
The following C file foo.c contains the function foo that is to be made
FORTRAN-callable.
typedef unsigned short grunt[4];
struct {
} bar;
main ()
{
}
/* CENTRY */
foo (integer,cstring)
int integer;
char *cstring;
{
}
/* ENDCENTRY */
Version 1.0
long l,l1;
char *str;
int kappa=7;
foo(kappa,bar,str);
if (integer == 1) printf("%s",cstring);
IRIS WORKSTATION GUIDE
81
Need help?
Do you have a question about the IRIS Workstation and is the answer not in the manual?
Questions and answers