ILE C/C++ Programmer's Guide

How the ILE Call Stack Is Used to Control Program Flow

The call stack is a list of call stack entries, in a last-in-first-out (LIFO) order. A call stack entry is a call to a program or procedure. There is one call stack per job.

When an ILE program is called, the program entry procedure is first added to the call stack. After the program entry procedure is called, control is given to the main entry point in the program (main() for C or C++) which is pushed onto the stack.

Figure 196 shows a call stack for an program consisting of an OPM program which calls an ILE program consisting of two modules: a C++ module containing the program entry procedure and the associated user entry procedure, and a C module containing a regular procedure. The most recent entry is at the bottom of the stack.

Figure 196. Program and Procedure Calls on the Call Stack



ileprpr
Note:
In a dynamic program call, the calls to the program entry procedure and the user entry procedure (UEP) occur together, because the call to the UEP is automatic. In later diagrams involving the call stack, the two steps of a dynamic program call are combined.

For more information about the call stack, see ILE Concepts, SC41-5606-07.


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