?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE: Object Library Generator' ??
MODULE ocm$select_display_level;

{ PURPOSE:
{   To alter the default level of display
{   information to be provided by the
{   SET_DISPLAY_OPTION command (formerly called SELECT_DISPLAY_LEVEL)
{   and to display the currently operative default selections.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc oce$library_generator_errors
*copyc ost$status
?? POP ??
*copyc clp$count_list_elements
*copyc clp$evaluate_parameters
*copyc osp$set_status_abnormal
*copyc ocv$global_display_toggles
?? OLDTITLE ??
?? NEWTITLE := 'display_toggle_settings ' ??
?? EJECT ??

  PROCEDURE display_toggle_settings
    (    toggle_settings: oct$display_toggles;
     VAR status: ost$status);


    VAR
      pos: 1 .. 255,
      line: [STATIC] string (256) := '  display_options = (';


    pos := 23;

    IF occ$display_all IN toggle_settings THEN
      line (pos, 5) := 'ALL  ';
      pos := pos + 5;

    ELSEIF toggle_settings = $oct$display_toggles [] THEN
      line (pos, 6) := 'NONE  ';
      pos := pos + 6;

    ELSE
      IF occ$display_time_date IN toggle_settings THEN
        line (pos, 11) := 'DATE_TIME, ';
        pos := pos + 11;
      IFEND;

      IF occ$display_module_header IN toggle_settings THEN
        line (pos, 8) := 'HEADER, ';
        pos := pos + 8;
      IFEND;

      IF occ$display_component_info IN toggle_settings THEN
        line (pos, 11) := 'COMPONENT, ';
        pos := pos + 11;
      IFEND;

      IF occ$display_libraries IN toggle_settings THEN
        line (pos, 11) := 'LIBRARIES, ';
        pos := pos + 11;
      IFEND;

      IF occ$display_xdcls IN toggle_settings THEN
        line (pos, 13) := 'ENTRY_POINT, ';
        pos := pos + 13;
      IFEND;

      IF occ$display_xrefs IN toggle_settings THEN
        line (pos, 11) := 'REFERENCE, ';
        pos := pos + 11;
      IFEND;
    IFEND;

    line (pos - 2, 2) := ' )';

    osp$set_status_abnormal ('OC', oce$i_display_toggle, line (1, pos - 1), status);


  PROCEND display_toggle_settings;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] ocp$_set_display_option' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$_set_display_option
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (ocm$creol_setdo) set_display_option, set_display_options, setdo (
{   display_option, display_options, do: any of
{       key
{         all, none
{       keyend
{       list of key
{         (component, c)
{         (date_time, dt)
{         (entry_point, ep)
{         (header, h)
{         (libraries, library, l)
{         (reference, r)
{       keyend
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] 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 .. 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 .. 13] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 7, 17, 18, 30, 21, 407],
    clc$command, 4, 2, 0, 0, 0, 0, 2, 'OCM$CREOL_SETDO'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 1],
    ['DO                             ',clc$abbreviation_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, 605,
  clc$optional_parameter, 0, 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$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]]
      ],
    504, [[1, 0, clc$list_type], [488, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$keyword_type], [13], [
        ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['COMPONENT                      ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['DATE_TIME                      ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['DT                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['ENTRY_POINT                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['EP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['H                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['HEADER                         ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['LIBRARIES                      ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['LIBRARY                        ', clc$alias_entry, clc$normal_usage_entry, 5],
        ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['REFERENCE                      ', clc$nominal_entry, clc$normal_usage_entry, 6]]
        ]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      node: ^clt$data_value,
      toggles: oct$display_toggles;

    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].specified THEN
      toggles := $oct$display_toggles [];
      IF pvt [p$display_option].value^.kind = clc$keyword THEN
        IF pvt [p$display_option].value^.keyword_value = 'ALL' THEN
          toggles := -$oct$display_toggles [];
        ELSE { none
          toggles := $oct$display_toggles [];
        IFEND;
      ELSE { list of keywords
        node := pvt [p$display_option].value;
        WHILE node <> NIL DO
          CASE node^.element_value^.keyword_value (1) OF
          = 'C' =
            toggles := toggles + $oct$display_toggles [occ$display_component_info];
          = 'L' =
            toggles := toggles + $oct$display_toggles [occ$display_libraries];
          = 'D' =
            toggles := toggles + $oct$display_toggles [occ$display_time_date];
          = 'E' =
            toggles := toggles + $oct$display_toggles [occ$display_xdcls];
          = 'H' =
            toggles := toggles + $oct$display_toggles [occ$display_module_header];
          = 'R' =
            toggles := toggles + $oct$display_toggles [occ$display_xrefs];
          CASEND;
          node := node^.link;
        WHILEND;

      IFEND;

      ocv$global_display_toggles := toggles;
    IFEND;


    display_toggle_settings (ocv$global_display_toggles, status);


  PROCEND ocp$_set_display_option;


MODEND ocm$select_display_level;
