+static int object_export(GTypeModule *pkg, unsigned long idx)
+{
+ struct upkg *upkg = U_PKG(pkg)->pkg;
+ GObject *obj;
+ int ret = -1;
+
+ obj = u_object_new_from_package(upkg, idx);
+ if (!obj) {
+ fprintf(stderr, "%s: failed to load object.\n", progname);
+ return -1;
+ }
+
+ if (!U_OBJECT_IS_EXPORTABLE(obj)) {
+ fprintf(stderr, "%s: object is not exportable.\n", progname);
+ goto out;
+ }
+
+ ret = export(pkg, obj, idx);
+out:
+ g_object_unref(obj);
+ return ret;
+}
+
+int package_export(GTypeModule *pkg)