There are two types of macros involved in declaring a C function that is to be called from FORTRAN; the function name and the function arguments. If the C function is to be treated as a FORTRAN subroutine, then it should be declared with the macro F77_SUBROUTINE. This will declare the C function to be of type void and will generate the correct form of the of the routine name, handling such things as appending a trailing underscore where required.
If the C function is to be treated as a FORTRAN numerical or logical function, then it should be declared with one of the macros F77_type_FUNCTION. These macros will declare the function to be of the appropriate type, e.g. a function declared with F77_INTEGER_FUNCTION is likely to be of type int.
The declaration of a C function that is to be treated as a FORTRAN character function is more complex than one that returns a scalar numeric or logical value. The first argument of the function should be CHARACTER_RETURN_VALUE(return_value), where return_value is a variable of type ``pointer to char''. Although character functions work perfectly well on all current Starlink hardware, it is one of the more difficult things to guess how other manufacturer might implement them. Consequently, it is recommended that character functions be avoided where possible and that a subroutine that returns a character argument be used instead.
CNF and F77 Mixed Language Programming -- FORTRAN and C