Hi to all,
In my wrappers-generator program, I'm using the pygccxml declarations
hierarchy to retrieve all declarations from a C library. Now I've some
problems with the order of the declarations obtained from the
header-parsing process. Supposing those two structures in the global
namespace:
typedef struct Foo
{
....
} Foo;
typedef struct Bar
{
Foo *foo;
......
} Bar;
I need to wrap the Foo structure first than Bar because the Foo type
is used as a Bar's field type. The problem is that, when I iter among
the pygccxml definitions (by example, among the ones returned by the
mdecl_wrapper_t instance obtained by the "global_namespace.classes()"
call) the definitions are often not sorted by declaration-order. The
question is: do I need to order the declarations manually or there's
some other easier way? Sorting the declarations of a small library
it's not a big problem, but when I've to wrap libraries with thousand
of declarations the situation changes...
Thanks for any advice,
Daniele
|