Displaying 3 results from an estimated 3 matches for "swfdec_as_str_sub".
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
...fdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ if (cx->version == 5) {
+ swfdec_as_string_split_5 (cx, object, argc, argv, ret);
+ } else {
+ swfdec_as_string_split_6 (cx, object, argc, argv, ret);
+ }
+}
+
static const char *
swfdec_as_str_sub (SwfdecAsContext *cx, const char *str, guint offset, guint len)
{
@@ -413,15 +432,16 @@ swfdec_as_str_sub (SwfdecAsContext *cx,
return str;
}
-static void
+SWFDEC_AS_NATIVE (251, 13, swfdec_as_string_substr)
+void
swfdec_as_string_substr (SwfdecAsContext *cx, SwfdecAsObject *object,
g...
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
...ject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+swfdec_as_string_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
SwfdecAsString *string = SWFDEC_AS_STRING (object);
@@ -229,27 +236,25 @@ static const char *
swfdec_as_str_sub (SwfdecAsContext *cx, const char *str, guint offset, guint len)
{
const char *end;
- char *dup;
str = g_utf8_offset_to_pointer (str, offset);
end = g_utf8_offset_to_pointer (str, len);
- dup = g_strndup (str, end - str);
- str = swfdec_as_context_get_string (cx, dup);
- g_free (dup)...
2007 May 31
0
Branch 'as' - 8 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c test/trace
...else
+ to += len;
+ if (to < 0)
+ to = 0;
+ if (from < 0 && to >= -from)
+ to = 0;
+ }
} else {
to = G_MAXINT;
}
+ if (from < 0)
+ from += len;
from = CLAMP (from, 0, len);
to = CLAMP (to, 0, len - from);
SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_str_sub (object->context, string->string, from, to));