Loglan 05 External Func HC
Loglan 05 External Func HC
Loglan 05 External Func HC
Contents
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Loglan Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Example 1: Calling External C Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Example 2: Calling External Fortran Function in Windows . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
External functions may be called from within a Loglan program. Because the Loglan program is converted
to C, it is easier if the external function is also written in this language, although Fortran may also be called
if the argument passing mechanism is compatible.
NOTE All parameters and variables are to be in lowercase to prevent compilation failure.
Files containing compiled external functions are passed to loglan_compile by the OBJS or EXTLIBS
arguments.
NOTE In Windows, to set the Fortran compiler variable use the Windows short name. The
following example gives a guide:
NOTE This example works on Linux but it may be simpler as it is possible that the Fortran
compiler location will be in the path so there would be no need for the PG_F77 environment
variable to be set.
E
environment variable
PG_77 3
external function
Loglan call 2
L
Loglan
difficulties with Fortran subroutines 2
external function call 2
program structure 2
P
PG_F77
environment variable 3
program structure
Loglan 2