C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-36
FUNCTION
c-function-name
is the name used inside the program to refer to the external routine.
language
is the name of the language of the external routine. tal identifies both TAL and
pTAL routines.
attribute
specifies a function attribute, which is one of:
alias ("external-name")
identifies the name of the external routine used by Binder or a linker.
external-name can include any character that Binder or a linker recognizes.
The external-name specification is treated:
The TNS/R C/C++ compiler does not modify the string supplied as the
external-name specification in any manner; that is, it does not upshift it.
The TNS C/C++ compiler upshifts the external-name string if the
language is cobol, fortran, pascal, or tal. However, if the language is C or
unspecified, the TNS compiler does not modify the name.
The external-name argument must be enclosed in parentheses and
quotation marks, as indicated in the syntax. For example:
alias ("MyTALFunction")
Use alias to describe the name of a function written in COBOL, FORTRAN,
D-series Pascal, or TAL that does not have a valid C name.
resident
causes the function code to remain in main memory for the duration of program
execution. The operating system does not swap pages of this code. Binder or
a linker allocate storage for resident functions as the first functions in the code
space.
variable
directs the compiler to treat all formal parameters of the function as though
they were optional, even if some parameters are required by your code. If you
add new parameters to a variable function, all callers to the function must be
recompiled.
Variable functions are equivalent to VARIABLE procedures in TAL, pTAL, and
D-series Pascal. For more details, see Writing Variable and Extensible
Functions on page 9-4.