?? RIGHT := 110 ??
?? NEWTITLE := 'PACKAGE_SOFTWARE utility: APPLY_OBJECT_CORRECTION subcommand.' ??
MODULE ram$apply_object_correction_cmd;

{ PURPOSE:
{   This module contains the interface that interprets the SCL parameters
{   and passes them into the CYBIL interface OCM$APPLY_OBJECT_CORRECTION.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
?? POP ??
*copyc clp$evaluate_parameters
*copyc ocp$apply_object_correction

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

?? OLDTITLE ??
?? NEWTITLE := '[XDCL] rap$apply_object_correction_cmd', EJECT ??

{ PURPOSE:
{   This interface interprets the SCL parameters and to make a call to the
{   CYBIL interface OCM$APPLY_OBJECT_CORRECTION.
{
{ DESIGN:
{
{ NOTES:
{

  PROCEDURE [XDCL] rap$apply_object_correction_cmd
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);


{ PROCEDURE appocc_pdt (
{   base_file, bf: file = $required
{   correction_file, cf: file = $required
{   target_file, tf: file = $required
{   status)

?? PUSH (LISTEXT := ON) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [88, 10, 6, 9, 54, 52, 58],
    clc$command, 7, 4, 3, 0, 0, 0, 4, 'APPOCC_PDT'], [
    ['BASE_FILE                      ',clc$nominal_entry, 1],
    ['BF                             ',clc$abbreviation_entry, 1],
    ['CF                             ',clc$abbreviation_entry, 2],
    ['CORRECTION_FILE                ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4],
    ['TARGET_FILE                    ',clc$nominal_entry, 3],
    ['TF                             ',clc$abbreviation_entry, 3]],
    [
{ 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, 3, clc$required_parameter, 0
  , 0],
{ 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$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
    [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]],
{ PARAMETER 2
    [[1, 0, clc$file_type]],
{ PARAMETER 3
    [[1, 0, clc$file_type]],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? POP ??

  CONST
    p$base_file = 1,
    p$correction_file = 2,
    p$target_file = 3,
    p$status = 4;

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


    status.normal := TRUE;

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

    ocp$apply_object_correction (pvt [p$base_file].value^.file_value^,
          pvt [p$correction_file].value^.file_value^, pvt [p$target_file].value^.file_value^,
          status);

  PROCEND rap$apply_object_correction_cmd;
MODEND ram$apply_object_correction_cmd;
