|
The Perl argument stack is used to store the values which are sent as parameters to the
XSUB and to store the XSUB's return value(s). In reality all Perl functions (including non-XSUB
ones) keep their values on this stack all the same time, each limited to its own range of
positions on the stack. In this document the first position on that stack which belongs to the
active function will be referred to as position 0 for that function.
XSUBs refer to their stack arguments with the macro ST(x), where x refers to
a position in this XSUB's part of the stack. Position 0 for that function would be known to
the XSUB as ST(0). The XSUB's incoming parameters and outgoing return values always begin at
ST(0). For many simple cases the xsubpp compiler will generate the code necessary to
handle the argument stack by embedding code fragments found in the typemaps. In more complex
cases the programmer must supply the code.
|
|