returntype is a multiname, now
[swftools.git] / lib / as3 / abc.h
index f74a459..50b02fb 100644 (file)
@@ -40,9 +40,18 @@ DECLARE_LIST(exception);
 
 DECLARE(trait);
 
+
+#define METHOD_NEED_ARGUMENTS 1
+#define METHOD_NEED_ACTIVATION 2
+#define METHOD_NEED_REST 4
+#define METHOD_HAS_OPTIONAL 8
+#define METHOD_SET_DXNS 0x40
+#define METHOD_HAS_PARAM_NAMES 0x80
+
 struct _abc_method {
     multiname_t*return_type;
     multiname_list_t*parameters;
+    constant_list_t*optional_parameters;
     const char*name;
     U8 flags;
     abc_method_body_t*body;
@@ -71,6 +80,7 @@ abc_file_t*abc_file_new();
 #define TRAIT_FUNCTION 5
 #define TRAIT_CONST 6
 
+
 struct _trait {
     unsigned char kind;
     unsigned char attributes;
@@ -87,8 +97,7 @@ struct _trait {
         multiname_t*type_name;
         int data2;
     };
-    int vindex;
-    int vkind;
+    constant_t*value;
 };
 
 struct _abc_class {
@@ -119,9 +128,9 @@ void abc_class_interface(abc_class_t*c);
 void abc_class_protectedNS(abc_class_t*c, char*namespace);
 void abc_class_add_interface(abc_class_t*c, multiname_t*interface);
 
-abc_method_body_t* abc_class_staticconstructor(abc_class_t*cls, char*returntype, int num_params, ...);
-abc_method_body_t* abc_class_constructor(abc_class_t*cls, char*returntype, int num_params, ...);
-abc_method_body_t* abc_class_method(abc_class_t*cls, char*returntype, char*name, int num_params, ...);
+abc_method_body_t* abc_class_staticconstructor(abc_class_t*cls, multiname_t*returntype, int num_params, ...);
+abc_method_body_t* abc_class_constructor(abc_class_t*cls, multiname_t*returntype, int num_params, ...);
+abc_method_body_t* abc_class_method(abc_class_t*cls, multiname_t*returntype, char*name, int num_params, ...);
 
 struct _exception {
     code_t*from;
@@ -147,6 +156,7 @@ struct _abc_method_body {
     trait_list_t*traits;
     
     int index; // filled in during writing
+    codestats_t*stats; //filled in during writing
 };
 
 typedef struct _abc_script {
@@ -156,7 +166,7 @@ typedef struct _abc_script {
 } abc_script_t;
 
 abc_method_t* abc_nullmethod(abc_file_t*file);
-abc_script_t* abc_initscript(abc_file_t*file, char*returntype, int num_params, ...);
+abc_script_t* abc_initscript(abc_file_t*file, multiname_t*returntype, int num_params, ...);
 
 #define __