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

Function l_nhcore_init

src/nhlua.c:139–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137static lua_State *luapat; /* instance for file pattern matching */
138
139void
140l_nhcore_init(void)
141{
142 nhl_sandbox_info sbi = { NHL_SB_SAFE, 1 * 1024 * 1024, 0,
143 1 * 1024 * 1024 };
144
145 if ((gl.luacore = nhl_init(&sbi)) != 0) {
146 if (!nhl_loadlua(gl.luacore, "nhcore.lua")) {
147 gl.luacore = (lua_State *) 0;
148 } else {
149 int i;
150
151 for (i = 0; i < NUM_NHCORE_CALLS; i++)
152 nhcore_call_available[i] = TRUE;
153 }
154 } else
155 impossible("l_nhcore_init failed");
156}
157
158void
159l_nhcore_done(void)

Callers 2

newgameFunction · 0.85
restore_luadataFunction · 0.85

Calls 3

nhl_initFunction · 0.85
nhl_loadluaFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected