list_append(c->interfaces, multiname_clone(interface));
}
-abc_method_t* abc_method_new(abc_file_t*file, multiname_t*returntype, char body)
+void abc_method_init(abc_method_t*m, abc_file_t*file, multiname_t*returntype, char body)
{
/* construct method object */
- NEW(abc_method_t,m);
m->index = array_length(file->methods);
array_append(file->methods, NO_KEY, m);
m->return_type = returntype;
m->body = c;
c->method = m;
}
-
+}
+abc_method_t* abc_method_new(abc_file_t*file, multiname_t*returntype, char body)
+{
+ NEW(abc_method_t,m);
+ abc_method_init(m, file, returntype, body);
return m;
}
}
-trait_t* abc_class_find_slotid(abc_class_t*cls, int slotid)
+trait_t* traits_find_slotid(trait_list_t*traits, int slotid)
{
trait_list_t*l;
trait_t*t=0;
- for(l=cls->traits;l;l=l->next) {
+ for(l=traits;l;l=l->next) {
if(l->trait->slot_id==slotid) {
t=l->trait;
break;
abc_file_t*file = (abc_file_t*)code;
if(!pool)
pool = pool_new();
+ if(!file)
+ file = abc_file_new();
TAG*tmp = swf_InsertTag(0,0);
TAG*tag = tmp;