?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Device Mangement' ??
MODULE dmm$device_file_display;
?? PUSH (LISTEXT := ON) ??
*copyc oss$task_shared
*copyc rmd$volume_declarations
*copyc fst$attachment_options
*copyc ofe$error_codes
*copyc ost$status
?? POP ??
*copyc amp$get_segment_pointer
*copyc avp$system_administrator
*copyc clp$begin_utility
*copyc clp$close_display
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$get_path_description
*copyc clp$get_value
*copyc clp$include_file
*copyc clp$new_display_line
*copyc clp$new_display_page
*copyc clp$open_display_reference
*copyc clp$put_partial_display
*copyc clp$scan_parameter_list
*copyc dmp$change_file_damage_r3
*copyc dmp$copy_dat
*copyc dmp$copy_device_file
*copyc dmp$copy_dfl
*copyc dmp$copy_directory
*copyc dmp$copy_label
*copyc dmp$copy_log
*copyc dmp$copy_login_table
*copyc dmp$display_cylinders
*copyc dmp$display_dat
*copyc dmp$display_device_file
*copyc dmp$display_device_log
*copyc dmp$display_device_space
*copyc dmp$display_directory
*copyc dmp$display_file_tables
*copyc dmp$display_label
*copyc dmp$display_login_table
*copyc dmp$reassign_file_r3
*copyc dmp$utility_flush_logs_r3
*copyc fsp$close_file
*copyc fsp$open_file
*copyc mmp$get_allocated_addresses
*copyc osp$set_status_abnormal
?? NEWTITLE := '  Global Variables', EJECT ??

  VAR
    display_control: clt$display_control,
    utility_name: [READ] ost$name := 'Display_device_file            ';

?? TITLE := '  display_device_file', EJECT ??

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

