+static void import_print_fullname(const struct upkg_import *import)
+{
+ if (import) {
+ import_print_fullname(import->parent);
+ if (import->parent)
+ putchar('.');
+ printf("%s", import->name);
+ }
+}
+
+static void
+export_print_class(GTypeModule *pkg, const struct upkg_export *export)
+{
+ struct upkg *upkg = U_PKG(pkg)->pkg;
+
+ if (export->class < 0) {
+ const struct upkg_import *class;
+
+ class = upkg_get_import(upkg, -(export->class+1));
+ import_print_fullname(class);
+ } else if (export->class > 0) {
+ const struct upkg_export *class;
+
+ class = upkg_get_export(upkg, export->class-1);
+ export_print_fullname(pkg, class);
+ } else {
+ printf("Core.Class");
+ }
+}
+
+void print_upkg_exports(GTypeModule *pkg)
+{
+ struct upkg *upkg = U_PKG(pkg)->pkg;
+
+ for (unsigned i = 0; i < upkg->export_count; i++) {
+ const struct upkg_export *export = upkg_get_export(upkg, i);
+
+ printf("%u - ", i+1);
+ export_print_fullname(pkg, export);
+ printf(" (");
+ export_print_class(pkg, export);
+ printf(")\n");