search for: swfdec_as_value_set_string

Displaying 20 results from an estimated 82 matches for "swfdec_as_value_set_string".

2007 Sep 02
0
libswfdec/swfdec_as_array.c libswfdec/swfdec_as_string.c
...offset = swfdec_as_value_to_integer (object->context, &argv[1]); @@ -152,6 +158,9 @@ swfdec_as_string_charAt (SwfdecAsContext int i; const char *s, *t; + if (argc < 1) + return; + i = swfdec_as_value_to_integer (object->context, &argv[0]); if (i < 0) { SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); @@ -177,6 +186,9 @@ swfdec_as_string_charCodeAt (SwfdecAsCon const char *s; gunichar c; + if (argc < 1) + return; + i = swfdec_as_value_to_integer (cx, &argv[0]); if (i < 0) { SWFDEC_AS_VALUE_SET_NUMBER (ret, NAN); @@ -289,9 +301,10 @@ vo...
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...tic void -swfdec_as_object_toString (SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval) +swfdec_as_object_toString (SwfdecAsContext *cx, SwfdecAsObject *object, + guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval) { if (SWFDEC_IS_AS_FUNCTION (object)) { SWFDEC_AS_VALUE_SET_STRING (retval, SWFDEC_AS_STR__type_Function_); @@ -701,10 +705,13 @@ swfdec_as_object_init_context (SwfdecAsC swfdec_as_object_set_variable (object, SWFDEC_AS_STR_prototype, &val); if (version > 5) { - swfdec_as_object_add_function (proto, SWFDEC_AS_STR_hasOwnProperty, 0, swfdec_as_obje...
2007 Jul 14
0
libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_bits.c
...% 256; s[1] = 0; - utf8 = g_convert (s, -1, "UTF8", "LATIN1", NULL, NULL, NULL); + utf8 = g_convert (s, -1, "UTF-8", "LATIN1", NULL, NULL, NULL); if (utf8 == NULL) { g_warning ("conversion of character %u failed", (guint) s[0]); SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY); @@ -2025,7 +2025,7 @@ swfdec_action_mb_ascii_to_char_5 (Swfdec s[0] = i; s[1] = 0; } - utf8 = g_convert (s, -1, "UTF8", "LATIN1", NULL, NULL, NULL); + utf8 = g_convert (s, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);...
2007 Aug 24
0
7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.c test/trace
...cAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { - SwfdecAsString *string = SWFDEC_AS_STRING (object); + const char *string = swfdec_as_object_to_string (cx, object); int i; const char *s, *t; @@ -140,7 +144,7 @@ swfdec_as_string_charAt (SwfdecAsContext SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); return; } - s = swfdec_as_str_nth_char (string->string, i); + s = swfdec_as_str_nth_char (string, i); if (*s == 0) { SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); return; @@ -150,11 +154,12 @@ swfdec_as_string_charAt (SwfdecAsContext...
2007 Oct 31
0
5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_audio.c libswfdec/swfdec_sound.c libswfdec/swfdec_xml.c
...x = object->context; SwfdecAsValue val; - char **varlist, *p; + char **varlist, *p, *unescaped; guint i; varlist = g_strsplit (str, "&", -1); @@ -1571,15 +1571,21 @@ swfdec_as_object_decode (SwfdecAsObject *object, const char *str) } if (p != NULL) { - SWFDEC_AS_VALUE_SET_STRING (&val, - swfdec_as_context_give_string (object->context, - swfdec_as_string_unescape (cx, p))); + unescaped = swfdec_as_string_unescape (cx, p); + if (unescaped != NULL) { + SWFDEC_AS_VALUE_SET_STRING (&val, + swfdec_as_context_give_string (cx, unescaped)); + }...
2008 Jan 19
0
11 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h test/image test/swfdec_test.c test/swfdec_test_image.c test/trace
...SWFDEC_XML (object)->ignore_white = + swfdec_as_value_to_boolean (cx, &argv[0]); } static void @@ -217,8 +218,8 @@ swfdec_xml_get_xmlDecl (SwfdecAsContext *cx, SwfdecAsObject *object, if (!SWFDEC_IS_XML (object)) return; - if (SWFDEC_XML (object)->xmlDecl != NULL) { - SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_XML (object)->xmlDecl); + if (SWFDEC_XML (object)->xml_decl != NULL) { + SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_XML (object)->xml_decl); } else { SWFDEC_AS_VALUE_SET_UNDEFINED (ret); } @@ -238,7 +239,7 @@ swfdec_xml_set_xmlDecl (SwfdecAsContext *cx, SwfdecAsObj...
2007 Oct 25
0
libswfdec/swfdec_as_object.c
...as_string_unescape (object->context, str); - if (str == NULL) - return; - varlist = g_strsplit (str, "&", -1); for (i = 0; varlist[i] != NULL; i++) { @@ -1538,13 +1535,16 @@ swfdec_as_object_decode (SwfdecAsObject *object, const char *str) if (p != NULL) { SWFDEC_AS_VALUE_SET_STRING (&val, - swfdec_as_context_get_string (object->context, p)); + swfdec_as_context_give_string (object->context, + swfdec_as_string_unescape (cx, p))); } else { SWFDEC_AS_VALUE_SET_STRING (&val, SWFDEC_AS_STR_EMPTY); } swfdec_as_object_set_variable (object...
2007 Oct 31
0
3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_movie_asprops.c
...diff --git a/libswfdec/swfdec_movie_asprops.c b/libswfdec/swfdec_movie_asprops.c index deb8d7a..990ccf3 100644 --- a/libswfdec/swfdec_movie_asprops.c +++ b/libswfdec/swfdec_movie_asprops.c @@ -380,6 +380,7 @@ mc_target_get (SwfdecMovie *movie, SwfdecAsValue *rval) } if (s->len == 0) { SWFDEC_AS_VALUE_SET_STRING (rval, SWFDEC_AS_STR_SLASH); + g_string_free (s, TRUE); } else { SWFDEC_AS_VALUE_SET_STRING (rval, swfdec_as_context_give_string ( SWFDEC_AS_OBJECT (movie)->context, g_string_free (s, FALSE))); commit 95923db82b9a6495360a1b0b10f2ea4fe8df5393 Author: Benjamin Otte <otte at gnome...
2007 Jun 20
1
Branch 'as' - 2 commits - libswfdec/swfdec_as_interpret.c
libswfdec/swfdec_as_interpret.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) New commits: diff-tree 9c5cb7cb9f6278896bc8a1e7cd7fb541b079c8de (from 1e19719b58b5cfcb800c81a5f5432c3ad662dbbc) Author: Benjamin Otte <otte at gnome.org> Date: Wed Jun 20 20:58:52 2007 +0200 the modulo arguments were mixed diff --git a/libswfdec/swfdec_as_interpret.c
2007 Aug 20
0
8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_load_object.c libswfdec/swfdec_loadvars_as.c test/trace
..., msg); g_byte_array_free (array, TRUE); - return NULL; + return g_strdup (""); } #undef APPEND } @@ -680,11 +680,10 @@ swfdec_as_string_unescape_internal (Swfd swfdec_as_string_unescape (cx, swfdec_as_value_to_string (cx, &argv[0])); if (result != NULL) { SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, result)); + g_free (result); } else { - SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); + SWFDEC_AS_VALUE_SET_UNDEFINED (ret); } - - g_free (result); } void diff-tree f3fafaa0f2c241b4c42c0f436cfe438d9ab3eadf (from 4c3971ef059f0f7a8c...
2007 Aug 27
0
7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec.h libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_player.c
...+{ + SWFDEC_AS_VALUE_SET_BOOLEAN (ret, FALSE); +} + +static void +swfdec_system_is_debugger (SwfdecPlayer *player, SwfdecAsValue *ret) +{ + SWFDEC_AS_VALUE_SET_BOOLEAN (ret, player->system->debugger); +} + +static void +swfdec_system_version (SwfdecPlayer *player, SwfdecAsValue *ret) +{ + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string ( + SWFDEC_AS_CONTEXT (player), player->system->version)); +} + +static void +swfdec_system_manufacturer (SwfdecPlayer *player, SwfdecAsValue *ret) +{ + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string ( + SWFDEC_AS_CONTEXT (player), player-&gt...
2007 Oct 17
0
6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
...eturn_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (text->variable != NULL); + g_return_if_fail (value != NULL); + + swfdec_text_field_movie_parse_listen_variable (text, text->variable, + &object, &name); + if (object != NULL) { + SwfdecAsValue val; + SWFDEC_AS_VALUE_SET_STRING (&val, value); + swfdec_as_object_set_variable (object, name, &val); + } +} + +static void +swfdec_text_field_movie_variable_listener_callback (SwfdecAsObject *object, + const char *name, const SwfdecAsValue *val) +{ + SwfdecTextFieldMovie *text; - // FIXME: proper variable looku...
2007 Jun 28
0
Branch 'as' - 2 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...C_AS_VALUE_GET_BOOLEAN swfdec_as_value_to_boolean -swfdec_as_value_to_integer +SWFDEC_AS_VALUE_SET_BOOLEAN +SWFDEC_AS_VALUE_GET_NUMBER swfdec_as_value_to_number +swfdec_as_value_to_integer +SWFDEC_AS_VALUE_SET_INT +SWFDEC_AS_VALUE_SET_NUMBER +SWFDEC_AS_VALUE_GET_STRING +swfdec_as_value_to_string +SWFDEC_AS_VALUE_SET_STRING +SWFDEC_AS_VALUE_SET_NULL +SWFDEC_AS_VALUE_GET_OBJECT swfdec_as_value_to_object +SWFDEC_AS_VALUE_SET_OBJECT swfdec_as_value_to_primitive -swfdec_as_value_to_string +swfdec_as_double_to_string +swfdec_as_str_concat +<SUBSECTION Standard> +SWFDEC_IS_AS_VALUE +SWFDEC_AS_VALUE_IS_UNDEFINED +SWF...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...en) { - char *s; SwfdecAsValue *val = swfdec_as_stack_peek (cx, 1); - gunichar c = ((guint) swfdec_as_value_to_integer (cx, val)) % 65536; - s = g_ucs4_to_utf8 (&c, 1, NULL, NULL, NULL); - if (s == NULL) { - g_warning ("conversion of character %u failed", (guint) c); - SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY); - } else { - SWFDEC_AS_VALUE_SET_STRING (val, swfdec_as_context_get_string (cx, s)); - g_free (s); - } -} + if (cx->version <= 5) { + char s[3]; + char *utf8; + guint i; -static void -swfdec_action_ascii_to_char_5 (SwfdecAsContext *cx, guint act...
2007 Oct 22
0
12 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
...ld_movie_do_get_text (SwfdecAsContext *cx, + SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, + SwfdecAsValue *ret) { SwfdecTextFieldMovie *text; - char *str, *p; SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - if (text->input == NULL) { - SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); - return; - } - - str = g_strdup (text->input->str); - - // if input was orginally html, remove all \r - if (text->input_html) { - p = str; - while ((p = strchr (p, '\r')) != NULL) { - memmove (p, p + 1, strlen (p)); - } - } - - //...
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
...al)->type = SWFDEC_TYPE_AS_NUMBER; \ + (__val)->value.number = d; \ } G_STMT_END #define SWFDEC_AS_VALUE_IS_STRING(val) ((val)->type == SWFDEC_TYPE_AS_STRING) #define SWFDEC_AS_VALUE_GET_STRING(val) (g_assert ((val)->type == SWFDEC_TYPE_AS_STRING), (val)->value.string) #define SWFDEC_AS_VALUE_SET_STRING(val,s) G_STMT_START { \ - (val)->type = SWFDEC_TYPE_AS_STRING; \ - (val)->value.string = s; \ + SwfdecAsValue *__val = (val); \ + (__val)->type = SWFDEC_TYPE_AS_STRING; \ + (__val)->value.string = s; \ } G_STMT_END #define SWFDEC_AS_VALUE_IS_NULL(val) ((val)->type == SWFDEC_...
2007 Nov 07
0
7 commits - doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_decoder.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c
...x; SwfdecAsObject *movie; - SwfdecAsValue vals[n_args + 2]; + guint skip = progress ? 4 : 2; + SwfdecAsValue vals[n_args + skip]; if (resource->clip_loader == NULL) return; @@ -123,10 +125,37 @@ swfdec_resource_emit_signal (SwfdecResource *resource, const char *name, SwfdecA SWFDEC_AS_VALUE_SET_STRING (&vals[0], name); SWFDEC_AS_VALUE_SET_OBJECT (&vals[1], movie); + if (progress) { + SwfdecResource *res; + + if (SWFDEC_IS_MOVIE (movie)) + res = swfdec_movie_get_own_resource (SWFDEC_MOVIE (movie)); + else + res = NULL; + if (res && res->decoder) {...
2007 Sep 03
0
4 commits - libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_interpret.c test/trace
...as_boolean_toString (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { - SwfdecAsBoolean *b = SWFDEC_AS_BOOLEAN (object); + SwfdecAsBoolean *b; + + if (!SWFDEC_IS_AS_BOOLEAN (object)) + return; + b = SWFDEC_AS_BOOLEAN (object); SWFDEC_AS_VALUE_SET_STRING (ret, b->boolean ? SWFDEC_AS_STR_true : SWFDEC_AS_STR_false); } -static void +SWFDEC_AS_NATIVE (107, 0, swfdec_as_boolean_valueOf) +void swfdec_as_boolean_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { - SwfdecAsBoolean *b...
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...o_set (SwfdecAsObject *object, const char *variable, const SwfdecAsValue *val, guint flags) @@ -285,23 +340,29 @@ swfdec_as_object_do_set (SwfdecAsObject swfdec_as_context_run (object->context); } } else { - if (var->watch) { - SwfdecAsValue ret, args[4]; - SWFDEC_AS_VALUE_SET_STRING (&args[0], variable); - args[1] = var->value; - args[2] = *val; - if (var->watch_data) { - args[3] = *var->watch_data; - } else { - SWFDEC_AS_VALUE_SET_UNDEFINED (&args[3]); - } - if (var->watch_recurse <= (object->context->version <= 6...
2007 Nov 27
0
12 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_load_object_as.c libswfdec/swfdec_load_object.c libswfdec/swfdec_load_object.h
...l, size); - swfdec_as_object_set_variable_and_flags (load_object->target, - SWFDEC_AS_STR__bytesTotal, &val, SWFDEC_AS_VARIABLE_HIDDEN); -} -static void -swfdec_load_object_ondata (SwfdecLoadObject *load_object, const char *text) -{ - SwfdecAsValue val; - - if (text != NULL) { - SWFDEC_AS_VALUE_SET_STRING (&val, text); - } else { - SWFDEC_AS_VALUE_SET_UNDEFINED (&val); + if (load_object->progress != NULL) { + load_object->progress (load_object->target, + swfdec_loader_get_loaded (loader), swfdec_loader_get_size (loader)); } - - swfdec_as_object_call (load_object->targ...