?? RIGHT := 110 ??
MODULE ram$intervene_in_deadstart;

*copyc osd$default_pragmats
?? PUSH (LISTEXT := ON) ??
*copyc clp$pop_utility
*copyc clp$push_utility
*copyc clp$put_job_output
*copyc clp$scan_command_file
*copyc oss$job_paged_literal

?? POP ??

*copyc rah$intervene_in_deadstart

  VAR
    rav$intervene_in_deadstart_name: [XDCL, READ, oss$job_paged_literal] ost$name := 'INTERVENE_IN_DEADSTART';

  PROCEDURE [XDCL, #GATE] rap$intervene_in_deadstart
    (VAR status: ost$status);

    VAR
      i: 1 .. 4,
      lines: [STATIC, READ, oss$job_paged_literal] array [1 .. 4] of string (79) :=
            ['                                                                    ',
            ' At this point in the deadstart process you are given the           ',
            ' opportunity to intervene by entering any of the available commands.',
            ' Enter GO to continue.                                              '];

{ table intervene_commands s=xdcl
{ command (go) p=rap$go cm=xref

?? PUSH (LISTEXT := ON) ??

    VAR
      intervene_commands: [XDCL, READ, oss$job_paged_literal] ^clt$command_table :=
            ^intervene_commands_entries,

      intervene_commands_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 1] of
            clt$command_table_entry := [
            {} ['GO                             ', clc$nominal_entry, clc$advertised_entry, 1,
            clc$automatically_log, clc$linked_call, ^rap$go]];

    PROCEDURE [XREF] rap$go
      (    parameter_list: clt$parameter_list;
       VAR status: ost$status);

?? POP ??

    FOR i := 1 TO 4 DO
      clp$put_job_output (lines [i], status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    FOREND;

    clp$push_utility (rav$intervene_in_deadstart_name, clc$global_command_search, intervene_commands, NIL,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$scan_command_file (clc$job_command_input, rav$intervene_in_deadstart_name, 'int', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$pop_utility (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND rap$intervene_in_deadstart;
MODEND ram$intervene_in_deadstart
