IBM Version 4 manual Api, Exit Point Example

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 101
Image 101

int main()

{

int ccsid, pgm_num, num_of_attrs, epgm_num, len_epgm_data, add_epgm_num, \ccsid_ptr, \pgm_num_ptr;

error_code_struct error_code; rgpt_controls control_keys; addep_attributes attrib_keys;

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ /\ Register the exit point with the registration facility. ￿If the \/

/\

registration of the

exit point is successful, add an exit￿

\/

/\

program to the exit

point.

\/

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

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

/\ Initialize the error code parameter.

To

signal exceptions

to

\/

/\

this program

by the API, you need

to

set

the bytes provided￿

\/

/\

field of the

error code to zero.

Because this program has

 

\/

/\ exceptions sent back through the error code parameter, i￿t sets \/

/\

the

bytes provided field to the number of bytes that it gi￿ves

\/

/\

the

API for the parameter.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ error_code.ec_fields.Bytes_Provided=sizeof(error_code_str￿uct);

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

/\ Set

the

exit point controls. Each control field is passed￿ to

\/

/\

the

API

using a variable length record. Each record must

\/

/\

start on a 4-byte boundary.

\/

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

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

/\ Set

the total

number of

controls that are

being specifie￿d on

\/

/\

the

call. This program

lets the

API take

the default for the

\/

/\

controls that

are not specified.

 

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ control_keys.num_rec=2;

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

/\ Set the values for the two controls

that are specified:

\/

/\

Maximum number of exit programs =

\/

/\

Exit point text description

=

"EXIT POINT EXAMPLE"

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ control_keys.max_pgms_rec.Length_Vlen_Record=16; control_keys.max_pgms_rec.Control_Key=3; control_keys.max_pgms_rec.Length_Data=4; control_keys.max_pgms=1ð;

control_keys.descrip_rec.Length_Vlen_Record=62;

 

control_keys.descrip_rec.Control_Key=8;

 

control_keys.descrip_rec.Length_Data=5ð;

 

memcpy(control_keys.text_desc,

 

"EXIT POINT EXAMPLE

",5ð);

Chapter 4. Common Information across

APIs—Advanced (ILE)4-11Example

Page 101
Image 101
IBM Version 4 manual Api, Exit Point Example