// file: ln_insert_0.cc
//
 
// isip include files
//
#include "link_node.h"
#include "link_node_constants.h"
 
// method: insert_cc
//
// arguments:
//  Link_node* node : (input) the node pointer to insert
//
// return: a logical_1 indicating success
//
// this method inserts a new node in the next position
//
logical_1 Link_node::insert_cc(Link_node* node_a) {

  // make sure it is a valid node
  //
  if (node_a == (Link_node*)NULL) {
    return ISIP_TRUE;
  }
  
  // set the next node pointer by adjusting link pointers
  //
  if (next_d != (Link_node*)NULL) {
    next_d->prev_d = node_a;
    node_a->next_d = next_d;
  }
  node_a->prev_d = this;
  next_d = node_a;  

  // exit gracefully
  //
  return ISIP_TRUE;
}
