search for: swfdec_type_as_str

Displaying 12 results from an estimated 12 matches for "swfdec_type_as_str".

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
...s_string_init_context (SwfdecAsC SWFDEC_AS_VALUE_SET_OBJECT (&val, string); swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor, &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT); - swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1); - swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1); - swfdec_as_object_add_function (proto, SWFDEC_AS_STR_lastIndexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_lastIndexOf, 1); - swfdec_as_object_add_...
2007 Jun 28
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c test/trace
...c, SwfdecAsValue *argv, SwfdecAsValue *ret) { @@ -671,6 +695,7 @@ swfdec_as_string_init_context (SwfdecAsC SWFDEC_AS_VALUE_SET_OBJECT (&val, string); swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1); + swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charCodeAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charCodeAt, 1); swfdec_as_object_add_fu...
2007 Apr 12
0
Branch 'as' - 14 commits - libswfdec-gtk/swfdec_playback_alsa.c 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
...se SWFDEC_TYPE_AS_NULL: + case SWFDEC_AS_TYPE_NULL: return "null"; - case SWFDEC_TYPE_AS_NUMBER: + case SWFDEC_AS_TYPE_NUMBER: return "Number"; - case SWFDEC_TYPE_AS_BOOLEAN: + case SWFDEC_AS_TYPE_BOOLEAN: return "Boolean"; - case SWFDEC_TYPE_AS_STRING: + case SWFDEC_AS_TYPE_STRING: return "String"; - case SWFDEC_TYPE_AS_ASOBJECT: + case SWFDEC_AS_TYPE_OBJECT: /* FIXME: improve */ return "Object"; default: diff-tree cb15af072feee4d0ea3672d283597e1b4ccfefe1 (from ba06192bc917398202563f5c9a0...
2007 Aug 21
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c test/trace
...g); - swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val); + swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor, + &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charCodeAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charCodeAt, 1); diff --git a/libswfdec/swf...
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
...UMBER(val,d) G_STMT_START { \ - (val)->type = SWFDEC_TYPE_AS_NUMBER; \ - (val)->value.number = d; \ + SwfdecAsValue *__val = (val); \ + (__val)->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); \ + (...
2007 Apr 05
0
Branch 'as' - 9 commits - configure.ac libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...SWFDEC_TYPE_AS_UNDEFINED: + case SWFDEC_TYPE_AS_NULL: + return (context->version >= 7) ? NAN : 0.0; + case SWFDEC_TYPE_AS_BOOLEAN: + return SWFDEC_AS_VALUE_GET_BOOLEAN (value) ? 1 : 0; + case SWFDEC_TYPE_AS_NUMBER: + return SWFDEC_AS_VALUE_GET_NUMBER (value); + case SWFDEC_TYPE_AS_STRING: + { + char *end; + double d = g_ascii_strtod (SWFDEC_AS_VALUE_GET_STRING (value), &end); + if (*end == '\0') + return d; + else + return NAN; + } + case SWFDEC_TYPE_AS_ASOBJECT: + SWFDEC_ERROR ("FIXME"); + return NAN; + default: + g_asser...
2007 Apr 11
0
Branch 'as' - 4 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
..._UNDEFINED: + case SWFDEC_TYPE_AS_NULL: + return FALSE; + case SWFDEC_TYPE_AS_BOOLEAN: + return SWFDEC_AS_VALUE_GET_BOOLEAN (value); + case SWFDEC_TYPE_AS_NUMBER: + { + double d = SWFDEC_AS_VALUE_GET_NUMBER (value); + return d != 0.0 && !isnan (d); + } + case SWFDEC_TYPE_AS_STRING: + if (context->version <= 6) { + double d = swfdec_as_value_to_number (context, value); + return d != 0.0 && !isnan (d); + } else { + return SWFDEC_AS_VALUE_GET_STRING (value) != SWFDEC_AS_STR_EMPTY; + } + case SWFDEC_TYPE_AS_ASOBJECT: + return TRUE; + de...
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
...string_init_context (SwfdecAsC swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val); SWFDEC_AS_VALUE_SET_OBJECT (&val, string); swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val); + swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1); + swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charCodeAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charCodeAt, 1); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_substr, SWFDEC_TYPE_AS_STRING, swfdec_as_string_substr, 1); swfdec_as_object_add_func...
2007 Aug 23
0
23 commits - doc/.gitignore doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec/Makefile.am
...slice(start:Number, end:Number) : String split(delimiter:String, [limit:Number]) : Array #endif @@ -724,6 +750,7 @@ swfdec_as_string_init_context (SwfdecAsC &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1); + swfdec_as_object_add_function (proto, SWFDEC_AS_STR_lastIndexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_lastIndexOf, 1); swfdec_as_object_add_...
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
...E_AS_NULL: + cond = TRUE; + break; + case SWFDEC_TYPE_AS_BOOLEAN: + cond = SWFDEC_AS_VALUE_GET_BOOLEAN (lval) == SWFDEC_AS_VALUE_GET_BOOLEAN (rval); + break; + case SWFDEC_TYPE_AS_NUMBER: + cond = SWFDEC_AS_VALUE_GET_NUMBER (lval) == SWFDEC_AS_VALUE_GET_NUMBER (rval); + break; + case SWFDEC_TYPE_AS_STRING: + cond = SWFDEC_AS_VALUE_GET_STRING (lval) == SWFDEC_AS_VALUE_GET_STRING (rval); + break; + case SWFDEC_TYPE_AS_ASOBJECT: + cond = SWFDEC_AS_VALUE_GET_OBJECT (lval) == SWFDEC_AS_VALUE_GET_OBJECT (rval); + break; + default: + g_assert_not_reached (); + cond = FALSE; + break; }...
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
...(SwfdecAsC g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context)); - string = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global, - SWFDEC_AS_STR_String, 0, swfdec_as_string_construct, 0)); - swfdec_as_native_function_set_construct_type (SWFDEC_AS_NATIVE_FUNCTION (string), SWFDEC_TYPE_AS_STRING); + proto = swfdec_as_object_new_empty (context); + if (proto == NULL) + return; + string = SWFDEC_AS_OBJECT (swfdec_as_object_add_constructor (context->global, + SWFDEC_AS_STR_String, 0, SWFDEC_TYPE_AS_STRING, + swfdec_as_string_construct, 0, proto)); if (!string) re...
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
...e *value) { g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), SWFDEC_AS_STR_EMPTY); g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), SWFDEC_AS_STR_EMPTY); - if (SWFDEC_AS_VALUE_IS_STRING (value)) { - return SWFDEC_AS_VALUE_GET_STRING (value); + switch (value->type) { + case SWFDEC_TYPE_AS_STRING: + return SWFDEC_AS_VALUE_GET_STRING (value); + case SWFDEC_TYPE_AS_UNDEFINED: + if (context->version > 6) + return SWFDEC_AS_STR_UNDEFINED; + else + return SWFDEC_AS_STR_EMPTY; + case SWFDEC_TYPE_AS_BOOLEAN: + return SWFDEC_AS_VALUE_GET_BOOLEAN (value) ? SWFDEC_A...