/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\Structures\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ typedef struct {

void

\parm1;

void

\parm2;

char

\pgm_name;

int

pgm_name_size;

} ffdc_info_t;

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\Prototypes\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ void UNEXPECTED_HDLR(_INTRPT_Hndlr_Parms_T \);

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

FUNCTION NAME:

main

\/

/\

 

 

\/

/\

FUNCTION:

Generates exception and then passes control

\/

/\

 

to exception handler.

\/

/\

 

 

\/

/\

INPUT:

Two character strings.

\/

/\

 

 

\/

/\

OUTPUT:

NONE

\/

/\

 

 

\/

/\

EXCEPTIONS:

CPFxxxx - All unexpected CPF exceptions

\/

/\

 

MCHxxxx - All unexpected MCH exceptions

\/

/\

 

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ void main(int argc, char \argv[])

{

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ NOTE:

argv will contain the parameters passed in to this

\/

/\

function. In this case, two parameters are passed

\/

/\

in.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ The argv parameter contains the parameters that

were pas￿sed as

\/

/\

character arrays. argv[ð] contains the program

name, and the

\/

/\

parameter(s) starts with argv[1].

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

char

\nulptr;

/\

Pointer

used

to generate

error

\/

char

pgm_name[3ð];

/\

Program

name

 

 

\/

volatile ffdc_info_t ffdc_info; /\

FFDC info for unexpected

e￿rror

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Set up FFDC information for unexpected error.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ ffdc_info.parm1 = argv[1];

ffdc_info.parm2 = argv[2]; ffdc_info.pgm_name = pgm_name; memcpy(pgm_name, argv[ð], strlen(argv[ð])); ffdc_info.pgm_name_size = strlen(argv[ð]);

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

Enable the exception handler, and pass ffdc_info

into

the￿

\/

/\

exception handler via the communications area so

that

da￿ta

\/

Chapter 6. Original Program Model (OPM) and Integrated Language Environment (ILE)6-3Difference

Page 131
Image 131
IBM Version 4 manual Function, Output None Exceptions