*copyc osd$default_pragmats
?? NEWTITLE := 'NOS/VE Release Maintenance' ??
MODULE ram$compare_170_files;
*copyc rah$compare_170_files
*copyc clp$get_path_description
*copyc clp$get_value
*copyc clp$scan_parameter_list
*copyc pmp$exit
*copyc rap$generate_170_modset
?? EJECT ??
?? NEWTITLE := '  [XDCL] rap$compare_170_files' ??

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

{ PDT com7f (
{     initial_file,if : file = $required
{     updated_file,uf : file = $required
{     replacement_file,rf : file = lgo
{     directive_file,df : file = dir
{     status)

?? PUSH (LISTEXT := ON) ??

    VAR
      com7f: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^com7f_names, ^com7f_params];

    VAR
      com7f_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 9] of
        clt$parameter_name_descriptor := [['INITIAL_FILE', 1], ['IF', 1], [
        'UPDATED_FILE', 2], ['UF', 2], ['REPLACEMENT_FILE', 3], ['RF', 3], [
        'DIRECTIVE_FILE', 4], ['DF', 4], ['STATUS', 5]];

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

{ INITIAL_FILE IF }
      [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL,
        clc$file_value]],

{ UPDATED_FILE UF }
      [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL,
        clc$file_value]],

{ REPLACEMENT_FILE RF }
      [[clc$optional_with_default, ^com7f_dv3], 1, 1, 1, 1,
        clc$value_range_not_allowed, [NIL, clc$file_value]],

{ DIRECTIVE_FILE DF }
      [[clc$optional_with_default, ^com7f_dv4], 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]]];

    VAR
      com7f_dv3: [STATIC, READ, cls$pdt_names_and_defaults] string (3) :=
        'lgo';

    VAR
      com7f_dv4: [STATIC, READ, cls$pdt_names_and_defaults] string (3) :=
        'dir';

?? POP ??

    VAR
      rav$status: ost$status,
      temp_value: clt$value,
      temp_file: clt$file,
      temp_reference: clt$file_reference,
      temp_path_container: clt$path_container,
      temp_path: ^pft$path,
      temp_cycle: clt$cycle_selector,
      temp_position: clt$open_position,

      if_lfn: amt$local_file_name,
      if_name: clt$path_name,
      uf_lfn: amt$local_file_name,
      uf_name: clt$path_name,
      rf_lfn: amt$local_file_name,
      df_lfn: amt$local_file_name,
      compare_flag: boolean;

{ scan parameter list for validity }

    clp$scan_parameter_list (plist, com7f, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

{ get initial_file parameter values }

    clp$get_value ('initial_file', 1, 1, clc$low, temp_value, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    if_lfn := temp_value.file.local_file_name;
    temp_file.local_file_name := temp_value.file.local_file_name;

    clp$get_path_description (temp_file, temp_reference, temp_path_container,
          temp_path, temp_cycle, temp_position, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    if_name := temp_reference.path_name;

{ get updated_file parameter values }

    clp$get_value ('updated_file', 1, 1, clc$low, temp_value, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    uf_lfn := temp_value.file.local_file_name;
    temp_file.local_file_name := temp_value.file.local_file_name;


    clp$get_path_description (temp_file, temp_reference, temp_path_container,
          temp_path, temp_cycle, temp_position, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    uf_name := temp_reference.path_name;

{ get replacement_file parameter value }

    clp$get_value ('replacement_file', 1, 1, clc$low, temp_value, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    rf_lfn := temp_value.file.local_file_name;

{ get directive_file parameter values }

    clp$get_value ('directive_file', 1, 1, clc$low, temp_value, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
      pmp$exit (status);
    IFEND;

    df_lfn := temp_value.file.local_file_name;

{ comapre the files }

    rap$generate_170_modset (if_lfn, if_name, uf_lfn, uf_name, rf_lfn, df_lfn,
          compare_flag, rav$status);
    IF NOT rav$status.normal THEN
      status := rav$status;
    ELSE
      status.normal := TRUE;
    IFEND;

    pmp$exit (status);

  PROCEND rap$compare_170_files;

MODEND ram$compare_170_files;
