ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/ile1a2.htm

288 lines
8.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>ILE CEE API Calling Conventions</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- ILE1A SCRIPT A converted by B2H R4.1 (346) (CMS) by NLJONES at -->
<!-- RCHVMX on 25 Feb 1999 at 10:33:07 -->
<!--Edited by Kersten Nov 2001 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--End Header Records --><!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>ILE CEE API Calling and Naming Conventions</h2>
<p>You access ILE CEE APIs using the same call mechanisms currently used by
HLLs to support calls in general.</p>
<p>If you use ILE C, you can use an ILE CEE API with the syntax shown in the
following example.</p>
<pre>
#include &lt;leawi.h&gt;
main ()
{
CEExxxx(<em>&amp;parm1, &amp;parm2, ... &amp;parmn, &amp;fc</em>);
}
</pre>
<p>If you use ILE COBOL, you can call most of the ILE CEE APIs using the
following syntax.</p>
<pre>
CALL PROCEDURE 'CEExxxx'
USING <em>parm1, parm2, ... parmn, fc</em>.
</pre>
<p>The following APIs require a different calling convention in ILE COBOL than
that shown above.</p>
<ul>
<li>
<p>Get String Information (CEEGSI)</p>
</li>
<li>
<p>Register a User Written Condition Handler (CEEHDLR)</p>
</li>
<li>
<p>Retrieve Operational Descriptor Information (CEEDOD)</p>
</li>
<li>
<p>Test for Omitted Argument (CEETSTA)</p>
</li>
<li>
<p>Register Call Stack Entry Termination User Exit Procedure (CEERTX)</p>
</li>
<li>
<p>Unregister a User Written Condition Handler (CEEHDLU)</p>
</li>
<li>
<p>Unregister Call Stack Entry Termination User Exit Procedure (CEEUTX)</p>
</li>
</ul>
<p>In the SPECIAL-NAMES paragraph specify:</p>
<pre>
LINKAGE TYPE
SYS FOR 'CEExxxx' 'CEEyyyy' ...
</pre>
for the APIs that are to be called. In the PROCEDURE DIVISION, the APIs are
called using the following syntax.
<pre>
CALL 'CEExxxx' USING <em>parm1, parm2, ... parmn, fc</em>.
.
.
.
CALL 'CEEyyyy' USING <em>parm1, parm2, ... parmn, fc</em>.
</pre>
<p>If you use ILE RPG, you call an ILE CEE API using the following syntax.</p>
<pre>
C CALLB 'CEExxxx'
C PARM <em>parm1</em>
C PARM <em>parm2</em>
...
C PARM <em>parmn</em>
C PARM <em>fc</em>
</pre>
<p><strong>Note:</strong> Operational descriptors are used for some of the ILE
CEE APIs, for example, CEEDATE. Refer to the section on #pragma descriptors in
the <a href="../books/sc097852.pdf" target="_blank">WebSphere Development
Studio: C/C++ Language Reference</a><img src="wbpdf.gif" alt="Link to PDF">
book for information on how to properly pass arguments to these ILE CEE APIs
from inside a C program.</p>
<p>If you use ILE COBOL, you can call functions that require operational
descriptors using the following syntax.</p>
<pre>
SPECIAL NAMES.
LINKAGE PROCEDURE FOR 'CEExxxx' USING ALL DESCRIBED.
PROCEDURE DIVISION.
CALL PROCEDURE 'CEExxxx'
USING <em>parm1, parm2, ... parmn, fc</em>.
</pre>
<p>If you use ILE RPG, you can call functions that require operational
descriptors using either of the following approaches.</p>
<pre>
C CALLB(D) 'CEExxxx'
C PARM <em>parm1</em>
C PARM <em>parm2</em>
...
C PARM <em>parmn</em>
C PARM <em>fc</em>
</pre>
<p>or</p>
<pre>
D CEExxxx PR OPDESC
D <em>parm1</em>
D <em>parm2</em>
D ...
D <em>parmn</em>
D <em>fc</em>
C CALLP CEExxxx(<em>parm1 : parm2 :</em>
C <em>... : parmn : fc</em>)
</pre>
<p><strong>Note:</strong> If you use ILE RPG to call ILE CEE APIs, the
following restriction applies:</p>
<ul>
<li>APIs cannot be used if DFTACTGRP(*YES) is specified on the CRTBNDRPG CL
command. ILE static binding is not available when a program is created with
DFTACTGRP(*YES). This means that your program cannot contain a CALLB operation.
(Also, you cannot use the BNDDIR or ACTGRP parameters when creating this
program.) Specifying DFTACTGRP(*YES) during the creation of an ILE RPG program
means that the program will always run in the default activation group. See the
<a href="../books/sc092507.pdf" target="_blank">WebSphere Development Studio:
ILE RPG Programmer's Guide</a><img src="wbpdf.gif" alt="Link to PDF"> book for
more information about the CRTBNDRPG CL command and the DFTACTGRP parameter.</li>
</ul>
<p>The following descriptions apply to the call syntax shown in the ILE
language examples above:</p>
<dl>
<dt><strong>leawi.h</strong></dt>
<dd>The name of the header file for C prototypes
<p><strong>Note:</strong> Header files used with ILE CEE APIs are in library
QSYSINC. To ensure that these header files are found during compilation,
specify *YES on the SYSINC parameter of the CRTCMOD or CRTBNDC CL commands.
Also ensure that the Openness Includes can be selected as an option under GO
LICPGM during the installation of the i5/OS<SUP>(TM)</SUP> operating system.</p>
</dd>
<dt><strong>CEExxxx</strong></dt>
<dd>The name of the ILE CEE API<br>
<br>
</dd>
<dt><strong>parm1, parm2, ... parm<em>n</em></strong></dt>
<dd>Omissible or required parameters passed to or returned from the called ILE
CEE API. The &amp; character in the syntax for ILE C indicates that the
parameters are explicitly passed by reference.<br>
<br>
</dd>
<dt><strong>fc</strong></dt>
<dd>An omissible feedback code that indicates the result of the ILE CEE API.
The &amp; character in the syntax for ILE C indicates that the parameter is
explicitly passed by reference.</dd>
</dl>
<p>The order in which the parameters are listed in the parameter table for each
ILE CEE API, is the order in which the parameters must be specified. For
example, the following table shows the parameters for the CEEHDLR API:</p>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">1</td>
<td align="left" valign="top" width="40%">procedure</td>
<td align="left" valign="top" width="20%">Input</td>
<td align="left" valign="top" width="30%">HDLR_ENTRY</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">token</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">POINTER</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Omissible Parameter:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">3</td>
<td align="left" valign="top" width="40%">fc</td>
<td align="left" valign="top" width="20%">Output</td>
<td align="left" valign="top" width="30%">FEEDBACK</td>
</tr>
</table>
<br>
</div>
<p>When you call the CEEHDLR API, the first parameter you specify must be <em>
procedure</em> (number 1 in the table), followed by <em>token</em> (number 2 in
the table), and then <em>fc</em> (number 3 in the table).</p>
<br>
<h3>Naming Conventions of the ILE CEE APIs</h3>
<p>Most ILE CEE APIs are available to any HLL that ILE supports. Naming
conventions of the ILE CEE APIs are as follows:</p>
<ul>
<li>Bindable API names starting with CEE are intended to be consistent across
the IBM<SUP>(R)</SUP> systems.</li>
<li>Bindable API names starting with CEE4 are specific to the iSeries<SUP>(TM)</SUP>
system.</li>
</ul>
<p>
For more information about using ILE CEE APIs, see the following sections:
<ul>
<li><a href="ile1a4.htm">Data Type Definitions of ILE CEE</a>&nbsp;
<li><a href="ile1a5.htm">Omitting Parameters in ILE CEE</a>
<li><a href="ile1a6.htm">i5/OS Messages and the ILE CEE API Feedback Code</a>
</ul>
<hr>
<table align="center" cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"ile1a1.htm">ILE CEE APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</body>
</html>