X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp.h;h=617d77785063fde7f721c162011259bd2f8bd498;hb=7fddc82f0212c2b411408f0a05ebb86f9e431bd9;hp=8986db95df7fe22aed77833eb642dafb96ddeb73;hpb=c5661c80adf757c3cf464bf5f538fe5082b73584;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp.h b/pp.h index 8986db9..617d777 100644 --- a/pp.h +++ b/pp.h @@ -162,45 +162,117 @@ onto the stack. =for apidoc Am|void|PUSHs|SV* sv Push an SV onto the stack. The stack must have room for this element. -Does not handle 'set' magic. See C. +Does not handle 'set' magic. Does not use C. See also C, +C and C. =for apidoc Am|void|PUSHp|char* str|STRLEN len Push a string onto the stack. The stack must have room for this element. -The C indicates the length of the string. Handles 'set' magic. See -C. +The C indicates the length of the string. Handles 'set' magic. Uses +C, so C or C should be called to declare it. Do not +call multiple C-oriented macros to return lists from XSUB's - see +C instead. See also C and C. =for apidoc Am|void|PUSHn|NV nv Push a double onto the stack. The stack must have room for this element. -Handles 'set' magic. See C. +Handles 'set' magic. Uses C, so C or C should be +called to declare it. Do not call multiple C-oriented macros to +return lists from XSUB's - see C instead. See also C and +C. =for apidoc Am|void|PUSHi|IV iv Push an integer onto the stack. The stack must have room for this element. -Handles 'set' magic. See C. +Handles 'set' magic. Uses C, so C or C should be +called to declare it. Do not call multiple C-oriented macros to +return lists from XSUB's - see C instead. See also C and +C. =for apidoc Am|void|PUSHu|UV uv Push an unsigned integer onto the stack. The stack must have room for this -element. See C. +element. Handles 'set' magic. Uses C, so C or C +should be called to declare it. Do not call multiple C-oriented +macros to return lists from XSUB's - see C instead. See also +C and C. =for apidoc Am|void|XPUSHs|SV* sv Push an SV onto the stack, extending the stack if necessary. Does not -handle 'set' magic. See C. +handle 'set' magic. Does not use C. See also C, +C and C. =for apidoc Am|void|XPUSHp|char* str|STRLEN len Push a string onto the stack, extending the stack if necessary. The C -indicates the length of the string. Handles 'set' magic. See -C. +indicates the length of the string. Handles 'set' magic. Uses C, so +C or C should be called to declare it. Do not call +multiple C-oriented macros to return lists from XSUB's - see +C instead. See also C and C. =for apidoc Am|void|XPUSHn|NV nv Push a double onto the stack, extending the stack if necessary. Handles -'set' magic. See C. +'set' magic. Uses C, so C or C should be called to +declare it. Do not call multiple C-oriented macros to return lists +from XSUB's - see C instead. See also C and C. =for apidoc Am|void|XPUSHi|IV iv Push an integer onto the stack, extending the stack if necessary. Handles -'set' magic. See C. +'set' magic. Uses C, so C or C should be called to +declare it. Do not call multiple C-oriented macros to return lists +from XSUB's - see C instead. See also C and C. =for apidoc Am|void|XPUSHu|UV uv Push an unsigned integer onto the stack, extending the stack if necessary. -See C. +Handles 'set' magic. Uses C, so C or C should be +called to declare it. Do not call multiple C-oriented macros to +return lists from XSUB's - see C instead. See also C and +C. + +=for apidoc Am|void|PUSHmortal +Push a new mortal SV onto the stack. The stack must have room for this +element. Does not handle 'set' magic. Does not use C. See also +C, C and C. + +=for apidoc Am|void|mPUSHp|char* str|STRLEN len +Push a string onto the stack. The stack must have room for this element. +The C indicates the length of the string. Handles 'set' magic. Does +not use C. See also C, C and C. + +=for apidoc Am|void|mPUSHn|NV nv +Push a double onto the stack. The stack must have room for this element. +Handles 'set' magic. Does not use C. See also C, C +and C. + +=for apidoc Am|void|mPUSHi|IV iv +Push an integer onto the stack. The stack must have room for this element. +Handles 'set' magic. Does not use C. See also C, C +and C. + +=for apidoc Am|void|mPUSHu|UV uv +Push an unsigned integer onto the stack. The stack must have room for this +element. Handles 'set' magic. Does not use C. See also C, +C and C. + +=for apidoc Am|void|XPUSHmortal +Push a new mortal SV onto the stack, extending the stack if necessary. Does +not handle 'set' magic. Does not use C. See also C, +C and C. + +=for apidoc Am|void|mXPUSHp|char* str|STRLEN len +Push a string onto the stack, extending the stack if necessary. The C +indicates the length of the string. Handles 'set' magic. Does not use +C. See also C, C and C. + +=for apidoc Am|void|mXPUSHn|NV nv +Push a double onto the stack, extending the stack if necessary. Handles +'set' magic. Does not use C. See also C, C and +C. + +=for apidoc Am|void|mXPUSHi|IV iv +Push an integer onto the stack, extending the stack if necessary. Handles +'set' magic. Does not use C. See also C, C and +C. + +=for apidoc Am|void|mXPUSHu|UV uv +Push an unsigned integer onto the stack, extending the stack if necessary. +Handles 'set' magic. Does not use C. See also C, C +and C. =cut */ @@ -231,6 +303,18 @@ See C. #define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END #define XPUSHundef STMT_START { SvOK_off(TARG); XPUSHs(TARG); } STMT_END +#define PUSHmortal PUSHs(sv_newmortal()) +#define mPUSHp(p,l) sv_setpvn_mg(PUSHmortal, (p), (l)) +#define mPUSHn(n) sv_setnv_mg(PUSHmortal, (NV)(n)) +#define mPUSHi(i) sv_setiv_mg(PUSHmortal, (IV)(i)) +#define mPUSHu(u) sv_setuv_mg(PUSHmortal, (UV)(u)) + +#define XPUSHmortal XPUSHs(sv_newmortal()) +#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn_mg(PUSHmortal, (p), (l)); } STMT_END +#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv_mg(PUSHmortal, (NV)(n)); } STMT_END +#define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv_mg(PUSHmortal, (IV)(i)); } STMT_END +#define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv_mg(PUSHmortal, (UV)(u)); } STMT_END + #define SETs(s) (*sp = s) #define SETTARG STMT_START { SvSETMAGIC(TARG); SETs(TARG); } STMT_END #define SETp(p,l) STMT_START { sv_setpvn(TARG, (p), (l)); SETTARG; } STMT_END @@ -385,8 +469,8 @@ See C. changed SV* ref to SV* tmpRef */ #define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \ if (SvREFCNT(tmpRef)>1) { \ + SvRV(rv)=AMG_CALLun(rv,copy); \ SvREFCNT_dec(tmpRef); \ - SvRV(rv)=AMG_CALLun(rv,copy); \ } } STMT_END /*