[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_pcall
- From: Brian Hook <hook_l@...>
- Date: Wed, 4 Feb 2004 19:18:33 -0500
Thanks for all the quick replies. I'm going to try to dissect Tomas's
response here to see if I can figure out what's going on:
The following two just find the global function _TRACEBACK (presumably
part of the Debug library?) and place its address on top of stack?
> lua_pushliteral(L, "_TRACEBACK");
> lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */
This then gets the index of the _TRACEBACK function on the stack
> err_func = lua_gettop (L);
Then you call with that index -- presumably if you do anything to
stack before this call, the err_func will no longer be valid, right?
> return (luaL_loadfile (L, name)) || (lua_pcall (L, 0, 0,
> err_func)); }