]> git.draconx.ca Git - upkg.git/blobdiff - src/libupkg.c
uobject: Make module loader understand exports/imports.
[upkg.git] / src / libupkg.c
index f1424e8977048e70e19cdb44dac42036207d874a..d4978a39bd89adabcb06d31ae412f479be13d7fb 100644 (file)
@@ -46,7 +46,7 @@ struct upkg_name {
 struct upkg_export_priv {
        struct upkg_export pub;
 
-       long class, super;
+       long super;
        unsigned long size, offset;
 };
 
@@ -282,7 +282,7 @@ static int pkg_init_exports(struct upkg_priv *pkg)
                }
 
                len = 0;
-               rc = upkg_decode_index(&export->class, buf+len, nbuf-len);
+               rc = upkg_decode_index(&export->pub.class, buf+len, nbuf-len);
                if (rc == 0) goto err;
                len += rc;
 
@@ -556,15 +556,15 @@ const char *upkg_export_class(struct upkg *pub, unsigned long idx,
        export = &pkg->exports[idx];
 
        /* Assumption: class references are always imports. */
-       format_assert(export->class <= 0, return NULL);
+       format_assert(export->pub.class <= 0, return NULL);
 
        /* Get the class. */
-       if (export->class == 0) {
+       if (export->pub.class == 0) {
                if (package) *package = "Core";
                return "Class";
        }
 
-       pkg_idx = -(export->class + 1);
+       pkg_idx = -(export->pub.class + 1);
        if (pkg_idx >= pkg->pub.import_count)
                return NULL;
        iclass = &pkg->imports[pkg_idx];