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_ES￿CAPE)

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 progr￿am \/

/\ 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 discu 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 “Integ 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 fa

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)4-9Example

Page 99
Image 99
IBM Version 4 manual Registration Facility Using ILE APIs-Examples, Add Exit Program-ILE, Ile C