?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Logging: Logging Command Processors' ??
MODULE lgm$logging_commands;

{ PURPOSE:
{  This module contains the command processors related to logging.

?? NEWTITLE := 'Global Declarations Referenced by This Module.', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc fst$path
*copyc lge$not_global_log
*copyc lge$unknown_log_keyword
*copyc pmt$global_logset
?? POP ??
*copyc clp$evaluate_parameters
*copyc clp$trimmed_string_size
*copyc lgp$display_log
*copyc lgp$display_critical_log_attr
*copyc lgp$display_log_attributes
*copyc lgp$terminate_critical_log
*copyc lgp$terminate_log
*copyc osp$set_status_abnormal
*copyc pmp$get_date
?? OLDTITLE ??
?? NEWTITLE := 'determine_log_ordinal', EJECT ??
{ PURPOSE:
{   Translate the keyword value specified on a command into its corresponding log ordinal value.

  PROCEDURE determine_log_ordinal
    (    keyword_value: ost$name;
     VAR log_ordinal: pmt$logs;
     VAR status: ost$status);

    status.normal := TRUE;

    IF keyword_value = 'SYSTEM_LOG' THEN
      log_ordinal := pmc$system_log;
    ELSEIF keyword_value = 'ACCOUNT_LOG' THEN
      log_ordinal := pmc$account_log;
    ELSEIF keyword_value = 'ENGINEERING_LOG' THEN
      log_ordinal := pmc$engineering_log;
    ELSEIF keyword_value = 'HISTORY_LOG' THEN
      log_ordinal := pmc$history_log;
    ELSEIF keyword_value = 'JOB_ACCOUNT_LOG' THEN
      log_ordinal := pmc$job_account_log;
    ELSEIF keyword_value = 'JOB_LOG' THEN
      log_ordinal := pmc$job_log;
    ELSEIF keyword_value = 'JOB_STATISTIC_LOG' THEN
      log_ordinal := pmc$job_statistic_log;
    ELSEIF keyword_value = 'SECURITY_LOG' THEN
      log_ordinal := pmc$security_log;
    ELSEIF keyword_value = 'STATISTIC_LOG' THEN
      log_ordinal := pmc$statistic_log;
    ELSE
      osp$set_status_abnormal ('LG', lge$unknown_log_keyword, keyword_value, status)
    IFEND;

  PROCEND determine_log_ordinal;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$_display_log', EJECT ??
{ PURPOSE:
{   Command processor for the DISPLAY_LOG command.

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

{ PROCEDURE (osm$disl) display_log, disl (
{   display_option, display_options, do: any of
{       key
{         (all, a)
{         (last, l)
{       keyend
{       integer
{     anyend = all
{   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 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: 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$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 3, 23, 8, 50, 29, 875],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'OSM$DISL'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_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, 195,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [5, 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
    [6, 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$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    155, [[1, 0, clc$keyword_type], [4], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ,
    'all'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      count: integer,
      display_option_selection: lgt$display_option_selection;

    status.normal := TRUE;

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

    IF pvt [p$display_option].value^.kind = clc$integer THEN
      IF pvt [p$display_option].value^.integer_value.value < 0 THEN
        IF pvt [p$display_option].value^.integer_value.value = clc$min_integer THEN
          count := -(pvt [p$display_option].value^.integer_value.value+1);
        ELSE
          count := -pvt [p$display_option].value^.integer_value.value;
        IFEND;
      ELSE
        count := pvt [p$display_option].value^.integer_value.value;
      IFEND;
      display_option_selection.display_options := lgc$count;
      IF count >= UPPERVALUE (display_option_selection.count) - 1 THEN
        display_option_selection.count := UPPERVALUE (display_option_selection.count) - 1;
      ELSE
        display_option_selection.count := count;
      IFEND;
    ELSE
      IF pvt [p$display_option].value^.keyword_value = 'ALL' THEN
        display_option_selection.display_options := lgc$all;
      ELSE
        display_option_selection.display_options := lgc$last;
      IFEND;
    IFEND;

    lgp$display_log (clc$display_job_log, display_option_selection, pvt [p$output].
          value^.file_value^, status);

  PROCEND lgp$_display_log;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$_display_system_log', EJECT ??
{ PURPOSE:
{   Command processor for the DISPLAY_SYSTEM_LOG command.

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

{   PROCEDURE (osm$dissl) display_system_log, dissl (
{     display_option, display_options, do: any of
{         key
{           (all, a)
{           (last, l)
{         keyend
{         integer
{       anyend = last
{     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 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: 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$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [94, 1, 11, 9, 46, 47, 276],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'OSM$DISSL'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_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, 195, clc$optional_default_parameter, 0, 4],
{ PARAMETER 2
    [5, 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
    [6, 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$union_type], [[clc$integer_type,
    clc$keyword_type],
    FALSE, 2],
    155, [[1, 0, clc$keyword_type], [4], [
      ['A                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
      ['L                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
      ['LAST                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ,
    'last'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      count: integer,
      display_option_selection: lgt$display_option_selection;

    status.normal := TRUE;

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

    IF pvt [p$display_option].value^.kind = clc$integer THEN
      IF pvt [p$display_option].value^.integer_value.value < 0 THEN
        IF pvt [p$display_option].value^.integer_value.value = clc$min_integer THEN
          count := -(pvt [p$display_option].value^.integer_value.value+1);
        ELSE
          count := -pvt [p$display_option].value^.integer_value.value;
        IFEND;
      ELSE
        count := pvt [p$display_option].value^.integer_value.value;
      IFEND;
      display_option_selection.display_options := lgc$count;
      IF count >= UPPERVALUE (display_option_selection.count) - 1 THEN
        display_option_selection.count := UPPERVALUE (display_option_selection.count) - 1;
      ELSE
        display_option_selection.count := count;
      IFEND;
    ELSE
      IF pvt [p$display_option].value^.keyword_value (1) = 'A' THEN
        display_option_selection.display_options := lgc$all;
      ELSE
        display_option_selection.display_options := lgc$last;
      IFEND;
    IFEND;

    lgp$display_log (clc$display_system_log, display_option_selection, pvt [p$output].value^.file_value^,
          status);

  PROCEND lgp$_display_system_log;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$display_critical_window_log', EJECT ??
{ PURPOSE:
{   Command processor for the DISPLAY_CRITICAL_WINDOW_LOG command.

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

{   PROCEDURE (osm$discwl) display_critical_window_log, discwl (
{     display_option, display_options, do: any of
{         key
{           (all, a)
{           (last, l)
{         keyend
{         integer
{       anyend = last
{     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 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: 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$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [94, 1, 11, 9, 45, 16, 156],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'OSM$DISCWL'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_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, 195, clc$optional_default_parameter, 0, 4],
{ PARAMETER 2
    [5, 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
    [6, 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$union_type], [[clc$integer_type,
    clc$keyword_type],
    FALSE, 2],
    155, [[1, 0, clc$keyword_type], [4], [
      ['A                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
      ['L                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
      ['LAST                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
      ],
    20, [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ,
    'last'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      count: integer,
      display_option_selection: lgt$display_option_selection;

    status.normal := TRUE;

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

    IF pvt [p$display_option].value^.kind = clc$integer THEN
      IF pvt [p$display_option].value^.integer_value.value < 0 THEN
        IF pvt [p$display_option].value^.integer_value.value = clc$min_integer THEN
          count := -(pvt [p$display_option].value^.integer_value.value+1);
        ELSE
          count := -pvt [p$display_option].value^.integer_value.value;
        IFEND;
      ELSE
        count := pvt [p$display_option].value^.integer_value.value;
      IFEND;
      display_option_selection.display_options := lgc$count;
      IF count >= UPPERVALUE (display_option_selection.count) - 1 THEN
        display_option_selection.count := UPPERVALUE (display_option_selection.count) - 1;
      ELSE
        display_option_selection.count := count;
      IFEND;
    ELSE
      IF pvt [p$display_option].value^.keyword_value (1) = 'A' THEN
        display_option_selection.display_options := lgc$all;
      ELSE
        display_option_selection.display_options := lgc$last;
      IFEND;
    IFEND;

    lgp$display_log (clc$display_critical_window_log, display_option_selection,
          pvt [p$output].value^.file_value^, status);

  PROCEND lgp$display_critical_window_log;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$_display_log_attributes', EJECT ??
{ PURPOSE:
{   This is the command processor for the DISPLAY_LOG_ATTRIBUTES command.

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

{   PROCEDURE display_log_attributes (
{     log, l: key
{         (account_log, account, al)
{         (critical_window_log, cwl)
{         (engineering_log, engineering, el)
{         (history_log, history, hl)
{         (job_account_log, jal)
{         (job_log, jl)
{         (job_statistic_log, jsl)
{         (security_log, security)
{         (statistic_log, statistic, sl)
{         (system_log, system)
{       keyend = system_log
{     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,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 24] of clt$keyword_specification,
        default_value: string (10),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [93, 10, 13, 14, 9, 55, 37],
    clc$command, 5, 3, 0, 0, 0, 0, 3, ''], [
    ['L                              ',clc$abbreviation_entry, 1],
    ['LOG                            ',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, 895, clc$optional_default_parameter, 0, 10],
{ 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$keyword_type], [24], [
    ['ACCOUNT                        ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['ACCOUNT_LOG                    ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['AL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['CRITICAL_WINDOW_LOG            ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['CWL                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['EL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['ENGINEERING                    ', clc$alias_entry,
  clc$normal_usage_entry, 3],
    ['ENGINEERING_LOG                ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['HISTORY                        ', clc$alias_entry,
  clc$normal_usage_entry, 4],
    ['HISTORY_LOG                    ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['HL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 4],
    ['JAL                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 5],
    ['JL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 6],
    ['JOB_ACCOUNT_LOG                ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['JOB_LOG                        ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['JOB_STATISTIC_LOG              ', clc$nominal_entry,
  clc$normal_usage_entry, 7],
    ['JSL                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
    ['SECURITY                       ', clc$abbreviation_entry,
  clc$normal_usage_entry, 8],
    ['SECURITY_LOG                   ', clc$nominal_entry,
  clc$normal_usage_entry, 8],
    ['SL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 9],
    ['STATISTIC                      ', clc$alias_entry,
  clc$normal_usage_entry, 9],
    ['STATISTIC_LOG                  ', clc$nominal_entry,
  clc$normal_usage_entry, 9],
    ['SYSTEM                         ', clc$abbreviation_entry,
  clc$normal_usage_entry, 10],
    ['SYSTEM_LOG                     ', clc$nominal_entry,
  clc$normal_usage_entry, 10]]
    ,
    'system_log'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      log: pmt$logs;

    status.normal := TRUE;

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

    IF (pvt [p$log].value^.keyword_value = 'CRITICAL_WINDOW_LOG            ') THEN
      lgp$display_critical_log_attr (pvt [p$output].value^.file_value^, status);
    ELSE
      determine_log_ordinal (pvt [p$log].value^.keyword_value, log, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      lgp$display_log_attributes (log, pvt [p$output].value^.file_value^, status);
    IFEND;

  PROCEND lgp$_display_log_attributes;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$_terminate_log', EJECT ??
{ PURPOSE:
{   This is the command processor for the TERMINATE_LOG command.

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

{   PROCEDURE (osm$terl) terminate_log, terl (
{     log, t, type, l: key
{         (account_log, account, al)
{         (critical_window_log, critical_window, cwl)
{         (engineering_log, engineering, el)
{         (history_log, history, hl)
{         (security_log, security)
{         (statistic_log, statistic, sl)
{         (system_log, system)
{       keyend = $required
{     file, f: file = $optional
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 19] of clt$keyword_specification,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [95, 1, 5, 10, 57, 48, 234],
    clc$command, 7, 3, 1, 0, 0, 0, 3, 'OSM$TERL'], [
    ['F                              ',clc$abbreviation_entry, 2],
    ['FILE                           ',clc$nominal_entry, 2],
    ['L                              ',clc$abbreviation_entry, 1],
    ['LOG                            ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3],
    ['T                              ',clc$alias_entry, 1],
    ['TYPE                           ',clc$alias_entry, 1]],
    [
{ PARAMETER 1
    [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, 710, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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_parameter, 0, 0],
{ 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$keyword_type], [19], [
    ['ACCOUNT                        ', clc$alias_entry,
  clc$normal_usage_entry, 1],
    ['ACCOUNT_LOG                    ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['AL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['CRITICAL_WINDOW                ', clc$alias_entry,
  clc$normal_usage_entry, 2],
    ['CRITICAL_WINDOW_LOG            ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['CWL                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['EL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['ENGINEERING                    ', clc$alias_entry,
  clc$normal_usage_entry, 3],
    ['ENGINEERING_LOG                ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['HISTORY                        ', clc$alias_entry,
  clc$normal_usage_entry, 4],
    ['HISTORY_LOG                    ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['HL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 4],
    ['SECURITY                       ', clc$abbreviation_entry,
  clc$normal_usage_entry, 5],
    ['SECURITY_LOG                   ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['SL                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 6],
    ['STATISTIC                      ', clc$alias_entry,
  clc$normal_usage_entry, 6],
    ['STATISTIC_LOG                  ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['SYSTEM                         ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
    ['SYSTEM_LOG                     ', clc$nominal_entry,
  clc$normal_usage_entry, 7]]
    ],
{ PARAMETER 2
    [[1, 0, clc$file_type]],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$log = 1,
      p$file = 2,
      p$status = 3;

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

    VAR
      date: ost$date,
      global_log: pmt$global_logs,
      log: pmt$logs,
      termination_file: fst$path;

    status.normal := TRUE;

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

    IF (pvt [p$log].value^.keyword_value <> 'CRITICAL_WINDOW_LOG            ') THEN
      determine_log_ordinal (pvt [p$log].value^.keyword_value, log, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      IF log in -$pmt$global_logset[] THEN
        global_log := log;
      ELSE
        osp$set_status_abnormal ('LG', lge$not_global_log, pvt [p$log].value^.keyword_value, status);
      IFEND;
    IFEND;

{ If the user specified a termination file use it.  Otherwise, construct a default termination file
{ reference of the form $USER.log_date.$NEXT.

    IF pvt [p$file].specified THEN
      termination_file := pvt [p$file].value^.file_value^;
    ELSE
      pmp$get_date (osc$ordinal_date, date, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      termination_file := '$USER.';
      IF (pvt [p$log].value^.keyword_value = 'CRITICAL_WINDOW_LOG            ') THEN
        termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'CRITICAL_WINDOW';
      ELSE
        CASE global_log OF
        = pmc$account_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'ACCOUNT';
        = pmc$engineering_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'ENGINEERING';
        = pmc$history_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'HISTORY';
        = pmc$security_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'SECURITY';
        = pmc$statistic_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'STATISTIC';
        = pmc$system_log =
          termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := 'SYSTEM';
        CASEND;
      IFEND;
      termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := '_';
      termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := date.ordinal;
      termination_file (clp$trimmed_string_size (termination_file) + 1, * ) := '.$NEXT';
    IFEND;

    IF (pvt [p$log].value^.keyword_value = 'CRITICAL_WINDOW_LOG            ') THEN
      lgp$terminate_critical_log (termination_file (1, clp$trimmed_string_size (termination_file)), status);
    ELSE
      lgp$terminate_log (global_log, termination_file (1, clp$trimmed_string_size (termination_file)),
            status);
    IFEND;

  PROCEND lgp$_terminate_log;
?? OLDTITLE ??
MODEND lgm$logging_commands;
