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

Function l_selection_push_new

src/nhlsel.c:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92/* push a new selection into lua stack, return the selectionvar */
93staticfn struct selectionvar *
94l_selection_push_new(lua_State *L)
95{
96 struct selectionvar *tmp = selection_new();
97 struct selectionvar *sel
98 = (struct selectionvar *) lua_newuserdata(L, sizeof (struct selectionvar));
99
100 luaL_getmetatable(L, "selection");
101 lua_setmetatable(L, -2);
102
103 *sel = *tmp;
104 sel->map = dupstr(tmp->map);
105 selection_free(tmp, TRUE);
106
107 return sel;
108}
109
110/* push a copy of selectionvar tmp to lua stack */
111void

Callers 5

l_selection_newFunction · 0.85
l_selection_andFunction · 0.85
l_selection_orFunction · 0.85
l_selection_xorFunction · 0.85
l_selection_subFunction · 0.85

Calls 3

selection_newFunction · 0.85
dupstrFunction · 0.85
selection_freeFunction · 0.85

Tested by

no test coverage detected