hash = crc32_add_string(hash, c->name);
return hash;
}
+static unsigned int memberinfo_hash(slotinfo_t*c)
+{
+ unsigned int hash = 0;
+ hash = crc32_add_string(hash, c->name);
+ return hash;
+}
static void* dummy_clone(void*other) {return other;}
static void dummy_destroy(slotinfo_t*c) {}
dup: (dup_func)dummy_clone, // all signatures are static
free: (free_func)dummy_destroy,
};
+type_t memberinfo_type = {
+ hash: (hash_func)memberinfo_hash,
+ equals: (equals_func)slotinfo_equals,
+ dup: (dup_func)dummy_clone, // all signatures are static
+ free: (free_func)dummy_destroy,
+};
// ----------------------- resolving ----------------------------------
slotinfo_t* registry_resolve(slotinfo_t*_s)
c->package = package;
c->name = name;
dict_put(registry_classes, c, c);
- dict_init2(&c->members, &slotinfo_type, AVERAGE_NUMBER_OF_MEMBERS);
+ dict_init2(&c->members, &memberinfo_type, AVERAGE_NUMBER_OF_MEMBERS);
schedule_for_resolve((slotinfo_t*)c);
return c;
c->name = "undefined";
}
- dict_init2(&c->members, &slotinfo_type, 1);
+ dict_init2(&c->members, &memberinfo_type, 1);
c->data = f;
dict_put(functionobjects, f, c);
return c;
return registry_getanytype();
}
}
+
+// ----------------------- package handling ---------------------------
+char registry_ispackage(char*package)
+{
+ /* crude approximation of "the real thing", but sufficient for now */
+ return !strncmp(package, "flash", 5);
+}
// ----------------------- builtin types ------------------------------
classinfo_t* registry_getanytype() {return 0;}
if(!c) c = (classinfo_t*)registry_safefind("", "RegExp");
return c;
}
+classinfo_t* registry_getnamespaceclass() {
+ static classinfo_t*c = 0;
+ if(!c) c = (classinfo_t*)registry_safefind("", "Namespace");
+ return c;
+}
classinfo_t* registry_getMovieClip() {
static classinfo_t*c = 0;
if(!c) c = (classinfo_t*)registry_safefind("flash.display", "MovieClip");