X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=XSUB.h;h=a5f8e591ad12fd939a57976c0bc6cb7c52f6b946;hb=9514c62b63b7afca8bfb22c2e26cd3413f1fa007;hp=cfcad5d595a1bbc8d99004c6bd5cb1bb3d9d4f5f;hpb=cb50131aab68ac6dda048612c6e853b8cb08701e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/XSUB.h b/XSUB.h index cfcad5d..a5f8e59 100644 --- a/XSUB.h +++ b/XSUB.h @@ -18,6 +18,11 @@ Variable which is setup by C to designate the object in a C++ XSUB. This is always the proper type for the C++ object. See C and L. +=for apidoc Amn|I32|ax +Variable which is setup by C to indicate the stack base offset, +used by the C, C and C macros. The C macro +must be called prior to setup the C variable. + =for apidoc Amn|I32|items Variable which is setup by C to indicate the number of items on the stack. See L. @@ -33,10 +38,18 @@ Used to access elements on the XSUB's stack. Macro to declare an XSUB and its C parameter list. This is handled by C. +=for apidoc Ams||dAX +Sets up the C variable. +This is usually handled automatically by C by calling C. + +=for apidoc Ams||dITEMS +Sets up the C variable. +This is usually handled automatically by C by calling C. + =for apidoc Ams||dXSARGS -Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This -is usually handled automatically by C. Declares the C -variable to indicate the number of items on the stack. +Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. +Sets up the C and C variables by calling C and C. +This is usually handled automatically by C. =for apidoc Ams||dXSI32 Sets up the C variable for an XSUB which has aliases. This is usually @@ -53,10 +66,13 @@ handled automatically by C. # define XS(name) void name(pTHXo_ CV* cv) #endif +#define dAX I32 ax = MARK - PL_stack_base + 1 + +#define dITEMS I32 items = SP - MARK + #define dXSARGS \ dSP; dMARK; \ - I32 ax = mark - PL_stack_base + 1; \ - I32 items = sp - mark + dAX; dITEMS #define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \ ? PAD_SV(PL_op->op_targ) : sv_newmortal())