FACT++  1.0
void print_hash_table ( )

Definition at line 1667 of file dns.c.

References dll_get_next(), foutptr, i, MAX_HASH_ENTRIES, red_serv::serv_name, and node::servp.

Referenced by main().

1668 {
1669  int i;
1670  RED_DNS_SERVICE *servp;
1671  int n_entries, max_entry_index = 0;
1672  int max_entries = 0;
1673 
1674 #ifdef VMS
1675  if( ( foutptr = fopen( "scratch$week:[cp_operator]dim_dns.log", "w" )
1676  ) == (FILE *)0 )
1677  {
1678  printf("Cannot open: scratch$week:[cp_operator]dim_dns.log for writing\n");
1679  fflush(stdout);
1680  return;
1681  }
1682 #endif
1683 
1684  for( i = 0; i < MAX_HASH_ENTRIES; i++ )
1685  {
1686  n_entries = 0;
1687 #ifdef VMS
1688  fprintf(foutptr,"HASH[%d] : \n",i);
1689 #endif
1690  servp = Service_hash_table[i];
1691  while( (servp = (RED_DNS_SERVICE *) dll_get_next(
1692  (DLL *) Service_hash_table[i],
1693  (DLL *) servp)) )
1694  {
1695 #ifdef VMS
1696  fprintf(foutptr,"%s\n",servp->serv_name);
1697 #endif
1698  n_entries++;
1699  }
1700 #ifdef VMS
1701  fprintf(foutptr,"\n\n");
1702 #endif
1703  if(n_entries != 0)
1704  printf("HASH[%d] - %d entries\n", i, n_entries);
1705  if(n_entries > max_entries)
1706  {
1707  max_entries = n_entries;
1708  max_entry_index = i;
1709  }
1710  }
1711 #ifdef VMS
1712  fclose(foutptr);
1713 #endif
1714  printf("Maximum : HASH[%d] - %d entries\n", max_entry_index, max_entries);
1715  fflush(stdout);
1716 }
int i
Definition: db_dim_client.c:21
Definition: dns.c:58
FILE * foutptr
Definition: dns.c:24
char serv_name[MAX_NAME]
Definition: dns.c:61
#define MAX_HASH_ENTRIES
Definition: dns.c:23
Definition: dim.h:530
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
static RED_DNS_SERVICE * Service_hash_table[MAX_HASH_ENTRIES]
Definition: dns.c:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function: