
*copyc OSD$DEFAULT_PRAGMATS
?? NEWTITLE := '170 NOS/VE REMOTE HOST' ??
MODULE rhmlgm;

?? NEWTITLE := 'GLOBAL TYPE DECLARATIONS' ??
?? SET (LIST := OFF) ??
?? EJECT ??
*copyc RHT$FUNCTION_STATUS

?? TITLE := 'EXTERNAL PROCEDURES REFERENCED BY THIS MODULE' ??
?? SET (LIST := OFF) ??
?? EJECT ??
*copyc ZUTPS2D
*copyc ZN7PMSG

    PROCEDURE [XREF] getword (address: integer;
        word: ^cell);


?? TITLE := 'LOG_STATUS' ??
?? SET (LIST := ON) ??
?? EJECT ??

{ LOG_STATUS
{
{      The purpose of this procedure is to send a message to the
{ NOS/A170 B display and/or the user dayfile.
{
{      LOG_STATUS (DESTINATION,STATUS_MESSAGE)
{
{ DESTINATION: (input) This parameter specifies the destination of
{              the message, i.e. the console display and job dayfile
{              or job dayfile only.
{
{ STATUS_MESSAGE: (input) This parameter specifies the ascii message
{                 to be logged.
{

  PROCEDURE [XDCL] log_status (destination: rht$log_destinations;
    status_message: rht$log_status_message);

    CONST
      job_log = 3,
      system_and_job_log = 0;

    VAR
      display_code_message: array [1 .. 8] of packed array [0 .. 9] of 0 .. 3f(16),
      dc_string_word_index: integer,
      dc_string_char_index: 0 .. 9,
      source_index: ost$string_index,
      ra_word_0: packed record
        fill1: 0 .. 0ffffffffff(16),
        fill2: 0 .. 01f(16),
        cfo,
        idledown,
        pause,
        sw6,
        sw5,
        sw4,
        sw3,
        sw2,
        sw1: boolean,
        fill3: 0 .. 03f(16),
      recend,
      rh_debug: boolean,
      eol: boolean;

{  Set rh debug if switch 1 is on.

    getword (0, #LOC(ra_word_0));
    rh_debug := ra_word_0.sw2;
    IF (rh_debug = FALSE) AND (destination = dayfile_log_and_display) THEN
      RETURN;
    IFEND;

    source_index := 1;
    REPEAT
      dc_string_word_index := 1;
      dc_string_char_index := 0;
      eol := TRUE;
      utp$convert_string_to_dc_string (utc$ascii64, display_code_message, dc_string_word_index,
        dc_string_char_index, status_message, source_index, eol);
      IF destination = display_in_system_log THEN
        n7p$issue_dayfile_message (#LOC (display_code_message), system_and_job_log);
      ELSE
        n7p$issue_dayfile_message (#LOC (display_code_message), job_log);
      IFEND;
    UNTIL source_index > STRLENGTH (status_message);

  PROCEND log_status;

MODEND rhmlgm;
