X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fas3%2Fregistry.h;h=d63e879c54842acd163eee38281be65a56aabe29;hp=915a71e7b50d28304b29fbb0c75d3147f9aaf4ed;hb=9ed9a87914fc9a590967d46de404e0f6290b7bb2;hpb=d016fb9a0dd752b541a45830ec55516ada425944 diff --git a/lib/as3/registry.h b/lib/as3/registry.h index 915a71e..d63e879 100644 --- a/lib/as3/registry.h +++ b/lib/as3/registry.h @@ -24,8 +24,10 @@ #ifndef __abc_registry_h__ #define __abc_registry_h__ -#include "pool.h" +#include "abc.h" +DECLARE(asset_bundle); +DECLARE_LIST(asset_bundle); DECLARE(slotinfo); DECLARE(classinfo); DECLARE(memberinfo); @@ -38,6 +40,7 @@ DECLARE_LIST(slotinfo); /* member/class flags */ #define FLAG_FINAL 1 #define FLAG_BUILTIN 128 +#define FLAG_ASSET 64 /* member flags */ #define FLAG_STATIC 2 @@ -77,7 +80,9 @@ struct _classinfo { int slot; classinfo_t*superclass; dict_t members; + dict_t static_members; void*data; //TODO: get rid of this- parser.y should pass type/value/code triples around + asset_bundle_t*assets; classinfo_t*interfaces[]; }; struct _memberinfo { @@ -110,6 +115,11 @@ struct _varinfo /*extends memberinfo*/ { constant_t*value; }; +struct _asset_bundle { + abc_file_t*file; + char used; +}; + extern type_t memberinfo_type; extern type_t slotinfo_type; char slotinfo_equals(slotinfo_t*c1, slotinfo_t*c2); @@ -117,9 +127,9 @@ char slotinfo_equals(slotinfo_t*c1, slotinfo_t*c2); void registry_init(); classinfo_t* classinfo_register(int access, const char*package, const char*name, int num_interfaces); -methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name); +methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static); methodinfo_t* methodinfo_register_global(U8 access, const char*package, const char*name); -varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name); +varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static); varinfo_t* varinfo_register_global(U8 access, const char*package, const char*name); slotinfo_t* registry_resolve(slotinfo_t*s); @@ -127,8 +137,8 @@ void registry_resolve_all(); slotinfo_t* registry_find(const char*package, const char*name); void registry_dump(); -memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char superclasses); -memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses); +memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char superclasses, char is_static); +memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses, char is_static); void registry_fill_multiname(multiname_t*m, namespace_t*n, slotinfo_t*c); #define MULTINAME(m,x) \ @@ -149,7 +159,12 @@ namespace_t access2namespace(U8 access, char*package); char registry_ispackage(const char*package); +void registry_add_asset(asset_bundle_t*bundle); +void registry_use(slotinfo_t*s); +asset_bundle_list_t*registry_getassets(); + // static multinames +classinfo_t voidclass; classinfo_t* registry_getanytype(); classinfo_t* registry_getarrayclass(); classinfo_t* registry_getobjectclass();