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

#include "ngram_node.h"

// method: delete_cc
//
// arguments:
//  Ngram_node* ngn : (input) the node to be put back in the list
//
// return: a logical_1 indicating success
//
// this method takes the input ngram node and puts it in the free
// ngram nodes list
//
logical_1 Memory_manager::delete_cc(Ngram_node* ngn_a) {

  // get a link node to hold this ngram node
  //
  Link_node* node = new_node_cc();
  
  // put the ngram node in this
  //
  ngn_a->clear_cc();
  node->set_item_cc((void_p)ngn_a);
  
  // insert the incoming node in the node list
  //
  node->insert_cc(ngram_list_d);
  ngram_list_d = node;
  
  // increment free ngram node count
  //
  ngram_count_d++;

  // exit gracefully
  //
  return ISIP_TRUE;
}
