#include <glib-object.h>
#include "upkg.h"
+#include "module.h"
#include "serializable.h"
#include "exportable.h"
-#include "music.h"
void print_upkg_flags(const char *prefix, unsigned long flags)
{
{
struct upkg *pkg;
- g_type_init();
-
if (argc < 2) {
fprintf(stderr, "usage: upkg file\n");
return EXIT_FAILURE;
}
+ if (module_init() != 0)
+ return EXIT_FAILURE;
+
pkg = upkg_fopen(argv[1]);
if (!pkg) {
fprintf(stderr, "failed to open package!\n");
printf("Exports: %lu\n", pkg->export_count);
printf("Imports: %lu\n", pkg->import_count);
- GObject *music = u_music_new();
+ UPkgModule *m = upkg_module_new("engine");
+ g_type_module_use(G_TYPE_MODULE(m));
+
+ GObject *music = g_object_new(g_type_from_name("EngineMusic"), NULL);
+ if (!music)
+ return EXIT_FAILURE;
struct upkg_file *f = upkg_export_open(pkg, 0);
upkg_deserialize(music, f);
printf("Wrote %s\n", name);
upkg_close(pkg);
+ module_exit();
+
return 0;
}