This doesn't actually do anything useful yet, but it's a start.
static int process_object(int mode, const char *objname)
{
static int process_object(int mode, const char *objname)
{
+ char work[strlen(objname)+1], *p = work, *c;
- pkg = u_pkg_open(objname);
+ strcpy(work, objname);
+
+ /* First, find and open the actual package. */
+ c = strchr(p, '.');
+ if (c) *c = 0;
+
+ pkg = u_pkg_open(p);
if (!pkg || !g_type_module_use(pkg)) {
fprintf(stderr, "%s: %s: failed to open package.\n",
if (!pkg || !g_type_module_use(pkg)) {
fprintf(stderr, "%s: %s: failed to open package.\n",
goto out;
}
if (!U_PKG(pkg)->pkg) {
if (u_pkg_is_native(pkg)) {
fprintf(stderr, "%s: %s: not a UObject package.\n",
goto out;
}
if (!U_PKG(pkg)->pkg) {
if (u_pkg_is_native(pkg)) {
fprintf(stderr, "%s: %s: not a UObject package.\n",
} else {
fprintf(stderr, "%s: %s: package not found.\n",
} else {
fprintf(stderr, "%s: %s: package not found.\n",
+ /* Resolve the hierarchical reference. */
+ while (c) {
+ p = c+1;
+ c = strchr(p, '.');
+ if (c) *c = 0;
+
+ current = upkg_export_find(U_PKG(pkg)->pkg, current, p);
+ if (current == -1) {
+ /* We want to print the full name up to this point. */
+ strcpy(work, objname);
+ if (c) *c = 0;
+
+ fprintf(stderr, "%s: %s: object not found.\n",
+ progname, work);
+ goto out_unuse;
+ }
+ }
+
switch (mode) {
case MODE_INFO:
ret = package_info(U_PKG(pkg)->pkg);
switch (mode) {
case MODE_INFO:
ret = package_info(U_PKG(pkg)->pkg);