/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ 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 passed 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[]; /\ Program name \/
volatile ffdc_info_t ffdc_info; /\ FFDC info for unexpected error \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ 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 data \/
Chapter 6. Original Program Model (OPM) and Integrated Language Environment (ILE) Differences 6-3