ILE C/C++ Compiler Reference


linkage



>>-#--pragma--linkage--(--+-program_name-+--,------------------->
                          '-typedef_name-'
 
>--OS--+------------+--)---------------------------------------><
       '-,--nowiden-'
 
 

Description

Identifies a given function or function typedef as being an external program subject to OS/400 parameter passing conventions.

This pragma allows calls only to external programs. For information on making calls to bound procedures, see #pragma argument .

Parameter

program_name
Specifies the name of an external program. The external name must be specified in uppercase characters and be no longer than 10 characters in length, unless the #pragma map directive is specified to meet OS/400 program naming conventions. However, if the name specified in #pragma map is too long, it will be truncated to 255 characters during #pragma linkage processing.

typedef_name
Specifies a typedef affected by this pragma.

OS
Specifies that the external program is called using OS/400 calling conventions.

nowiden
If specified, arguments are not widened before they are copied and passed.

Notes on Usage

This pragma lets an iSeries program call an external program. The external program can be written in any language.

The pragma can be applied to functions, function types, and function pointer types. If it is applied to a function typedef, the effect of the pragma also applies to all functions and new typedefs declared using that original typedef.

This directive can appear either before or after the program name (or type) is declared. However, the program cannot have been called, nor a type been used in a declaration, before the pragma directive.

The function or function pointer can only return either an int or a void.

Arguments on the call are passed according to the following OS/400 argument-passing conventions:

The compiler issues a warning message and ignores the #pragma linkage directive if:


[ Top of Page | Previous Page | Next Page | Table of Contents ]