Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 71
Sample Command-Interface Program
The CHANGE^LOGON^MESSAGE procedure is called when the operator
chooses to change the logon message by selecting 1 from the menu. This
procedure prompts the operator for the new logon text before sending an
RT^logon^message to $CMON.
The CHANGE^LOGOFF^MESSAGE procedure is called when the operator
chooses to change the logoff message by selecting 2 from the menu. This
procedure prompts the operator for the new logoff text before sending an
RT^logoff^message to $CMON.
The REJECT^REQUESTS procedure is called when the operator chooses to
disallow command-interpreter requests prior to shutting down the system. The
operator selects 3 from the menu. The procedure prompts the operator for the new
shutdown text and then sends an RT^shutdown^message to $CMON.
The ACCEPT^REQUESTS procedure is called when the operator chooses to
reenable command-interpreter requests by selecting 4 from the menu. The
procedure sends an RT^start^message to $CMON.
The CHANGE^CPU^STATUS procedure is called when the operator chooses to
alter the status of a CPU by moving it from one priority group to another. The
operator chooses to do this by selecting 5 from the menu. The procedure prompts
the operator first for the CPU number, then for a 1 or a 0 depending on whether the
operator wants to move the CPU into the high-priority group or the low-priority
group.
The EXIT^PROGRAM procedure is called when the operator chooses to quit the
command-interface program by selecting x from the menu. This procedure stops
the command-interface program.
The ILLEGAL^REQUEST procedure is called whenever the operator makes an
invalid selection from the menu. The procedure prints a message indicating that
the selection is invalid before returning to the main procedure to redisplay the
menu.
The FILE^ERRORS and FILE^ERRORS^NAME procedures attempt to report any
file-system errors that occur.
The WRITE^LINE procedure provides a convenient way to display a line of text on
the terminal.
The code for the command-interface program appears on the following pages.