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

Function cmdbind_remove

src/cmd.c:2157–2177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2155}
2156
2157staticfn void
2158cmdbind_remove(uchar key)
2159{
2160 struct Cmd_bind *bind = gc.Cmd.cmdbinds;
2161 struct Cmd_bind *prev = (struct Cmd_bind *) 0;
2162
2163 while (bind) {
2164 if (bind->key == key) {
2165 if (prev)
2166 prev->next = bind->next;
2167 else
2168 gc.Cmd.cmdbinds = bind->next;
2169 if (bind->param)
2170 free(bind->param);
2171 free(bind);
2172 return;
2173 }
2174 prev = bind;
2175 bind = bind->next;
2176 }
2177}
2178
2179void
2180cmdbind_freeall(void)

Callers 3

cmdbind_addFunction · 0.85
bind_keyFunction · 0.85
reset_commandsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected