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

Function mac_get_ext_cmd

outdated/sys/mac/mgetline.c:60–76  ·  view source on GitHub ↗

Read in an extended command - doing command line completion for * when enough characters have been entered to make a unique command. * This is just a modified getlin() followed by a lookup. -jsb */

Source from the content-addressed store, hash-verified

58 * This is just a modified getlin() followed by a lookup. -jsb
59 */
60int
61mac_get_ext_cmd()
62{
63 char bufp[BUFSZ];
64 int i;
65
66 if (iflags.extmenu)
67 return extcmd_via_menu();
68 topl_getlin("# ", bufp, true);
69 for (i = 0; extcmdlist[i].ef_txt != (char *) 0; i++)
70 if (!strcmp(bufp, extcmdlist[i].ef_txt))
71 break;
72 if (extcmdlist[i].ef_txt == (char *) 0)
73 i = -1; /* not found */
74
75 return i;
76}
77
78/* macgetline.c */

Callers

nothing calls this directly

Calls 2

extcmd_via_menuFunction · 0.85
topl_getlinFunction · 0.85

Tested by

no test coverage detected