?? LEFT := 1, RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Command Language : Command Processors for System Task Commands' ??
MODULE clm$system_task_maintenance;

{ PURPOSE:
{   This module contains the command processors for the commands that define, delete, activate and
{   deactivate system tasks.

?? NEWTITLE := 'Global Declarations Referenced by this Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$parameter_list
*copyc clt$parameter_list_contents
*copyc ost$status
?? POP ??
*copyc clp$count_list_elements
*copyc clp$evaluate_parameters
*copyc osp$activate_system_task
*copyc osp$deactivate_system_task
*copyc osp$define_system_task
*copyc osp$delete_system_task
*copyc osp$set_status_abnormal
?? OLDTITLE, NEWTITLE := '[XDCL, #GATE] clp$activate_system_task', EJECT ??

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

{   PROCEDURE (osm$actst) activate_system_task, activate_system_tasks, actst (
{     task_name, task_names, tn: list of name = $required
{     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 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 7, 31, 14, 4, 44, 512],
    clc$command, 4, 2, 1, 0, 0, 0, 2, 'OSM$ACTST'], [
    ['STATUS                         ',clc$nominal_entry, 2],
    ['TASK_NAME                      ',clc$nominal_entry, 1],
    ['TASK_NAMES                     ',clc$alias_entry, 1],
    ['TN                             ',clc$abbreviation_entry, 1]],
    [
{ 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, 21, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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$list_type], [5, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      node: ^clt$data_value;

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

    node := pvt [p$task_name].value;
    WHILE node <> NIL DO
      osp$activate_system_task (node^.element_value^.name_value, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      node := node^.link;
    WHILEND;

  PROCEND clp$activate_system_task;
?? OLDTITLE, NEWTITLE := '[XDCL, #GATE] clp$deactivate_system_task', EJECT ??

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

{   PROCEDURE (osm$deast) deactivate_system_task, deactivate_system_tasks, deast (
{     task_name, task_names, tn: list of name = $required
{     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 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 7, 31, 14, 4, 51, 678],
    clc$command, 4, 2, 1, 0, 0, 0, 2, 'OSM$DEAST'], [
    ['STATUS                         ',clc$nominal_entry, 2],
    ['TASK_NAME                      ',clc$nominal_entry, 1],
    ['TASK_NAMES                     ',clc$alias_entry, 1],
    ['TN                             ',clc$abbreviation_entry, 1]],
    [
{ 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, 21, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [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$list_type], [5, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      node: ^clt$data_value;

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

    node := pvt [p$task_name].value;
    WHILE node <> NIL DO
      osp$deactivate_system_task (node^.element_value^.name_value, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      node := node^.link;
    WHILEND;

  PROCEND clp$deactivate_system_task;
?? OLDTITLE, NEWTITLE := '[XDCL, #GATE] clp$define_system_task', EJECT ??

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

{   PROCEDURE (osm$defst) define_system_task, defst (
{     name, n: name = $required
{     starting_procedure, sp: program_name = $optional
{     automatic_restart, ar: boolean = true
{     deactivate_task_option, dto:
{       key
{         (terminate, t)
{         (voluntary, v)
{         (prohibited, p)
{       keyend = terminate
{     idle_task_option, ito:
{       key
{         (terminate, t)
{         (voluntary, v)
{         (ignore, i)
{       keyend = terminate
{     restart_after_idle, rai: boolean = true
{     spy_identifier, si: integer 0..63 = 0
{     parameters, parameter, p: string = $optional
{     files, file, f: list of file = $optional
{     libraries, library, l:
{       list of any of
{         key
{           osf$task_services_library
{         keyend
{         file
{       anyend = $optional
{     modules, module, m: list of program_name = $optional
{     load_map, lm: file = $optional
{     load_map_options, load_map_option, lmo:
{       any of
{         key
{           all
{           none
{         keyend
{         list of key
{           (segment, s)
{           (block, b)
{           (entry_point, ep)
{           (cross_reference, cr)
{         keyend
{       anyend = none
{     preset_value, pv:
{       key
{         (zero, z)
{         (floating_point_indefinite, fpi)
{         (infinity, i)
{         (alternate_ones, ao)
{        keyend = $optional
{     termination_error_level, tel:
{       key
{         (warning, w)
{         (error, e)
{         (fatal, f)
{       keyend = warning
{     stack_size, ss: integer 1 .. osc$max_segment_length = $optional
{     debug_input, di: file = $optional
{     debug_output, do: file = $optional
{     abort_file, af: file = $optional
{     debug_mode, dm: boolean = false
{     execution_ring, er: integer 3 .. 15 = 11
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 48] of clt$pdt_parameter_name,
      parameters: array [1 .. 22] 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,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (9),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (9),
      recend,
      type6: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
        default_value: string (1),
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: 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 .. 1] of clt$keyword_specification,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
          recend,
        recend,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
      type13: 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 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: 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 .. 8] of clt$keyword_specification,
          recend,
        recend,
        default_value: string (4),
      recend,
      type14: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (7),
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type17: record
        header: clt$type_specification_header,
      recend,
      type18: record
        header: clt$type_specification_header,
      recend,
      type19: record
        header: clt$type_specification_header,
      recend,
      type20: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type21: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
        default_value: string (2),
      recend,
      type22: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 2, 9, 34, 16, 334],
    clc$command, 48, 22, 1, 0, 0, 0, 22, 'OSM$DEFST'], [
    ['ABORT_FILE                     ',clc$nominal_entry, 19],
    ['AF                             ',clc$abbreviation_entry, 19],
    ['AR                             ',clc$abbreviation_entry, 3],
    ['AUTOMATIC_RESTART              ',clc$nominal_entry, 3],
    ['DEACTIVATE_TASK_OPTION         ',clc$nominal_entry, 4],
    ['DEBUG_INPUT                    ',clc$nominal_entry, 17],
    ['DEBUG_MODE                     ',clc$nominal_entry, 20],
    ['DEBUG_OUTPUT                   ',clc$nominal_entry, 18],
    ['DI                             ',clc$abbreviation_entry, 17],
    ['DM                             ',clc$abbreviation_entry, 20],
    ['DO                             ',clc$abbreviation_entry, 18],
    ['DTO                            ',clc$abbreviation_entry, 4],
    ['ER                             ',clc$abbreviation_entry, 21],
    ['EXECUTION_RING                 ',clc$nominal_entry, 21],
    ['F                              ',clc$abbreviation_entry, 9],
    ['FILE                           ',clc$alias_entry, 9],
    ['FILES                          ',clc$nominal_entry, 9],
    ['IDLE_TASK_OPTION               ',clc$nominal_entry, 5],
    ['ITO                            ',clc$abbreviation_entry, 5],
    ['L                              ',clc$abbreviation_entry, 10],
    ['LIBRARIES                      ',clc$nominal_entry, 10],
    ['LIBRARY                        ',clc$alias_entry, 10],
    ['LM                             ',clc$abbreviation_entry, 12],
    ['LMO                            ',clc$abbreviation_entry, 13],
    ['LOAD_MAP                       ',clc$nominal_entry, 12],
    ['LOAD_MAP_OPTION                ',clc$alias_entry, 13],
    ['LOAD_MAP_OPTIONS               ',clc$nominal_entry, 13],
    ['M                              ',clc$abbreviation_entry, 11],
    ['MODULE                         ',clc$alias_entry, 11],
    ['MODULES                        ',clc$nominal_entry, 11],
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['P                              ',clc$abbreviation_entry, 8],
    ['PARAMETER                      ',clc$alias_entry, 8],
    ['PARAMETERS                     ',clc$nominal_entry, 8],
    ['PRESET_VALUE                   ',clc$nominal_entry, 14],
    ['PV                             ',clc$abbreviation_entry, 14],
    ['RAI                            ',clc$abbreviation_entry, 6],
    ['RESTART_AFTER_IDLE             ',clc$nominal_entry, 6],
    ['SI                             ',clc$abbreviation_entry, 7],
    ['SP                             ',clc$abbreviation_entry, 2],
    ['SPY_IDENTIFIER                 ',clc$nominal_entry, 7],
    ['SS                             ',clc$abbreviation_entry, 16],
    ['STACK_SIZE                     ',clc$nominal_entry, 16],
    ['STARTING_PROCEDURE             ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 22],
    ['TEL                            ',clc$abbreviation_entry, 15],
    ['TERMINATION_ERROR_LEVEL        ',clc$nominal_entry, 15]],
    [
{ PARAMETER 1
    [32, 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
    [45, 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
    [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, 4],
{ PARAMETER 4
    [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, 229,
  clc$optional_default_parameter, 0, 9],
{ PARAMETER 5
    [18, 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, 229,
  clc$optional_default_parameter, 0, 9],
{ PARAMETER 6
    [39, 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, 4],
{ PARAMETER 7
    [42, 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_default_parameter, 0, 1],
{ PARAMETER 8
    [35, 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, 8, clc$optional_parameter, 0
  , 0],
{ PARAMETER 9
    [17, 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, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [21, 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, 83, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [30, 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, 19, clc$optional_parameter,
  0, 0],
{ PARAMETER 12
    [25, 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 13
    [27, 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, 420,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 14
    [36, 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, 303,
  clc$optional_parameter, 0, 0],
{ PARAMETER 15
    [48, 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, 229,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 16
    [44, 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 17
    [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$optional_parameter, 0
  , 0],
{ PARAMETER 18
    [8, 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 19
    [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$optional_parameter, 0
  , 0],
{ PARAMETER 20
    [7, 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, 5],
{ PARAMETER 21
    [14, 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_default_parameter, 0, 2],
{ PARAMETER 22
    [46, 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$program_name_type]],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [6], [
    ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['PROHIBITED                     ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['TERMINATE                      ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['V                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['VOLUNTARY                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'terminate'],
{ PARAMETER 5
    [[1, 0, clc$keyword_type], [6], [
    ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['IGNORE                         ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['T                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['TERMINATE                      ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['V                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['VOLUNTARY                      ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'terminate'],
{ PARAMETER 6
    [[1, 0, clc$boolean_type],
    'true'],
{ PARAMETER 7
    [[1, 0, clc$integer_type], [0, 63, 10],
    '0'],
{ PARAMETER 8
    [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],
{ PARAMETER 9
    [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$file_type]]
    ],
{ PARAMETER 10
    [[1, 0, clc$list_type], [67, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],
      FALSE, 2],
      44, [[1, 0, clc$keyword_type], [1], [
        ['OSF$TASK_SERVICES_LIBRARY      ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ],
      3, [[1, 0, clc$file_type]]
      ]
    ],
{ PARAMETER 11
    [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$program_name_type]]
    ],
{ PARAMETER 12
    [[1, 0, clc$file_type]],
{ PARAMETER 13
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['BLOCK                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['CR                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['CROSS_REFERENCE                ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['ENTRY_POINT                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['EP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['SEGMENT                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
        ]
      ]
    ,
    'none'],
{ PARAMETER 14
    [[1, 0, clc$keyword_type], [8], [
    ['ALTERNATE_ONES                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['AO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['FLOATING_POINT_INDEFINITE      ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['FPI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['INFINITY                       ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['Z                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ZERO                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ],
{ PARAMETER 15
    [[1, 0, clc$keyword_type], [6], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['ERROR                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['F                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['FATAL                          ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['WARNING                        ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ,
    'warning'],
{ PARAMETER 16
    [[1, 0, clc$integer_type], [1, osc$max_segment_length, 10]],
{ PARAMETER 17
    [[1, 0, clc$file_type]],
{ PARAMETER 18
    [[1, 0, clc$file_type]],
{ PARAMETER 19
    [[1, 0, clc$file_type]],
{ PARAMETER 20
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 21
    [[1, 0, clc$integer_type], [3, 15, 10],
    '11'],
{ PARAMETER 22
    [[1, 0, clc$status_type]]];

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

    CONST
      p$name = 1,
      p$starting_procedure = 2,
      p$automatic_restart = 3,
      p$deactivate_task_option = 4,
      p$idle_task_option = 5,
      p$restart_after_idle = 6,
      p$spy_identifier = 7,
      p$parameters = 8,
      p$files = 9,
      p$libraries = 10,
      p$modules = 11,
      p$load_map = 12,
      p$load_map_options = 13,
      p$preset_value = 14,
      p$termination_error_level = 15,
      p$stack_size = 16,
      p$debug_input = 17,
      p$debug_output = 18,
      p$abort_file = 19,
      p$debug_mode = 20,
      p$execution_ring = 21,
      p$status = 22;

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

    CONST
      terminate = 'TERMINATE',
      voluntary = 'VOLUNTARY';

    VAR
      automatic_restart: boolean,
      deactivate_task_option: ost$termination_type,
      execution_ring: ost$valid_ring,
      i: clt$list_size,
      idle_task_option: ost$termination_type,
      libraries: ^llt$object_library_list,
      library_count: clt$list_size,
      module_count: clt$list_size,
      modules: ^pmt$module_list,
      node: ^clt$data_value,
      object_file_count: clt$list_size,
      object_files: ^llt$object_file_list,
      parameter_string: ^clt$parameter_list_contents,
      parameters: ^clt$parameter_list,
      program_attributes: ^llt$program_attributes,
      program_description: ^llt$program_description,
      restart_after_idle: boolean,
      spy_identifier: pmt$spy_identifier,
      task_name: ost$name;

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

    object_file_count := clp$count_list_elements (pvt [p$files].value);
    library_count := clp$count_list_elements (pvt [p$libraries].value);
    module_count := clp$count_list_elements (pvt [p$modules].value);
    PUSH program_description: [[REP (#SIZE (llt$program_attributes) + (object_file_count + library_count) *
          #SIZE (clt$path_name) + module_count * #SIZE (pmt$program_name)) OF cell]];
    RESET program_description;
    NEXT program_attributes IN program_description;
    program_attributes^.contents := $pmt$prog_description_contents [];

    task_name := pvt [p$name].value^.program_name_value;

    IF pvt [p$starting_procedure].specified THEN
      program_attributes^.contents := program_attributes^.contents +
            $pmt$prog_description_contents [pmc$starting_proc_specified];
      program_attributes^.starting_procedure := pvt [p$starting_procedure].value^.program_name_value;
    IFEND;

    automatic_restart := pvt [p$automatic_restart].value^.boolean_value.value;

    IF pvt [p$deactivate_task_option].value^.keyword_value = terminate THEN
      deactivate_task_option := osc$tt_terminate;
    ELSEIF pvt [p$deactivate_task_option].value^.keyword_value = voluntary THEN
      deactivate_task_option := osc$tt_voluntary;
    ELSE { pvt [p$deactivate_task_option].value^.keyword_value = 'PROHIBITED' }
      deactivate_task_option := osc$tt_ignore_or_prohibited;
    IFEND;

    IF pvt [p$idle_task_option].value^.keyword_value = terminate THEN
      idle_task_option := osc$tt_terminate;
    ELSEIF pvt [p$idle_task_option].value^.keyword_value = voluntary THEN
      idle_task_option := osc$tt_voluntary;
    ELSE { pvt [p$idle_task_option].value^.keyword_value = 'IGNORE' }
      idle_task_option := osc$tt_ignore_or_prohibited;
    IFEND;

    restart_after_idle := pvt [p$restart_after_idle].value^.boolean_value.value;

    spy_identifier := pvt [p$spy_identifier].value^.integer_value.value;

    IF pvt [p$parameters].specified THEN
      PUSH parameter_string: [#SIZE (pvt [p$parameters].value^.string_value^)];
      parameter_string^.size := #SIZE (pvt [p$parameters].value^.string_value^);
      parameter_string^.text := pvt [p$parameters].value^.string_value^
    ELSE
      PUSH parameter_string: [0];
      parameter_string^.size := 0;
      parameter_string^.text := '';
    IFEND;
    parameters := #SEQ (parameter_string^);

    IF object_file_count > 0 THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$object_file_list_specified];
      program_attributes^.number_of_object_files := object_file_count;
      NEXT object_files: [1 .. object_file_count] IN program_description;
      node := pvt [p$files].value;
      FOR i := 1 TO object_file_count DO
        object_files^ [i] := node^.element_value^.file_value^;
        node := node^.link;
      FOREND;
    IFEND;

    IF module_count > 0 THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$module_list_specified];
      program_attributes^.number_of_modules := module_count;
      NEXT modules: [1 .. module_count] IN program_description;
      node := pvt [p$modules].value;
      FOR i := 1 TO module_count DO
        modules^ [i] := node^.element_value^.program_name_value;
        node := node^.link;
      FOREND;
    IFEND;

    IF library_count > 0 THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$library_list_specified];
      program_attributes^.number_of_libraries := library_count;
      NEXT libraries: [1 .. library_count] IN program_description;
      node := pvt [p$libraries].value;
      FOR i := 1 TO library_count DO
        IF node^.element_value^.kind = clc$keyword THEN
          libraries^ [i] := node^.element_value^.keyword_value;
        ELSE
          libraries^ [i] := node^.element_value^.file_value^;
        IFEND;
        node := node^.link;
      FOREND;
    IFEND;

    IF pvt [p$load_map].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$load_map_file_specified];
      program_attributes^.load_map_file := pvt [p$load_map].value^.file_value^;
    IFEND;

    program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
          [pmc$load_map_options_specified];
    program_attributes^.load_map_options := $pmt$load_map_options [];
    IF pvt [p$load_map_options].value^.kind = clc$keyword THEN
      IF pvt [p$load_map_options].value^.keyword_value = 'ALL' THEN
        program_attributes^.load_map_options := -$pmt$load_map_options [pmc$no_load_map];
      ELSE {NONE}
        program_attributes^.load_map_options := $pmt$load_map_options [pmc$no_load_map];
      IFEND;
    ELSE {clc$list of clc$keyword}
      node := pvt [p$load_map_options].value;
      WHILE node <> NIL DO
        IF node^.element_value^.keyword_value = 'SEGMENT' THEN
          program_attributes^.load_map_options := program_attributes^.load_map_options +
                $pmt$load_map_options [pmc$segment_map];
        ELSEIF node^.element_value^.keyword_value = 'BLOCK' THEN
          program_attributes^.load_map_options := program_attributes^.load_map_options +
                $pmt$load_map_options [pmc$block_map];
        ELSEIF node^.element_value^.keyword_value = 'ENTRY_POINT' THEN
          program_attributes^.load_map_options := program_attributes^.load_map_options +
                $pmt$load_map_options [pmc$entry_point_map];
        ELSE {CROSS_REFERENCE}
          program_attributes^.load_map_options := program_attributes^.load_map_options +
                $pmt$load_map_options [pmc$entry_point_xref];
        IFEND;
        node := node^.link;
      WHILEND;
    IFEND;

    IF pvt [p$preset_value].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$preset_specified];
      IF pvt [p$preset_value].value^.keyword_value = 'FLOATING_POINT_INDEFINITE' THEN
        program_attributes^.preset := pmc$initialize_to_indefinite;
      ELSEIF pvt [p$preset_value].value^.keyword_value = 'INFINITY' THEN
        program_attributes^.preset := pmc$initialize_to_infinity;
      ELSEIF pvt [p$preset_value].value^.keyword_value = 'ALTERNATE_ONES' THEN
        program_attributes^.preset := pmc$initialize_to_alt_ones;
      ELSEIF pvt [p$preset_value].value^.keyword_value = 'ZERO' THEN
        program_attributes^.preset := pmc$initialize_to_zero;
      IFEND;
    IFEND;

    program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
          [pmc$term_error_level_specified];
    IF pvt [p$termination_error_level].value^.keyword_value = 'WARNING' THEN
      program_attributes^.termination_error_level := pmc$warning_load_errors;
    ELSEIF pvt [p$termination_error_level].value^.keyword_value = 'ERROR' THEN
      program_attributes^.termination_error_level := pmc$error_load_errors;
    ELSEIF pvt [p$termination_error_level].value^.keyword_value = 'FATAL' THEN
      program_attributes^.termination_error_level := pmc$fatal_load_errors;
    IFEND;

    IF pvt [p$stack_size].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$max_stack_size_specified];
      program_attributes^.maximum_stack_size := pvt [p$stack_size].value^.integer_value.value;
    IFEND;

    IF pvt [p$debug_input].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$debug_input_specified];
      program_attributes^.debug_input := pvt [p$debug_input].value^.file_value^;
    IFEND;

    IF pvt [p$debug_output].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$debug_output_specified];
      program_attributes^.debug_output := pvt [p$debug_output].value^.file_value^;
    IFEND;

    IF pvt [p$abort_file].specified THEN
      program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
            [pmc$abort_file_specified];
      program_attributes^.abort_file := pvt [p$abort_file].value^.file_value^;
    IFEND;

    program_attributes^.contents := program_attributes^.contents + $pmt$prog_description_contents
          [pmc$debug_mode_specified];
    program_attributes^.debug_mode := pvt [p$debug_mode].value^.boolean_value.value;

    execution_ring := pvt [p$execution_ring].value^.integer_value.value;

    osp$define_system_task (task_name, automatic_restart, deactivate_task_option, idle_task_option,
          restart_after_idle, spy_identifier, execution_ring, program_description, parameters, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND clp$define_system_task;
?? OLDTITLE, NEWTITLE := '[XDCL, #GATE] clp$delete_system_task', EJECT ??

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

{   PROCEDURE (osm$delst) delete_system_task, delst (
{     name, n: name = $required
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] 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,
    recend := [
    [1,
    [89, 7, 31, 14, 5, 18, 653],
    clc$command, 3, 2, 1, 0, 0, 0, 2, 'OSM$DELST'], [
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ 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
    [3, 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$status_type]]];

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

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

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

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

    osp$delete_system_task (pvt [p$name].value^.name_value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND clp$delete_system_task;
?? OLDTITLE ??
MODEND clm$system_task_maintenance;
