ILE C/C++ Programmer's Guide


Figures

  1. Program Creation in ILE
  2. ILE C Source to Add Integers and Print Characters
  3. Structure of Program MYPROG
  4. Example of a Basic Binder Listing
  5. Example of Header File (search.h)
  6. Source File that Contains Constructor Definitions for the Search Class
  7. File that Contains the Member Function Definition for the Search Class
  8. Source Code for myproga.cpp
  9. Calls between Program and Service Program
  10. Display Module Information Screen for a Sample Module SEARCH
  11. Example of a Binder Language Source File
  12. Binder Language Source File Generated for Module SEARCH
  13. Binder Language Source File Generated by the RTVBNDSRC Command
  14. Unresolved Import Requests in a Program with Circular References
  15. m1.cpp -- First Source File for Application with Circular References
  16. m2.cpp -- Second Source Files for Application with Circular References
  17. m3.cpp -- Third Source File for Application with Circular References
  18. Binder Language for Service Program SP1
  19. Binder Language for Service Program SP2
  20. Binder Language for Service Program SP1
  21. Example of Source Code to Create a Dummy C++ Program
  22. Source Code for Example myprog.cpp
  23. Exports from Service Program COST
  24. Import Requests in Programs COSTDPT1 and COSTDPT2
  25. Source Code for Service Program COST
  26. T1520REP -- ILE C Source to Pass Parameters to an ILE C Program
  27. Source File for a Program that Passes the Value 'Hello, World' to Another Program
  28. Calling Program XRUN2 Using the TFRCTL Command
  29. Example of Source Code that Transfers Control to Another Program
  30. Example of Source Code that Receives and Prints a Null-Terminated Character String
  31. Calling Program CALCOST from a User-Defined Command COST
  32. Source Code for Command Prompt that Runs the CALCOST Program
  33. Source Code for Program CALCOST
  34. Running Programs in a Named Activation Group
  35. Running Programs in Unnamed Activation Groups
  36. Running a Service Program in the Activation Groups of Calling Programs
  37. Example of Dynamic Allocation and De-Allocation of Storage for a Class Object
  38. Example of Dynamic Allocation and De-Allocation of Storage for an Array of Objects
  39. T1520XH7 -- ILE C Source for Exception Handling
  40. Example: Using ISO C Record I/O
  41. Example: Using ILE C Record I/O
  42. I/O Feedback Information
  43. Using the System Buffer
  44. Example: Opening a File Twice
  45. Example: Opening a File Once
  46. Using printf()
  47. Using printf() to Reduce Function Calls
  48. Example of a Program that Uses Linked Lists
  49. Example of Source Code that Uses a short Type Member to End a Linked List
  50. Example of Minimizing Padding by Rearranging Variables
  51. Sample Application: High-Level Input/Processing/Output Flow
  52. ILE Activation Group of the Sample Application
  53. DDS Source for Audit File T1520DD1
  54. T1520CL1 -- CL Source to Pass Variables to an ILE C Program
  55. T1520CM1 -- CL Command Source to Receive Input Data
  56. ILE C Source to Call Functions in Other Modules
  57. Sample ILE C Source to Calculate Tax and Format Cost for Output
  58. ILE C Source to Write an Audit Trail
  59. T1520IC4 -- ILE C Source to Export Tax Rate Data
  60. Binder Language Source to Export Tax Rate Data
  61. Binder Language Source to Export write_audit_trail Procedure
  62. Example of ILE C Source Data Definitions
  63. Examples of Using Pointers in Debug Sessions, Screen 1
  64. Examples of Using Pointers in Debug Sessions, Screen 2
  65. Examples of Simple Operations Used in Debug Expressions
  66. Examples of Using Bit Fields in Debug Expressions
  67. Examples of Using Structures and Unions in Debug Expressions
  68. Examples of Using Enumerations in Debug Expressions
  69. System and Space Pointers in ILE C Source Code
  70. Example of System and Space Pointer Display
  71. Module Source Display for DEBUGEX
  72. Module Source Display After Stepping into CPGM
  73. Using EVAL to Change a Variable
  74. Sample EVAL Commands for Pointers, Variables, and Bit Fields
  75. Sample EVAL Commands for C Structures, Unions and Enumerations
  76. Sample EVAL Commands for System and Space Pointers
  77. Sample EVAL Commands for C++ Expressions
  78. Using EVAL with a Class Template
  79. Using EVAL with a Function Template
  80. Source for Sample EVAL Commands
  81. Source for Sample EVAL Commands for Displaying System and Space Pointers
  82. Source for Sample EVAL Commands for Displaying C++ Constructs
  83. iSeries Data Management Records Mapping to an ILE C Stream File
  84. ILE C Source to Open an ILE C Text Stream File
  85. Writing to a Text Stream File
  86. ILE C Source to Write Characters to a Text Stream File
  87. Reading from a Text Stream File
  88. ILE C Source to Read Characters from a Text Stream File
  89. ILE C Source to Open a Binary Stream File
  90. Writing to a Binary Stream File One Character at a Time
  91. ILE C Source to Write Characters to a Binary Stream File
  92. Reading from a Binary Stream File One Character at a Time
  93. ILE C Source to Read Characters from a Binary Stream File
  94. Updating a Binary Stream File with Data Longer than Record Length
  95. ILE C Source to Update a Binary Stream File with Data Longer than the Record Length
  96. Updating a Binary Stream File with Data Shorter than Record Length
  97. ILE C Source to Update a Binary Stream File with Data Shorter than the Record Length
  98. Writing to a Binary Stream File One Record at a Time
  99. ILE C Source to Write to a Binary Stream File by Record
  100. Reading from a Binary Stream File a Record at a Time
  101. ILE C Source to Read from a Binary Stream File by Record
  102. Simple C Program to Clear a C Session
  103. T1520API -- ILE C Source to Call an ILE C Procedure
  104. The Integrated File System Interface
  105. Comparison of a Stream File and a Record-Oriented File
  106. iSeries Records Mapping to a C/C++ Stream File
  107. Comparison of Text Stream and Binary Stream Contents
  108. Header Description
  109. T1520DD8 -- DDS Source for Customer Records
  110. T1520EDF -- ILE C Source to Include an Externally Described Database File
  111. Ouput Listing from Program T1520EDF -- Customer Master Record
  112. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX(*OBJ)
  113. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX(*NONE)
  114. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX value *MYPREFIX
  115. ILE C Source Using the #pragma mapinc lvlchk Option
  116. T1520DD3 -- DDS Source for Program
  117. Ouput Listing from the Program
  118. DDS Source for a Display File
  119. Structure Definition for a Display File
  120. DDS Source for a Device File
  121. Structure Definitions for a Device File
  122. DDS Source for Indicators
  123. Structure Definition for Indicators
  124. Header Description Showing Comments for Indicators
  125. Structure Definition for Multiple Formats
  126. Structure Definitions for a Device File
  127. Structure Definitions for BOTH Option
  128. T1520ASP -- ILE C Source to Process a Database Record File in Arrival Sequence
  129. T1520DD3 -- DDS Source for Database Records
  130. T1520KSP -- ILE C Source to Process a Database Record File in Keyed Sequence
  131. T1520DD4 -- DDS Source for Database Records
  132. T1520REC -- ILE C Source to Process a Database File Using Record I/O Functions
  133. T1520DD5 -- DDS Source for Daily Transactions
  134. T1520DD6 -- DDS Source for Monthly Transactions
  135. T1520DD7 -- DDS Source for a Purchase Order Display
  136. T1520COM -- ILE C Source to Group File Operations Using Commitment Control
  137. T1520DD0 -- DDS Source for a Phone Book Display
  138. T1520ID2 -- ILE C Source to Specify Indicators in a Separate Indicator Area
  139. T1520DD9 -- DDS Source for a Phone Book Display
  140. T1520ID1 -- ILE C Source to Specify Indicators as Part of the File Buffer
  141. T1520DDD -- DDS Source for an I/O Display
  142. T1520DEV -- ILE C Source to Establish a Default Device
  143. T1520DDE -- DDS Source for Name and Password Display
  144. T1520CDV -- ILE C Source to Change the Default Device
  145. T1520DDF -- DDS Source for a Feedback Display
  146. T1520FBK -- ILE C Source to Use Feedback Information
  147. T1520DDG -- DDS Source for a Subfile Display
  148. T1520SUB -- ILE C Source to Use Subfiles
  149. T1520DDA -- DDS Source for Password and User ID
  150. T1520DDB -- DDS Source to Send Password and User ID
  151. T1520DDC -- DDS Source to Receive Password and User ID
  152. T1520ICF -- ILE C Source to Send and Receive Data
  153. T1520TGT -- ILE C Source to Check Data is Sent and Returned
  154. T1520FCF -- ILE C Source to Use First Character Forms Control
  155. Sample Source Statements for Program T1520TAP
  156. T1520TAP -- ILE C Source to Write to a Tape File
  157. T1520DSK -- ILE C Source to Write Records to a Diskette File
  158. Error Handling for OPM and ILE
  159. ILE C Source Code with Unhandled Exceptions
  160. ILE C Source to Check for the Return Value of fopen()
  161. ILE C Source to Check the errno Value for fopen()
  162. _C_Maj_Min_rc Type Definition
  163. _RIOFB_T Type Definition
  164. _Sys_Struct_T Type Definition
  165. _Maj_Min_rc_T Type Definition
  166. Definition of Structure _INTRPT_Hndlr_Parms_T
  167. ILE C Source to Scope Direct Monitor Handlers
  168. ILE C Source to Use Exception Classes
  169. ILE C Source to Handle Exceptions
  170. T1520XH1 -- ILE C Source to Use Direct Monitor Handlers -- main()
  171. T1520ICA -- ILE C Source that Uses Direct Monitor Handlers
  172. T1520XH2 -- ILE C Source to Use Direct Monitor Handlers -- Service Program
  173. T1520XH3 -- ILE C Source to Use Direct Monitors with Labels as Handlers
  174. T1520XH5 -- ILE C Source to Use ILE Condition Handlers -- main()
  175. T1520XH6 -- ILE C Source to Use ILE Condition Handlers -- Service Program
  176. T1520IC6 -- ILE C Source to Use ILE Condition Handlers
  177. T1520IC7 -- ILE C Source to Percolate a Message to Handle a Condition
  178. T1520IC8 -- ILE C Source to Promote a Message to Handle a Condition
  179. ILE C Source to Manage the State of a Signal Handler
  180. Resetting Signal Handlers
  181. Stacking Signal Handlers
  182. T1520SIG -- ILE C Source that Sets Up Signal Handlers
  183. Exception Handler Priority
  184. ILE C Source to Nest Exceptions
  185. T1520XH4 -- ILE C Source that Uses Cancel Handlers
  186. T1520DDJ -- DDS Source for a Phone Book Display
  187. T1520EHD -- ILE C Source to Handle Exceptions
  188. ILE C Source to Declare Pointer Variables
  189. ILE C++ Source to Declare Pointer Variables
  190. ILE C Source to Declare a Pointer to a Bound Procedure
  191. ILE C Source to Declare a Pointer to an iSeries Program as a Function Pointer
  192. ILE C++ Source to Declare a Pointer to an iSeries Program as a Function Pointer
  193. ILE C Source to Show OS/400 pointer casting
  194. T1520DL8 -- ILE C Source that Uses OS/400 pointers
  195. T1520DL9 -- ILE C Source that Uses OS/400 pointers
  196. Program and Procedure Calls on the Call Stack
  197. Example of Using the #pragma map Directive to Rename Functions
  198. An ILE C++ Function Declared As an External Function
  199. C++ Source File hourclas.cpp Definitions Used by C Source File hour.c
  200. C Source file hour.c that Uses Definitions from C++ Source File hourclas.cpp
  201. Example of a Shared C/C++ Header File
  202. Example of C++ Class without Virtual Functions
  203. Example of C Structure that Corresponds to C++ Class without Virtual Functions
  204. C++ Source File hourclas.cpp that Contains Classes Used by C Source File hour.c
  205. C Source File hour.c that Uses C++ Classes Defined in Source File hourclas.cpp
  206. Example of ILE C Structure Definition that Cannot Be Ported to ILE C++
  207. Example of Code with Decimal Constants and a Case Statement that Are Incompatible
  208. Example of ILE C Source Code Using the extern Linkage Specification
  209. Example of ILE C Source Code Using the #pragma argument Linkage Specification
  210. Example of ILE C++ Source Code Using the extern Linkage Specification
  211. BCD Macros that Port Code from ILE C to ILE C++
  212. ILE C Source Code to Port Code to a Packed Decimal Data Type
  213. ILE C++ Source Code to Port Code a Packed Decimal Data Type
  214. Example of Using BCD Macros to Port Code to ILE C++
  215. BCD Macros that Map C++ Class Template Instantiations to ILE C Syntax
  216. Example of Code that Determines the Number of Digits in a Packed Decimal Data Type.
  217. Example of Code that Determines the Number of Digits in a _DecimalT Class Template Object
  218. Example of Code that Determines the Number of Decimal Digits in an Internal Packed Decimal Data Object
  219. Example of Code that Determines the Number of Decimal Digits in an Internal _DecimalT Class Object
  220. Example of a Conditional Expression that Fails because of Class Differences
  221. Example of an Explicit Cast that Resolves Class Differences between Expressions
  222. Example of Use of a Consistent Variable Type
  223. ILE C Code that Uses Packed Decimal Data Types
  224. ILE C++ Code that Uses the _DecimalT Class Template Instead of the C Packed Decimal Data Types
  225. Example of a Single Set of Dual Prototypes that Allow a Header File to be Used by Both ILE C and ILE C++
  226. Example of Multiple Sets of Dual Prototypes that Allow a Header File to be Used by Both ILE C and ILE C++
  227. Example of Construct that Permits ILE C Programs to Access C++ LInkage Functions
  228. Example of #pragma enum Directive that Resolves Data Type Size Issues
  229. Example of Type Mismatch
  230. Code that Declares an unsigned char Pointer as an unsigned char Variable
  231. Example of Code Ported to ILE that Results in an Uncaught Exception
  232. ILE C++ Procedures Cannot Call Active ILE COBOL Procedures
  233. Example of Using the #pragma linkage(PGMNAME, OS) Directive to Retrieve Returned Function Results
  234. ILE C Source to Call a Function with Operational Descriptors
  235. Type Cast to Override a Function without Overriding Linkage
  236. ILE Structure
  237. Basic Object Structure
  238. Example of the Interlanguage Call Capabilities of an ILE C++ Program
  239. C++ Source Code T2123ICC that Exports a Variable for Use by ILE COBOL and ILE RPG Procedures
  240. T2123CB2
  241. ILE RPG Module T2123RP2
  242. SQUARE -- CL Command Source to Receive Input Data
  243. SQITF -- ILE C Source to Pass an Argument by Value
  244. SQ -- ILE C Source to Perform Calculations and Return a Value
  245. User-Defined CL Command SQUARE that Calculates the Square of a Specified Number
  246. Example of CL Program that Passes Arguments to an ILE C++ Program
  247. Example of Generic CL Command Prompt
  248. Example of C++ Program that Receives Arguments (Pointers) by Reference
  249. ILE C Source to Determine the String Arguments in a Function
  250. ILE C Source that Declares a Function that Requires Operational Descriptors
  251. ILE C Source to Generate Operational Descriptors
  252. OPM CL Example: Basic Program Structure
  253. Structure of the Program in ILE C
  254. T1520DD2 -- DDS Source for an Audit File
  255. T1520CL2 -- CL Source to Pass Variables to an ILE C Program
  256. T1520CM2 -- CL Command Source to Receive Input Data
  257. T1520IC5 -- ILE C Source to Call COBOL AND RPG
  258. T1520CB1 -- OPM COBOL Source to Calculate Tax and Format Cost
  259. T1520RP1 -- OPM RPG Source to Write the Audit Trail
  260. Basic Object Structure
  261. Integrated Language Environment Structure
  262. T1520DD2 -- Source to Create Physical Files
  263. T1520CL3 -- ILE CL Source to Pass Variables to an ILE C Program
  264. T1520CM2 -- Source to Create a CL Command Prompt
  265. T1520ICB -- ILE C Source to Call COBOL and RPG Procedures
  266. T1520ICC -- Source Code to Export Tax Rate Data
  267. T1520CB2 -- ILE COBOL Source to Calculate Tax and Format Cost
  268. T1520RP2 -- ILE RPG Source to Write the Audit Trail
  269. ILE-OPM CL Example: Basic Program Structure
  270. Structure of the Program in ILE C++
  271. ILE C Source to Convert Packed Decimals
  272. ILE C Source to Convert a Packed Decimal to a Packed Decimal with Smaller Precision
  273. ILE C Source to Convert a Packed Decimal to a Packed Decimal with Smaller Integral Part
  274. ILE C Source to Convert a Packed Decimal to a Packed Decimal with Smaller Integral Part and Smaller Precision
  275. ILE C Source to Convert a Packed Decimal with a Fractional Part to an Integer
  276. ILE C Source to Convert a Packed Decimal with Less than 10 Digits in the Integral Part to an Integer
  277. ILE C Source to Convert a Packed Decimal with More than 10 Digits in the Integral Part to an Integer
  278. ILE C Source to Convert a Packed Decimal with More than 10 Digits in Both Parts to an Integer
  279. ILE C Source to Convert a Packed Decimal to a Floating Point
  280. ILE C Source to Pass Packed Decimal Variable to a Function
  281. ILE C Source to Pass a Pointer to a Packed Decimal Value to a Function
  282. ILE C Source for an ILE C Program that Passes Packed Decimal Data
  283. COBOL Source that Receives Packed Decimal Data from an ILE C Program
  284. ILE C Source to Use the va_arg Macro with a Packed Decimal Data Type
  285. ILE C Source to Write Packed Decimal Constants to a File and Scan Them Back
  286. ILE C Source to Print Packed Decimal Constants
  287. Packed Decimal Warnings and Error Conditions
  288. ILE C Source to Suppress a Run-Time Exception
  289. Example: Arithmetic Operators for the _DecimalT Class Template
  290. Example: Relational Operators and the _DecimalT Class Template
  291. Example: Conditional Operators and the _DecimalT Class Template
  292. Example: Equality Operators and the _DecimalT Class Template
  293. Example: Unary Operators and the _DecimalT Class Template
  294. Example of Converting a Value from One _DecimalT Class Template to Another
  295. Example of Conversion from One _DecimalT Class Template to Another with Smaller Precision
  296. Example of Conversion from One _DecimalT Class Template to Another with a Smaller Integral Part
  297. Example of Conversion from One _DecimalT Class Template to Another with a Smaller Integral Part and Smaller Precision
  298. Example of Converting an Integer Type to a _DecimalT Class Template with a Fractional Part
  299. Example of Converting an Integer Type to a _DecimalT Class Template with Less than 10 Digits in the Integral Part
  300. Example of Converting to an Integer Type from a _DecimalT Class Template with More than 10 Digits in the Integral Part
  301. Example of Converting to an Integer Type from a _DecimalT Class Template with a Fractional Part, and with an Integral Part that Has More than 10 Digits
  302. Example of Converting a _DecimalT Class Template to a Floating Point Data Type
  303. Example of Determining the Total Number of Bytes Occupied by a _DecimalT Class Template
  304. Example of Determining the Number of Digits in a _DecimalT Class Template
  305. Example of Determining the Number of Decimal Digits p of a _DecimalT Class Template
  306. _DecimalT Class Template Run-Time Exceptions
  307. Run-Time Exceptions Issued by the Compiler for _DecimalT Class Templates
  308. Example of Using the C++ Try Catch Throw Feature to Handle a _DecimalT Class Template Exception
  309. Commands to Enable Error Checking within the _DecimalT Class Template at Compile Time
  310. Commands to Disable Error Checking within the _DecimalT Class Template at Compile Time
  311. Example of Passing a _DecimalT Class Template Object to a Function
  312. Example of Passing a Pointer to a _DecimalT Class Template Object
  313. Example of Calling an ILE COBOL Program from an ILE C++ Program and Passing a _DecimalT Class Template
  314. Example of Writing _DecimalT Class Template Constants to a File
  315. Example of Writing _DecimalT Class Template Constants to a File Using the ofstream Class
  316. Example of Class Template Instantiation
  317. Example of C++ Code that Works with or without the TEMPINC Option
  318. Example of a Constructor Function that Is Defined Inline
  319. Example of a Constructor Function that Is Defined Externally
  320. Example of All Instances of a Class Defined in a Single Compilation Unit
  321. Example of Class Definitions Used in Template Arguments Also Contained in Source Code (Does Not Compile Properly)
  322. Example of Template-Implementation File
  323. A Typical tempinc File
  324. Example of a Forward Declaration Based on the LLP64 Data Model
  325. Example of Source Code that Redefines the Global new and delete Operators
  326. Example of a Template that Adopts the Data Model in Effect When the Template Is Declared
  327. ILE Source to Cast a Pointer to a Derived Class to Use a Detail that Is Otherwise Unavailable
  328. ILE Source to Get a Pointer to a Derived Class to Use a Member Function in Specified Calculations Only
  329. ILE Source to Get a Pointer to a Derived Class Using Reference Casts
  330. Examples of typeid operator in Expressions
  331. Examples of typeid operators
  332. ILE Source Showing extended_type_info Class Types
  333. Source File CCSID Conversion
  334. T1520CCS -- ILE C Source to Convert Strings and Literals


[ Top of Page | Previous Page | Next Page | Table of Contents ]