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

Function cmd_from_ecname

src/cmd.c:3070–3089  ·  view source on GitHub ↗

return visual interpretation of the key bound to extended command, or the ext cmd name if not bound to any key. */

Source from the content-addressed store, hash-verified

3068/* return visual interpretation of the key bound to extended command,
3069 or the ext cmd name if not bound to any key. */
3070char *
3071cmd_from_ecname(const char *ecname)
3072{
3073 static char cmdnamebuf[QBUFSZ];
3074 const struct ext_func_tab *extcmd;
3075
3076 for (extcmd = extcmdlist; extcmd->ef_txt; ++extcmd)
3077 if (!strcmp(extcmd->ef_txt, ecname)) {
3078 char key = cmd_from_func(extcmd->ef_funct);
3079
3080 if (key)
3081 Sprintf(cmdnamebuf, "%s", visctrl(key));
3082 else
3083 Sprintf(cmdnamebuf, "#%s", ecname);
3084 return cmdnamebuf;
3085 }
3086
3087 cmdnamebuf[0] = '\0';
3088 return cmdnamebuf;
3089}
3090
3091const char *
3092ecname_from_fn(int (*fn)(void))

Callers 1

nhl_get_cmd_keyFunction · 0.85

Calls 2

cmd_from_funcFunction · 0.85
visctrlFunction · 0.85

Tested by

no test coverage detected