Previous: Fortran vs. C Up: SUBLIB Subroutine Library Next: Help Files

Other-Language Bridges

As mentioned previously, most SUBLIB routines written in Fortran need to have a C bridge, and most routines written in C need a Fortran bridge. The rules for creating such bridges, and examples of them, are in Section , Mixing Fortran and C.

There are cases, although rare, where the alternate-language bridge will not be needed. For example, the routines mvcl and mvlc convert strings between CHARACTER*n and BYTE arrays. This function is not useful in C, since C does not use CHARACTER*n variables and there are already routines to accept them in arguments. Therefore, these routines only need a Fortran interface, since they will only ever be called from Fortran.

Another example might be some of the Real-Time subroutines. The entire Real-Time system is written in C, including some SUBLIB routines. These routines are designed to be called only from Real-Time, which is entirely in C. Therefore, no Fortran bridge needs to be written for them. These routines are in SUBLIB even though they are used only by Real-Time because the Real-Time system consists of more than one application program.

rgd059@ipl.jpl.nasa.gov