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




{ PURPOSE:                                }
{   Contains the routines needed by the   }
{   OLG 'structure' commands to modify the}
{   NLM list.                             }

?? PUSH (LISTEXT := ON) ??
*copyc oct$nlm_modification_list
*copyc oct$nlm_replacement_list
*copyc OST$STATUS
?? POP ??
*copyc OSP$SET_STATUS_ABNORMAL

*copyc OCP$ADD_AN_NLM
*copyc OCP$ADD_AN_NLM_TO_LIST
*copyc OCP$DELETE_AN_NLM
*copyc OCP$EXTRACT_NLM_FROM_LIST
*copyc ocv$olg_working_heap
?? NEWTITLE := '  OCP$SEARCH_MODIFICATION_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$search_modification_list ALIAS 'ocpsml' (module_name: pmt$program_name;
    modification_list: ^oct$nlm_modification_list;
    VAR element_before: ^oct$nlm_modification_list;
    VAR name_found: boolean);




    element_before := modification_list;

    WHILE (element_before^.link <> NIL) DO
      IF (element_before^.link^.nlm^.name = module_name) THEN
        name_found := TRUE;
        RETURN;
      ELSE
        element_before := element_before^.link;
      IFEND;

    WHILEND;

    name_found := FALSE;



  PROCEND ocp$search_modification_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$SEARCH_REPLACEMENT_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$search_replacement_list ALIAS 'ocpsrl' (module_name: pmt$program_name;
    replacement_list: ^oct$nlm_replacement_list;
    VAR element_before: ^oct$nlm_replacement_list;
    VAR name_found: boolean);




    element_before := replacement_list;

    WHILE (element_before^.link <> NIL) DO
      IF (element_before^.link^.nlm^.name = module_name) THEN
        name_found := TRUE;
        RETURN;
      ELSE
        element_before := element_before^.link;
      IFEND;

    WHILEND;

    name_found := FALSE;



  PROCEND ocp$search_replacement_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$FREE_NLM_MODIFICATION_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$free_nlm_modification_list (modification_list: ^oct$nlm_modification_list);


    VAR
      modification: ^oct$nlm_modification_list;


    modification := modification_list^.link;
    modification_list^.link := NIL;

    WHILE modification <> NIL DO
      FREE modification^.nlm IN ocv$olg_working_heap^;

      modification := modification^.link;
    WHILEND;


  PROCEND ocp$free_nlm_modification_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$FREE_NLM_REPLACEMENT_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$free_nlm_replacement_list (replacement_list: ^oct$nlm_replacement_list);


    VAR
      replacement: ^oct$nlm_replacement_list;


    replacement := replacement_list^.link;
    replacement_list^.link := NIL;

    WHILE replacement <> NIL DO
      replacement := replacement^.link;
    WHILEND;


  PROCEND ocp$free_nlm_replacement_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$SEARCH_XDCL_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$search_xdcl_list ALIAS 'ocpsxl' (name: pmt$program_name;
    list: ^oct$external_declaration_list;
    VAR name_found: boolean;
    VAR element_before: ^oct$external_declaration_list);




    element_before := list;

    WHILE (element_before^.link <> NIL) AND (element_before^.link^.name <> name) DO
      element_before := element_before^.link;
    WHILEND;

    name_found := element_before^.link <> NIL;


  PROCEND ocp$search_xdcl_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$ADD_ADDITIONS_TO_NLM_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$add_additions_to_nlm_list ALIAS 'ocpaanl' (after: ^oct$new_library_module_list;
    addition_list: ^oct$nlm_modification_list);


    VAR
      where: ^oct$new_library_module_list,
      next_addition: ^oct$nlm_modification_list;




    next_addition := addition_list^.link;
    where := after;

    WHILE (next_addition <> NIL) DO
      ocp$add_an_nlm (where, next_addition^.nlm);

      where := next_addition^.nlm;

      next_addition := next_addition^.link;
    WHILEND;


  PROCEND ocp$add_additions_to_nlm_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$DELETE_LIST_FROM_NLM_LIST' ??
  ?? EJECT ??

  PROCEDURE [XDCL] ocp$delete_list_from_nlm_list ALIAS 'ocpdlnl' (deletion_list: ^oct$nlm_modification_list);


    VAR
      next_deletion: ^oct$nlm_modification_list;




    next_deletion := deletion_list^.link;

    WHILE (next_deletion <> NIL) DO
      ocp$delete_an_nlm (next_deletion^.nlm);

      next_deletion := next_deletion^.link;
    WHILEND;


  PROCEND ocp$delete_list_from_nlm_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$REPLACE_INTO_NLM_LIST' ??
?? EJECT ??

  PROCEDURE [XDCL] ocp$replace_list_into_nlm_list ALIAS 'ocprlnl' (replacement_list:
    ^oct$nlm_replacement_list);


    VAR
      next_replacement: ^oct$nlm_replacement_list;




    next_replacement := replacement_list^.link;

    WHILE (next_replacement <> NIL) DO
      next_replacement^.nlm^.description := next_replacement^.description;
      next_replacement^.nlm^.changed_info := NIL;

      next_replacement := next_replacement^.link;
    WHILEND;


  PROCEND ocp$replace_list_into_nlm_list;
?? OLDTITLE ??
?? NEWTITLE := '  OCP$REORDER_NLM_LIST' ??
?? EJECT ??




  PROCEDURE [XDCL] ocp$reorder_nlm_list ALIAS 'ocprnl' (after: ^oct$new_library_module_list;
    reorder_list: ^oct$nlm_modification_list);


    VAR
      where: ^oct$new_library_module_list,
      next_reorder: ^oct$nlm_modification_list;


    next_reorder := reorder_list^.link;
    where := after;

    WHILE (next_reorder <> NIL) DO
      ocp$extract_nlm_from_list (next_reorder^.nlm);

      ocp$add_an_nlm_to_list (where, next_reorder^.nlm);

      where := next_reorder^.nlm;

      next_reorder := next_reorder^.link;
    WHILEND;


  PROCEND ocp$reorder_nlm_list;
?? OLDTITLE ??




MODEND ocm$list_processors.
