IBM Version 4 manual Appendix B. Original Examples in Additional BLanguages-97

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 375
Image 375

{

printf("File could not be opened\n"); exit(1);

}

error_code.ec_fields.Bytes_Provided = sizeof(error_code_t);

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ /\ Call QUSROBJD to see if the user space was previously cre￿ated in \/

/\ QTEMP. If it was, simply reuse it.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

QUSROBJD(rcvvar,

/\ Receiver variable

\/

rcvlen,

/\ Receiver variable length

\/

rjobd_fmt,

/\ Format

\/

space_name,

/\ User space name and library

\/

space_type,

/\ User object type

\/

&error_code);

/\ Error code

\/

if(error_code.ec_fields.Bytes_Available > ð)

{

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

/\

If a CPF98ð1 error was received, then the user space was no￿t

\/

/\

found.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ if(memcmp(error_code.ec_fields.Exception_Id, "CPF98ð1", 7) == ð￿)

{

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

/\ Create a user space for the list generated by QSYLOBJP. \/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

QUSCRTUS(space_name,

/\ User space name and library

\/

ext_attr,

/\ Extended attribute

\/

space_size,

/\ Size of the user space

\/

&space_init,

/\ Space initialization

\/

space_auth,

/\ Public authority to user space \/

space_text,

/\ User space text

\/

space_rep,

/\ Replace existing user space?

\/

&error_code,

/\ Error Code

\/

space_dmn);

/\ Domain of created user space

\/

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

/\ Check for errors on QUSCRTUS.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ if(error_code.ec_fields.Bytes_Available > ð)

{

memcpy(api_name, "QUSCRTUS ", 1ð); apierr();

}

}

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

/\ An error occurred accessing the user space.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ else

{

memcpy(api_name, "QUSRJOBD ", 1ð); apierr();

}

}

Appendix B. Original Examples in Additional BLanguages-97

Page 375
Image 375
IBM Version 4 manual Appendix B. Original Examples in Additional BLanguages-97