X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fpool.h;h=504ca5e314f59791dc579862588d5f66a163d55c;hb=5c2aa0563fd6e2196b74e60945d2cb7549af80eb;hp=52df041df1febecd9a1d61a7309e50af0e4dd009;hpb=85cb016fc673430b36d86885f93b75c442df9cbc;p=swftools.git diff --git a/lib/as3/pool.h b/lib/as3/pool.h index 52df041..504ca5e 100644 --- a/lib/as3/pool.h +++ b/lib/as3/pool.h @@ -28,6 +28,8 @@ #include "../rfxswf.h" DECLARE(pool); +DECLARE(constant); +DECLARE_LIST(constant); DECLARE(multiname); DECLARE(namespace); DECLARE(namespace_set); @@ -46,16 +48,74 @@ struct _pool { array_t*x_multinames; }; +typedef enum access_type +{ACCESS_STANDARD=0x16, + ACCESS_PACKAGE=0x16, + ACCESS_PACKAGEINTERNAL=0x17, + ACCESS_PROTECTED=0x18, + ACCESS_EXPLICIT=0x19, + ACCESS_STATICPROTECTED=0x1a, + ACCESS_PRIVATE=0x05 +} access_type_t; + + +typedef enum constant_type +{ +CONSTANT_STRING=0x01, +CONSTANT_INT=0x03, +CONSTANT_UINT=0x04, +CONSTANT_FLOAT=0x06, + +CONSTANT_TRUE=0x0B, +CONSTANT_FALSE=0x0A, +CONSTANT_NULL=0x0C, +CONSTANT_UNDEFINED=0x00, + +CONSTANT_NAMESPACE=0x08, +CONSTANT_NAMESPACE_PACKAGE=0x16, +CONSTANT_NAMESPACE_PACKAGEINTERNAL=0x17, +CONSTANT_NAMESPACE_PROTECTED=0x18, +CONSTANT_NAMESPACE_EXPLICIT=0x19, +CONSTANT_NAMESPACE_STATICPROTECTED=0x1A, +CONSTANT_NAMESPACE_PRIVATE=0x05, +} contant_type_t; + +struct _constant { + union { + double f; + int i; + unsigned int u; + char*s; + namespace_t*ns; + }; + int type; +}; + +constant_t* constant_new_int(int x); +constant_t* constant_new_uint(unsigned int x); +constant_t* constant_new_float(double x); +constant_t* constant_new_string(char*s); +constant_t* constant_new_namespace(namespace_t*ns); +constant_t* constant_new_true(); +constant_t* constant_new_false(); +constant_t* constant_new_null(); +constant_t* constant_new_undefined(); +char constant_has_index(constant_t*c); +constant_t* constant_fromindex(pool_t*pool, int index, int type); +char* constant_to_string(constant_t*c); +int constant_get_index(pool_t*pool, constant_t*c); +void constant_free(constant_t*c); + typedef enum multiname_type {QNAME=0x07, - QNAMEA=0x0D, RTQNAME=0x0F, - RTQNAMEA=0x10, RTQNAMEL=0x11, - RTQNAMELA=0x12, MULTINAME=0x09, - MULTINAMEA=0x0E, MULTINAMEL=0x1B, + QNAMEA=0x0D, + RTQNAMEA=0x10, + RTQNAMELA=0x12, + MULTINAMEA=0x0E, MULTINAMELA=0x1C } multiname_type_t; @@ -101,6 +161,9 @@ int pool_find_string(pool_t*pool, const char*s); int pool_find_multiname(pool_t*pool, multiname_t*name); /* object -> integer (lookup/creation) */ +int pool_register_int(pool_t*p, int i); +int pool_register_uint(pool_t*p, unsigned int i); +int pool_register_float(pool_t*p, double d); int pool_register_string(pool_t*pool, const char*s); int pool_register_namespace(pool_t*pool, namespace_t*ns); int pool_register_namespace_set(pool_t*pool, namespace_set_t*set);