X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fregistry.h;h=dc3099ef6ed0976d76a2d9ac42283fa07a304f87;hb=d49fd65de7a35d210dd7b9aa746ac647c5a90238;hp=77d1f89df0c2d30d08e07d20bdee675d9ea1df06;hpb=f8e9dcb54eb45db2bc25e8e4f1d1213fe4344cc3;p=swftools.git diff --git a/lib/as3/registry.h b/lib/as3/registry.h index 77d1f89..dc3099e 100644 --- a/lib/as3/registry.h +++ b/lib/as3/registry.h @@ -26,16 +26,21 @@ #include "pool.h" +DECLARE(packageinfo); DECLARE(classinfo); -DECLARE_LIST(classinfo); DECLARE(memberinfo); +DECLARE_LIST(classinfo); struct _classinfo { U8 access; U8 flags; const char*package; const char*name; - int slot; + union { + ptroff_t slot; // slot nr in initscript traits + classinfo_t*cls; // specific class of a Class type + memberinfo_t*function; //specific function of a Function type + }; classinfo_t*superclass; dict_t members; @@ -62,7 +67,7 @@ struct _memberinfo { }; extern type_t classinfo_type; -extern type_t function_signature_type; +extern type_t memberinfo_type; void registry_init(); @@ -78,9 +83,9 @@ classinfo_t* registry_getintclass(); classinfo_t* registry_getuintclass(); classinfo_t* registry_getnullclass(); classinfo_t* registry_getbooleanclass(); -classinfo_t* registry_getfunctionclass(); classinfo_t* registry_getMovieClip(); -classinfo_t* registry_getfunctionclass(memberinfo_t*f); +classinfo_t* memberinfo_asclass(memberinfo_t*f); +classinfo_t* registry_getclassclass(classinfo_t*a); classinfo_t* registry_findclass(const char*package, const char*name); memberinfo_t* registry_findmember(classinfo_t*cls, const char*name); @@ -89,6 +94,10 @@ void registry_fill_multiname(multiname_t*m, namespace_t*n, classinfo_t*c); multiname_t* classinfo_to_multiname(classinfo_t*cls); char registry_isfunctionclass(); +char registry_isclassclass(); + +classinfo_t* memberinfo_gettype(memberinfo_t*); + /* convenience functions */ #define sig2mname(x) classinfo_to_multiname(x) #define TYPE_ANY registry_getanytype() @@ -106,9 +115,14 @@ char registry_isfunctionclass(); #define TYPE_STRING registry_getstringclass() #define TYPE_IS_STRING(t) ((t) == registry_getstringclass()) -#define TYPE_FUNCTION(f) registry_getfunctionclass(f) +#define TYPE_OBJECT registry_getobjectclass() + +#define TYPE_FUNCTION(f) memberinfo_asclass(f) #define TYPE_IS_FUNCTION(t) registry_isfunctionclass(t) +#define TYPE_CLASS(f) registry_getclassclass(f) +#define TYPE_IS_CLASS(t) registry_isclassclass(t) + #define TYPE_NULL registry_getnullclass() #define TYPE_IS_NULL(t) ((t) == registry_getnullclass())