/* The default argument passing mechanism for strings in Fortran is the address of a descriptor. This is the definition of the structure: struct dsc$descriptor_s fc ; fc.dsc$w_length = sizeof(string)-1 ; fc.dsc$b_dtype = DSC$K_DTYPE_T ; fc.dsc$b_class = DSC$K_CLASS_S ; fc.dsc$a_pointer = string ; There is a macro for defining such a descriptor: #define $DESCRIPTOR(name,string) struct dsc$descriptor_s name = { sizeof(string)-1, DSC$K_DTYPE_T, DSC$K_CLASS_S, string } To call for instance the Fortran subroutine ASK_I4 from a C program: $DESCRIPTOR(name,string) Create descriptor `name' for `string' where string is a standard null-terminated C string ask_i4(&name,&i) ; Pass the address of the descriptor to ask_i4 Declare `string' global of type `char' or local of type `static char'. NOTE: I haven't been able to find the file DESCRIP.H anywhere on CASS01, but it must be around somewhere. The macro $DESCRIPTOR is defined in SYS$LIBRARY:GKSDESCRIP.H. */ #include void ask_i2 ( struct dsc$descriptor_s *descr, int *i ) ; void ask_i4 ( struct dsc$descriptor_s *descr, long *i ) ; long itrim ( struct dsc$descriptor_s *descr) ; long iGetSymbol ( struct dsc$descriptor_s *descr1, struct dsc$descriptor_s *descr2 ) ; long iGetLogical( struct dsc$descriptor_s *descr1, struct dsc$descriptor_s *descr2 ) ; long iGetTermLimits( float *xl, float *yl ) ; long iSysToDisplay ( float *x, float *y, long *ix, long *iy ) ;