Top | ![]() |
![]() |
![]() |
![]() |
SwfdecScript * | swfdec_script_new () |
SwfdecScript * | swfdec_script_ref () |
void | swfdec_script_unref () |
guint | swfdec_script_get_version () |
The debugger object is a special object that can be set on a SwfdecAsContext upon creation. If that is done, the debugger can then be used to inspect the running Actionscript application.
SwfdecScript * swfdec_script_new (SwfdecBuffer *buffer
,const char *name
,guint version
);
Creates a new script for the actionscript provided in buffer
.
buffer |
the SwfdecBuffer containing the script. This function will take ownership of the passed in buffer. |
|
name |
name of the script for debugging purposes |
|
version |
Actionscript version to use in this script |
SwfdecScript *
swfdec_script_ref (SwfdecScript *script
);
Increases the reference count of the given script
by one.
void
swfdec_script_unref (SwfdecScript *script
);
Decreases the reference count of the given script
by one. If the count
reaches zero, it will automatically be destroyed.
guint
swfdec_script_get_version (SwfdecScript *script
);
Queries the Flash version this script was compiled with. Different versions result in slightly different behavior in the script interpreter.
typedef struct _SwfdecAsDebugger SwfdecAsDebugger;
This is the type of the debugger object.
struct SwfdecAsDebuggerClass { /* a new object was added to the GC */ void (* add) (SwfdecAsDebugger * debugger, SwfdecAsContext * context, SwfdecAsObject * object); /* an object was removed from the GC */ void (* remove) (SwfdecAsDebugger * debugger, SwfdecAsContext * context, SwfdecAsObject * object); /* called before executing a bytecode */ void (* step) (SwfdecAsDebugger * debugger, SwfdecAsContext * context); /* called after adding a frame from the function stack */ void (* enter_frame) (SwfdecAsDebugger * debugger, SwfdecAsContext * context, SwfdecAsFrame * frame); /* called after removing a frame from the function stack */ void (* leave_frame) (SwfdecAsDebugger * debugger, SwfdecAsContext * context, SwfdecAsFrame * frame, const SwfdecAsValue * return_value); /* called before setting a variable */ void (* set_variable)(SwfdecAsDebugger * debugger, SwfdecAsContext * context, SwfdecAsObject * object, const char * variable, const SwfdecAsValue * value); };
The class object for the debugger. You need to override these functions to get useful functionality for the debugger.
Called whenever an object is added to the garbage collection engine
using |
||
Called whenever an object is about to be collected by the garbage collector. |
||
This function is called everytime just before a bytecode is executed by the script engine. So it's very powerful, but can also slow down the script engine a lot. |
||
Called after a new SwfdecAsFrame has been initialized and pushed to the top of the execution stack. |
||
Called just after a SwfdecAsFrame has been removed from the execution stack. The return value has not been forwarded to the parent when this function is called. |
||
Called whenever |
typedef struct _SwfdecScript SwfdecScript;
This is the object used for code to be executed by Swfdec. Scripts are independant from the SwfdecAsContext they are executed in, so you can execute the same script in multiple contexts.