next up previous 252
Next: F77_type_FUNCTION - Declare a FORTRAN function
Up: Full Description of F77 Macros
Previous: F77_IMPORT_type - Import a FORTRAN variable to a C variable.


F77_IMPORT_type_ARRAY - Import an array of type from FORTRAN to C

Description:
Depending upon the type and system, the FORTRAN array will be copied to the C array, making any required changes to the data, or the pointer to the C array will be set to point to the FORTRAN array. (type not CHARACTER.)

Invocation:
F77_IMPORT_type_ARRAY(farg,carg,nels)

Arguments:

farg
A pointer to the FORTRAN array
carg
A pointer to the C array
nels
The number of elements to be exported

Examples:

F77_IMPORT_type_ARRAY(carg,farg,nels)
type LOGICAL will expand as follows:

All systems: {int f77dims[1];f77dims[0]=nels;
  cnfImpla(farg,carg,1,f77dims);}

type POINTER will expand as follows:

All systems: {int f77i;for(f77i=0;nels>f77i;f77i++){
  carg[f77i]=cnfCptr(farg[f77i]); }}

All other types will expand as follows:

All systems: carg=farg


Associated macro:
F77_IMPORT_CHARACTER_ARRAY



next up previous 252
Next: F77_type_FUNCTION - Declare a FORTRAN function
Up: Full Description of F77 Macros
Previous: F77_IMPORT_type - Import a FORTRAN variable to a C variable.

CNF and F77 Mixed Language Programming -- FORTRAN and C
Starlink User Note 209
P.M. Allan
A.J. Chipperfield
R.F. Warren-Smith
19 January 2000
E-mail:ussc@star.rl.ac.uk