summaryrefslogtreecommitdiff
path: root/other/Kermit/src/__exported_sym.c
blob: 3a9943a9667b4e774909261879e9055c01bc5e3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef 0
void
print_exported_symbols ()
{
  struct new_module_symbol
  {
    unsigned long value;
    unsigned long name;
  }
   *syms = NULL, *s = NULL;

  unsigned long long_tmp;
  char *char_tmp = NULL;
  size_t ret, bufsize, x = 800;

  s = syms = new struct new_module_symbol[x];
  bufsize = sizeof (struct new_module_symbol) * x;

  while (query_module (NULL, QM_SYMBOLS, syms, bufsize, &ret) == -1)
    {
      if (errno == ENOSPC)
	{
	  delete syms;
	  x += 400;
	  s = syms = new struct new_module_symbol[x];
	  bufsize = sizeof (struct new_module_symbol) * x;
	}
      else
	{
	  if (Silent)
            {
	      cout << "0" << endl;
	      exit (1);
            }
	  cerr << "query_module error!" << endl;
	  abort ();
	}
    }

  cout.setf (ios::hex, ios::basefield);
  for (x = 0; x < ret; x++, s++)
    {
      char_tmp = (char *) syms + s->name;
      long_tmp = (unsigned long) s->value;
      cout << long_tmp << " " << char_tmp << endl;
    }
  delete syms;
  cout.setf (ios::dec, ios::basefield);
}
#endif

main (){}