3 Routines for compiling Flash2 AVM2 ABC Actionscript
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 */
24 #ifndef __abc_registry_h__
25 #define __abc_registry_h__
29 DECLARE(class_signature);
30 DECLARE_LIST(class_signature);
31 DECLARE(function_signature);
33 struct _class_signature {
34 /* this is very similar to a QNAME */
39 class_signature_t*superclass;
41 class_signature_t*interfaces[];
43 char class_signature_equals(class_signature_t*c1, class_signature_t*c2);
44 extern type_t class_signature_type;
46 struct _function_signature {
48 class_signature_list_t*params;
50 extern type_t function_signature_type;
54 class_signature_t* class_signature_register(int access, char*package, char*name);
57 class_signature_t* registry_getanytype();
58 class_signature_t* registry_getobjectclass();
59 class_signature_t* registry_getnumberclass();
60 class_signature_t* registry_getstringclass();
61 class_signature_t* registry_getintclass();
62 class_signature_t* registry_getuintclass();
63 class_signature_t* registry_getnullclass();
64 class_signature_t* registry_getbooleanclass();
65 class_signature_t* registry_getMovieClip();
67 class_signature_t* registry_findclass(const char*package, const char*name);
69 void registry_fill_multiname(multiname_t*m, namespace_t*n, class_signature_t*c);
70 multiname_t* class_signature_to_multiname(class_signature_t*cls);
72 /* convenience functions */
73 #define sig2mname(x) class_signature_to_multiname(x)
74 #define TYPE_ANY registry_getanytype()
75 #define TYPE_IS_ANY(t) ((t) == registry_getanytype())
76 #define TYPE_INT registry_getintclass()
77 #define TYPE_IS_INT(t) ((t) == registry_getintclass())
78 #define TYPE_UINT registry_getuintclass()
79 #define TYPE_IS_UINT(t) ((t) == registry_getuintclass())
80 #define TYPE_NUMBER registry_getnumberclass()
81 #define TYPE_IS_NUMBER(t) ((t) == registry_getnumberclass())
82 #define TYPE_FLOAT registry_getnumberclass()
83 #define TYPE_IS_FLOAT(t) ((t) == registry_getnumberclass())
84 #define TYPE_BOOLEAN registry_getbooleanclass()
85 #define TYPE_IS_BOOLEAN(t)((t) == registry_getbooleanclass())
86 #define TYPE_STRING registry_getstringclass()
87 #define TYPE_IS_STRING(t) ((t) == registry_getstringclass())
88 #define TYPE_NULL registry_getnullclass()
89 #define TYPE_IS_NULL(t) ((t) == registry_getnullclass())
91 #define TYPE_IS_BUILTIN_SIMPLE(type) (TYPE_IS_INT(type) || \
92 TYPE_IS_UINT(type) || \
93 TYPE_IS_FLOAT(type) || \
94 TYPE_IS_BOOLEAN(type) || \