IBM Version 4 manual Appendix Original Examples in Additional

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 281
Image 281

#include <qusec.h>

/\ Error Code Parameter Include for the APIs \/

#include <qwdrjobd.h> .2/

/\ Retrieve Job Description API Include

\/

#include <qliept.h>

 

 

char received[8];

/\ Used to receive error msgs signaled

\/

 

 

/\ from QWDRJOBD API.

\/

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

/\ Function:

error_handler

 

\/

/\ Description:

This function handles exceptions signalled from the

\/

/\

QWDRJOBD

API.

The message identifier received is

\/

/\

assigned

to the variable 'received'.

\/

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

void error_handler(int dummy)

{

_INTRPT_Hndlr_Parms_T ExcDta = {ð};

_GetExcData(&ExcDta); memcpy(received,ExcDta.Msg_Id,7); signal(SIGALL,error_handler);

}

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

/\ Error Code Structure

\/

/\

\/

/\ This shows how the user can define the variable length po￿rtion of

\/

/\ error code for the exception data.

\/

/\

\/

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

typedef struct {

 

Qus_EC_t

ec_fields;

char

Exception_Data[1ðð];

} error_code_t;

main(int argc, char \argv[] .8/

{

 

error_code_t error_code;

char

qual_job_desc[2ð];

char

\qual_job_ptr = qual_job_desc;

char

rec_var[39ð];

char

hold_value[1ð];

char

command_string[53];

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

/\ Enable error handler.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ signal(SIGALL,error_handler);

memset(hold_value, ' ', 1ð); memset(received, ' ', 7);

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

/\ Make sure

we received the correct

number of parameters. T￿he argc

\/

/\ parameter

will contain

the number

of parameters that was￿ passed

\/

/\

to

this program. This number also

includes the program it￿self,

\/

/\

so

we need to evaluate

argc-1.

 

\/

 

 

 

 

Appendix

B. Original Examples in Additional

BLanguages-3

Page 281
Image 281
IBM Version 4 manual Appendix Original Examples in Additional