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

Function get_nh_lua_variables

src/nhlua.c:1296–1316  ·  view source on GitHub ↗

return nh_lua_variable lua table as a string */

Source from the content-addressed store, hash-verified

1294
1295/* return nh_lua_variable lua table as a string */
1296char *
1297get_nh_lua_variables(void)
1298{
1299 char *key = NULL;
1300
1301 if (!gl.luacore) {
1302 panic("nh luacore not inited");
1303 /*NOTREACHED*/
1304 return key;
1305 }
1306 lua_getglobal(gl.luacore, "get_variables_string");
1307 if (lua_type(gl.luacore, -1) == LUA_TFUNCTION) {
1308 if (nhl_pcall_handle(gl.luacore, 0, 1, "get_nh_lua_variables",
1309 NHLpa_impossible)) {
1310 return key;
1311 }
1312 key = dupstr(lua_tostring(gl.luacore, -1));
1313 }
1314 lua_pop(gl.luacore, 1);
1315 return key;
1316}
1317
1318RESTORE_WARNING_UNREACHABLE_CODE
1319

Callers 1

save_luadataFunction · 0.85

Calls 3

nhl_pcall_handleFunction · 0.85
dupstrFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected