3 Routines for handling Flash2 AVM2 ABC contantpool entries.
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 */
28 #include "../rfxswf.h"
33 DECLARE(namespace_set);
34 DECLARE_LIST(multiname);
35 DECLARE_LIST(namespace);
38 /* abc file constant pool */
45 array_t*x_namespace_sets;
49 typedef enum multiname_type
62 char* access2str(int type);
68 struct _namespace_set {
69 namespace_list_t*namespaces;
72 extern type_t multiname_type;
74 multiname_type_t type;
76 namespace_set_t*namespace_set;
80 /* object -> string */
81 char* namespace_set_to_string(namespace_set_t*set);
82 char* multiname_to_string(multiname_t*m);
83 char* namespace_to_string(namespace_t*ns);
85 /* integer -> object */
86 int pool_lookup_int(pool_t*pool, int i);
87 unsigned int pool_lookup_uint(pool_t*pool, int i);
88 double pool_lookup_float(pool_t*pool, int i);
89 char*pool_lookup_string(pool_t*pool, int i);
90 namespace_t*pool_lookup_namespace(pool_t*pool, int i);
91 namespace_set_t*pool_lookup_namespace_set(pool_t*pool, int i);
92 multiname_t*pool_lookup_multiname(pool_t*pool, int i);
94 /* object -> integer (lookup) */
95 int pool_find_int(pool_t*pool, int x);
96 int pool_find_uint(pool_t*pool, unsigned int x);
97 int pool_find_double(pool_t*pool, double x);
98 int pool_find_namespace(pool_t*pool, namespace_t*ns);
99 int pool_find_namespace_set(pool_t*pool, namespace_set_t*set);
100 int pool_find_string(pool_t*pool, const char*s);
101 int pool_find_multiname(pool_t*pool, multiname_t*name);
103 /* object -> integer (lookup/creation) */
104 int pool_register_string(pool_t*pool, const char*s);
105 int pool_register_namespace(pool_t*pool, namespace_t*ns);
106 int pool_register_namespace_set(pool_t*pool, namespace_set_t*set);
107 int pool_register_multiname(pool_t*pool, multiname_t*n);
108 int pool_register_multiname2(pool_t*pool, char*name);
111 namespace_t* namespace_new(U8 access, const char*name);
112 namespace_t* namespace_new_package(const char*name);
113 namespace_t* namespace_new_packageinternal(const char*name);
114 namespace_t* namespace_new_protected(const char*name);
115 namespace_t* namespace_new_explicit(const char*name);
116 namespace_t* namespace_new_staticprotected(const char*name);
117 namespace_t* namespace_new_private(const char*name);
118 namespace_t* namespace_clone(namespace_t*ns);
120 multiname_t* multiname_fromstring(const char*name);
121 multiname_t* multiname_new(namespace_t*ns, const char*name);
122 multiname_t* multiname_clone(multiname_t*other);
125 void multiname_destroy(multiname_t*m);
126 void namespace_destroy(namespace_t*n);
128 /* pool constructors/destructors */
130 void pool_read(pool_t*pool, TAG*tag);
131 void pool_write(pool_t*pool, TAG*tag);
132 void pool_destroy(pool_t*pool);