?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Device Management : Display_Mass_Store Command' ??
MODULE dmm$display_mass_store_command;

{ PURPOSE:
{  This module contains the run anywhere procedure that executes the DISPLAY_MASS_STORAGE command.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
?? POP ??
*copyc clp$evaluate_parameters
*copyc jmp$system_job
*copyc ofp$execute_display_task
  CONST
    ms_display = 'MS_DISPLAY                     ';

?? TITLE := 'dmp$display_mass_store_command', EJECT ??

  PROCEDURE [XDCL, #GATE] dmp$display_mass_store_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE display_mass_store, disms (
{   output, o: file = $optional
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [88, 12, 1, 13, 2, 22, 297],
    clc$command, 3, 2, 0, 0, 0, 0, 2, ''], [
    ['O                              ',clc$abbreviation_entry, 1],
    ['OUTPUT                         ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$output = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    status.normal := TRUE;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    { Process the OUTPUT parameter in such a way that DISPLAY_A is treated as a normal file name if this is
    { not the system job. If the OUTPUT parameter is not specified, then send the display data to DISPLAY_A
    { if this is the system job and to $OUTPUT otherwise.

    IF pvt [p$output].specified THEN
      ofp$execute_display_task (pvt [p$output].value^.file_value^, ms_display, status);
    ELSE
      IF jmp$system_job () THEN
        ofp$execute_display_task ('$LOCAL.DISPLAY_A', ms_display, status);
      ELSE
        ofp$execute_display_task ('$OUTPUT', ms_display, status);
      IFEND;
    IFEND;

  PROCEND dmp$display_mass_store_command;
MODEND dmm$display_mass_store_command;
