+#define AVERAGE_NUMBER_OF_MEMBERS 8
+classinfo_t* classinfo_register(int access, const char*package, const char*name, int num_interfaces)
+{
+ classinfo_t*c = rfx_calloc(sizeof(classinfo_t)+(sizeof(classinfo_t*)*(num_interfaces+1)));
+ c->interfaces[0] = 0;
+ c->kind = INFOTYPE_CLASS;
+ c->access = access;
+ c->package = package;
+ c->name = name;
+ dict_put(classes, c, c);
+ dict_init(&c->members,AVERAGE_NUMBER_OF_MEMBERS);
+ return c;
+}
+methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*name)
+{
+ NEW(methodinfo_t,m);
+ m->kind = INFOTYPE_METHOD;
+ m->access = access;
+ m->name = name;
+ m->parent = cls;
+ dict_put(&cls->members, name, m);
+ return m;
+}
+varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*name)
+{
+ NEW(varinfo_t,m);
+ m->kind = INFOTYPE_SLOT;
+ m->access = access;
+ m->name = name;
+ m->parent = cls;
+ dict_put(&cls->members, name, m);
+ return m;
+}
+methodinfo_t* methodinfo_register_global(U8 access, const char*package, const char*name)
+{
+ NEW(methodinfo_t, m);
+ m->kind = INFOTYPE_METHOD;
+ m->flags = FLAG_STATIC;
+ m->access = access;
+ m->package = package;
+ m->name = name;
+ m->parent = 0;
+ dict_put(classes, m, m);
+ return m;
+}
+varinfo_t* varinfo_register_global(U8 access, const char*package, const char*name)
+{
+ NEW(varinfo_t, m);
+ m->kind = INFOTYPE_SLOT;
+ m->flags = FLAG_STATIC;
+ m->access = access;
+ m->package = package;
+ m->name = name;
+ m->parent = 0;
+ dict_put(classes, m, m);
+ return m;
+}
+
+// --------------- builtin classes (from builtin.c) ----------------------
+
+void registry_init()
+{
+ if(!classes)
+ classes = builtin_getclasses();
+}
+slotinfo_t* registry_find(const char*package, const char*name)
+{
+ assert(classes);
+ slotinfo_t tmp;
+ tmp.package = package;
+ tmp.name = name;
+ slotinfo_t* c = (slotinfo_t*)dict_lookup(classes, &tmp);
+ /*if(c)
+ printf("%s.%s->%08x (%s.%s)\n", package, name, c, c->package, c->name);*/
+ return c;
+}
+slotinfo_t* registry_safefind(const char*package, const char*name)
+{
+ slotinfo_t*c = registry_find(package, name);
+ if(!c) {
+ printf("%s.%s\n", package, name);
+ }
+ assert(c);
+ return c;
+}
+void registry_dump()