// file: ln_remove_0.cc
//
 
// isip include files
//
#include "link_node.h"
#include "link_node_constants.h"
 
// method: remove_cc
//
// arguments:
//  Link_node* node : (input) the node pointer to remove
//
// return: a logical_1 indicating success
//
// this method removes the specified node
//
logical_1 Link_node::remove_cc(Link_node* node_a) {

  // check if this pointer is to be removed
  //
  if (node_a == this) {
    return ISIP_FALSE;
  }
  
  // remove the specified node pointer by adjusting link pointers
  //
  if (node_a->next_d != (Link_node*)NULL) {
    node_a->next_d->prev_d = node_a->prev_d;
  }
  if (node_a->prev_d != (Link_node*)NULL) {
    node_a->prev_d->next_d = node_a->next_d;
  }
  node_a->next_d = (Link_node*)NULL;
  node_a->prev_d = (Link_node*)NULL;

  // exit gracefully
  //
  return ISIP_TRUE;
}
