upkg: Pass the UPkg module struct into package_info.
authorNick Bowler <nbowler@draconx.ca>
Fri, 13 Jul 2012 14:20:58 +0000 (10:20 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 13 Jul 2012 14:20:58 +0000 (10:20 -0400)
src/upkg.c

index 50f5ddab8491cab0787dd53f12025b2dbd8008e6..2b26aa460da470de9ee70124b6a5e8aebdcf9cee 100644 (file)
@@ -236,29 +236,31 @@ void print_upkg_imports(struct upkg *pkg)
        }
 }
 
-int package_info(struct upkg *pkg)
+int package_info(GTypeModule *pkg)
 {
-       printf("Version: %u\n",  pkg->version);
-       printf("License: %u\n",  pkg->license);
+       struct upkg *upkg = U_PKG(pkg)->pkg;
+
+       printf("Version: %u\n", upkg->version);
+       printf("License: %u\n", upkg->license);
        printf("GUID: ");
-       print_guid(pkg->guid);
+       print_guid(upkg->guid);
 
-       printf("Flags:   %lx\n", pkg->flags);
+       printf("Flags:   %lx\n", upkg->flags);
        if (verbose >= 2) {
-               print_upkg_flags("        ", pkg->flags);
+               print_upkg_flags("        ", upkg->flags);
        }
 
-       printf("Names:   %lu\n", pkg->name_count);
+       printf("Names:   %lu\n", upkg->name_count);
        if (verbose >= 3) {
-               for (unsigned long i = 0; i < pkg->name_count; i++) {
-                       printf("%lu - %s\n", i, upkg_get_name(pkg, i));
+               for (unsigned long i = 0; i < upkg->name_count; i++) {
+                       printf("%lu - %s\n", i, upkg_get_name(upkg, i));
                }
        }
 
-       printf("Exports: %lu\n", pkg->export_count);
-       if (verbose >= 1) print_upkg_exports(pkg);
-       printf("Imports: %lu\n", pkg->import_count);
-       if (verbose >= 1) print_upkg_imports(pkg);
+       printf("Exports: %lu\n", upkg->export_count);
+       if (verbose >= 1) print_upkg_exports(upkg);
+       printf("Imports: %lu\n", upkg->import_count);
+       if (verbose >= 1) print_upkg_imports(upkg);
 
        return 0;
 }
@@ -516,7 +518,7 @@ static int process_object(int mode, const char *objname)
        switch (mode) {
        case MODE_INFO:
                if (current < 0)
-                       ret = package_info(U_PKG(pkg)->pkg);
+                       ret = package_info(pkg);
                else
                        ret = object_info(pkg, current);
                break;