?? NEWTITLE := 'NOS/VE FF Test Utility' ??
MODULE osm$ff_test_utility;
?? RIGHT := 110 ??

{ Fredy's Test Utility

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc oss$job_paged_literal
*copyc ofe$error_codes
*copyc ost$halfword
*copyc ost$status
?? POP ??
*copyc clf#make_string_value

*copyc avp$configuration_administrator
*copyc clp$begin_utility
*copyc clp$change_variable
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$include_file
*copyc osp$set_status_abnormal
*copyc i#int_to_sign_0_fill_rjstring
*copyc i#int_to_unsig_0_fill_rjstring
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??

  CONST
    c$utility_name = 'FF_TEST_UTILITY                ';

?? OLDTITLE ??
?? NEWTITLE := 'P$INT_TO_SIGN_0_FILL_RJSTRING', EJECT ??

  PROCEDURE p$int_to_sign_0_fill_rjstring
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE p$int_to_sign_0_fill_rjstring (
{   i: integer = $required
{   size: integer 0..38 = $optional
{   s: (VAR) string = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 3, 22, 13, 34, 59, 898],
    clc$command, 4, 4, 1, 0, 0, 1, 4, ''], [
    ['I                              ',clc$nominal_entry, 1],
    ['S                              ',clc$nominal_entry, 3],
    ['SIZE                           ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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, 20, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [3, 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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 8,
  clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [4, 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$integer_type], [clc$min_integer, clc$max_integer, 10]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [0, 38, 10]],
{ PARAMETER 3
    [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$i = 1,
      p$size = 2,
      p$s = 3,
      p$status = 4;

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

    VAR
      str_p: ^string ( * ),
      work_area_p: ^clt$work_area;

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

    IF pvt [p$size].specified THEN
      PUSH str_p: [pvt [p$size].value^.integer_value.value];
    ELSE
      PUSH str_p: [38];
    IFEND;

    i#int_to_sign_0_fill_rjstring (pvt [p$i].value^.integer_value.value, str_p^);

    IF (pvt [p$s].specified) AND (pvt [p$s].variable <> NIL) THEN
      PUSH work_area_p: [[REP 100 OF cell]];
      clp$change_variable (pvt [p$s].variable^, clf#make_string_value (str_p^, work_area_p), status);
    IFEND;

  PROCEND p$int_to_sign_0_fill_rjstring;
?? OLDTITLE ??
?? NEWTITLE := 'P$INT_TO_UNSIG_0_FILL_RJSTRING', EJECT ??

  PROCEDURE p$int_to_unsig_0_fill_rjstring
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE p$int_to_unsig_0_fill_rjstring (
{   i: integer = $required
{   size: integer 0..38 = $optional
{   s: (VAR) string = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 3, 22, 13, 34, 54, 222],
    clc$command, 4, 4, 1, 0, 0, 1, 4, ''], [
    ['I                              ',clc$nominal_entry, 1],
    ['S                              ',clc$nominal_entry, 3],
    ['SIZE                           ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ 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, 20, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [3, 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, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 8,
  clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [4, 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$integer_type], [clc$min_integer, clc$max_integer, 10]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [0, 38, 10]],
{ PARAMETER 3
    [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$i = 1,
      p$size = 2,
      p$s = 3,
      p$status = 4;

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

    VAR
      str_p: ^string ( * ),
      work_area_p: ^clt$work_area;

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

    IF pvt [p$size].specified THEN
      PUSH str_p: [pvt [p$size].value^.integer_value.value];
    ELSE
      PUSH str_p: [38];
    IFEND;

    i#int_to_unsig_0_fill_rjstring (pvt [p$i].value^.integer_value.value, str_p^);

    IF (pvt [p$s].specified) AND (pvt [p$s].variable <> NIL) THEN
      PUSH work_area_p: [[REP 100 OF cell]];
      clp$change_variable (pvt [p$s].variable^, clf#make_string_value (str_p^, work_area_p), status);
    IFEND;

  PROCEND p$int_to_unsig_0_fill_rjstring;
?? OLDTITLE ??
?? NEWTITLE := 'P$_QUIT', EJECT ??

  PROCEDURE p$_quit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE quit (
{   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,
    [104, 2, 19, 21, 14, 25, 906],
    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 (c$utility_name, status);

  PROCEND p$_quit;
?? OLDTITLE ??
?? NEWTITLE := '[xdcl, #gate] OSP$FF_TEST_UTILITY', EJECT ??

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

{ PROCEDURE manage_set_utility (
{   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,
    [104, 3, 22, 12, 57, 39, 863],
    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=v$ff_test_utility_cmds t=command sn=oss$job_paged_literal
{ command n=(i#int_to_sign_0_fill_rjstring, i2rjss) p=p$int_to_sign_0_fill_rjstring cm=local
{ command n=(i#int_to_unsig_0_fill_rjstring, i2rjsu) p=p$int_to_unsig_0_fill_rjstring cm=local
{ command n=(quit, qui) p=p$_quit cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

    VAR
      v$ff_test_utility_cmds: [STATIC, READ, oss$job_paged_literal] ^clt$command_table :=
            ^v$ff_test_utility_cmds_entries,

      v$ff_test_utility_cmds_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 6] of
            clt$command_table_entry := [
            {} ['I#INT_TO_SIGN_0_FILL_RJSTRING  ', clc$nominal_entry, clc$normal_usage_entry, 1,
            clc$automatically_log, clc$linked_call, ^p$int_to_sign_0_fill_rjstring],
            {} ['I#INT_TO_UNSIG_0_FILL_RJSTRING ', clc$nominal_entry, clc$normal_usage_entry, 2,
            clc$automatically_log, clc$linked_call, ^p$int_to_unsig_0_fill_rjstring],
            {} ['I2RJSS                         ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
            clc$automatically_log, clc$linked_call, ^p$int_to_sign_0_fill_rjstring],
            {} ['I2RJSU                         ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
            clc$automatically_log, clc$linked_call, ^p$int_to_unsig_0_fill_rjstring],
            {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
            clc$automatically_log, clc$linked_call, ^p$_quit],
            {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 3,
            clc$automatically_log, clc$linked_call, ^p$_quit]];

?? POP ??

    VAR
      utility_attributes: array [1 .. 3] of clt$utility_attribute;

?? NEWTITLE := 'P$INIT_UTILITY', EJECT ??

    PROCEDURE p$init_utility
      (VAR status: ost$status);

      utility_attributes [1].key := clc$utility_command_table;
      utility_attributes [1].command_table := v$ff_test_utility_cmds;
      utility_attributes [2].key := clc$utility_prompt;
      utility_attributes [2].prompt.value := 'FFTU';
      utility_attributes [2].prompt.size := 4;
      utility_attributes [3].key := clc$utility_termination_command;
      utility_attributes [3].termination_command := 'quit';
{     utility_attributes [4].key := clc$utility_function_proc_table;
{     utility_attributes [4].function_processor_table := ;

      clp$begin_utility (c$utility_name, utility_attributes, status);

    PROCEND p$init_utility;
?? OLDTITLE ??
?? EJECT ??

    IF NOT avp$configuration_administrator () THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration, system_operation',
            status);
      RETURN; {----->
    IFEND;

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

    p$init_utility (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$include_file (clc$current_command_input, {ignore prompt} '', c$utility_name, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$end_utility (c$utility_name, status);

  PROCEND osp$ff_test_utility;
?? OLDTITLE ??
MODEND osm$ff_test_utility;
