?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE : Loader : Dynamic table management' ??
MODULE lom$dynamic_table_management;

{ PURPOSE:
{   This module contains procedures which increase the size of one of four dynamic tables which
{   coexist in a single segment.  Knowledge of the interaction of these tables (as they grow)
{   is localized in this module.
{
{ NOTES:
{   Conditions raised: LOE$ABORT_LOAD, LOE$INSUFFICIENT_MEMORY, LOE$LOADER_MALFUNCTION.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc lle$loader_status_conditions
*copyc llt$deferred_common_blocks
*copyc loe$abort_load
*copyc lot$library_list
*copyc lot$loaded_entry_point_list
*copyc lot$loader_type_definitions
*copyc oss$job_paged_literal
*copyc oss$task_private
?? POP ??
*copyc lop$report_error
*copyc mmp$create_segment
*copyc osp$set_status_abnormal
*copyc pmp$cause_condition
*copyc pmp$exit
*copyc lov$secondary_status
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared by This Module', EJECT ??

  VAR
    dynamic_tables_container: [STATIC] ^SEQ ( * ) := NIL,
    lov$allocated_segments: [XDCL, #GATE] ^array [ * ] of lot$segment_allocation := NIL,
    lov$common_blocks: [XDCL] ^array [ * ] of lot$common_block_definition := NIL,
    lov$dynamic_loaded_entry_points: [XDCL, oss$task_private] ^lot$loaded_entry_point_list := NIL,

{!  Temporary until PSR CILA170 is answered.

    lov$library_list: [XDCL] lot$library_list := [NIL, NIL, NIL];

{!  lov$library_list: [XDCL] lot$library_list := [NIL, ^lov$library_list.first, NIL];

  VAR
    ring_attributes: [oss$job_paged_literal, READ] array [1 .. 1] of mmt$attribute_descriptor :=
          [[mmc$kw_ring_numbers, loc$loader_ring, osc$user_ring_2]];

?? OLDTITLE ??
?? NEWTITLE := '[XDCL] lop$augment_lib_list_container', EJECT ??

  PROCEDURE [XDCL] lop$augment_lib_list_container;

    CONST
      container_size_increment = 4;

    VAR
      abort_status: ^ost$status,
      allocated_segments_copy: ^array [ * ] of lot$segment_allocation,
      common_blocks_copy: ^array [ * ] of lot$common_block_definition,
      dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list,
      existing_libraries: ^SEQ ( * ),
      library: ^lot$library_descriptor,
      nil_pointer: boolean,
      number_of_libraries: pmt$number_of_libraries,
      segment_pointer: mmt$segment_pointer;

  /normal_sequence/
    BEGIN
      IF dynamic_tables_container = NIL THEN
        mmp$create_segment (^ring_attributes, mmc$sequence_pointer, loc$loader_ring, segment_pointer,
              lov$secondary_status);
        IF NOT lov$secondary_status.normal THEN
          lop$report_error (lle$unable_to_create_table, 'DYNAMIC TABLES', '', 0);
          PUSH abort_status;
          pmp$cause_condition (loe$abort_load, NIL, abort_status^);
          pmp$exit (abort_status^);
        IFEND;
        dynamic_tables_container := segment_pointer.seq_pointer;
      ELSE
        IF lov$dynamic_loaded_entry_points <> NIL THEN
          save_dynamic_loaded_eps (dynamic_loaded_ep_copy);
        IFEND;
        IF lov$common_blocks <> NIL THEN
          PUSH common_blocks_copy: [1 .. UPPERBOUND (lov$common_blocks^)];
          common_blocks_copy^ := lov$common_blocks^;
        IFEND;
        IF lov$allocated_segments <> NIL THEN
          PUSH allocated_segments_copy: [1 .. UPPERBOUND (lov$allocated_segments^)];
          allocated_segments_copy^ := lov$allocated_segments^;
        IFEND;
      IFEND;
      number_of_libraries := 0;
      library := lov$library_list.first;
      WHILE library <> NIL DO
        number_of_libraries := number_of_libraries + 1;
        library := library^.nnext;
      WHILEND;
      RESET dynamic_tables_container;
      NEXT lov$library_list.container: [[REP (number_of_libraries + container_size_increment) OF
            lot$library_descriptor]] IN dynamic_tables_container;
      IF lov$library_list.container = NIL THEN
        EXIT /normal_sequence/
      IFEND;
      RESET lov$library_list.container;
      IF number_of_libraries <> 0 THEN

{ Position new library_list container after existing library descriptors.

        NEXT existing_libraries: [[REP number_of_libraries OF lot$library_descriptor]] IN
              lov$library_list.container;
      IFEND;
      IF lov$allocated_segments <> NIL THEN
        NEXT lov$allocated_segments: [1 .. UPPERBOUND (allocated_segments_copy^)] IN dynamic_tables_container;
        IF lov$allocated_segments = NIL THEN
          EXIT /normal_sequence/
        IFEND;
        lov$allocated_segments^ := allocated_segments_copy^;
      IFEND;
      IF lov$common_blocks <> NIL THEN
        NEXT lov$common_blocks: [1 .. UPPERBOUND (common_blocks_copy^)] IN dynamic_tables_container;
        IF lov$common_blocks = NIL THEN
          EXIT /normal_sequence/
        IFEND;
        lov$common_blocks^ := common_blocks_copy^;
      IFEND;
      IF lov$dynamic_loaded_entry_points <> NIL THEN
        restore_dynamic_loaded_eps (dynamic_loaded_ep_copy, nil_pointer);
        IF nil_pointer THEN
          EXIT /normal_sequence/;
        IFEND;
      IFEND;
      RETURN
    END /normal_sequence/;
    lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
    PUSH abort_status;
    pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
    pmp$exit (abort_status^);
  PROCEND lop$augment_lib_list_container;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] lop$augment_allocated_segments', EJECT ??

  PROCEDURE [XDCL] lop$augment_allocated_segments;

    CONST
      allocated_segments_size_incr = 5;

    VAR
      abort_status: ^ost$status,
      allocated_segments_size: lot$allocated_segments_index,
      common_blocks_copy: ^array [ * ] of lot$common_block_definition,
      dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list,
      nil_pointer: boolean,
      segment_pointer: mmt$segment_pointer;

    IF dynamic_tables_container = NIL THEN
      mmp$create_segment (^ring_attributes, mmc$sequence_pointer, loc$loader_ring, segment_pointer,
            lov$secondary_status);
      IF NOT lov$secondary_status.normal THEN
        lop$report_error (lle$unable_to_create_table, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$abort_load, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
      dynamic_tables_container := segment_pointer.seq_pointer;
    ELSE
      IF lov$dynamic_loaded_entry_points <> NIL THEN
        save_dynamic_loaded_eps (dynamic_loaded_ep_copy);
        RESET dynamic_tables_container TO lov$dynamic_loaded_entry_points;
      IFEND;
      IF lov$common_blocks <> NIL THEN
        PUSH common_blocks_copy: [1 .. UPPERBOUND (lov$common_blocks^)];
        common_blocks_copy^ := lov$common_blocks^;
        RESET dynamic_tables_container TO lov$common_blocks;
      IFEND;
      IF lov$allocated_segments <> NIL THEN
        RESET dynamic_tables_container TO lov$allocated_segments;
      IFEND;
    IFEND;
    IF lov$allocated_segments = NIL THEN
      allocated_segments_size := allocated_segments_size_incr;
    ELSE
      allocated_segments_size := allocated_segments_size_incr + UPPERBOUND (lov$allocated_segments^);
    IFEND;
    NEXT lov$allocated_segments: [1 .. allocated_segments_size] IN dynamic_tables_container;
    IF lov$allocated_segments = NIL THEN
      lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
      PUSH abort_status;
      pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
      pmp$exit (abort_status^);
    IFEND;
    IF lov$common_blocks <> NIL THEN
      NEXT lov$common_blocks: [1 .. UPPERBOUND (common_blocks_copy^)] IN dynamic_tables_container;
      IF lov$common_blocks = NIL THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      ELSE
        lov$common_blocks^ := common_blocks_copy^;
      IFEND;
    IFEND;
    IF lov$dynamic_loaded_entry_points <> NIL THEN
      restore_dynamic_loaded_eps (dynamic_loaded_ep_copy, nil_pointer);
      IF nil_pointer THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
    IFEND;
  PROCEND lop$augment_allocated_segments;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] lop$augment_dynamic_loaded_eps', EJECT ??

  PROCEDURE [XDCL] lop$augment_dynamic_loaded_eps;

    CONST
      dynamic_loaded_ep_increment = 50;

    VAR
      abort_status: ^ost$status,
      dynamic_loaded_ep_size: ost$non_negative_integers,
      segment_pointer: mmt$segment_pointer;

    IF dynamic_tables_container = NIL THEN
      mmp$create_segment (^ring_attributes, mmc$sequence_pointer, loc$loader_ring, segment_pointer,
            lov$secondary_status);
      IF NOT lov$secondary_status.normal THEN
        lop$report_error (lle$unable_to_create_table, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$abort_load, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
      dynamic_tables_container := segment_pointer.seq_pointer;
    ELSE
      IF lov$dynamic_loaded_entry_points <> NIL THEN
        RESET dynamic_tables_container TO lov$dynamic_loaded_entry_points^.container;
      IFEND;
    IFEND;
    IF lov$dynamic_loaded_entry_points = NIL THEN
      NEXT lov$dynamic_loaded_entry_points IN dynamic_tables_container;
      IF lov$dynamic_loaded_entry_points = NIL THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
      lov$dynamic_loaded_entry_points^.number_of_entry_points := 0;
      lov$dynamic_loaded_entry_points^.container := NIL;
    IFEND;

    dynamic_loaded_ep_size := dynamic_loaded_ep_increment;
    IF lov$dynamic_loaded_entry_points^.container <> NIL THEN
      dynamic_loaded_ep_size := dynamic_loaded_ep_size + UPPERBOUND (lov$dynamic_loaded_entry_points^.
            container^);
    IFEND;
    NEXT lov$dynamic_loaded_entry_points^.container: [1 .. dynamic_loaded_ep_size] IN
          dynamic_tables_container;
    IF lov$dynamic_loaded_entry_points^.container = NIL THEN
      lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
      PUSH abort_status;
      pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
      pmp$exit (abort_status^);
    IFEND;
  PROCEND lop$augment_dynamic_loaded_eps;
?? OLDTITLE ??
?? NEWTITLE := 'check_for_duplicate_commmon_blks', EJECT ??

{ PURPOSE:
{   The purpose of this request is to determine if a deferred common block
{   is already defined and if so to report an error to the load map.

  PROCEDURE check_for_duplicate_common_blks
    (    deferred_common_blocks: ^llt$deferred_common_blocks;
     VAR previously_defined: {input - output} array [1 .. * ] of boolean;
     VAR number_to_be_added: {input - output} lot$common_blocks_index);

    VAR
      abort_status: ^ost$status,
      containing_segment: lot$allocated_segments_index,
      current_last: lot$common_blocks_index,
      i: lot$common_blocks_index,
      j: lot$common_blocks_index,
      malfunction_status: ^ost$status,
      new_last: lot$common_blocks_index;


    new_last := UPPERBOUND (deferred_common_blocks^);
    current_last := UPPERBOUND (lov$common_blocks^);
    FOR i := 1 TO new_last DO
      FOR j := 1 TO current_last DO
        IF (lov$common_blocks^ [j].name = deferred_common_blocks^ [i].name) AND
              (lov$common_blocks^ [j].loaded_ring = deferred_common_blocks^ [i].loaded_ring) AND
              (lov$common_blocks^ [j].global_lock = deferred_common_blocks^ [i].global_lock) THEN
          previously_defined [i] := TRUE;
          number_to_be_added := number_to_be_added - 1;
          lop$report_error (lle$duplicate_common_block, deferred_common_blocks^ [i].name, '', 0);

{ If all possible duplicate definitions have been found, return.

          IF (current_last = (new_last - number_to_be_added)) THEN
            RETURN;
          IFEND;
        IFEND;
      FOREND;
    FOREND;

  PROCEND check_for_duplicate_common_blks;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] lop$add_deferred_common_blocks', EJECT ??

{ PURPOSE:
{   The purpose of this request is to add the deferred common block
{   definitions to the dynamic common block table.

  PROCEDURE [XDCL] lop$add_deferred_common_blocks
    (    deferred_common_blocks: ^llt$deferred_common_blocks);

    VAR
      abort_status: ^ost$status,
      dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list,
      i: lot$common_blocks_index,
      new_index: lot$common_blocks_index,
      nil_pointer: boolean,
      number_to_be_added: lot$common_blocks_index,
      previously_defined: ^array [1 .. * ] of boolean,
      segment_pointer: mmt$segment_pointer,
      size: lot$common_blocks_index;


    IF dynamic_tables_container = NIL THEN
      mmp$create_segment (^ring_attributes, mmc$sequence_pointer, loc$loader_ring, segment_pointer,
            lov$secondary_status);
      IF NOT lov$secondary_status.normal THEN
        lop$report_error (lle$unable_to_create_table, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$abort_load, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
      dynamic_tables_container := segment_pointer.seq_pointer;
    ELSE
      IF lov$dynamic_loaded_entry_points <> NIL THEN
        save_dynamic_loaded_eps (dynamic_loaded_ep_copy);
        RESET dynamic_tables_container TO lov$dynamic_loaded_entry_points;
      IFEND;
      IF lov$common_blocks <> NIL THEN
        RESET dynamic_tables_container TO lov$common_blocks;
      IFEND;
    IFEND;

    IF lov$common_blocks = NIL THEN
      NEXT lov$common_blocks: [1 .. UPPERBOUND (deferred_common_blocks^)] IN dynamic_tables_container;
      IF lov$common_blocks <> NIL THEN
        FOR i := 1 TO UPPERBOUND (deferred_common_blocks^) DO
          lov$common_blocks^ [i] := deferred_common_blocks^ [i];
        FOREND;
      ELSE
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
    ELSE
      size := UPPERBOUND (lov$common_blocks^);
      number_to_be_added := UPPERBOUND (deferred_common_blocks^);

      PUSH previously_defined: [1 .. number_to_be_added];
      FOR i := 1 TO number_to_be_added DO
        previously_defined^ [i] := FALSE;
      FOREND;

      check_for_duplicate_common_blks (deferred_common_blocks, previously_defined^, number_to_be_added);

      NEXT lov$common_blocks: [1 .. size + number_to_be_added] IN dynamic_tables_container;
      IF lov$common_blocks = NIL THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;

      new_index := size;

      FOR i := 1 TO UPPERBOUND (deferred_common_blocks^) DO
        IF NOT previously_defined^ [i] THEN
          new_index := new_index + 1;
          lov$common_blocks^ [new_index] := deferred_common_blocks^ [i];
        IFEND;
      FOREND;
    IFEND;

    IF lov$dynamic_loaded_entry_points <> NIL THEN
      restore_dynamic_loaded_eps (dynamic_loaded_ep_copy, nil_pointer);
      IF nil_pointer THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
    IFEND;

  PROCEND lop$add_deferred_common_blocks;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] lop$find_common_block_definiton', EJECT ??

{  PURPOSE:
{    This procedure locates the definition of a specified common block if it has already been loaded.
{    If the common block has not been loaded previously, an entry is reserved in the common block
{    definition table.

  PROCEDURE [XDCL] lop$find_common_block_definiton
    (    section_definition: ^llt$section_definition;
         attributes: lot$module_attributes;
     VAR previously_defined {control} : boolean;
     VAR i: lot$common_blocks_index;
     VAR common_block_length: ost$segment_length);

    VAR
      abort_status: ^ost$status,
      current_last: lot$common_blocks_index,
      containing_segment: lot$allocated_segments_index,
      dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list,
      extensible_common_block: boolean,
      malfunction_status: ^ost$status,
      nil_pointer: boolean,
      segment_pointer: mmt$segment_pointer;

    extensible_common_block := section_definition^.kind = llc$extensible_common_block;
    IF lov$common_blocks = NIL THEN
      current_last := 0;
    ELSE
      current_last := UPPERBOUND (lov$common_blocks^);
      FOR i := 1 TO current_last DO
        IF (lov$common_blocks^ [i].name = section_definition^.name) AND
              (lov$common_blocks^ [i].loaded_ring = attributes.loaded_ring) AND
              (lov$common_blocks^ [i].global_lock = attributes.global_key_lock) THEN
          previously_defined := TRUE;
          IF (lov$common_blocks^ [i].extensible = extensible_common_block) AND
                (lov$common_blocks^ [i].allocation_alignment = section_definition^.allocation_alignment) AND
                (lov$common_blocks^ [i].allocation_offset = section_definition^.allocation_offset) AND
                (lov$common_blocks^ [i].access_attributes = section_definition^.access_attributes) THEN
            IF lov$common_blocks^ [i].allocation_length <> section_definition^.length THEN
              IF extensible_common_block THEN
                IF lov$common_blocks^ [i].allocation_length < section_definition^.length THEN
                  lov$common_blocks^ [i].allocation_length := section_definition^.length;

                  IF NOT lov$common_blocks^ [i].unallocated_common THEN

                  /find_containing_segment/
                    BEGIN
                      FOR containing_segment := 1 TO UPPERBOUND (lov$allocated_segments^) DO
                        IF lov$allocated_segments^ [containing_segment].segment =
                              lov$common_blocks^ [i].address.segment THEN
                          EXIT /find_containing_segment/
                        IFEND;
                      FOREND;
                      PUSH malfunction_status;
                      osp$set_status_abnormal ('LL', lle$loader_malfunctioned, 'find common block definition',
                            malfunction_status^);
                      PUSH abort_status;
                      pmp$cause_condition (loe$loader_malfunction, malfunction_status, abort_status^);
                      pmp$exit (abort_status^);
                    END /find_containing_segment/;

                    IF lov$common_blocks^ [i].allocation_length <=
                          lov$allocated_segments^ [containing_segment].maximum_length THEN
                      lov$allocated_segments^ [containing_segment].current_length :=
                            lov$common_blocks^ [i].allocation_length;
                    ELSE
                      common_block_length := lov$allocated_segments^ [containing_segment].maximum_length;
                      lov$common_blocks^ [i].allocation_length := common_block_length;

{!  The following error is reported to load map too early.

                      lop$report_error (lle$extensible_common_truncated, '', '', 0);
                    IFEND;
                  IFEND;
                IFEND;
              ELSE
                IF lov$common_blocks^ [i].allocation_length < section_definition^.length THEN

{!  The following error is reported to load map too early.

                  lop$report_error (lle$common_truncated, section_definition^.name, '', 0);
                ELSE

{!  The following error is reported to load map too early.

                  lop$report_error (lle$common_size_mismatch, section_definition^.name, '', 0);
                IFEND;
              IFEND;
            IFEND;
          ELSE

{!  The following error is reported to load map too early.

            lop$report_error (lle$common_attr_mismatch, section_definition^.name, '', 0);
          IFEND;
          RETURN
        IFEND;
      FOREND;
    IFEND;
    previously_defined := FALSE;
    IF dynamic_tables_container = NIL THEN
      mmp$create_segment (^ring_attributes, mmc$sequence_pointer, loc$loader_ring, segment_pointer,
            lov$secondary_status);
      IF NOT lov$secondary_status.normal THEN
        lop$report_error (lle$unable_to_create_table, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$abort_load, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
      dynamic_tables_container := segment_pointer.seq_pointer;
    ELSE
      IF lov$dynamic_loaded_entry_points <> NIL THEN
        save_dynamic_loaded_eps (dynamic_loaded_ep_copy);
        RESET dynamic_tables_container TO lov$dynamic_loaded_entry_points;
      IFEND;
      IF lov$common_blocks <> NIL THEN
        RESET dynamic_tables_container TO lov$common_blocks;
      IFEND;
    IFEND;
    i := current_last + 1;
    NEXT lov$common_blocks: [1 .. i] IN dynamic_tables_container;
    IF lov$common_blocks <> NIL THEN
      lov$common_blocks^ [i].name := section_definition^.name;
      lov$common_blocks^ [i].global_lock := attributes.global_key_lock;
      lov$common_blocks^ [i].loaded_ring := attributes.loaded_ring;
      lov$common_blocks^ [i].allocation_length := section_definition^.length;
      lov$common_blocks^ [i].allocation_alignment := section_definition^.allocation_alignment;
      lov$common_blocks^ [i].allocation_offset := section_definition^.allocation_offset;
      lov$common_blocks^ [i].access_attributes := section_definition^.access_attributes;
      lov$common_blocks^ [i].extensible := extensible_common_block;
    ELSE
      lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
      PUSH abort_status;
      pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
      pmp$exit (abort_status^);
    IFEND;

    IF lov$dynamic_loaded_entry_points <> NIL THEN
      restore_dynamic_loaded_eps (dynamic_loaded_ep_copy, nil_pointer);
      IF nil_pointer THEN
        lop$report_error (lle$loader_table_overflow, 'DYNAMIC TABLES', '', 0);
        PUSH abort_status;
        pmp$cause_condition (loe$insufficient_memory, NIL, abort_status^);
        pmp$exit (abort_status^);
      IFEND;
    IFEND;

  PROCEND lop$find_common_block_definiton;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] restore_dynamic_loaded_eps', EJECT ??

{ PURPOSE:
{   The purpose of this request is restore the saved copy of the dynamically
{   loaded entry points.

  PROCEDURE [INLINE] restore_dynamic_loaded_eps
    (    dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list;
     VAR nil_pointer: boolean);


    NEXT lov$dynamic_loaded_entry_points IN dynamic_tables_container;
    nil_pointer := (lov$dynamic_loaded_entry_points = NIL);
    IF NOT nil_pointer THEN
      NEXT lov$dynamic_loaded_entry_points^.container: [1 .. UPPERBOUND (dynamic_loaded_ep_copy^.
            container^)] IN dynamic_tables_container;
      nil_pointer := (lov$dynamic_loaded_entry_points^.container = NIL);
      IF NOT nil_pointer THEN
        lov$dynamic_loaded_entry_points^.number_of_entry_points :=
              dynamic_loaded_ep_copy^.number_of_entry_points;
        lov$dynamic_loaded_entry_points^.container^ := dynamic_loaded_ep_copy^.container^;
      IFEND;
    IFEND;

  PROCEND restore_dynamic_loaded_eps;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] save_dynamic_loaded_eps', EJECT ??

{ PURPOSE:
{   The purpose of this request is save a copy of the dynamically loaded entry
{   points so that they may be restored later.

  PROCEDURE [INLINE] save_dynamic_loaded_eps
    (VAR dynamic_loaded_ep_copy: ^lot$loaded_entry_point_list);

    PUSH dynamic_loaded_ep_copy;
    dynamic_loaded_ep_copy^ := lov$dynamic_loaded_entry_points^;
    PUSH dynamic_loaded_ep_copy^.container: [1 .. UPPERBOUND (lov$dynamic_loaded_entry_points^.container^)];
    dynamic_loaded_ep_copy^.container^ := lov$dynamic_loaded_entry_points^.container^;

  PROCEND save_dynamic_loaded_eps;
?? OLDTITLE ??
MODEND lom$dynamic_table_management;
