<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="SwfdecAsFrame">
<refmeta>
<refentrytitle role="top_of_page" id="SwfdecAsFrame.top_of_page">SwfdecAsFrame</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>SWFDEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>SwfdecAsFrame</refname>
<refpurpose>information about currently executing frames</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="SwfdecAsFrame.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;swfdec/swfdec.h&gt;

                    <link linkend="SwfdecAsFrame-struct">SwfdecAsFrame</link>;
<link linkend="SwfdecAsFrame">SwfdecAsFrame</link>*      <link linkend="swfdec-as-frame-get-next">swfdec_as_frame_get_next</link>            (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
const <link linkend="char">char</link>*         <link linkend="swfdec-as-frame-get-function-name">swfdec_as_frame_get_function_name</link>   (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
<link linkend="SwfdecScript">SwfdecScript</link>*       <link linkend="swfdec-as-frame-get-script">swfdec_as_frame_get_script</link>          (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
<link linkend="SwfdecAsObject">SwfdecAsObject</link>*     <link linkend="swfdec-as-frame-get-this">swfdec_as_frame_get_this</link>            (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
                    <link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link>;
<link linkend="SwfdecAsValue">SwfdecAsValue</link>*      <link linkend="swfdec-as-stack-iterator-init">swfdec_as_stack_iterator_init</link>       (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter,
                                                         <link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
<link linkend="SwfdecAsValue">SwfdecAsValue</link>*      <link linkend="swfdec-as-stack-iterator-init-arguments">swfdec_as_stack_iterator_init_arguments</link>
                                                        (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter,
                                                         <link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);
<link linkend="SwfdecAsValue">SwfdecAsValue</link>*      <link linkend="swfdec-as-stack-iterator-next">swfdec_as_stack_iterator_next</link>       (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter);
</synopsis>
</refsynopsisdiv>

<refsect1 id="SwfdecAsFrame.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="SwfdecGcObject">SwfdecGcObject</link>
         +----<link linkend="SwfdecAsObject">SwfdecAsObject</link>
               +----SwfdecAsFrame
</synopsis>

</refsect1>








<refsect1 id="SwfdecAsFrame.description" role="desc">
<title role="desc.title">Description</title>
<para>
This section is only interesting for people that want to look into debugging.
A SwfdecAsFrame describes a currently executing function while it is
running. On every new function call, a new frame is created and pushed on top
of the frame stack. To get the topmost one, use 
<link linkend="swfdec-as-context-get-frame"><function>swfdec_as_context_get_frame()</function></link>. After that you can inspect various properties
of the frame, like the current stack.
</para>
<para>
a <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link> is a <link linkend="SwfdecAsObject"><type>SwfdecAsObject</type></link>, so it is possible to set variables on
it. These are local variables inside the executing function. So you can use
functions such as <link linkend="swfdec-as-object-get-variable"><function>swfdec_as_object_get_variable()</function></link> to inspect them.</para>
<para>

</para>
</refsect1>

<refsect1 id="SwfdecAsFrame.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="SwfdecAsFrame-struct" role="struct">
<title>SwfdecAsFrame</title>
<indexterm zone="SwfdecAsFrame-struct"><primary>SwfdecAsFrame</primary></indexterm><programlisting>typedef struct _SwfdecAsFrame SwfdecAsFrame;</programlisting>
<para>
the object used to represent an executing function.</para>
<para>

</para></refsect2>
<refsect2 id="swfdec-as-frame-get-next" role="function">
<title>swfdec_as_frame_get_next ()</title>
<indexterm zone="swfdec-as-frame-get-next"><primary>swfdec_as_frame_get_next</primary></indexterm><programlisting><link linkend="SwfdecAsFrame">SwfdecAsFrame</link>*      swfdec_as_frame_get_next            (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Gets the next frame in the frame stack. The next frame is the frame that
will be executed after this <parameter>frame</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the next <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if this is the bottommost frame.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="swfdec-as-frame-get-function-name" role="function">
<title>swfdec_as_frame_get_function_name ()</title>
<indexterm zone="swfdec-as-frame-get-function-name"><primary>swfdec_as_frame_get_function_name</primary></indexterm><programlisting>const <link linkend="char">char</link>*         swfdec_as_frame_get_function_name   (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Gets the name of the function that is currently executing. This function is
intended for debugging purposes.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a string. Do not free.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="swfdec-as-frame-get-script" role="function">
<title>swfdec_as_frame_get_script ()</title>
<indexterm zone="swfdec-as-frame-get-script"><primary>swfdec_as_frame_get_script</primary></indexterm><programlisting><link linkend="SwfdecScript">SwfdecScript</link>*       swfdec_as_frame_get_script          (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Gets the script associated with the given <parameter>frame</parameter>. If the frame references
a native function, there will be no script and this function returns <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The script executed by this frame or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="swfdec-as-frame-get-this" role="function">
<title>swfdec_as_frame_get_this ()</title>
<indexterm zone="swfdec-as-frame-get-this"><primary>swfdec_as_frame_get_this</primary></indexterm><programlisting><link linkend="SwfdecAsObject">SwfdecAsObject</link>*     swfdec_as_frame_get_this            (<link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Gets the this object of the given <parameter>frame</parameter>. If the frame has no this object,
<link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecAsFrame"><type>SwfdecAsFrame</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The this object of the frame or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="SwfdecAsStackIterator" role="struct">
<title>SwfdecAsStackIterator</title>
<indexterm zone="SwfdecAsStackIterator"><primary>SwfdecAsStackIterator</primary></indexterm><programlisting>typedef struct {
} SwfdecAsStackIterator;
</programlisting>
<para>
This is a struct used to walk the stack of a frame. It is supposed to be 
allocated on the stack. All of its members are private.</para>
<para>

</para></refsect2>
<refsect2 id="swfdec-as-stack-iterator-init" role="function">
<title>swfdec_as_stack_iterator_init ()</title>
<indexterm zone="swfdec-as-stack-iterator-init"><primary>swfdec_as_stack_iterator_init</primary></indexterm><programlisting><link linkend="SwfdecAsValue">SwfdecAsValue</link>*      swfdec_as_stack_iterator_init       (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter,
                                                         <link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Initializes <parameter>iter</parameter> to walk the stack of <parameter>frame</parameter>. The first value on the stack
will alread be returned. This makes it possible to write a simple loop to 
print the whole stack:
<informalexample><programlisting>for (value = swfdec_as_stack_iterator_init (&amp;iter, frame); value != NULL;
    value = swfdec_as_stack_iterator_next (&amp;iter)) {
  char *s = swfdec_as_value_to_debug (value);
  g_print ("%s\n", s);
  g_free (s);
}</programlisting></informalexample></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecStackIterator"><type>SwfdecStackIterator</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> the frame to initialize from
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the topmost value on the stack of <parameter>frame</parameter> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="swfdec-as-stack-iterator-init-arguments" role="function">
<title>swfdec_as_stack_iterator_init_arguments ()</title>
<indexterm zone="swfdec-as-stack-iterator-init-arguments"><primary>swfdec_as_stack_iterator_init_arguments</primary></indexterm><programlisting><link linkend="SwfdecAsValue">SwfdecAsValue</link>*      swfdec_as_stack_iterator_init_arguments
                                                        (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter,
                                                         <link linkend="SwfdecAsFrame">SwfdecAsFrame</link> *frame);</programlisting>
<para>
Initializes a stack iterator to walk the arguments passed to the given <parameter>frame</parameter>. See
<link linkend="swfdec-as-stack-iterator-init"><function>swfdec_as_stack_iterator_init()</function></link> about suggested iterator usage.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> iterator to be initialized
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>frame</parameter>&nbsp;:</term>
<listitem><simpara> the frame to initialize from
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The value of the first argument
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="swfdec-as-stack-iterator-next" role="function">
<title>swfdec_as_stack_iterator_next ()</title>
<indexterm zone="swfdec-as-stack-iterator-next"><primary>swfdec_as_stack_iterator_next</primary></indexterm><programlisting><link linkend="SwfdecAsValue">SwfdecAsValue</link>*      swfdec_as_stack_iterator_next       (<link linkend="SwfdecAsStackIterator">SwfdecAsStackIterator</link> *iter);</programlisting>
<para>
Gets the next value on the stack.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="SwfdecAsStackIterator"><type>SwfdecAsStackIterator</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The next value on the stack or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no more values are on the stack
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
