memcpy(exit_pgm_lib,
((Qus_EXTIð2ðð_Entry_t \)rcv_ptr)Program_Library,1ð);
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Resolve to the exit program. If an error occurs on the \/
/\ resolve operation to the library, the rsl_ok indicator is \/
/\ set to failed in the RSL_PGM_HDLR exception handler. \/
/\ The RSLVSP MI instruction signals all errors to this \/
/\ program; therefore, enable the exception handler to \/
/\ capture any errors that may occur. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
#pragma exception_handler (RSLVSP_PGM_HDLR,rsl_ok,ð,_C2_MH_ESCAPE)
exit_pgm_ptr=((Pgm_OS \)rslvsp(_Program,
exit_pgm_name,
exit_pgm_lib,
_AUTH_POINTER));
#pragma disable_handler
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ If the resolve is successful, call the exit program. \/
/\ If not, move on to the next exit program. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
if (rsl_ok)
{
exit_pgm_ptr(info_for_exit_pgm);
}
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Set the receiver variable to point to the next exit program \/
/\ that is returned. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
rsl_ok=1;
rcv_ptr=rcv_var +
((Qus_EXTIð2ðð_Entry_t \)rcv_ptr)Offset_Next_Entry;
}
Registration Facility Using ILE APIs—Examples
Following are the entire program listings for the ILE C programs discussed in the
preceding topics. The programs perform the following tasks:
Register an exit point and add an exit program
Retrieve exit point and exit program information
Remove an exit program and deregister an exit point
These example programs are also shown in additional languages in “Integrated
Language Environment (ILE) APIs—Examples” on page B-47.
Register Exit Point and Add Exit Program—ILE C Example
The following program registers an exit point with the registration facility and adds
an exit program to the exit point.
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ PROGRAM: Register an Exit Point \/
/\ Add an Exit Program \/
/\ \/
/\ LANGUAGE: ILE C \/
Chapter 4. Common Information across APIs—Advanced (ILE) Example 4-9