make numbers garbage-collected objects
[swfdec.git] / swfdec / swfdec_as_interpret.h
blob36f2f3fda46d52fcfafbf72b53c6907d89c6845f
1 /* Swfdec
2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
20 #ifndef _SWFDEC_AS_INTERPRET_H_
21 #define _SWFDEC_AS_INTERPRET_H_
23 #include <swfdec/swfdec_as_types.h>
25 G_BEGIN_DECLS
27 typedef struct {
28 const char * name; /* name identifying the action */
29 char * (* print) (guint action, const guint8 *data, guint len);
30 int remove; /* values removed from stack or -1 for dynamic */
31 int add; /* values added to the stack or -1 for dynamic */
32 void (* exec) (SwfdecAsContext *cx, guint action, const guint8 *data, guint len);
33 guint version; /* the version this action was introduced in */
34 } SwfdecActionSpec;
36 extern const SwfdecActionSpec swfdec_as_actions[256];
38 /* all known actions */
39 typedef enum {
40 SWFDEC_AS_ACTION_END = 0x00,
41 SWFDEC_AS_ACTION_NEXT_FRAME = 0x04,
42 SWFDEC_AS_ACTION_PREVIOUS_FRAME = 0x05,
43 SWFDEC_AS_ACTION_PLAY = 0x06,
44 SWFDEC_AS_ACTION_STOP = 0x07,
45 SWFDEC_AS_ACTION_TOGGLE_QUALITY = 0x08,
46 SWFDEC_AS_ACTION_STOP_SOUNDS = 0x09,
47 SWFDEC_AS_ACTION_ADD = 0x0A,
48 SWFDEC_AS_ACTION_SUBTRACT = 0x0B,
49 SWFDEC_AS_ACTION_MULTIPLY = 0x0C,
50 SWFDEC_AS_ACTION_DIVIDE = 0x0D,
51 SWFDEC_AS_ACTION_EQUALS = 0x0E,
52 SWFDEC_AS_ACTION_LESS = 0x0F,
53 SWFDEC_AS_ACTION_AND = 0x10,
54 SWFDEC_AS_ACTION_OR = 0x11,
55 SWFDEC_AS_ACTION_NOT = 0x12,
56 SWFDEC_AS_ACTION_STRING_EQUALS = 0x13,
57 SWFDEC_AS_ACTION_STRING_LENGTH = 0x14,
58 SWFDEC_AS_ACTION_STRING_EXTRACT = 0x15,
59 SWFDEC_AS_ACTION_POP = 0x17,
60 SWFDEC_AS_ACTION_TO_INTEGER = 0x18,
61 SWFDEC_AS_ACTION_GET_VARIABLE = 0x1C,
62 SWFDEC_AS_ACTION_SET_VARIABLE = 0x1D,
63 SWFDEC_AS_ACTION_SET_TARGET2 = 0x20,
64 SWFDEC_AS_ACTION_STRING_ADD = 0x21,
65 SWFDEC_AS_ACTION_GET_PROPERTY = 0x22,
66 SWFDEC_AS_ACTION_SET_PROPERTY = 0x23,
67 SWFDEC_AS_ACTION_CLONE_SPRITE = 0x24,
68 SWFDEC_AS_ACTION_REMOVE_SPRITE = 0x25,
69 SWFDEC_AS_ACTION_TRACE = 0x26,
70 SWFDEC_AS_ACTION_START_DRAG = 0x27,
71 SWFDEC_AS_ACTION_END_DRAG = 0x28,
72 SWFDEC_AS_ACTION_STRING_LESS = 0x29,
73 SWFDEC_AS_ACTION_THROW = 0x2A,
74 SWFDEC_AS_ACTION_CAST = 0x2B,
75 SWFDEC_AS_ACTION_IMPLEMENTS = 0x2C,
76 SWFDEC_AS_ACTION_RANDOM = 0x30,
77 SWFDEC_AS_ACTION_MB_STRING_LENGTH = 0x31,
78 SWFDEC_AS_ACTION_CHAR_TO_ASCII = 0x32,
79 SWFDEC_AS_ACTION_ASCII_TO_CHAR = 0x33,
80 SWFDEC_AS_ACTION_GET_TIME = 0x34,
81 SWFDEC_AS_ACTION_MB_STRING_EXTRACT = 0x35,
82 SWFDEC_AS_ACTION_MB_CHAR_TO_ASCII = 0x36,
83 SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR = 0x37,
84 SWFDEC_AS_ACTION_DELETE = 0x3A,
85 SWFDEC_AS_ACTION_DELETE2 = 0x3B,
86 SWFDEC_AS_ACTION_DEFINE_LOCAL = 0x3C,
87 SWFDEC_AS_ACTION_CALL_FUNCTION = 0x3D,
88 SWFDEC_AS_ACTION_RETURN = 0x3E,
89 SWFDEC_AS_ACTION_MODULO = 0x3F,
90 SWFDEC_AS_ACTION_NEW_OBJECT = 0x40,
91 SWFDEC_AS_ACTION_DEFINE_LOCAL2 = 0x41,
92 SWFDEC_AS_ACTION_INIT_ARRAY = 0x42,
93 SWFDEC_AS_ACTION_INIT_OBJECT = 0x43,
94 SWFDEC_AS_ACTION_TYPE_OF = 0x44,
95 SWFDEC_AS_ACTION_TARGET_PATH = 0x45,
96 SWFDEC_AS_ACTION_ENUMERATE = 0x46,
97 SWFDEC_AS_ACTION_ADD2 = 0x47,
98 SWFDEC_AS_ACTION_LESS2 = 0x48,
99 SWFDEC_AS_ACTION_EQUALS2 = 0x49,
100 SWFDEC_AS_ACTION_TO_NUMBER = 0x4A,
101 SWFDEC_AS_ACTION_TO_STRING = 0x4B,
102 SWFDEC_AS_ACTION_PUSH_DUPLICATE = 0x4C,
103 SWFDEC_AS_ACTION_SWAP = 0x4D,
104 SWFDEC_AS_ACTION_GET_MEMBER = 0x4E,
105 SWFDEC_AS_ACTION_SET_MEMBER = 0x4F,
106 SWFDEC_AS_ACTION_INCREMENT = 0x50,
107 SWFDEC_AS_ACTION_DECREMENT = 0x51,
108 SWFDEC_AS_ACTION_CALL_METHOD = 0x52,
109 SWFDEC_AS_ACTION_NEW_METHOD = 0x53,
110 SWFDEC_AS_ACTION_INSTANCE_OF = 0x54,
111 SWFDEC_AS_ACTION_ENUMERATE2 = 0x55,
112 SWFDEC_AS_ACTION_BREAKPOINT = 0x5F,
113 SWFDEC_AS_ACTION_BIT_AND = 0x60,
114 SWFDEC_AS_ACTION_BIT_OR = 0x61,
115 SWFDEC_AS_ACTION_BIT_XOR = 0x62,
116 SWFDEC_AS_ACTION_BIT_LSHIFT = 0x63,
117 SWFDEC_AS_ACTION_BIT_RSHIFT = 0x64,
118 SWFDEC_AS_ACTION_BIT_URSHIFT = 0x65,
119 SWFDEC_AS_ACTION_STRICT_EQUALS = 0x66,
120 SWFDEC_AS_ACTION_GREATER = 0x67,
121 SWFDEC_AS_ACTION_STRING_GREATER = 0x68,
122 SWFDEC_AS_ACTION_EXTENDS = 0x69,
123 SWFDEC_AS_ACTION_GOTO_FRAME = 0x81,
124 SWFDEC_AS_ACTION_GET_URL = 0x83,
125 SWFDEC_AS_ACTION_STORE_REGISTER = 0x87,
126 SWFDEC_AS_ACTION_CONSTANT_POOL = 0x88,
127 SWFDEC_AS_ACTION_STRICT_MODE = 0x89,
128 SWFDEC_AS_ACTION_WAIT_FOR_FRAME = 0x8A,
129 SWFDEC_AS_ACTION_SET_TARGET = 0x8B,
130 SWFDEC_AS_ACTION_GOTO_LABEL = 0x8C,
131 SWFDEC_AS_ACTION_WAIT_FOR_FRAME2 = 0x8D,
132 SWFDEC_AS_ACTION_DEFINE_FUNCTION2 = 0x8E,
133 SWFDEC_AS_ACTION_TRY = 0x8F,
134 SWFDEC_AS_ACTION_WITH = 0x94,
135 SWFDEC_AS_ACTION_PUSH = 0x96,
136 SWFDEC_AS_ACTION_JUMP = 0x99,
137 SWFDEC_AS_ACTION_GET_URL2 = 0x9A,
138 SWFDEC_AS_ACTION_DEFINE_FUNCTION = 0x9B,
139 SWFDEC_AS_ACTION_IF = 0x9D,
140 SWFDEC_AS_ACTION_CALL = 0x9E,
141 SWFDEC_AS_ACTION_GOTO_FRAME2 = 0x9F
142 } SwfdecAsAction;
144 // FIXME: move
145 SwfdecAsObject * swfdec_action_lookup_object (SwfdecAsContext * cx,
146 SwfdecAsObject * o,
147 const char * path,
148 const char * end);
150 G_END_DECLS
151 #endif