?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Operator Facility : System Operator Utility' ??
MODULE ofm$system_operator_utility_r3;

{ PURPOSE:
{   This module contains the ring 3 support procedures for the System
{   Operator Utility (SOU).
?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc cle$redundancy_in_selections
*copyc oft$operator_classes
?? POP ??
*copyc avp$activate_capabilities
*copyc avp$check_for_console_operation
*copyc avp$configuration_administrator
*copyc avp$get_capability
*copyc avp$removable_media_admin
*copyc avp$removable_media_operator
*copyc avp$system_operator
*copyc avp$system_displays
*copyc clp$change_variable
*copyc clp$evaluate_parameters
*copyc clp$get_variable_value
*copyc osp$get_system_constant
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := 'Global declarations for this module', EJECT ??

{   Array indices for SCL record type for SELECTED variable.

    CONST
      i$accnt     = 1,        {accounting_administration index}
      i$config    = 2,        {configuration_administration index}
      i$fam       = 3,        {family_administration index}
      i$rma       = 4,        {removable_media_administration index}
      i$rmo       = 5,        {removable_media_operation index}
      i$sys_admin = 6,        {system_administration index}
      i$sys_disp  = 7,        {system_displays index}
      i$sys_oper  = 8,        {system_operation index}

      max_valid_capability_index = 8;
?? OLDTITLE ??
?? NEWTITLE := 'ofp$activate_sou_capabilities', EJECT ??

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

{    PROCEDURE (osm$sysou_actsc) activate_sou_capabilities (
{      selected_capabilities: record
{          accounting_administration : boolean,
{          configuration_administration : boolean,
{          family_administration : boolean,
{          removable_media_administration : boolean,
{          removable_media_operation : boolean,
{          system_administration : boolean,
{          system_displays : boolean,
{          system_operation : boolean,
{        recend = $required
{      status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
        recend,
        field_spec_7: clt$field_specification,
        element_type_spec_7: record
          header: clt$type_specification_header,
        recend,
        field_spec_8: clt$field_specification,
        element_type_spec_8: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 6, 13, 49, 15, 510],
    clc$command, 2, 2, 1, 0, 0, 0, 2, 'OSM$SYSOU_ACTSC'], [
    ['SELECTED_CAPABILITIES          ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ 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, 319, 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$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$record_type], [8],
    ['ACCOUNTING_ADMINISTRATION      ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['CONFIGURATION_ADMINISTRATION   ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['FAMILY_ADMINISTRATION          ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['REMOVABLE_MEDIA_ADMINISTRATION ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['REMOVABLE_MEDIA_OPERATION      ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_ADMINISTRATION          ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_DISPLAYS                ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_OPERATION               ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selected_capabilities = 1,
      p$status = 2;

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

    VAR
      capabilities: avt$conditional_capabilities;

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

{ Verify that the console operation only security option is enforced if on.

    avp$check_for_console_operation ('System operation', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    capabilities := $avt$conditional_capabilities [];

    IF pvt [p$selected_capabilities].value^.field_values^ [i$accnt].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_accounting_admin];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$config].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_configuration_admin];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$fam].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_family_admin];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$rma].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_removable_media_admin];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$rmo].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_removable_media_operator];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$sys_admin].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_system_admin];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$sys_disp].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_system_displays];
    IFEND;

    IF pvt [p$selected_capabilities].value^.field_values^ [i$sys_oper].value^.boolean_value.value THEN
        capabilities := capabilities + $avt$conditional_capabilities [avc$cc_system_operator];
    IFEND;

    avp$activate_capabilities (capabilities, 'SYSTEM_OPERATOR_UTILITY        ', status);

  PROCEND ofp$activate_sou_capabilities;
?? TITLE := 'ofp$evaluate_sou_capabilities', EJECT ??

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

{       PROCEDURE (osm$sysou_evasc) evaluate_sou_capabilities (
{         selected_capabilities: (VAR) record
{             accounting_administration : boolean,
{             configuration_administration : boolean,
{             family_administration : boolean,
{             removable_media_administration : boolean,
{             removable_media_operation : boolean,
{             system_administration : boolean,
{             system_displays : boolean,
{             system_operation : boolean,
{           recend = $required
{         capabilities, capability, c: list of key
{             (accounting_administration, aa)
{             (configuration_administration, ca)
{             (family_administration, fa)
{             (removable_media_administration, rma)
{             (removable_media_operation, rmo)
{             (system_administration, sa)
{             (system_displays, sd)
{             (system_operation, so)
{           keyend = $optional
{         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$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
        recend,
        field_spec_7: clt$field_specification,
        element_type_spec_7: record
          header: clt$type_specification_header,
        recend,
        field_spec_8: clt$field_specification,
        element_type_spec_8: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 16] of clt$keyword_specification,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 6, 13, 15, 18, 27, 527],
    clc$command, 5, 3, 1, 0, 0, 1, 3, 'OSM$SYSOU_EVASC'], [
    ['C                              ',clc$abbreviation_entry, 2],
    ['CAPABILITIES                   ',clc$nominal_entry, 2],
    ['CAPABILITY                     ',clc$alias_entry, 2],
    ['SELECTED_CAPABILITIES          ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ 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_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 319, 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, 615, 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$record_type], [8],
    ['ACCOUNTING_ADMINISTRATION      ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['CONFIGURATION_ADMINISTRATION   ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['FAMILY_ADMINISTRATION          ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['REMOVABLE_MEDIA_ADMINISTRATION ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['REMOVABLE_MEDIA_OPERATION      ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_ADMINISTRATION          ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_DISPLAYS                ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]],
    ['SYSTEM_OPERATION               ', clc$required_field, 3], [[1, 0,
  clc$boolean_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [599, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [16], [
      ['AA                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
      ['ACCOUNTING_ADMINISTRATION      ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
      ['CA                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
      ['CONFIGURATION_ADMINISTRATION   ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
      ['FA                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
      ['FAMILY_ADMINISTRATION          ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
      ['REMOVABLE_MEDIA_ADMINISTRATION ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
      ['REMOVABLE_MEDIA_OPERATION      ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
      ['RMA                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 4],
      ['RMO                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 5],
      ['SA                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 6],
      ['SD                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
      ['SO                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 8],
      ['SYSTEM_ADMINISTRATION          ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
      ['SYSTEM_DISPLAYS                ', clc$nominal_entry,
  clc$normal_usage_entry, 7],
      ['SYSTEM_OPERATION               ', clc$nominal_entry,
  clc$normal_usage_entry, 8]]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$selected_capabilities = 1,
      p$capabilities = 2,
      p$status = 3;

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

    VAR
      capable: boolean,
      index: integer,
      next_capability_p: ^clt$data_value,
      next_keyword_p: ^clt$data_value,
      selected_capabilities: clt$data_value;

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

{ Verify that the console operation only security option is enforced if on.

    avp$check_for_console_operation ('System operation', status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Initialize the selected_capabilities value such that each field value in the record is FALSE.

    selected_capabilities.kind := clc$record;
    PUSH selected_capabilities.field_values : [1 .. max_valid_capability_index];
    selected_capabilities.field_values^[i$accnt].name := 'ACCOUNTING_ADMINISTRATION';
    selected_capabilities.field_values^[i$config].name := 'CONFIGURATION_ADMINISTRATION';
    selected_capabilities.field_values^[i$fam].name := 'FAMILY_ADMINISTRATION';
    selected_capabilities.field_values^[i$rma].name := 'REMOVABLE_MEDIA_ADMINISTRATION';
    selected_capabilities.field_values^[i$rmo].name := 'REMOVABLE_MEDIA_OPERATION';
    selected_capabilities.field_values^[i$sys_admin].name := 'SYSTEM_ADMINISTRATION';
    selected_capabilities.field_values^[i$sys_disp].name := 'SYSTEM_DISPLAYS';
    selected_capabilities.field_values^[i$sys_oper].name := 'SYSTEM_OPERATION';

    FOR index := 1 TO max_valid_capability_index DO
      PUSH selected_capabilities.field_values^[index].value;
      selected_capabilities.field_values^[index].value^.kind := clc$boolean;
      selected_capabilities.field_values^[index].value^.boolean_value.value := FALSE;
      selected_capabilities.field_values^[index].value^.boolean_value.kind := clc$true_false_boolean;
    FOREND;

{ If the capabilities parameter is specified, verify that each keyword in the list is unique and return the
{ specified capabilities as the selected_capabilities.  Otherwise, return all the capabilities for which
{ the user is validated as the selected_capabilities.

    IF pvt [p$capabilities].specified THEN
      next_capability_p := pvt [p$capabilities].value;
      WHILE next_capability_p <> NIL DO
        next_keyword_p := next_capability_p^.link;
        WHILE next_keyword_p <> NIL DO
          IF next_capability_p^.element_value^.keyword_value =
                next_keyword_p^.element_value^.keyword_value THEN
            osp$set_status_abnormal ('CL', cle$redundancy_in_selections,
                  next_capability_p^.element_value^.keyword_value, status);
            RETURN;
          IFEND;
          next_keyword_p := next_keyword_p^.link;
        WHILEND;

        IF next_capability_p^.element_value^.keyword_value = 'ACCOUNTING_ADMINISTRATION' THEN
          selected_capabilities.field_values^ [i$accnt].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'CONFIGURATION_ADMINISTRATION' THEN
          selected_capabilities.field_values^ [i$config].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'FAMILY_ADMINISTRATION' THEN
          selected_capabilities.field_values^ [i$fam].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'REMOVABLE_MEDIA_ADMINISTRATION' THEN
          selected_capabilities.field_values^ [i$rma].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'REMOVABLE_MEDIA_OPERATION' THEN
          selected_capabilities.field_values^ [i$rmo].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'SYSTEM_ADMINISTRATION' THEN
          selected_capabilities.field_values^ [i$sys_admin].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'SYSTEM_DISPLAYS' THEN
          selected_capabilities.field_values^ [i$sys_disp].value^.boolean_value.value := TRUE;
        ELSEIF next_capability_p^.element_value^.keyword_value = 'SYSTEM_OPERATION' THEN
          selected_capabilities.field_values^ [i$sys_oper].value^.boolean_value.value := TRUE;
        IFEND;

        next_capability_p := next_capability_p^.link;
      WHILEND;

    ELSE
      avp$get_capability (avc$accounting_administration, avc$user, capable, status);
      selected_capabilities.field_values^ [i$accnt].value^.boolean_value.value := capable;
      avp$get_capability (avc$configuration_admin, avc$user, capable, status);
      selected_capabilities.field_values^ [i$config].value^.boolean_value.value := capable;
      avp$get_capability (avc$family_administration, avc$user, capable, status);
      selected_capabilities.field_values^ [i$fam].value^.boolean_value.value := capable;
      avp$get_capability (avc$removable_media_admin, avc$user, capable, status);
      selected_capabilities.field_values^ [i$rma].value^.boolean_value.value := capable;
      avp$get_capability (avc$removable_media_operation, avc$user, capable, status);
      selected_capabilities.field_values^ [i$rmo].value^.boolean_value.value := capable;
      avp$get_capability (avc$system_administration, avc$user, capable, status);
      selected_capabilities.field_values^ [i$sys_admin].value^.boolean_value.value := capable;
      avp$get_capability (avc$system_displays, avc$user, capable, status);
      selected_capabilities.field_values^ [i$sys_disp].value^.boolean_value.value := capable;
      avp$get_capability (avc$system_operation, avc$user, capable, status);
      selected_capabilities.field_values^ [i$sys_oper].value^.boolean_value.value := capable;
    IFEND;

    clp$change_variable (pvt [p$selected_capabilities].variable^, ^selected_capabilities, status);

  PROCEND ofp$evaluate_sou_capabilities;
?? TITLE := 'ofp$get_active_operator_classes', EJECT ??
*copyc ofh$get_active_operator_classes

  PROCEDURE [XDCL, #GATE] ofp$get_active_operator_classes
    (VAR active_operator_classes: oft$operator_classes);

    active_operator_classes := $oft$operator_classes [];
    IF avp$removable_media_operator () THEN
      active_operator_classes := active_operator_classes + $oft$operator_classes
            [ofc$removable_media_operator];
    IFEND;

    IF avp$system_operator () THEN
      active_operator_classes := active_operator_classes + $oft$operator_classes [ofc$system_operator];
    IFEND;

  PROCEND ofp$get_active_operator_classes;

?? TITLE := 'ofp$_get_system_attribute', EJECT ??
  PROCEDURE [XDCL, #GATE] ofp$_get_system_attribute
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE get_system_attribute, getsa (
{   name, n: name = $required
{   on, o: (VAR) boolean = $required
{   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$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [90, 7, 26, 13, 27, 58, 6],
    clc$command, 5, 3, 2, 0, 0, 1, 3, ''], [
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['ON                             ',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, 5, 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_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$required_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$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$boolean_type]],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$name = 1,
      p$on = 2,
      p$status = 3;

    VAR
      bool_value_p: ^clt$data_value,
      constant: integer,
      index: integer,
      pvt: array [1 .. 3] of clt$parameter_value;

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

    index := 0;
    osp$get_system_constant (pvt [p$name].value^.name_value, index, constant,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH bool_value_p;
    bool_value_p^.kind := clc$boolean;
    bool_value_p^.boolean_value.value := constant = 1;
    bool_value_p^.boolean_value.kind := clc$true_false_boolean;

    clp$change_variable (pvt [p$on].variable^, bool_value_p, status);

  PROCEND ofp$_get_system_attribute;

MODEND ofm$system_operator_utility_r3;
