Security APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
Software Product APIs .............................. 8-20
UNIX-Type APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
User Interface APIs ................................ 8-27
Virtual Terminal APIs ............................... 8-28
Work Management APIs ............................. 8-28
Work Station Support APIs ............................ 8-28
Miscellaneous APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
Chapter 9. Common API Programming Errors ................. 9-1
Using the Error Code Parameter ........................... 9-2
Using the Error Code Parameter—Example of Incorrect Coding ....... 9-2
Using the Error Code Parameter—Example of Correct Coding ........ 9-3
Defining Data Structures ............................... 9-5
Defining a Data Structure—Example of Incorrect Coding ........... 9-5
Defining A Data Structure—Example of Correct Coding ............ 9-7
Defining Receiver Variables ............................. 9-10
Defining Receiver Variables—Example of Incorrect Coding ......... 9-10
Defining Receiver Variables—Example of Correct Coding .......... 9-12
Defining List Entry Format Lengths ........................ 9-14
Defining List Entry Format Lengths—Example of Incorrect Coding ..... 9-14
Defining List Entry Format Lengths—Example of Correct Coding ..... 9-16
Using Null Pointers with OPM APIs ........................ 9-18
Using Null Pointers with OPM APIs—Example of Incorrect Coding .... 9-18
Using Null Pointers with OPM APIs—Example of Correct Coding ..... 9-19
Defining Byte Alignment ............................... 9-22
Defining Byte Alignment—Example of Incorrect Coding ........... 9-22
Defining Byte Alignment—Example of Correct Coding ............ 9-25
Using Offsets in a User Space ........................... 9-27
Using Offsets in a User Space—Example of Incorrect Coding ....... 9-27
Using Offsets in a User Space—Example of Correct Coding ........ 9-31
Coding for New Function .............................. 9-36
Coding for New Function—Example of Incorrect Coding .......... 9-36
Coding for New Function—Example of Correct Coding ........... 9-43
Appendix A. Performing Tasks Using APIs—Examples .......... A-1
Packaging Your Own Software Products ..................... A-1
Retrieving a File Description to a User Space—ILE C Example ........ A-11
Using Data Queues versus User Queues ..................... A-15
Data Queue—ILE C Example .......................... A-16
User Queue—ILE C Example .......................... A-17
Appendix B. Original Examples in Additional Languages ......... B-1
Original Program Model (OPM) APIs—Examples ................ B-2
Retrieving the Hold Parameter (Exception Message)—ILE C Example .. B-2
Retrieving the Hold Parameter (Exception Message)—ILE COBOL Example B-4
Retrieving the Hold Parameter (Exception Message)—ILE RPG Example B-6
Handling Error Conditions—ILE RPG Example ................ B-8
Retrieving the Hold Parameter (Error Code Structure)—ILE C Example . B-10
Retrieving the Hold Parameter (Error Code Structure)—ILE COBOL
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-12
Retrieving the Hold Parameter (Error Code Structure)—ILE RPG Example B-14
Accessing the HOLD Attribute—ILE C Example ............... B-16
Accessing the HOLD Attribute—ILE COBOL Example ............ B-18
vi System API Programming V4R1