Website hosting service by Active-Venture.com
  

 Back to Index

Stack Manipulation Macros

dMARK

Declare a stack marker variable, mark, for the XSUB. See MARK and dORIGMARK.

 
		dMARK;  

dORIGMARK

Saves the original stack mark for the XSUB. See ORIGMARK.

 
		dORIGMARK;  

dSP

Declares a local copy of perl's stack pointer for the XSUB, available via the SP macro. See SP.

 
		dSP;  

EXTEND

Used to extend the argument stack for an XSUB's return values. Once used, guarantees that there is room for at least nitems to be pushed onto the stack.

 
	void	EXTEND(SP, int nitems)  

MARK

Stack marker variable for the XSUB. See dMARK.

ORIGMARK

The original stack mark for the XSUB. See dORIGMARK.

POPi

Pops an integer off the stack.

 
	IV	POPi  

POPl

Pops a long off the stack.

 
	long	POPl  

POPn

Pops a double off the stack.

 
	NV	POPn  

POPp

Pops a string off the stack. Deprecated. New code should provide a STRLEN n_a and use POPpx.

 
	char*	POPp  

POPpbytex

Pops a string off the stack which must consist of bytes i.e. characters < 256. Requires a variable STRLEN n_a in scope.

 
	char*	POPpbytex  

POPpx

Pops a string off the stack. Requires a variable STRLEN n_a in scope.

 
	char*	POPpx  

POPs

Pops an SV off the stack.

 
	SV*	POPs  

PUSHi

Push an integer onto the stack. The stack must have room for this element. Handles 'set' magic. See XPUSHi.

 
	void	PUSHi(IV iv)  

PUSHMARK

Opening bracket for arguments on a callback. See PUTBACK and perlcall.

 
		PUSHMARK;  

PUSHn

Push a double onto the stack. The stack must have room for this element. Handles 'set' magic. See XPUSHn.

 
	void	PUSHn(NV nv)  

PUSHp

Push a string onto the stack. The stack must have room for this element. The len indicates the length of the string. Handles 'set' magic. See XPUSHp.

 
	void	PUSHp(char* str, STRLEN len)  

PUSHs

Push an SV onto the stack. The stack must have room for this element. Does not handle 'set' magic. See XPUSHs.

 
	void	PUSHs(SV* sv)  

PUSHu

Push an unsigned integer onto the stack. The stack must have room for this element. See XPUSHu.

 
	void	PUSHu(UV uv)  

PUTBACK

Closing bracket for XSUB arguments. This is usually handled by xsubpp. See PUSHMARK and perlcall for other uses.

 
		PUTBACK;  

SP

Stack pointer. This is usually handled by xsubpp. See dSP and SPAGAIN.

SPAGAIN

Refetch the stack pointer. Used after a callback. See perlcall.

 
		SPAGAIN;  

XPUSHi

Push an integer onto the stack, extending the stack if necessary. Handles 'set' magic. See PUSHi.

 
	void	XPUSHi(IV iv)  

XPUSHn

Push a double onto the stack, extending the stack if necessary. Handles 'set' magic. See PUSHn.

 
	void	XPUSHn(NV nv)  

XPUSHp

Push a string onto the stack, extending the stack if necessary. The len indicates the length of the string. Handles 'set' magic. See PUSHp.

 
	void	XPUSHp(char* str, STRLEN len)  

XPUSHs

Push an SV onto the stack, extending the stack if necessary. Does not handle 'set' magic. See PUSHs.

 
	void	XPUSHs(SV* sv)  

XPUSHu

Push an unsigned integer onto the stack, extending the stack if necessary. See PUSHu.

 
	void	XPUSHu(UV uv)  

XSRETURN

Return from XSUB, indicating number of items on the stack. This is usually handled by xsubpp.

 
	void	XSRETURN(int nitems)  

XSRETURN_IV

Return an integer from an XSUB immediately. Uses XST_mIV.

 
	void	XSRETURN_IV(IV iv)  

XSRETURN_NO

Return &PL_sv_no from an XSUB immediately. Uses XST_mNO.

 
		XSRETURN_NO;  

XSRETURN_NV

Return a double from an XSUB immediately. Uses XST_mNV.

 
	void	XSRETURN_NV(NV nv)  

XSRETURN_PV

Return a copy of a string from an XSUB immediately. Uses XST_mPV.

 
	void	XSRETURN_PV(char* str)  

XSRETURN_UNDEF

Return &PL_sv_undef from an XSUB immediately. Uses XST_mUNDEF.

 
		XSRETURN_UNDEF;  

XSRETURN_YES

Return &PL_sv_yes from an XSUB immediately. Uses XST_mYES.

 
		XSRETURN_YES;  

XST_mIV

Place an integer into the specified position pos on the stack. The value is stored in a new mortal SV.

 
	void	XST_mIV(int pos, IV iv)  

XST_mNO

Place &PL_sv_no into the specified position pos on the stack.

 
	void	XST_mNO(int pos)  

XST_mNV

Place a double into the specified position pos on the stack. The value is stored in a new mortal SV.

 
	void	XST_mNV(int pos, NV nv)  

XST_mPV

Place a copy of a string into the specified position pos on the stack. The value is stored in a new mortal SV.

 
	void	XST_mPV(int pos, char* str)  

XST_mUNDEF

Place &PL_sv_undef into the specified position pos on the stack.

 
	void	XST_mUNDEF(int pos)  

XST_mYES

Place &PL_sv_yes into the specified position pos on the stack.

 
	void	XST_mYES(int pos)  

 

  

 

Domain name registration & domain search - 
Register cheap domain name from $7.95 and enjoy free domain services 
 

Cheap domain name search service -
Domain name services at just
$8.95/year only
 

Register domain name -
Buy domain name registration and cheap domain transfer at low, affordable price.

© 2002-2004 Active-Venture.com Web Site Hosting Service

 

[ How the mind works is still a mystery. We understand the hardware, but we don't have a clue about the operating system.   ]

 

 
 
 

Disclaimer: This documentation is provided only for the benefits of our web hosting customers.
For authoritative source of the documentation, please refer to http://www.perldoc.com