Using Bindable APIs

Bindable application programming interfaces (APIs) are available to all ILE languages. In some cases they provide additional function beyond that provided by a specific ILE language. They are also useful for mixed-language applications because they are HLL independent.

The bindable APIs provide a wide range of functions including:
  • Activation group and control flow management
  • Storage management
  • Condition management
  • Message services
  • Source Debugger
  • Math functions
  • Call management
  • Operational descriptor access

You access ILE bindable APIs using the same call mechanisms used by ILE RPG to call procedures, that is, the CALLP operation or the CALLB operation. If the API returns a value and you want to use it, call the API in an expression. For the information required to define a prototype for an API, see the description of the API in the CL and APIs section of the Programming category in the IBM® i Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/. Figure 1 shows a sample 'call' to a bindable API.

Figure 1. Sample Call Syntax for ILE Bindable APIs
D CEExxxx         PR                  EXTPROC('CEExxxx')
D   parm1   ...
D   ...
C                   CALLP   CEExxxx( parm1 : parm2 :  :
                                     parmn : feedback)
 or
C                   CALLB   'CEExxxx'
C                   PARM                  parm1
C                   PARM                  parm2
                    ...
C                   PARM                  parmn
C                   PARM                  feedback
where
  • CEExxxx is the name of the bindable API
  • parm1, parm2, ... parmn are omissible or required parameters passed to or returned from the called API.
  • feedback is an omissible feedback code that indicates the result of the bindable API.
Note: Bindable APIs cannot be used if DFTACTGRP(*YES) is specified on the CRTBNDRPG command.

For more information on bindable APIs, refer to the CL and APIs section of the Programming category in the IBM i Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/.