switched from multiname to own types
[swftools.git] / lib / as3 / registry.h
1 /* registry.h
2
3    Routines for compiling Flash2 AVM2 ABC Actionscript
4
5    Extension module for the rfxswf library.
6    Part of the swftools package.
7
8    Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
9  
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.
14
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.
19
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 */
23
24 #ifndef __abc_registry_h__
25 #define __abc_registry_h__
26
27 #include "pool.h"
28
29 DECLARE(class_signature);
30 DECLARE_LIST(class_signature);
31 DECLARE(function_signature);
32
33 struct _class_signature {
34     /* this is very similar to a QNAME */
35     U8 access;
36     const char*package;
37     const char*name;
38
39     class_signature_t*superclass;
40     dict_t members;
41     class_signature_t*interfaces[];
42 };
43 char class_signature_equals(class_signature_t*c1, class_signature_t*c2);
44 extern type_t class_signature_type;
45
46 struct _function_signature {
47     const char*name;
48     class_signature_list_t*params;
49 };
50 extern type_t function_signature_type;
51
52 void registry_init();
53         
54 class_signature_t* class_signature_register(int access, char*package, char*name);
55
56 // static multinames
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();
66
67 class_signature_t* registry_findclass(const char*package, const char*name);
68
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);
71 #define sig2mname(x) class_signature_to_multiname(x)
72
73 #endif