// file: ht_debug_0.cc
//

// isip include files
//

#ifndef __ISIP_INTEGRAL_CONSTANTS_H
#include<integral_constants.h>
#endif

#include "hash_table.h"
#include "hash_table_constants.h"

// method: debug_cc
//
// arguments:
//  FILE* fp: (input) a open file pointer
//  char_1* message: (input) a message to be displayed
//
// return: a logical_1 flag indicating success
//
logical_1 Hash_table::debug_cc(FILE *fp_a, char_1* message_a) {
  
  // dump the contents of the class to the file
  //
  fprintf(fp_a, "%s::%s size_d = %ld\n", HASH_TABLE_CLASS_NAME, message_a,
	  size_d);
  
  // print the mode
  //
  fprintf(fp_a, "%s::%s mode_d = %c\n", HASH_TABLE_CLASS_NAME, message_a,
	  mode_d);

  // dump the link node pointer information
  //
  fprintf(fp_a, "%s::%s hash_cells_d = %p\n", HASH_TABLE_CLASS_NAME, message_a,
	  cells_d);

  // for each cell
  //
  if (cells_d != (Hash_cell**)NULL) {
    for (int_4 k = 0; k < size_d; k++) {
      
      // output the node list
      //
      for (Hash_cell* cell = cells_d[k]; cell != (Hash_cell*)NULL;
	   cell = cell->get_next_cc()) {
	cell->debug_cc(fp_a, message_a);
      }
    }
  }

  // exit gracefully
  //
  return ISIP_TRUE;
}
