search for: min_args

Displaying 14 results from an estimated 14 matches for "min_args".

2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h
...fdec_as_object.h" #include "swfdec_as_stack.h" @@ -389,10 +390,11 @@ start: frame = context->frame; if (frame == context->last_frame) goto out; - if (frame->function && frame->function->native) { - if (frame->argc >= frame->function->min_args && - g_type_is_a (G_OBJECT_TYPE (frame->thisp), frame->function->type)) { - frame->function->native (frame->thisp, frame->argc, frame->argv, frame->return_value); + if (SWFDEC_IS_AS_NATIVE_FUNCTION (frame->function)) { + SwfdecAsNativeFunction *native...
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
...s running normally * @SWFDEC_AS_CONTEXT_INTERRUPTED: the context has been interrupted by a * debugger @@ -384,7 +386,7 @@ start: goto out; if (frame->function && frame->function->native) { if (frame->argc >= frame->function->min_args) { - frame->function->native (context, frame->scope, frame->argc, frame->argv, frame->return_value); + frame->function->native (frame->scope, frame->argc, frame->argv, frame->return_value); } swfdec_as_context_return (context); goto start...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
..._as_frame_internal.h" +#include "swfdec_as_internal.h" #include "swfdec_as_stack.h" #include "swfdec_debug.h" @@ -122,22 +123,23 @@ SwfdecAsFunction * swfdec_as_native_function_new (SwfdecAsContext *context, const char *name, SwfdecAsNative native, guint min_args) { - SwfdecAsNativeFunction *nfun; - SwfdecAsFunction *fun; + SwfdecAsNativeFunction *fun; g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); g_return_val_if_fail (native != NULL, NULL); - fun = swfdec_as_function_create (context, SWFDEC_TYPE_AS_NATIVE_FUNCTION, - size...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js 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_function.c
...ION, NULL); + swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), scope->context, sizeof (SwfdecAsFunction)); + fun->scope = scope; + fun->script = script; + + return fun; +} + +SwfdecAsFunction * +swfdec_as_function_new_native (SwfdecAsContext *context, SwfdecAsNativeCall native, + guint min_args) +{ + SwfdecAsFunction *fun; + + g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); + g_return_val_if_fail (native != NULL, NULL); + + if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsFunction))) + return NULL; + fun = g_object_new (SWFDEC_TYPE_AS_FUNCTION, NULL); + swfde...
2007 Jul 13
0
12 commits - AUTHORS doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...(SwfdecAsNativeFunction, swfdec_as_native_function, SWFDEC_TYPE_AS_FUNCTION) @@ -97,6 +103,21 @@ swfdec_as_native_function_init (SwfdecAs { } +/** + * swfdec_as_native_function_new: + * @context: a #SwfdecAsContext + * @name: name of the function + * @native: function to call when executed + * @min_args: minimum number of arguments required + * + * Creates a new native function, that will execute @native when called. The + * @min_args parameter sets a requirement for the minimum number of arguments + * to pass to @native. If the function gets called with less arguments, it + * will just redurn und...
2007 May 23
0
Branch 'as' - 7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c 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 libswfdec/swfdec_as_strings.c
...0 messed up a check for calling native functions diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index 44ee604..c88c66a 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -420,7 +420,7 @@ start: if (frame->argc >= native->min_args && (native->type == 0 || (frame->thisp != NULL && - !g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type)))) { + g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type)))) { native->native (frame->thisp, frame->argc, frame->argv,...
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
...bject.c b/libswfdec/swfdec_as_object.c index b2a3262..f62f59b 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -783,20 +783,54 @@ SwfdecAsFunction * swfdec_as_object_add_function (SwfdecAsObject *object, const char *name, GType type, SwfdecAsNative native, guint min_args) { + g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL); + g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (type == 0 || g_type_is_a (type, SWFDEC_TYPE_AS_OBJECT), NULL); + + return swfdec_as_object_add_constructor (object, name, type, 0, native, min_args, NULL); +} +...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h index c80aec0..9c184c9 100644 --- a/libswfdec/swfdec_as_object.h +++ b/libswfdec/swfdec_as_object.h @@ -154,6 +154,10 @@ SwfdecAsFunction *swfdec_as_object_add_f const char * name, SwfdecAsNative native, guint min_args); +void swfdec_as_object_add_variable (SwfdecAsObject * object, + const char * name, + SwfdecAsVariableSetter set, + SwfdecAsVariableGetter get); void swfdec_as_object_run (SwfdecAsObject * object, SwfdecScript * script); diff-tree a843e801169afd960d58def92a2...
2007 Jul 13
0
4 commits - configure.ac libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.h libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h NEWS
...b/libswfdec/swfdec_as_object.h @@ -22,7 +22,6 @@ #include <glib-object.h> #include <libswfdec/swfdec_as_types.h> -#include <libswfdec/swfdec_types.h> G_BEGIN_DECLS @@ -143,8 +142,6 @@ SwfdecAsFunction *swfdec_as_object_add_f SwfdecAsNative native, guint min_args); -void swfdec_as_object_run (SwfdecAsObject * object, - SwfdecScript * script); gboolean swfdec_as_object_has_function (SwfdecAsObject * object, const char * name); void swfdec_as_object_call (SwfdecAsObject * object, diff-tree d617bb496e5aa49a138dd34a62dc...
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
...->stack)); } } diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c index 68e98c5..29ef86e 100644 --- a/libswfdec/swfdec_as_function.c +++ b/libswfdec/swfdec_as_function.c @@ -126,9 +126,8 @@ swfdec_as_function_call (SwfdecAsFunctio if (n_args < function->min_args) { SwfdecAsStack *stack = context->frame->stack; if (n_args == 0) { - SwfdecAsValue value = { SWFDEC_TYPE_AS_UNDEFINED, }; swfdec_as_stack_ensure_size (stack, 1); - swfdec_as_stack_push (stack, &value); + SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (stack));...
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
...s_context.c b/libswfdec/swfdec_as_context.c index 5d4435a..a63cf4d 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -446,8 +446,7 @@ start: SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (frame->function); if (frame->argc >= native->min_args && (native->type == 0 || - (frame->thisp != NULL && - g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type)))) { + g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type))) { /* FIXME FIXME FIXME: no casting here please! */ native->nat...
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
...s_function_call (SwfdecAsFunctio } else { n_args = 0; } + SWFDEC_AS_VALUE_SET_UNDEFINED (return_value); /* now do different things depending on if we're a native function or not */ if (function->native) { - SwfdecAsValue retval = { 0, }; if (n_args < function->min_args) { SwfdecAsStack *stack = context->frame->stack; if (n_args == 0) { @@ -139,10 +142,11 @@ swfdec_as_function_call (SwfdecAsFunctio frame = swfdec_as_frame_new_native (thisp); g_assert (function->name); frame->function_name = function->name; - function-...
2007 Jul 02
0
Branch 'as' - 24 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...hrow an error and abort */ + swfdec_as_context_abort (context, "Stack overflow"); + return; + } if (SWFDEC_IS_AS_NATIVE_FUNCTION (frame->function)) { SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (frame->function); if (frame->argc >= native->min_args && diff-tree 41035d740f3910c483715f157f20845c14074794 (from f24ac118ee47065dac5b9f9c5fea1d98072485dc) Author: Benjamin Otte <otte at gnome.org> Date: Sun Jul 1 00:20:06 2007 +0100 Array creation does not call the array constructor. FIXME: Should it? Or maybe only some...
2007 Nov 28
0
59 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_event.c
...ructor * @n_args: number of arguments diff --git a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h index f32723d..a8b4379 100644 --- a/libswfdec/swfdec_as_object.h +++ b/libswfdec/swfdec_as_object.h @@ -176,8 +176,6 @@ SwfdecAsFunction *swfdec_as_object_add_constructor guint min_args, SwfdecAsObject * prototype); -gboolean swfdec_as_object_has_function (SwfdecAsObject * object, - const char * name); void swfdec_as_object_call (SwfdecAsObject * object, const char * name, guint argc, commit 6a63d325d02a7edf1d89485780928fa64345414...