Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 37
Sample $CMON Program
The WRITE^LINE procedure provides a convenient way of writing a line to the
terminal.
Procedures for Processing Requests From the
Command-Interface Program
The CHANGE^LOGON^MESSAGE procedure is called when $CMON receives an
RT^LOGON^MESSAGE structure from the command-interface program. This
procedure updates a buffer containing logon text using the text contained in the
incoming message.
The CHANGE^LOGOFF^MESSAGE procedure is called when $CMON receives
an RT^LOGOFF^MESSAGE structure from the command-interface program. This
procedure updates a buffer containing logoff text with the text contained in the
incoming message.
The REJECT^REQUESTS procedure is called when $CMON receives an
RT^SHUTDOWN^MESSAGE structure from the command-interface program. The
procedure sets the REFUSE^ALL flag on to prevent further command-interpreter
requests from being accepted. In addition, the procedure updates a buffer
containing shutdown text with the text string contained in the incoming message.
This message is sent to TACL processes that make requests when the
REFUSE^ALL flag is on.
The ACCEPT^REQUESTS procedure is called when $CMON receives an
RT^START^MESSAGE structure from the command-interface program. The
procedure clears the REFUSE^ALL flag, allowing $CMON to accept command-
interpreter requests.
The CHANGE^CPU^STATUS procedure is called when $CMON receives a
CPU^CHANGESTATUS^MESSAGE structure from the command-interface
program. The incoming message contains a CPU number and CPU status. The
procedure updates the CPU^LIST array to reflect the new CPU status.
Procedures for Processing Command-Interpreter Messages
The PROCESS^CONFIG^MSG procedure is called when $CMON receives a
Config^msg message from a TACL process. This procedure returns a blank text
string to the TACL process; the TACL process retains the default logon
parameters.
The PROCESS^PRELOGON^MSG procedure is called when $CMON receives a
Prelogon^msg message from a TACL process. This procedure normally accepts
the request and returns a blank text string. The request is rejected for all
nonoperator TACL processes only if the operator has already set the
REFUSE^ALL flag to inhibit further requests.
The PROCESS^LOGON^MSG procedure is called when $CMON receives a
LOGON^MSG message from a TACL process. This procedure normally accepts
the request and returns a text string for display. The request is rejected for all