MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / PrintStack

Method PrintStack

src/lua/LuaUtils.cpp:278–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276//============================================================================//
277
278void LuaUtils::PrintStack(lua_State* L) {
279 const int top = lua_gettop(L);
280 for (int i = 1; i <= top; i++) {
281 printf("\t%i: type = %s (%p)\n", i, luaL_typename(L, i), lua_topointer(L, i));
282 const int type = lua_type(L, i);
283 if (type == LUA_TSTRING) {
284 printf("\t\t%s\n", lua_tostring(L, i));
285 }
286 else if (type == LUA_TNUMBER) {
287 printf("\t\t%f\n", lua_tonumber(L, i));
288 }
289 else if (type == LUA_TBOOLEAN) {
290 printf("\t\t%s\n", lua_tobool(L, i) ? "true" : "false");
291 }
292 else {
293 printf("\n");
294 }
295 }
296}
297
298
299//============================================================================//

Callers

nothing calls this directly

Calls 5

lua_tonumberFunction · 0.85
lua_toboolFunction · 0.85
lua_gettopFunction · 0.50
lua_topointerFunction · 0.50
lua_typeFunction · 0.50

Tested by

no test coverage detected