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

Function l_get_config_errors

src/cfgfiles.c:1515–1539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1513
1514#ifndef SFCTOOL
1515int
1516l_get_config_errors(lua_State *L)
1517{
1518 struct _config_error_errmsg *dat = config_error_msg;
1519 struct _config_error_errmsg *tmp;
1520 int idx = 1;
1521
1522 lua_newtable(L);
1523
1524 while (dat) {
1525 lua_pushinteger(L, idx++);
1526 lua_newtable(L);
1527 nhl_add_table_entry_int(L, "line", dat->line_num);
1528 nhl_add_table_entry_str(L, "error", dat->errormsg);
1529 lua_settable(L, -3);
1530 tmp = dat->next;
1531 free(dat->errormsg);
1532 dat->errormsg = (char *) 0;
1533 free(dat);
1534 dat = tmp;
1535 }
1536 config_error_msg = (struct _config_error_errmsg *) 0;
1537
1538 return 1;
1539}
1540#endif /* SFCTOOL */
1541
1542/* varargs 'config_error_add()' moved to pline.c */

Callers

nothing calls this directly

Calls 2

nhl_add_table_entry_intFunction · 0.85
nhl_add_table_entry_strFunction · 0.85

Tested by

no test coverage detected