+
+memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char recursive, char is_static)
+{
+ memberinfo_t tmp;
+ tmp.name = name;
+ tmp.package = ns?ns:"";
+
+ if(!recursive) {
+ if(!is_static)
+ return (memberinfo_t*)dict_lookup(&cls->members, &tmp);
+ else
+ return (memberinfo_t*)dict_lookup(&cls->static_members, &tmp);
+ }
+ /* look at classes directly extended by this class */
+ slotinfo_t*m = 0;
+ classinfo_t*s = cls;
+
+ if(recursive>1) // check *only* superclasses
+ s = s->superclass;
+
+ while(s) {
+ if(s->kind == INFOTYPE_UNRESOLVED)
+ break;
+
+ if(!is_static) {
+ m = (slotinfo_t*)dict_lookup(&s->members, &tmp);
+ if(m) return (memberinfo_t*)m;
+ }
+ m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp);
+ if(m) return (memberinfo_t*)m;
+
+ s = s->superclass;
+ }
+ /* look at interfaces, and parent interfaces */
+ int t=0;
+ while(cls->interfaces[t]) {
+ classinfo_t*s = cls->interfaces[t];
+ if(s->kind != INFOTYPE_UNRESOLVED) {
+ while(s) {
+ if(!is_static) {
+ m = (slotinfo_t*)dict_lookup(&s->members, &tmp);
+ if(m) return (memberinfo_t*)m;
+ }
+ m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp);
+ if(m) return (memberinfo_t*)m;
+
+ s = s->superclass;
+ }
+ }
+ t++;
+ }
+ return 0;
+}
+
+memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses, char is_static)
+{
+ memberinfo_t*m = 0;
+ while(ns) {
+ m = registry_findmember(cls, ns->namespace->name, name, superclasses, is_static);
+ if(m) return m;
+ ns = ns->next;
+ }
+ m = registry_findmember(cls, "", name, superclasses, is_static);
+ if(m) return m;
+ /* TODO: it maybe would be faster to just store the builtin namespace as "" in
+ builtins.c (update: some members (e.g. XML.length) are present both for
+ "" and "http:...builtin") */
+ m = registry_findmember(cls, "http://adobe.com/AS3/2006/builtin", name, superclasses, is_static);
+ if(m) return m;
+ return 0;
+}
+
+
+void registry_fill_multiname(multiname_t*m, namespace_t*n, slotinfo_t*c)