-
-/* function and class pointers get their own type class */
-static dict_t* functionobjects = 0;
-classinfo_t* registry_getfunctionclass(memberinfo_t*f) {
- if(!functionobjects) {
- functionobjects = dict_new2(&ptr_type);
- } else {
- classinfo_t*c = dict_lookup(functionobjects, f);
- if(c)
- return c;
- }
-
- NEW(classinfo_t,c);
- c->access = ACCESS_PUBLIC;
- c->package = "";
- c->name = "Function";
- dict_init(&c->members,1);
- dict_put(&c->members, "call", f);
-
- dict_put(functionobjects, f, c);
- return c;
-}
-static dict_t* classobjects = 0;
-classinfo_t* registry_getclassclass(classinfo_t*a) {
- if(!classobjects) {
- classobjects = dict_new2(&ptr_type);
- } else {
- classinfo_t*c = dict_lookup(classobjects, a);
- if(c)
- return c;
- }
-
- NEW(classinfo_t,c);
- c->access = ACCESS_PUBLIC;
- c->package = "";
- c->name = "Class";
-
- NEW(memberinfo_t,m);
- m->kind = MEMBER_SLOT;
- m->name = "prototype";
- m->type = a;
-
- dict_init(&c->members,1);
- dict_put(&c->members, "prototype", m);
-
- dict_put(classobjects, a, c);
- 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;