{ PROCEDURE display_device_file_pdt (
{   input, i: file = $COMMAND
{   output, o: file = $OUTPUT
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        default_value: string (8),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [100, 8, 29, 10, 47, 25, 651],
    clc$command, 5, 3, 0, 0, 0, 0, 3, ''], [
    ['I                              ',clc$abbreviation_entry, 1],
    ['INPUT                          ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ 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_default_parameter, 0, 8],
{ PARAMETER 2
    [4, 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_default_parameter, 0, 7],
{ PARAMETER 3
    [5, 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],
    '$COMMAND'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

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

{ table display_command_list t=c s=local
{ command (change_file_damage, chafd         ) change_file_damage_processor     cm=local
{ command (copy_device_file, copdf           ) copy_device_file_processor       cm=local
{ command (display_cylinders, disc           ) display_cylinders_processor      cm=local
{ command (display_label, disl               ) display_label_processor          cm=local
{ command (display_device_file_list, disdfl  ) display_dfl_processor            cm=local
{ command (display_directory, disd           ) display_directory_processor      cm=local
{ command (display_dat, disdat               ) display_dat_processor            cm=local
{ command (display_device_log, disdl         ) display_device_log_processor     cm=local
{ command (display_file_tables, disft        ) display_file_tables_processor    cm=local
{ command (display_allocated_addresses, disaa) display_allocated_addrs_proc     cm=local
{ command (display_login_table, dislt        ) display_login_table_processor    cm=local
{ command (display_device_space, disds       ) display_device_space_processor   cm=local
{ command (flush_device_logs, fludl          ) flush_device_logs_processor      cm=local
{ command (quit, qui                         ) quit_processor                   cm=local
{ command (reassign_file, reaf               ) reassign_file_processor          cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  display_command_list: [STATIC, READ] ^clt$command_table := ^display_command_list_entries,

  display_command_list_entries: [STATIC, READ] array [1 .. 30] of clt$command_table_entry := [
  {} ['CHAFD                          ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^change_file_damage_processor],
  {} ['CHANGE_FILE_DAMAGE             ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^change_file_damage_processor],
  {} ['COPDF                          ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^copy_device_file_processor],
  {} ['COPY_DEVICE_FILE               ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^copy_device_file_processor],
  {} ['DISAA                          ', clc$abbreviation_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^display_allocated_addrs_proc],
  {} ['DISC                           ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^display_cylinders_processor],
  {} ['DISD                           ', clc$abbreviation_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^display_directory_processor],
  {} ['DISDAT                         ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^display_dat_processor],
  {} ['DISDFL                         ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^display_dfl_processor],
  {} ['DISDL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^display_device_log_processor],
  {} ['DISDS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^display_device_space_processor],
  {} ['DISFT                          ', clc$abbreviation_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^display_file_tables_processor],
  {} ['DISL                           ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^display_label_processor],
  {} ['DISLT                          ', clc$abbreviation_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^display_login_table_processor],
  {} ['DISPLAY_ALLOCATED_ADDRESSES    ', clc$nominal_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^display_allocated_addrs_proc],
  {} ['DISPLAY_CYLINDERS              ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^display_cylinders_processor],
  {} ['DISPLAY_DAT                    ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^display_dat_processor],
  {} ['DISPLAY_DEVICE_FILE_LIST       ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^display_dfl_processor],
  {} ['DISPLAY_DEVICE_LOG             ', clc$nominal_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^display_device_log_processor],
  {} ['DISPLAY_DEVICE_SPACE           ', clc$nominal_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^display_device_space_processor],
  {} ['DISPLAY_DIRECTORY              ', clc$nominal_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^display_directory_processor],
  {} ['DISPLAY_FILE_TABLES            ', clc$nominal_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^display_file_tables_processor],
  {} ['DISPLAY_LABEL                  ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^display_label_processor],
  {} ['DISPLAY_LOGIN_TABLE            ', clc$nominal_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^display_login_table_processor],
  {} ['FLUDL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^flush_device_logs_processor],
  {} ['FLUSH_DEVICE_LOGS              ', clc$nominal_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^flush_device_logs_processor],
  {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^quit_processor],
  {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^quit_processor],
  {} ['REAF                           ', clc$abbreviation_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^reassign_file_processor],
  {} ['REASSIGN_FILE                  ', clc$nominal_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^reassign_file_processor]];

?? POP ??

    VAR
      ring_attributes: amt$ring_attributes,
      status_p: ^ost$status,
      utility_attributes: array [1 .. 3] of clt$utility_attribute;

    status.normal := TRUE;
    IF NOT avp$system_administrator () THEN
      osp$set_status_abnormal ('OS', ofe$sou_not_active, 'system_administration', status);
      RETURN;
    IFEND;

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

    utility_attributes [1].key := clc$utility_command_table;
    utility_attributes [1].command_table := display_command_list;
    utility_attributes [2].key := clc$utility_termination_command;
    utility_attributes [2].termination_command := 'quit';
    utility_attributes [3].key := clc$utility_prompt;
    utility_attributes [3].prompt.value := 'DM';
    utility_attributes [3].prompt.size := 2;

    clp$begin_utility (utility_name, utility_attributes, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    ring_attributes.r1 := #RING(^ring_attributes);
    ring_attributes.r2 := #RING(^ring_attributes);
    ring_attributes.r3 := #RING(^ring_attributes);
    clp$open_display_reference (pvt [p$output].value^.file_value^, NIL, fsc$list, ring_attributes,
          display_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$include_file (pvt [p$input].value^.file_value^, '', utility_name, status);

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    clp$close_display (display_control, status_p^);
    IF NOT status_p^.normal THEN
      RETURN;
    IFEND;

    clp$end_utility (utility_name, status);

  PROCEND display_device_file;
?? TITLE := '  change_file_damage_processor', EJECT ??

  PROCEDURE change_file_damage_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT change_file_damage_pdt (
{    file, f: file = $required
{    damage, d: boolean = $required
{    damage_detection_enabled, dde: boolean = $required
{    dfl_damage, dd: boolean = $required
{    status)

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

  VAR
    change_file_damage_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [
  ^change_file_damage_pdt_names, ^change_file_damage_pdt_params];

  VAR
    change_file_damage_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 9] of
  clt$parameter_name_descriptor := [['FILE', 1], ['F', 1], ['DAMAGE', 2], ['D', 2], [
  'DAMAGE_DETECTION_ENABLED', 3], ['DDE', 3], ['DFL_DAMAGE', 4], ['DD', 4], ['STATUS', 5]];

  VAR
    change_file_damage_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 5] of
  clt$parameter_descriptor := [

{ FILE F }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$file_value]],

{ DAMAGE D }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$boolean_value]],

{ DAMAGE_DETECTION_ENABLED DDE }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$boolean_value]],

{ DFL_DAMAGE DD }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$boolean_value]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
  clc$array_not_allowed, clc$status_value]]];

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

    VAR
      damage: clt$value,
      damage_detection: clt$value,
      dfl_damage: clt$value,
      fid: amt$file_identifier,
      ignore_status: ost$status,
      p_attachment_options: ^fst$attachment_options,
      segp: amt$segment_pointer,
      value: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, change_file_damage_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('FILE', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('DAMAGE', 1, 1, clc$low, damage, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('DAMAGE_DETECTION_ENABLED', 1, 1, clc$low, damage_detection, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('DFL_DAMAGE', 1, 1, clc$low, dfl_damage, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH p_attachment_options: [1 .. 1];
    p_attachment_options^ [1].selector := fsc$access_and_share_modes;
    p_attachment_options^ [1].access_modes.selector := fsc$specific_access_modes;
    p_attachment_options^ [1].access_modes.value := $fst$file_access_options
          [fsc$read];
    p_attachment_options^ [1].share_modes.selector := fsc$specific_share_modes;
    p_attachment_options^ [1].share_modes.value := $fst$file_access_options
          [fsc$read, fsc$shorten, fsc$append, fsc$modify, fsc$execute];

    fsp$open_file (value.file.local_file_name, amc$segment, p_attachment_options, NIL, NIL, NIL, NIL, fid,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$get_segment_pointer (fid, amc$cell_pointer, segp, status);
    IF NOT status.normal THEN
      fsp$close_file (fid, ignore_status);
      RETURN;
    IFEND;

    dmp$change_file_damage_r3 (segp.cell_pointer, damage.bool.value, damage_detection.bool.value,
       dfl_damage.bool.value, ignore_status);
    fsp$close_file (fid, ignore_status);

  PROCEND change_file_damage_processor;
?? TITLE := '  copy_device_file_processor', EJECT ??

  PROCEDURE copy_device_file_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE copy_device_file (
{   device_file, df: key
{       (device_allocation_table, dat)
{       (device_file_list, dfl)
{       (directory, dir)
{       (login_table, login, lt)
{       (label, lab)
{       (device_log, log, dl)
{     advanced_key
{       (user_specified_device_file, usdf)
{     keyend = $required
{   recorded_vsn, rvsn, vsn: name 1..6 = $required
{   output_file, file, of, f: file = $required
{   user_specified_device_file_name, usdfn: (BY_NAME, ADVANCED) any of
{       string 1..31
{       name
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 12] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 16] of clt$keyword_specification,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [102, 1, 30, 16, 37, 58, 176],
    clc$command, 12, 5, 3, 1, 0, 0, 5, ''], [
    ['DEVICE_FILE                    ',clc$nominal_entry, 1],
    ['DF                             ',clc$abbreviation_entry, 1],
    ['F                              ',clc$abbreviation_entry, 3],
    ['FILE                           ',clc$alias_entry, 3],
    ['OF                             ',clc$alias_entry, 3],
    ['OUTPUT_FILE                    ',clc$nominal_entry, 3],
    ['RECORDED_VSN                   ',clc$nominal_entry, 2],
    ['RVSN                           ',clc$alias_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 5],
    ['USDFN                          ',clc$abbreviation_entry, 4],
    ['USER_SPECIFIED_DEVICE_FILE_NAME',clc$nominal_entry, 4],
    ['VSN                            ',clc$abbreviation_entry, 2]],
    [
{ PARAMETER 1
    [1, 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, 599,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [7, 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, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 3
    [6, 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$required_parameter, 0
  , 0],
{ PARAMETER 4
    [11, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 33, clc$optional_parameter,
  0, 0],
{ PARAMETER 5
    [9, 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$keyword_type], [16], [
    ['DAT                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['DEVICE_ALLOCATION_TABLE        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['DEVICE_FILE_LIST               ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['DEVICE_LOG                     ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['DFL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['DIR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['DIRECTORY                      ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['DL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
    ['LAB                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['LABEL                          ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['LOG                            ', clc$alias_entry, clc$normal_usage_entry, 6],
    ['LOGIN                          ', clc$alias_entry, clc$normal_usage_entry, 4],
    ['LOGIN_TABLE                    ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['LT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['USDF                           ', clc$abbreviation_entry, clc$advanced_usage_entry, 7],
    ['USER_SPECIFIED_DEVICE_FILE     ', clc$nominal_entry, clc$advanced_usage_entry, 7]]
    ],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 3
    [[1, 0, clc$file_type]],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],
    TRUE, 2],
    8, [[1, 0, clc$string_type], [1, 31, FALSE]],
    5, [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$device_file = 1,
      p$recorded_vsn = 2,
      p$output_file = 3,
      p$user_specified_device_file_na = 4 {USER_SPECIFIED_DEVICE_FILE_NAME} ,
      p$status = 5;

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

    VAR
      fid: amt$file_identifier,
      file_name: ost$name,
      segp: amt$segment_pointer,
      ignore: ost$status,
      vsn: rmt$recorded_vsn;

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

    fsp$open_file (pvt [p$output_file].value^.file_value^, amc$segment, NIL, NIL, NIL, NIL, NIL, fid,
            status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$get_segment_pointer (fid, amc$cell_pointer, segp, status);
    IF status.normal THEN
      vsn := pvt [p$recorded_vsn].value^.name_value (1, rmc$recorded_vsn_size);
      IF (pvt [p$device_file].value^.keyword_value = 'DEVICE_ALLOCATION_TABLE') THEN
        dmp$copy_dat (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'DEVICE_FILE_LIST') THEN
        dmp$copy_dfl (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'DIRECTORY') THEN
        dmp$copy_directory (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'LOGIN_TABLE') THEN
        dmp$copy_login_table (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'LABEL') THEN
        dmp$copy_label (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'DEVICE_LOG') THEN
        dmp$copy_log (vsn, segp.cell_pointer, status);
      ELSEIF (pvt [p$device_file].value^.keyword_value = 'USER_SPECIFIED_DEVICE_FILE')
{      } AND (pvt [p$user_specified_device_file_na].value <> NIL) THEN

        CASE pvt [p$user_specified_device_file_na].value^.kind OF
        = clc$string =
          file_name := pvt [p$user_specified_device_file_na].value^.string_value^;
        = clc$name =
          file_name := pvt [p$user_specified_device_file_na].value^.name_value;
        CASEND;

        dmp$copy_device_file (vsn, file_name, segp.cell_pointer, status);
      ELSE
        osp$set_status_abnormal ('dm', 1, 'sorry, not implemented', status);
      IFEND;
    IFEND;

    fsp$close_file (fid, ignore);

  PROCEND copy_device_file_processor;

?? TITLE := '  display_cylinders_processor', EJECT ??

  PROCEDURE display_cylinders_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ pdt display_cylinders_pdt (
{  recorded_vsn, recv, vsn: name
{  status )

?? PUSH (LISTEXT := ON) ??

    VAR
      display_cylinders_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^display_cylinders_pdt_names, ^display_cylinders_pdt_params];

    VAR
      display_cylinders_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 4] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['RECV', 1], ['VSN', 1], ['STATUS', 2]];

    VAR
      display_cylinders_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
        clt$parameter_descriptor := [

{ RECORDED_VSN RECV VSN }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_cylinders_pdt, status);
    IF status.normal THEN
      clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
      IF status.normal THEN
        dmp$display_cylinders (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
      IFEND;
    IFEND;

  PROCEND display_cylinders_processor;

?? TITLE := '  display_label', EJECT ??

  PROCEDURE display_label_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_label_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??
{ STATUS }

    VAR
      display_label_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [^display_label_pdt_names,
        ^display_label_pdt_params];

    VAR
      display_label_pdt_names: [STATIC, READ, cls$pdt] array [1 .. 3] of clt$parameter_name_descriptor :=
        [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_label_pdt_params: [STATIC, READ, cls$pdt] array [1 .. 2] of clt$parameter_descriptor := [

{ RECORDED_VSN R_V } [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1,
      osc$max_name_size]],

{ STATUS } [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
      clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_label_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_label (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_label_processor;
?? TITLE := '  display_dfl_processor', EJECT ??

  PROCEDURE display_dfl_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_list_pdt (
{   recorded_vsn, r_v: name = $optional
{   display_option, do: integer LOWERVALUE(dmt$device_file_list_index)..
{     ..UPPERVALUE(dmt$device_file_list_index) or key full, f, summary, s = full
{   status)

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

  VAR
    display_list_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [^display_list_pdt_names,
  ^display_list_pdt_params];

  VAR
    display_list_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 5] of
  clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['DISPLAY_OPTION', 2], ['DO', 2], [
  'STATUS', 3]];

  VAR
    display_list_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 3] of clt$parameter_descriptor
  := [

{ RECORDED_VSN R_V }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ DISPLAY_OPTION DO }
    [[clc$optional_with_default, ^display_list_pdt_dv2], 1, 1, 1, 1, clc$value_range_not_allowed, [^
  display_list_pdt_kv2, clc$integer_value, LOWERVALUE(dmt$device_file_list_index),
  UPPERVALUE(dmt$device_file_list_index)]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
  clc$array_not_allowed, clc$status_value]]];

  VAR
    display_list_pdt_kv2: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 4] of ost$name := ['FULL','F'
  ,'SUMMARY','S'];

  VAR
    display_list_pdt_dv2: [STATIC, READ, cls$pdt_names_and_defaults] string (4) := 'full';

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

    VAR
      summary_listing: boolean,
      full_listing:boolean,
      file_index:dmt$device_file_list_index,
      display_option: clt$value,
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_list_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('DISPLAY_OPTION', 1, 1, clc$low, display_option, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    CASE display_option.kind OF

    = clc$integer_value =

      file_index := display_option.int.value;
      summary_listing := false;
      full_listing := false;

    = clc$name_value =

      file_index := 0;
      IF (display_option.name.value = 'SUMMARY') OR (display_option.name.value = 'S') THEN
        summary_listing := true;
        full_listing := false;
      ELSE
        summary_listing := true;
        full_listing := true;
      IFEND
    ELSE
      status.normal := false;
      return;
    CASEND;

    dmp$display_device_file (
      display_control,
      recorded_vsn.name.value (1, rmc$recorded_vsn_size),
      summary_listing,
      full_listing,
      file_index,
      status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_dfl_processor;
?? TITLE := '  display_directory', EJECT ??

  PROCEDURE display_directory_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);


{ PDT display_directory_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_directory_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^display_directory_pdt_names, ^display_directory_pdt_params];

    VAR
      display_directory_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_directory_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
        clt$parameter_descriptor := [

{ RECORDED_VSN R_V }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_directory_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_directory (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_directory_processor;
?? TITLE := '  display_dat', EJECT ??

  PROCEDURE display_dat_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_dat_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_dat_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [^display_dat_pdt_names,
        ^display_dat_pdt_params];

    VAR
      display_dat_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_dat_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of clt$parameter_descriptor :=
        [

{ RECORDED_VSN R_V }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_dat_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_dat (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_dat_processor;
?? TITLE := '  display_device_log', EJECT ??

  PROCEDURE display_device_log_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_device_log_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_device_log_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^display_device_log_pdt_names, ^display_device_log_pdt_params];

    VAR
      display_device_log_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_device_log_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
        clt$parameter_descriptor := [

{ RECORDED_VSN R_V }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_device_log_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_device_log (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_device_log_processor;
?? TITLE := '  display_device_space_processor', EJECT ??

  PROCEDURE display_device_space_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_dat_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_dat_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [^display_dat_pdt_names,
        ^display_dat_pdt_params];

    VAR
      display_dat_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_dat_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of clt$parameter_descriptor :=
        [

{ RECORDED_VSN R_V }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_dat_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_device_space (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_device_space_processor;
?? TITLE := '  display_file_tables', EJECT ??

  PROCEDURE display_file_tables_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{  PDT display_file_tables_pdt (
{    file, f: file = $required
{    display_option, do: key full, f, summary, s = full
{    status)

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

  VAR
    display_file_tables_pdt: [STATIC, READ, cls$pdt]
  clt$parameter_descriptor_table := [^display_file_tables_pdt_names,
  ^display_file_tables_pdt_params];

  VAR
    display_file_tables_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults]
  array [1 .. 5] of clt$parameter_name_descriptor := [['FILE', 1], ['F', 1], [
  'DISPLAY_OPTION', 2], ['DO', 2], ['STATUS', 3]];

  VAR
    display_file_tables_pdt_params: [STATIC, READ, cls$pdt_parameters] array [
  1 .. 3] of clt$parameter_descriptor := [

{ FILE F }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL,
  clc$file_value]],

{ DISPLAY_OPTION DO }
    [[clc$optional_with_default, ^display_file_tables_pdt_dv2], 1, 1, 1, 1,
  clc$value_range_not_allowed, [^display_file_tables_pdt_kv2, clc$keyword_value
  ]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL,
  clc$variable_reference, clc$array_not_allowed, clc$status_value]]];

  VAR
    display_file_tables_pdt_kv2: [STATIC, READ, cls$pdt_names_and_defaults]
  array [1 .. 4] of ost$name := ['FULL','F','SUMMARY','S'];

  VAR
    display_file_tables_pdt_dv2: [STATIC, READ, cls$pdt_names_and_defaults
  ] string (4) := 'full';

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

    VAR
      overwrite_file_attribute: [READ, oss$task_shared] array [1 .. 1] of fst$file_cycle_attribute :=
            [[fsc$file_organization, amc$sequential]];

    VAR
      cycle_selector: clt$cycle_selector,
      display_option: clt$value,
      fid: amt$file_identifier,
      file_reference: clt$file_reference,
      full_listing: boolean,
      ignore_status: ost$status,
      open_position: clt$open_position,
      p_attachment_options: ^fst$attachment_options,
      path: ^pft$path,
      path_container: clt$path_container,
      segp: amt$segment_pointer,
      value: clt$value;

    clp$scan_parameter_list (parameter_list, display_file_tables_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('FILE', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH p_attachment_options: [1 .. 1];
    p_attachment_options^ [1].selector := fsc$access_and_share_modes;
    p_attachment_options^ [1].access_modes.selector := fsc$specific_access_modes;
    p_attachment_options^ [1].access_modes.value := $fst$file_access_options [fsc$read];
    p_attachment_options^ [1].share_modes.selector := fsc$specific_share_modes;
    p_attachment_options^ [1].share_modes.value :=
          $fst$file_access_options [fsc$read, fsc$shorten, fsc$append, fsc$modify, fsc$execute];

    fsp$open_file (value.file.local_file_name, amc$segment, p_attachment_options, NIL, NIL, NIL,
          ^overwrite_file_attribute, fid, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$get_segment_pointer (fid, amc$cell_pointer, segp, status);
    IF NOT status.normal THEN
      fsp$close_file (fid, ignore_status);
      RETURN;
    IFEND;

    clp$get_path_description (value.file, file_reference, path_container, path, cycle_selector, open_position,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('DISPLAY_OPTION', 1, 1, clc$low, display_option, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    full_listing := (display_option.name.value = 'FULL') OR (display_option.name.value = 'F');

    dmp$display_file_tables (file_reference.path_name (1, file_reference.path_name_size),
          full_listing, segp.cell_pointer, display_control, status);

    fsp$close_file (fid, ignore_status);

  PROCEND display_file_tables_processor;
?? TITLE := '  display_login_table', EJECT ??

  PROCEDURE display_login_table_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_login_table_pdt (
{   recorded_vsn, r_v : NAME
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_login_table_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^display_login_table_pdt_names, ^display_login_table_pdt_params];

    VAR
      display_login_table_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
        clt$parameter_name_descriptor := [['RECORDED_VSN', 1], ['R_V', 1], ['STATUS', 2]];

    VAR
      display_login_table_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
        clt$parameter_descriptor := [

{ RECORDED_VSN R_V }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$name_value, 1, osc$max_name_size]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      recorded_vsn: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_login_table_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RECORDED_VSN', 1, 1, clc$low, recorded_vsn, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$display_login_table (display_control, recorded_vsn.name.value (1, rmc$recorded_vsn_size), status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND display_login_table_processor;
?? TITLE := '  flush_device_logs_processor', EJECT ??

  PROCEDURE flush_device_logs_processor (parameter_list: clt$parameter_list;
                                     VAR status: ost$status);

{ PDT flush_device_logs_pdt (
{    status)

?? PUSH (LISTEXT := ON) ??

  VAR
    flush_device_logs_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [
      ^flush_device_logs_pdt_names, ^flush_device_logs_pdt_params];

  VAR
    flush_device_logs_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 1] of
      clt$parameter_name_descriptor := [['STATUS', 1]];

  VAR
    flush_device_logs_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 1] of
      clt$parameter_descriptor := [

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
      clc$array_not_allowed, clc$status_value]]];

?? POP ??

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, flush_device_logs_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$utility_flush_logs_r3;

  PROCEND flush_device_logs_processor;
?? TITLE := '  quit_processor', EJECT ??

  PROCEDURE quit_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE quit_pdt (
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [100, 8, 29, 10, 0, 48, 874],
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, 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$status_type]]];

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

    CONST
      p$status = 1;

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

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

    clp$end_include (utility_name, status);

  PROCEND quit_processor;
?? TITLE := '  reassign_file', EJECT ??

  PROCEDURE reassign_file_processor (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{  PDT reassign_file_pdt (
{    file, f: file = $required
{    status)

?? PUSH (LISTEXT := ON) ??

  VAR
    reassign_file_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [
      ^reassign_file_pdt_names, ^reassign_file_pdt_params];

  VAR
    reassign_file_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
      clt$parameter_name_descriptor := [['FILE', 1], ['F', 1], ['STATUS', 2]];

  VAR
    reassign_file_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
      clt$parameter_descriptor := [

{ FILE F }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$file_value]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
      clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      fid: amt$file_identifier,
      ignore_status: ost$status,
      p_attachment_options: ^fst$attachment_options,
      segp: amt$segment_pointer,
      value: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, reassign_file_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('FILE', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH p_attachment_options: [1 .. 1];
    p_attachment_options^ [1].selector := fsc$access_and_share_modes;
    p_attachment_options^ [1].access_modes.selector := fsc$specific_access_modes;
    p_attachment_options^ [1].access_modes.value := $fst$file_access_options [fsc$read];
    p_attachment_options^ [1].share_modes.selector := fsc$specific_share_modes;
    p_attachment_options^ [1].share_modes.value :=
          $fst$file_access_options [fsc$read, fsc$shorten, fsc$append, fsc$modify, fsc$execute];

    fsp$open_file (value.file.local_file_name, amc$segment, p_attachment_options, NIL, NIL, NIL, NIL, fid,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$get_segment_pointer (fid, amc$cell_pointer, segp, status);
    IF NOT status.normal THEN
      fsp$close_file (fid, ignore_status);
      RETURN;
    IFEND;

    dmp$reassign_file_r3 (segp.cell_pointer, status);

    fsp$close_file (fid, ignore_status);

  PROCEND reassign_file_processor;
?? TITLE := '  display_allocated_addresses', EJECT ??

  PROCEDURE display_allocated_addrs_proc (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{  PDT display_alloc_addr_pdt (
{    file, f: file = $required
{    status)

?? PUSH (LISTEXT := ON) ??

  VAR
    display_alloc_addr_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [
      ^display_alloc_addr_pdt_names, ^display_alloc_addr_pdt_params];

  VAR
    display_alloc_addr_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 3] of
      clt$parameter_name_descriptor := [['FILE', 1], ['F', 1], ['STATUS', 2]];

  VAR
    display_alloc_addr_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 2] of
      clt$parameter_descriptor := [

{ FILE F }
    [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$file_value]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
      clc$array_not_allowed, clc$status_value]]];

?? POP ??

    VAR
      addr_list: ^array [ * ] of dmt$addr_length_pair,
      addr_returned: integer,
      byte_address: ost$segment_offset,
      cycle_selector: clt$cycle_selector,
      fid: amt$file_identifier,
      file_reference: clt$file_reference,
      i: integer,
      ignore_status: ost$status,
      l: integer,
      line: string (132),
      list_overflow: boolean,
      open_position: clt$open_position,
      p_attachment_options: ^fst$attachment_options,
      path: ^pft$path,
      path_container: clt$path_container,
      segp: amt$segment_pointer,
      value: clt$value;

    status.normal := TRUE;

    clp$scan_parameter_list (parameter_list, display_alloc_addr_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('FILE', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH p_attachment_options: [1 .. 1];
    p_attachment_options^ [1].selector := fsc$access_and_share_modes;
    p_attachment_options^ [1].access_modes.selector := fsc$specific_access_modes;
    p_attachment_options^ [1].access_modes.value := $fst$file_access_options [fsc$read];
    p_attachment_options^ [1].share_modes.selector := fsc$specific_share_modes;
    p_attachment_options^ [1].share_modes.value :=
          $fst$file_access_options [fsc$read, fsc$shorten, fsc$append, fsc$modify, fsc$execute];

    fsp$open_file (value.file.local_file_name, amc$segment, p_attachment_options, NIL, NIL, NIL, NIL, fid,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    amp$get_segment_pointer (fid, amc$cell_pointer, segp, status);
    IF NOT status.normal THEN
      fsp$close_file (fid, ignore_status);
      RETURN;
    IFEND;

    byte_address := 0;
    PUSH addr_list: [1 .. 5];

    clp$get_path_description (value.file, file_reference,
      path_container, path, cycle_selector, open_position, status);
    clp$new_display_page (display_control, status);
    STRINGREP (line, l, ' Allocated Addresses: ', file_reference.path_name (1,
      file_reference.path_name_size));
    clp$put_partial_display (display_control, line (1, l), clc$trim,
          amc$terminate, status);

    clp$new_display_line (display_control, 3, status);

    REPEAT
      mmp$get_allocated_addresses (segp.cell_pointer, byte_address, addr_list^,
        addr_returned, list_overflow, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      FOR i := 1 TO addr_returned DO
        clp$put_partial_display (display_control, ' byte_address = ', clc$no_trim,
              amc$start, status);
        STRINGREP (line, l, addr_list^ [i].addr: #(16), '(16) ',
              ' length = ', addr_list^ [i].length: #(16), '(16) ');
        clp$put_partial_display (display_control, line (1, l), clc$trim,
              amc$terminate, status);
      FOREND;
      byte_address := addr_list^ [addr_returned].addr + addr_list^ [addr_returned].length;
    UNTIL NOT list_overflow;

    fsp$close_file (fid, ignore_status);

  PROCEND display_allocated_addrs_proc;

MODEND dmm$device_file_display;

