This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.000
[perl5.git] / XSUB.h
1 #define ST(off) stack_base[ax + off]
2
3 #ifdef CAN_PROTOTYPE
4 #define XS(name) void name(CV* cv)
5 #else
6 #define XS(name) void name(cv) CV* cv;
7 #endif
8
9 #define dXSARGS                         \
10         dSP; dMARK;                     \
11         I32 ax = mark - stack_base + 1; \
12         I32 items = sp - mark
13
14 #define XSANY CvXSUBANY(cv)
15
16 #define dXSI32 I32 ix = XSANY.any_i32
17
18 #define XSRETURN(off) stack_sp = stack_base + ax + ((off) - 1); return
19
20 #define XSRETURNNO    ST(0)=sv_mortalcopy(&sv_no); XSRETURN(1)
21 #define XSRETURNYES   ST(0)=sv_mortalcopy(&sv_yes); XSRETURN(1)
22 #define XSRETURNUNDEF ST(0)=sv_mortalcopy(&sv_undef); XSRETURN(1)