
?? RIGHT := 110 ??
?? NEWTITLE := 'FILE_REPAIR_UTILITY: FILRU Utility Command.' ??
MODULE qcm$file_repair_utility;

{ PURPOSE:
{   This module contains the command interface to set up and control the
{   file repair utility.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
*copyc qct$installation_defaults
?? POP ??
*copyc clp$begin_utility
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$include_file
*copyc fst$file_reference

?? TITLE := 'Global Declarations Declared by This Module', EJECT ??

  VAR
    qcv$filru_utility_name: [XDCL] clt$utility_name := 'FILE_REPAIR_UTILITY';


?? FMT (FORMAT := ON) ??

?? TITLE := '[XDCL] qcp$file_repair_utility', EJECT ??

{ PURPOSE:
{   This command interface sets up the FILE_REPAIR_UTILITY utility
{   session.
{
{ DESIGN:
{   This follows standard utility design.
{
{ NOTES:
{


PROCEDURE [XDCL] qcp$repair_files
                (parameter_list: clt$parameter_list;
                 VAR status: ost$status);


 { PROCEDURE fileru_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,
    [91, 4, 22, 11, 44, 22, 447],
    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;


{ table n=filru_command_table t=command s=xdcl
{ command n=(correct_v_file, corvf) p=qcp$correct_v_file cm=xref
{ command n=(quit, qui) p=qcp$quit_filru cm=xref
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  filru_command_table: [XDCL, READ] ^clt$command_table :=
      ^filru_command_table_entries,

  filru_command_table_entries: [STATIC, READ] array [1 .. 4] of
      clt$command_table_entry := [
  {} ['CORRECT_V_FILE                 ', clc$nominal_entry,
        clc$normal_usage_entry, 1, clc$automatically_log, clc$linked_call,
        ^qcp$correct_v_file],
  {} ['CORVF                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 1, clc$automatically_log, clc$linked_call,
        ^qcp$correct_v_file],
  {} ['QUI                            ', clc$abbreviation_entry,
        clc$normal_usage_entry, 2, clc$automatically_log, clc$linked_call,
        ^qcp$quit_filru],
  {} ['QUIT                           ', clc$nominal_entry,
        clc$normal_usage_entry, 2, clc$automatically_log, clc$linked_call,
        ^qcp$quit_filru]];

  PROCEDURE [XREF] qcp$correct_v_file
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] qcp$quit_filru
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

?? POP ??




?? PUSH (LISTEXT := ON) ??

VAR
  filru_function_table: [XDCL, READ] ^clt$function_processor_table := ^filru_function_table_entries,

  filru_function_table_entries: [STATIC, READ] array [1 .. 1] of clt$function_proc_table_entry := [
  {} ['$READ_DATA               ', clc$nominal_entry, clc$hidden_entry, 1, clc$linked_call,
        ^qcp$functions]];

  PROCEDURE [XREF] qcp$functions
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

?? POP ??

    CONST
      prompt_size = 5,
      prompt_value = 'FILRU';

    VAR
      utility_attributes_p: ^clt$utility_attributes;


    status.normal := TRUE;

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

    PUSH utility_attributes_p: [1 .. 4];
    utility_attributes_p^ [1].key := clc$utility_command_search_mode;
    utility_attributes_p^ [1].command_search_mode := clc$global_command_search;
    utility_attributes_p^ [2].key := clc$utility_command_table;
    utility_attributes_p^ [2].command_table := filru_command_table;
    utility_attributes_p^ [3].key := clc$utility_function_proc_table;
    utility_attributes_p^ [3].function_processor_table := filru_function_table;
    utility_attributes_p^ [4].key := clc$utility_prompt;
    utility_attributes_p^ [4].prompt.size := prompt_size;
    utility_attributes_p^ [4].prompt.value := prompt_value;

    clp$begin_utility (qcv$filru_utility_name, utility_attributes_p^, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$include_file (clc$current_command_input, prompt_value, qcv$filru_utility_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$end_utility (qcv$filru_utility_name, status);

  PROCEND qcp$repair_files;


MODEND qcm$file_repair_utility;
