MCPcopy Create free account
hub / github.com/DFHack/dfhack / get_console

Function get_console

library/LuaTools.cpp:318–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318static Console *get_console(lua_State *state)
319{
320 color_ostream *pstream = Lua::GetOutput(state);
321
322 if (!pstream)
323 {
324 lua_pushnil(state);
325 lua_pushstring(state, "no output stream");
326 return NULL;
327 }
328
329 if (!pstream->is_console())
330 {
331 lua_pushnil(state);
332 lua_pushstring(state, "not an interactive console");
333 return NULL;
334 }
335
336 return static_cast<Console*>(pstream);
337}
338
339static int DFHACK_TOSTRING_TOKEN = 0;
340

Callers 3

dfhack_lineedit_contFunction · 0.85
dfhack_lineeditFunction · 0.85

Calls 2

lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected