Event code 14 — Main routine invocation event
Purpose
This event is called in both CICS® and non-CICS environments to allow the member language to invoke the main program and handle normal return from the main program. This event allows member languages to apply language-specific semantics for main programs in cases where the language library does not gain control before Language Environment during initialization. This occurs in non-CICS environments when the environment is initialized by CELQSTRT, and is always the case in CICS environments.
Syntax (64-bit)
int32_t CELQVnnn (14, void **mainaddr, void
**mainopts, void **apal, int64_t
apal_len, void **altentryaddr, void
**XPLINKenvaddr)
POINTER *mainaddr;
POINTER *mainopts;
POINTER *apal;
int64_t *apal_len;
POINTER *altentryaddr;
POINTER *XPLINKenvaddr;
- mainaddr (input)
- The address of the main routine found either in CELQMAIN when CELQSTRT entered directly, or the PIPI table address when initialized through CELQPIPI (init_main).
- mainopts (input)
- The main options word from the INPL.
- apal (input)
- The R1 value to be passed to the main routine. When CELQSTRT is executed directly, this is determined by either the call to CEEBPLST, the PLIST manipulation CWI, or CEEEDBDEFPLPTR field in the EDB. When starting execution from a CELQPIPI (call_main) function, this is the parm_pointer in the CELQPIPI parameter list.
- apal_len (input)
- The doubleword length of the parameter list to be passed to the main routine.
- altentryaddr (input)
- An alternative entry address branched to if available. No assumptions can be made about the format of this entry point. Any initialization the event handler needs to accomplish before branching to this address must still be performed using the mainaddr parameter. If an alternative entry address is not available, this parameter is NULL.
- XPLINKenvaddr (input)
- The address of the XPLINK-compiled main program's environment.
Usage notes
- This event is called in both CICS and non-CICS environments.
- Language Environment allocates a DSA in order to call the MAIN routine.
- The member event handler must copy the parameter list into its own DSA and load registers 1, 2 and 3 before calling the MAIN routine.
- When control returns from this event, Language Environment performs termination activities similar CEETREN.
- This call is made for CICS when the invoke parameter of the Enclave Initialization event (see Event code 18 — enclave initialization event) was set to 1 by the language event handler for the language of the main, or when the maininv_on flag in INPL word 7 is set.
- This call is made for non-CICS when the maininv_on flag in INPL word 7 is set.
- Under CICS, the return code from the application program should be placed in CEECAACICSRSN before returning from this event.
- CICS SPF: Language Environment calls languages in the application key for this event. This key can be key 8 or key 9, depending on the EXECKEY setting for the application program in the PPT.
- CICS SPF: The parameters and storage areas pointed to by the parameters can potentially be in key 8 storage, with the exception of the apal parameter, which is in the application key.