MCPcopy Index your code
hub / github.com/NetHack/NetHack / wiz_load_lua

Function wiz_load_lua

src/wizcmds.c:349–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349DISABLE_WARNING_FORMAT_NONLITERAL
350
351/* the #wizloadlua command - load an arbitrary lua file */
352int
353wiz_load_lua(void)
354{
355 if (wizard) {
356 char buf[BUFSZ];
357 /* Large but not unlimited memory and CPU so random bits of
358 * code can be tested by wizards. */
359 nhl_sandbox_info sbi = {NHL_SB_SAFE | NHL_SB_DEBUGGING,
360 16*1024*1024, 0, 16*1024*1024};
361
362 buf[0] = '\0';
363 getlin("Load which lua file?", buf);
364 if (buf[0] == '\033' || buf[0] == '\0')
365 return ECMD_CANCEL;
366 if (!strchr(buf, '.'))
367 strcat(buf, ".lua");
368 (void) load_lua(buf, &sbi);
369 } else
370 pline(unavailcmd, ecname_from_fn(wiz_load_lua));
371 return ECMD_OK;
372}
373
374/* the #wizloaddes command - load a special level lua file */
375int

Callers

nothing calls this directly

Calls 4

getlinFunction · 0.85
load_luaFunction · 0.85
ecname_from_fnFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected