ibm-information-center/dist/eclipse/plugins/i5OS.ic.apiref_5.4.0.1/ileRemoveILEC.htm

157 lines
8.3 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Example in ILE C: Remove exit program and deregister exit point" />
<meta name="abstract" content="This program removes an exit program and deregisters an exit point from the registration facility." />
<meta name="description" content="This program removes an exit program and deregisters an exit point from the registration facility." />
<meta name="DC.Relation" scheme="URI" content="ileScenario.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="ileRemoveILEC" />
<meta name="DC.Language" content="en-us" />
<!-- 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Example in ILE C: Remove exit program and deregister exit point</title>
</head>
<body id="ileRemoveILEC"><a name="ileRemoveILEC"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example in ILE C: Remove exit program and deregister exit point</h1>
<div><p>This program removes an exit program and deregisters an exit point
from the registration facility.</p>
<div class="section"><div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm">Code license and disclaimer information</a> for important
legal information.</div>
<pre>/********************************************************************/
/* PROGRAM: Remove an Exit Program */
/* Deregister an Exit Point */
/* */
/* LANGUAGE: ILE C */
/* */
/* DESCRIPTION: This program removes an exit program and */
/* deregisters an exit point from the registration */
/* facility. */
/* */
/* APIs USED: QusRemoveExitProgram - Remove Exit Program */
/* QusDeregisterExitPoint - Deregister Exit Point */
/* */
/********************************************************************/
/* NOTE: This example uses APIs that are shipped with *EXCLUDE */
/* authority. The user needs *USE authority to the service */
/* program QUSRGFA1 to use these APIs. */
/********************************************************************/
/********************************************************************/
/* Includes */
/********************************************************************/
#include &lt;stdio.h&gt;
#include &lt;signal.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;qusrgfa1.h&gt;
#include &lt;qusec.h&gt;
#include &lt;qliept.h&gt;
/********************************************************************/
/* Structures */
/********************************************************************/
typedef struct { /* Error code */
Qus_EC_t ec_fields;
char exception_data[100];
} error_code_struct;
/********************************************************************/
/* */
/* main */
/* */
/********************************************************************/
int main()
{
int pgm_num=1;
error_code_struct error_code;
/******************************************************************/
/* Remove an exit program from the exit point and then deregister */
/* the exit point. It is not necessary to remove exit programs */
/* from an exit point before deregistering the exit point. It is */
/* done here only for illustration purposes. */
/******************************************************************/
/******************************************************************/
/* Initialize the error code parameter. To have exceptions */
/* signaled to this program by the API, set the bytes provided */
/* field of the code to zero. This program has exceptions sent */
/* through the error code parameter; therefore, the bytes */
/* provided field is set to the number of bytes that this program */
/* gives the API for the parameter. */
/******************************************************************/
error_code.ec_fields.Bytes_Provided=sizeof(error_code_struct);
/******************************************************************/
/* Call the API to remove the exit program. */
/******************************************************************/
QusRemoveExitProgram("EXAMPLE_EXIT_POINT ",
"EXMP0100",
pgm_num,
&amp;error_code);
/******************************************************************/
/* If an exception occurs, the API returns the exception in the */
/* error code parameter. The bytes available field is set to */
/* zero if no exception occurs and nonzero if an exception does */
/* occur. */
/******************************************************************/
if (error_code.ec_fields.Bytes_Available != 0)
{
printf("ATTEMPT TO REMOVE EXIT PROGRAM FAILED WITH EXCEPTION: %.7s",
error_code.ec_fields.Exception_Id);
exit(1);
}
/******************************************************************/
/* If the call to remove the exit program is successful, */
/* deregister the exit point. */
/******************************************************************/
/******************************************************************/
/* Call the API to add the exit program. */
/******************************************************************/
QusDeregisterExitPoint("EXAMPLE_EXIT_POINT ",
"EXMP0100",
&amp;error_code);
/******************************************************************/
/* If an exception occurs, the API returns the exception in the */
/* error code parameter. The bytes available field is set to */
/* zero if no exception occurs and nonzero if an exception does */
/* occur. */
/******************************************************************/
if (error_code.ec_fields.Bytes_Available != 0)
{
printf("ATTEMPT TO DEREGISTER EXIT POINT FAILED WITH EXCEPTION: %.7s",
error_code.ec_fields.Exception_Id);
exit(1);
}
} /* End program */</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ileScenario.htm" title="The example APIs in this section represent two general functions of APIs--change and retrieve.">Scenario: Integrated Language Environment (ILE) APIs</a></div>
</div>
</div>
</body>
</html>