Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


CALLINTERFACE

The CALLINTERFACE directive specifies the interface convention for CALL statements. The convention specified stays in effect until another CALLINTERFACE specification is made in the compilation unit.

Format
Read syntax diagramSkip visual syntax diagram>>-+->>CALLINTERFACE-+--+---------+--+--------------+----------><
   '->>CALLINT-------'  +-SYSTEM--+  +-DESC---------+  
                        +-OPTLINK-+  +-DESCRIPTOR---+  
                        '-CDECL---'  +-NODESC-------+  
                                     '-NODESCRIPTOR-'  
 
SYSTEM
Specifies that the call interface convention is the standard system linkage convention of the platform. This is the linkage convention used by Windows-based system APIs.
OPTLINK
Specifies that the call interface convention is OPTLINK, which provides a faster alternative to the SYSTEM convention. OPTLINK is the linkage convention that is used by existing IBM C and C++ functions and COBOL and PL/I programs.
CDECL
Specifies that the call interface convention is CDECL. CDECL is the linkage convention that is used to interface with Microsoft® Visual C++ for Windows functions. CDECL is the default convention for Microsoft C and C++ functions.
DESC, DESCRIPTOR
Indicates that an argument descriptor is passed for each argument on a CALL statement.
NODESC, NODESCRIPTOR
Indicates that no argument descriptors are passed for any arguments on a CALL statement. NODESC/NODESCRIPTOR is the default.

Specify >>CALLINTERFACE only in the procedure division.

The positions of CALL statements relative to the CALLINTERFACE directive are recognized following any processing of COPY and REPLACE statements. For example, CALL statements and CALLINTERFACE directives in COPY text are processed by the rules specified for the CALLINTERFACE directive.

Syntax and general rules

Difference between the directive and compiler option

You can indicate which calling convention you want by using either the CALLINTERFACE directive or the CALLINT compiler option. Use the directive when you want to use more than one call convention for the CALL statements in a compilation unit. Use the compiler option when you want to use the same call convention for the entire compilation unit.

Precedence of suboptions

If you specify both the CALLINTERFACE directive (with suboptions) and the CALLINT compiler option, the directive overrides the compiler option specification for the statements following the directive within a compilation unit.

If you specify the CALLINTERFACE directive without any suboptions, the CALLINT compiler option specification is in effect.

If you specify only the DESC/NODESC suboption, the calling convention in effect is the convention specified in the CALLINT compiler option. (DESC/NODESC are options only for the CALLINTERFACE directive. They are not available in the CALLINT compiler option.) For example, if the CALLINT compiler option is set to CALLINT SYSTEM, given the following directives:

(Section A)
...
>>CALLINTERFACE OPTLINK
(Section B)
...
>>CALLINTERFACE DESC
(Section C)

the following specifications are in effect:


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)