next up previous 252
Next: F77_ASSOC_type_ARRAY - Associate a FORTRAN array with a C array.
Up: Full Description of F77 Macros
Previous: DECLARE_type_ARRAY - Declare a FORTRAN array


DECLARE_type_ARRAY_DYN - Declare a dynamic type array

Description:
Declare a dynamic type array that will be passed to a FORTRAN routine using the type_ARRAY_ARG macro. Use this macro, in combination with the F77_CREATE_type_ARRAY and F77_FREE_type macros, where the size of the array is not known until run time. (type not LOCATOR.)

Invocation:
DECLARE_type_ARRAY_DYN(arg)

Arguments:

arg
The variable being declared.

Examples:

DECLARE_type_ARRAY_DYN(farg)
will expand as follows:

All systems: F77_type_TYPE *farg

DECLARE_CHARACTER_ARRAY_DYN(fstring)
will expand as follows:

All Unix: char *fstring; int fstring_length
VAX/VMS: char *fstring; int fstring_length
  struct dsc$descriptor_a fstring_arg

Notes:
On VMS, for CHARACTER, the expansion of the macro is quite complex. A pointer to a descriptor structure is declared in addition to a pointer to char (used to point to the actual string of characters) and an int variable to store the length of the array. The address of the descriptor is what is actually passed to the called FORTRAN routine.



next up previous 252
Next: F77_ASSOC_type_ARRAY - Associate a FORTRAN array with a C array.
Up: Full Description of F77 Macros
Previous: DECLARE_type_ARRAY - Declare a FORTRAN array

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