3 Routines for handling Flash2 AVM2 ABC Actionscript (header file)
5 Extension module for the rfxswf library.
6 Part of the swftools package.
8 Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
27 #define DECLARE(x) struct _##x;typedef struct _##x x##_t;
28 #define DECLARE_LIST(x) \
29 struct _##x##_list { \
31 struct _##x##_list*next; \
33 typedef struct _##x##_list x##_list_t; \
36 DECLARE(abc_method_body);
37 DECLARE(abc_interface);
38 DECLARE(abc_multiname);
39 DECLARE(abc_namespace);
41 DECLARE_LIST(abc_multiname);
43 typedef struct _abc_method {
44 abc_multiname_t*return_type;
45 abc_multiname_list_t*parameters;
50 int method_body_index;
53 typedef enum multiname_type
66 struct _abc_namespace {
71 struct _abc_multiname {
72 multiname_type_t type;
74 const char*namespace_set_name; // FIXME should be a struct
78 typedef struct _dict_entry {
83 typedef struct _dict {
98 dict_t*namespace_sets;
107 dict_t*method_bodies;
110 abc_file_t*abc_file_new();
112 typedef struct _abc_trait {
131 typedef struct _abc_class {
135 const char*classname;
136 const char*superclass;
137 const char*protectedNS;
139 abc_multiname_list_t*interfaces;
144 int static_constructor_index;
145 dict_t*static_constructor_traits;
150 abc_class_t* abc_class_new(abc_file_t*pool, char*classname, char*superclass);
151 void abc_class_sealed(abc_class_t*c);
152 void abc_class_final(abc_class_t*c);
153 void abc_class_interface(abc_class_t*c);
154 void abc_class_protectedNS(abc_class_t*c, char*namespace);
156 abc_method_body_t* abc_class_staticconstructor(abc_class_t*cls, char*returntype, int num_params, ...);
157 abc_method_body_t* abc_class_constructor(abc_class_t*cls, char*returntype, int num_params, ...);
158 abc_method_body_t* abc_class_method(abc_class_t*cls, char*returntype, char*name, int num_params, ...);
160 struct _abc_method_body {
168 int init_scope_depth;
174 typedef struct _abc_label {
177 typedef struct _abc_script {
183 abc_script_t* abc_initscript(abc_file_t*pool, char*returntype, int num_params, ...);