Event handler

The event handler is a member-supplied routine that is called at various times as a program runs when a significant event has occurred, or when the environment needs some information that is held by the member. During environment initialization, Language Environment determines the set of members present in the application and loads the event handler for each member language. The name of the event handler is manufactured by concatenating a fixed prefix and the member ID. The name constructed is CEEEVnnn, where nnn is the member number. The address of the event handler is saved for later retrieval. The values for nnn are in Figure 1.

Linkage to the member event handler is through BALR 14,15, and R1 contains a standard parameter address list. The first parameter always indicates the type of event for which the event handler has been called. Additional parameters are dependent upon the specific event.

The event handler places the following return codes (in decimal) in R15:
-4
The event handler does not want to process the event.
0
The event handler was successful.
16
The event handler encountered an unrecoverable error.

All environment services are available during the handling of the event, including the stack and heap, except for the options event and the main-opts event. This is Event Code 4, which is called by environment initialization to allow compatibility processing of runtime options.

With the exception of the CAA, PCB, process member list (MEML), and anchor vector, Language Environment can allocate control blocks above the line. Any member code that accesses a Language Environment control block must run in AMODE(31) to have addressability to the control blocks.

The event handler is called with the dump Event Code, 7, while processing various dump services. The dump event code has a function code that describes which dump service is to be performed. The remaining parameters for the dump event vary according to the specific sub-function code. See Event code 7 — dump event handler event for more information.

Language utilities function 6 has a sub-function code that describes what information is being requested. The remaining parameters for the utilities event vary according to the specific function code. For details, see Event code 6 — event handler utilities event.