Macro Def-Fortran-Routine

Part of:

package fortran-ffi-accessors
( def-fortran-routine &rest < args > )
def-fortran-routine name return-type {(arg-name arg-type {style})}*

This macro performs two related actions. First, it defines an alien
interface to the Fortran routine. Then it also defines a Lisp
function with the same name that calls the Fortran function
appropriately.

The name of the Fortran routine is NAME, which is a symbol. This is
also the name of Lisp function corresponding to the Fortran function.

The remaining forms specify the individual arguments that are passed
to the routine. ARG-NAME is a symbol that names the argument,
primarily for documentation. ARG-TYPE is the Fortran type of the
argument (see below). STYLE specifies whether the argument is an input
or an output of the routine (see below). The default for STYLE is
:INPUT.

RETURN-TYPE
:VOID A Fortran subroutine (no values returned)
:INTEGER Returns an INTEGER*4 value
:SINGLE-FLOAT Returns a REAL*4 value
:DOUBLE-FLOAT Returns a REAL*8 value
:COMPLEX-SINGLE-FLOAT Returns a COMPLEX*8 value
:COMPLEX-DOUBLE-FLOAT Returns a COMPLEX*16 value

ARG-TYPE
:INTEGER INTEGER*4
:SINGLE-FLOAT REAL*4
:DOUBLE-FLOAT DOUBLE PRECISION (REAL*8)
:COMPLEX-SINGLE-FLOAT COMPLEX*8
:COMPLEX-DOUBLE-FLOAT COMPLEX*16
(* X) An array of type X, where X is one of the above
types.
:STRING CHARACTER*(*)

STYLE
When ARG-TYPE is a simple scalar (including complex) STYLE means:
:INPUT Value will be used but not modified.
Similar to the :COPY style of DEF-ALIEN-ROUTINE.
:OUTPUT Input value not used (but some value must be given),
a value is returned via the Lisp command VALUES from
the lisp function NAME. Similar to the :IN-OUT style of
DEF-ALIEN-ROUTINE.
:INPUT-OUTPUT Input value may be used, a value
is returned via the lisp command VALUES from the
lisp function NAME.
Similar to the :IN-OUT style of DEF-ALIEN-ROUTINE.

When ARG-TYPE is an array or string STYLE means:
:INPUT Array entries are used but not modified.
:OUTPUT Array entries need not be initialized on input,
but will be *modified*. In addition, the array
will be returned via the Lisp command VALUES
from the lisp function NAME.

:INPUT-OUTPUT Like :OUTPUT but initial values on entry may be used.

The keyword :WORKSPACE is a nickname for :INPUT. The keywords
:INPUT-OR-OUTPUT,:WORKSPACE-OUTPUT, :WORKSPACE-OR-OUTPUT are nicknames
for :OUTPUT.