Lua-API

 view release on metacpan or  search on metacpan

API.xs  view on Meta::CPAN

	lua_State *	L
	int	nargs
	int	nresults

 # call either lua_checkstack or luaL_checkstack based upon the number
 # of parameters
void
lua_checkstack(L, sz, ...)
	lua_State *	L
	int	  sz
	PPCODE:
	  /* call lua_checkstack */
	  if ( items == 2 )
	  {
	    int status = lua_checkstack( L, sz );
            EXTEND(SP, 1);
            PUSHs(sv_2mortal(newSViv(status)));
	  }
	  /* emulate luaL_checkstack */
	  else if ( items == 3 )
	  {

API.xs  view on Meta::CPAN


const char *
lua_getlocal(L, ar, n)
	lua_State *	L
	const lua_Debug *	ar
	int	n

void
lua_getmetatable(L, ...)
	lua_State *	L
      PPCODE:
	if ( items != 1 )
	    croak_xs_usage( cv, "L,(objindex|name)" );
	if ( looks_like_number( ST(1) ) )
	{
	    int	objindex = (int)SvIV(ST(1));
	    int RETVAL = lua_getmetatable(L, objindex);
	    EXTEND(SP,1);
	    PUSHs(sv_2mortal(newSViv(RETVAL)));
	}
        else

API.xs  view on Meta::CPAN

	lua_State *	L
	const char *	tname

lua_State *
luaL_newstate(CLASS)
	char *CLASS = NO_INIT
    PROTOTYPE: $
    ALIAS:
	open = 1
	new = 2
    PPCODE:
        RETVAL = luaL_newstate();
	ST(0) = sv_newmortal();
        sv_setref_iv(ST(0), "Lua::API::State", PTR2IV(RETVAL));
	set_Perl_object( RETVAL, ST(0) );
        XSRETURN(1);


int
luaL_ref(L, t)
	lua_State *	L

API.xs  view on Meta::CPAN

luaL_typename(L, i)
	lua_State *	L
	int	i

MODULE = Lua::API		PACKAGE = Lua::API::Debug

lua_Debug *
new(CLASS)
	char *CLASS = NO_INIT
    PROTOTYPE: $
    PPCODE:
        Newxz( RETVAL, 1, lua_Debug );
	ST(0) = sv_newmortal();
        sv_setref_iv(ST(0), "Lua::API::Debug", PTR2IV(RETVAL));
	set_Perl_object( RETVAL, ST(0) );
        XSRETURN(1);

void
DESTROY(THIS)
	lua_Debug * THIS;
    CODE:

API.xs  view on Meta::CPAN

	RETVAL = THIS->short_src;
    OUTPUT:
	RETVAL

MODULE = Lua::API		PACKAGE = Lua::API::Buffer		PREFIX = luaL_

luaL_Buffer *
new(CLASS)
	char *CLASS = NO_INIT
    PROTOTYPE: $
    PPCODE:
        Newxz( RETVAL, 1, luaL_Buffer );
	ST(0) = sv_newmortal();
        sv_setref_iv(ST(0), "Lua::API::Buffer", PTR2IV(RETVAL));
	set_Perl_object( RETVAL, ST(0) );
        XSRETURN(1);

void
DESTROY(THIS)
	luaL_Buffer * THIS;
    CODE:

const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Lua::API macro", s));
          PUSHs(sv);

fallback/const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Lua::API macro", s));
          PUSHs(sv);



( run in 0.848 second using v1.01-cache-2.11-cpan-4e7a2411597 )