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

194 lines
6.5 KiB
HTML

<!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">
<!-- 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 -->
<!-- Created by Therese Dalton on 17 July 2001 -->
<!--File edited for Tidy July 2001 -->
<!-- Edited by Kersten Jan 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
<title>EimRC - EIM Return Code Parameter</title>
</head>
<body>
<!--Java sync-link-->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top"></a>
<h2>EimRC--EIM Return Code
Parameter</h2>
<p>All EIM APIs return an errno. If the EimRC parameter is not NULL, this EIM
return code structure contains additional information about the error that was
returned. It can be used to get a text description of the error.</p>
<p>The layout for EimRC follows:</p>
<pre>
typedef struct EimRC {
unsigned int memoryProvidedByCaller; /* Input: Size of the entire RC
structure. This is filled in by
the caller. This is used to tell
the API how much space was provided
for substitution text */
unsigned int memoryRequiredToReturnData;/* Output: Filled in by API
to tell caller how much data could
have been returned. Caller can then
determine if the caller provided
enough space (that is, if the
entire substitution string was
able to be copied to this
structure. */
int returnCode; /* Same as the errno returned as the
rc for the API */
int messageCatalogSetNbr; /* Message catalog set number */
int messageCatalogMessageID; /* Message catalog message id */
int ldapError; /* ldap error, if available */
int sslError; /* ssl error, if available */
char reserved[16]; /* Reserved for future use */
unsigned int substitutionTextLength; /* Length of substitution text
excluding a null-terminator which
may or may not be present */
char substitutionText[1]; /* further info describing the
error. */
} EimRC;
</pre>
<br>
<h3><a name="Header_41">Field Descriptions</a></h3>
<dl>
<dt><strong>memoryProvidedByCaller</strong></dt>
<dd>(Input) The number of bytes the calling application provides for the error
code. The number of bytes provided must be 48, or more than 48.<br>
<br>
</dd>
<dt><strong>memoryRequiredToReturnData</strong></dt>
<dd>(Output) The length of the error information available to the API to
return, in bytes. If this is 0, no error was detected and none of the fields
that follow this field in the structure are changed.<br>
<br>
</dd>
<dt><strong>returnCode</strong></dt>
<dd>(Output) The errno returned for this API. This is the same as the return
value for each API.<br>
<br>
</dd>
<dt><strong>messageCatalogSetNbr</strong></dt>
<dd>(Output) The message set number for the EIM catalog. This can be used with
the messageCatalogID to get the error message text.<br>
<br>
</dd>
<dt><strong>messageCatalogMessageID</strong></dt>
<dd>(Output) The message ID number for the EIM catalog. This can be used with
the messageCatalogSetNbr to get the error message text.<br>
<br>
</dd>
<dt><strong>reserved</strong></dt>
<dd>(Output) Reserved for future use.<br>
<br>
</dd>
<dt><strong>substitutionTextLength</strong></dt>
<dd>(Output) This field is set if any substitution text is returned. If there
is no substitution text, this field is zero.<br>
<br>
</dd>
<dt><strong>substitutionText</strong></dt>
<dd>(Output) Message substitution text.</dd>
</dl>
<br>
<!-- ============================================================== -->
<!-- -->
<!-- E X A M P L E -->
<!-- -->
<!-- ============================================================== -->
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following example shows how to retrieve the message text from the
message catalog.</p>
<pre>
#include &lt;nl_types.h&gt;
#include &lt;eim.h&gt;
char * getError(EimRC * eimrc)
{
nl_catd catd;
char * catmsg;
char * msg = NULL;
catd = catopen("/QIBM/PRODDATA/OS400/MRI2924/EIM/EIM.CAT", 0);
if (NULL == catd)
return NULL;
catmsg = catgets(catd,
eimrc-&gt;messageCatalogSetNbr,
eimrc-&gt;messageCatalogMessageID,
strerror(eimrc-&gt;returnCode));
if (catmsg)
{
msg = (char *)malloc(strlen(catmsg)+
eimrc-&gt;substitutionTextLength+1);
if (0 == eimrc-&gt;substitutionTextLength)
sprintf(msg,catmsg);
else
sprintf(msg, catmsg, eimrc-&gt;substitutionText);
}
catclose(catd);
return msg;
}
</pre>
<p><strong>Note:</strong> To use the message catalog support in nl_types.h,
you must compile the parts with LOCALETYPE(*LOCALE) and SYSIFCOPT(*IFSIO).</p>
<br>
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#top">Top</a> | <a href=
"sec.htm">Security APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>