7
#include <orbit/orbit.h>
9
#include "../src/orb/orb-core/orb-core-private.h"
12
dump_tc (CORBA_TypeCode tc, int ident)
16
id_str = g_new (char, ident + 1);
17
memset (id_str, ' ', ident);
18
id_str [ident] = '\0';
20
printf ("%sType %12s: '%s'\n",
21
id_str, TC_CORBA_TCKind->subnames [tc->kind],
26
dump_iface (ORBit_IInterface *iface)
30
printf ("Interface '%s', %d methods\n",
31
iface->tc->repo_id, iface->methods._length);
33
for (i = 0; i < iface->base_interfaces._length; i++) {
37
for (j = 0; j < i + 1; j++)
40
printf ("%s\n", iface->base_interfaces._buffer [i]);
45
if (iface->methods._length > 0) {
46
for (i = 0; i < iface->methods._length; i++) {
47
ORBit_IMethod *m = &iface->methods._buffer [i];
49
printf (" %s (%d args, %s) %s%s\n",
50
m->name, m->arguments._length,
51
m->contexts._length ? "has context," : "",
52
m->ret ? "returns " : "",
53
m->ret ? m->ret->repo_id : "");
56
printf ("No methods\n");
67
printf ("Installed type libraries:\n\n");
69
paths = ORBit_get_typelib_paths ();
71
for (i = 0; paths && paths [i]; i++) {
75
dh = opendir (paths [i]);
80
printf ("%s:\n\n", paths [i]);
82
for (de = readdir (dh); de; de = readdir (dh)) {
83
char *p, *str = g_strdup (de->d_name);
84
if ((p = strstr (str, "_module.la"))) {
86
printf ("\t%s\n", str);
98
main (int argc, char *argv [])
102
CORBA_sequence_CORBA_TypeCode *tcs;
103
CORBA_sequence_ORBit_IInterface *ifaces;
110
name = argv [argc - 1];
112
if (!ORBit_small_load_typelib (name))
113
g_error ("Can't find typelib of name '%s' in path", name);
115
tcs = ORBit_small_get_types (name);
117
if (!tcs || tcs->_length == 0)
118
printf ("No types\n");
120
printf ("%d types:\n", tcs->_length);
121
for (i = 0; i < tcs->_length; i++)
122
dump_tc (tcs->_buffer [i], 0);
125
ifaces = ORBit_small_get_iinterfaces (name);
126
if (!ifaces || ifaces->_length == 0)
127
printf ("No IInterfaces\n");
129
printf ("%d interfaces:\n", ifaces->_length);
130
for (i = 0; i < ifaces->_length; i++)
131
dump_iface (&ifaces->_buffer [i]);