// file: mm_delete_8.cc
//
 
// isip include files
//
#include "memory_manager.h"
#include "memory_manager_constants.h"

#include <lattice_path.h>

// method: delete_cc
//
// arguments:
//  Lattice_path* lpth : (input) the path node to be put back in the list
//
// return: a logical_1 indicating success
//
// this method takes the input lattice path and puts it in the free
// lattice paths list
//
logical_1 Memory_manager::delete_cc(Lattice_path* lpth_a) {

  // get a link node to hold this lattice path
  //
  Link_node* node = new_node_cc();
  
  // put the lattice path in this
  //
  lpth_a->clear_cc();
  node->set_item_cc((void_p)lpth_a);
  
  // insert the incoming node in the node list
  //
  node->insert_cc(lpath_list_d);
  lpath_list_d = node;
  
  // increment free lattice path count
  //
  lpath_count_d++;

  // exit gracefully
  //
  return ISIP_TRUE;
}
