POSTPEND Directive [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
POSTPEND Directive
The POSTPEND Directive allows C programmers to access FORTRAN routines
and data as per BSD programming standards.
syntax
$POSTPEND [ON ]
[OFF]
Default Off.
Location This directive must appear before any nondirective
statement in a program unit, including the program
head.
Other Information
The $POSTPEND directive postpends an underbar to the end of the names of
references to user declared routines, declarations of user routines and
references and declarations of user declared COMMON blocks.
External names defined by the ALIAS or EXTERNAL_ALIAS directive are not
affected by the POSTPEND directive and will not have an underbar
postpended to them even if the POSTPEND directive is on.
In the following example, a FORTRAN 77 subprogram file has the POSTPEND
directive on and declares a function called ftnsub which adds two numbers
and returns the result. A C program file calls the FORTRAN 77 subroutine
ftnsub by referring to ftnsub.
Example
FORTRAN 77 File:
$POSTPEND ON
SUBROUTINE ftnsub()
PRINT *, "In FORTRAN routine ftnsub."
RETURN
END
C File:
main()
{
ftnsub_(); /* The call to ftnsub_ is resolved to the FORTRAN 77 routine ftnsub.*/
}
MPE/iX 5.0 Documentation