IBM Version 4 manual Information retrieved

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 105
Image 105

/\

FUNCTION :

This function calls the exit programs that

\/

/\

 

were retrieved from the registration facility

\/

/\

 

repository.

\/

/\

 

 

\/

/\

INPUT:

Information retrieved

\/

/\

 

 

\/

/\

OUTPUT:

NONE

\/

/\

 

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ void Call_Exit_Program(char \rcv_var)

{

int num_exit_pgms, i;

char exit_pgm_name[1ð], exit_pgm_lib[1ð], info_for_exit_pgm[1ð], \rcv_ptr;

volatile int rsl_ok; Pgm_OS \exit_pgm_ptr;

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ /\ Save the number of exit programs returned and set the poi￿nter \/

/\ to point to the first exit program entry.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ rcv_ptr=rcv_var;

num_exit_pgms=((Qus_EXTIð2ðð_t \)rcv_ptr)→Number_Programs_Returned; rcv_ptr += ((Qus_EXTIð2ðð_t \)rcv_ptr)→Offset_Program_Entry; rsl_ok=1;

for (i=ð; i<num_exit_pgms; i++)

{

memcpy(exit_pgm_name,

((Qus_EXTIð2ðð_Entry_t \)rcv_ptr)→Program_Name,1ð); 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 capt￿ure

\/

/\ 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 operation is successful, call the exit

\/

/\

program. If not, move on to the next exit program.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ if (rsl_ok)

{

Chapter 4. Common Information across APIs—Advanced (ILE)4-15Example

Page 105
Image 105
IBM Version 4 manual Information retrieved