fortrc() — Return FORTRAN return code

Standards

Standards / Extensions C or C++ Dependencies
C Library both  

Format

#include <stdlib.h>

int fortrc(void);

External entry point: @@FORTRC, __fortrc

General description

Restriction: This function is not supported in AMODE 64.

The fortrc() function returns the value specified on the FORTRAN RETURN statement issued by the last FORTRAN routine called from the C program.

To avoid infringing on the user's name space, this nonstandard function has two names. One name is prefixed with two underscore characters, and one name is not. The name without the prefix underscore characters is exposed only when you use LANGLVL(EXTENDED).

To use this function, you must either invoke the function using its external entry point name (that is, the name that begins with two underscore characters), or compile with LANGLVL(EXTENDED). When you use LANGLVL(EXTENDED) any relevant information in the header is also exposed.

The FORTRAN routine called must be identified to C as a FORTRAN routine using the following preprocessor directive:
#pragmalinkage(identifier,FORTRAN,RETURNCODE).

The function fortrc() should be called immediately after a call to the FORTRAN routine identifier or else results are unpredictable.

If you do not include stdlib.h in your source code or you use the compile-time option LANGLVL(ANSI), then you must use _␠_fortrc to call the function.

Related information