From 64b820f5aa8bb7f2df9f297e325434f043e2d25b Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 2 Jan 2009 19:54:04 +0000 Subject: [PATCH] new function memberinfo_register_global --- lib/as3/registry.c | 16 +++++++++++++++- lib/as3/registry.h | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/as3/registry.c b/lib/as3/registry.c index 5aa254d..61fd55b 100644 --- a/lib/as3/registry.c +++ b/lib/as3/registry.c @@ -81,7 +81,7 @@ type_t memberinfo_type = { // ------------------------- constructors -------------------------------- #define AVERAGE_NUMBER_OF_MEMBERS 8 -classinfo_t* classinfo_register(int access, char*package, char*name, int num_interfaces) +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; @@ -123,6 +123,20 @@ memberinfo_t* memberinfo_register(classinfo_t*cls, const char*name, U8 kind) dict_put(&cls->members, name, m); return m; } +memberinfo_t* memberinfo_register_global(U8 access, const char*package, const char*name, U8 kind) +{ + NEW(memberinfo_t, m); + m->kind = kind; + m->flags = FLAG_STATIC; + m->name = name; + m->parent = 0; + + classinfo_t*c = classinfo_register(access, package, name, 0); + c->function = m; + c->flags |= FLAG_METHOD; + return m; +} + // --------------- builtin classes (from builtin.c) ---------------------- diff --git a/lib/as3/registry.h b/lib/as3/registry.h index b92c6a2..c4a8281 100644 --- a/lib/as3/registry.h +++ b/lib/as3/registry.h @@ -31,6 +31,17 @@ DECLARE(classinfo); DECLARE(memberinfo); DECLARE_LIST(classinfo); +#define FLAG_PUBLIC 1 +#define FLAG_FINAL 2 +#define FLAG_PROTECTED 4 +#define FLAG_STATIC 8 +#define FLAG_DYNAMIC 16 +#define FLAG_PRIVATE 32 +#define FLAG_OVERRIDE 64 +#define FLAG_METHOD 64 +#define FLAG_INTERNAL 128 +#define FLAG_NATIVE 256 + struct _classinfo { U8 access; U8 flags; @@ -72,8 +83,9 @@ extern type_t memberinfo_type; void registry_init(); -classinfo_t* classinfo_register(int access, char*package, char*name, int num_interfaces); +classinfo_t* classinfo_register(int access, const char*package, const char*name, int num_interfaces); memberinfo_t* memberinfo_register(classinfo_t*cls, const char*name, U8 type); +memberinfo_t* memberinfo_register_global(U8 access, const char*package, const char*name, U8 kind); // static multinames classinfo_t* registry_getanytype(); -- 1.7.10.4