Displaying 12 results from an estimated 12 matches for "swfdec_constant_pool_new_from_act".
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
....description = swfdec_script_print_action (action, data, len);
+ }
+ g_array_append_val (parser->commands, command);
+ if (action == 0x88) {
+ /* constant pool */
+ if (parser->constant_pool)
+ swfdec_constant_pool_free (parser->constant_pool);
+ parser->constant_pool = swfdec_constant_pool_new_from_action (data, len);
+ }
return TRUE;
}
static SwfdecDebuggerScript *
swfdec_debugger_script_new (SwfdecScript *script)
{
- GArray *array;
+ ScriptParser parser;
SwfdecDebuggerScript *ret;
ret = g_new0 (SwfdecDebuggerScript, 1);
ret->script = script;
swfdec_script_ref (scrip...
2007 Jun 06
0
Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...6fe2..0c312bf 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -130,7 +130,7 @@ swfdec_as_frame_new (SwfdecAsContext *co
if (script->constant_pool) {
frame->constant_pool_buffer = swfdec_buffer_ref (script->constant_pool);
frame->constant_pool = swfdec_constant_pool_new_from_action (
- script->constant_pool->data, script->constant_pool->length);
+ script->constant_pool->data, script->constant_pool->length, script->version);
if (frame->constant_pool) {
swfdec_constant_pool_attach_to_context (frame->constant_pool, context);
}...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...swfdec_action_wait_for_frame (SwfdecAsCo
swfdec_script_skip_actions (cx, jump);
}
-#if 0
static void
swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
SwfdecConstantPool *pool;
+ SwfdecAsFrame *frame;
+ frame = cx->frame;
pool = swfdec_constant_pool_new_from_action (data, len);
if (pool == NULL)
- return JS_FALSE;
- if (cx->fp->constant_pool)
- swfdec_constant_pool_free (cx->fp->constant_pool);
- cx->fp->constant_pool = pool;
- return JS_TRUE;
+ return;
+ swfdec_constant_pool_attach_to_context (pool, cx);
+ if (frame->...
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...;js/jsinterp.h"
-/*** SUPPORT FUNCTIONS ***/
-
+#include <string.h>
#include "swfdec_decoder.h"
#include "swfdec_movie.h"
#include "swfdec_root_movie.h"
+/*** CONSTANT POOLS ***/
+
+typedef GPtrArray SwfdecConstantPool;
+
+static SwfdecConstantPool *
+swfdec_constant_pool_new_from_action (const guint8 *data, guint len)
+{
+ guint8 *next;
+ guint i, n;
+ GPtrArray *pool;
+
+ if (len < 2) {
+ SWFDEC_ERROR ("constant pool too small");
+ return NULL;
+ }
+ n = GUINT16_FROM_LE (*((guint16*) data));
+ data += 2;
+ len -= 2;
+ pool = g_ptr_array_sized_new (n...
2007 May 21
0
Branch 'as' - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...sters = script->n_registers;
frame->registers = g_slice_alloc0 (sizeof (SwfdecAsValue) * frame->n_registers);
- frame->thisp = thisp;
if (script->constant_pool) {
frame->constant_pool_buffer = swfdec_buffer_ref (script->constant_pool);
frame->constant_pool = swfdec_constant_pool_new_from_action (
@@ -148,16 +145,13 @@ swfdec_as_frame_new (SwfdecAsObject *thi
}
SwfdecAsFrame *
-swfdec_as_frame_new_native (SwfdecAsObject *thisp)
+swfdec_as_frame_new_native (SwfdecAsContext *context)
{
- SwfdecAsContext *context;
SwfdecAsFrame *frame;
gsize size;
- g_return_val_if_fail (SWF...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
..._string (&bits, parser->version);
if (!s)
goto error;
g_string_append_c (string, '"');
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 2dd36be..ec73386 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -64,7 +64,7 @@ swfdec_constant_pool_new_from_action (const guint8 *data, guint len, guint versi
pool = g_malloc0 (sizeof (SwfdecConstantPool) + (n - 1) * sizeof (char *));
pool->n_strings = n;
for (i = 0; i < n; i++) {
- pool->strings[i] = swfdec_bits_get_string_with_version (&bits, version);
+ pool->strings[i] = sw...
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...wfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -22,6 +22,7 @@
#endif
#include "swfdec_script.h"
+#include "swfdec_as_context.h"
#include "swfdec_debug.h"
#include "swfdec_debugger.h"
#include "swfdec_scriptable.h"
@@ -82,6 +83,20 @@ swfdec_constant_pool_new_from_action (co
return pool;
}
+void
+swfdec_constant_pool_attach_to_context (SwfdecConstantPool *pool, SwfdecAsContext *context)
+{
+ guint i;
+
+ g_return_if_fail (pool != NULL);
+ g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
+
+ for (i = 0; i < pool->len; i++) {
+ g_ptr_array_ind...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...-struct _SwfdecScriptArgument {
- char * name; /* name of the argument (not GC'ed) */
- guint preload; /* preload slot to preload to or 0 */
-};
-
-const char * swfdec_action_get_name (guint action);
-guint swfdec_action_get_from_name (const char * name);
-
-SwfdecConstantPool *
- swfdec_constant_pool_new_from_action (const guint8 * data,
- guint len,
- guint version);
-void swfdec_constant_pool_free (SwfdecConstantPool * pool);
-guint swfdec_constant_pool_size (SwfdecConstantPool * pool);
-const char * swfdec_constant_pool_get (SwfdecConstantPool * pool,
- guint i);
-void...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...gt;n_frames);
+ } else {
+ loaded = movie->n_frames;
+ }
+ if (loaded < frame)
+ swfdec_script_skip_actions (cx, jump);
+}
+
+#if 0
+static void
+swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
+{
+ SwfdecConstantPool *pool;
+
+ pool = swfdec_constant_pool_new_from_action (data, len);
+ if (pool == NULL)
+ return JS_FALSE;
+ if (cx->fp->constant_pool)
+ swfdec_constant_pool_free (cx->fp->constant_pool);
+ cx->fp->constant_pool = pool;
+ return JS_TRUE;
+}
+
+static void
+swfdec_action_push (SwfdecAsContext *cx, guint action, const guin...
2007 Apr 12
0
Branch 'as' - 15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...iption != NULL);
g_array_append_val (parser->commands, command);
- if (action == 0x88) {
- /* constant pool */
+ if (action == SWFDEC_AS_ACTION_CONSTANT_POOL) {
if (parser->constant_pool)
swfdec_constant_pool_free (parser->constant_pool);
parser->constant_pool = swfdec_constant_pool_new_from_action (data, len);
diff-tree f47891d0c97c9679dc4234c83866948ace3d1d50 (from 36576d269d6927d4d2403f98c5dce4e0998b805f)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Apr 12 14:06:09 2007 +0200
return a valid string in _print_action () all the time, never return NULL
diff --git a/libswfd...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...;js/jsinterp.h"
-/*** SUPPORT FUNCTIONS ***/
-
+#include <string.h>
#include "swfdec_decoder.h"
#include "swfdec_movie.h"
#include "swfdec_root_movie.h"
+/*** CONSTANT POOLS ***/
+
+typedef GPtrArray SwfdecConstantPool;
+
+static SwfdecConstantPool *
+swfdec_constant_pool_new_from_action (const guint8 *data, guint len)
+{
+ guint8 *next;
+ guint i, n;
+ GPtrArray *pool;
+
+ if (len < 2) {
+ SWFDEC_ERROR ("constant pool too small");
+ return NULL;
+ }
+ n = GUINT16_FROM_LE (*((guint16*) data));
+ data += 2;
+ len -= 2;
+ pool = g_ptr_array_sized_new (n...
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...-struct _SwfdecScriptArgument {
- char * name; /* name of the argument (not GC'ed) */
- guint preload; /* preload slot to preload to or 0 */
-};
-
-const char * swfdec_action_get_name (guint action);
-guint swfdec_action_get_from_name (const char * name);
-
-SwfdecConstantPool *
- swfdec_constant_pool_new_from_action (const guint8 * data,
- guint len,
- guint version);
-void swfdec_constant_pool_free (SwfdecConstantPool * pool);
-guint swfdec_constant_pool_size (SwfdecConstantPool * pool);
-const char * swfdec_constant_pool_get (SwfdecConstantPool * pool,
- guint i);
-void...