.BG
.FN .Fortran
.FN .C
.TL
Call a Fortran or C Routine
.CS
\&.Fortran(name, ..., NAOK=F)
\&.C(name, ..., NAOK=F)
.AG name
a character string, giving the name of a subroutine.
The name should be as understood by Fortran or C; i.e., the same name
you would use to call the routine from Fortran or C (as opposed to
the name the loader actually puts in the symbol table).
.AG ...
arguments to the subroutine.
There must be exactly as many such arguments as the subroutine expects.
They must agree in storage mode with the corresponding argument
to the Fortran or C subroutine: see Table 7.1 in section 7.2.3.
Note in particular that all the arguments to the C subroutine
\f2must\fP be pointers, and that character vectors in S correspond
to `char**' declarations in C.
The length of the object passed in must be at least what the subroutine
expects; if not, expect memory faults and termination of the S session.
.AG NAOK
flag indicating whether NAs are allowed in any of the arguments
to be passed to the C or Fortran routine.
If `FALSE', S checks all arguments for missing values before calling
the subroutine and generates an error if any `NA's are present
in any argument.
.PP
Arguments may have any name.  The corresponding component of the value
will have the same name (see below).
Arguments may have attributes; in particular, they can be matrices or
multi-way arrays.
The returned components will retain these attributes.
.RT
a list with length equal to the number of `...' arguments; i.e., the
list of arguments to the subroutine.  The values in the elements of the
list will be the values given to `.Fortran' or `.C', unless the subroutine
itself overwrites some of the values, in which case the changed values
will be returned.
Normally the subroutine
.I will
overwrite some of its arguments, so that some
computed results can be returned.
Any attributes in the argument will be retained in the value;
for example, arrays will still be arrays.
.PP
The names attribute of the list will be the names of the `...' arguments.
.SA
`S_alloc' for allocating storage in a C routine.
.EX
# a Fortran routine that takes a double precision array and its length
\&.Fortran("mycalc",as.double(x),as.integer(length(x)))
.KW interface
.WR
