MCPcopy Create free account
hub / github.com/NetHack/NetHack / nhl_get_debug_themerm_name

Function nhl_get_debug_themerm_name

src/nhlua.c:992–1011  ·  view source on GitHub ↗

local debug_themerm = nh.debug_themerm(isfill) * if isfill is false, returns value of env variable THEMERM * if isfill is true, returns value of env variable THEMERMFILL * return nil if not in wizard mode or the variable isn't set */

Source from the content-addressed store, hash-verified

990 * if isfill is true, returns value of env variable THEMERMFILL
991 * return nil if not in wizard mode or the variable isn't set */
992staticfn int
993nhl_get_debug_themerm_name(lua_State *L)
994{
995 int argc = lua_gettop(L);
996 if (argc == 1) {
997 char *dbg_themerm = (char *) 0;
998 boolean is_fill = lua_toboolean(L, 1);
999 lua_pop(L, 1);
1000 if (wizard)
1001 dbg_themerm = getenv(is_fill ? "THEMERMFILL" : "THEMERM");
1002 if (!dbg_themerm || !*dbg_themerm) {
1003 lua_pushnil(L);
1004 } else {
1005 lua_pushstring(L, dbg_themerm);
1006 }
1007 } else {
1008 nhl_error(L, "debug_themerm should have 1 boolean arg");
1009 }
1010 return 1;
1011}
1012
1013RESTORE_WARNING_UNREACHABLE_CODE
1014

Callers

nothing calls this directly

Calls 1

nhl_errorFunction · 0.85

Tested by

no test coverage detected