here after # - now read a full-word command */
| 490 | |
| 491 | /* here after # - now read a full-word command */ |
| 492 | int |
| 493 | doextcmd(void) |
| 494 | { |
| 495 | int idx, retval; |
| 496 | int (*func)(void); |
| 497 | |
| 498 | /* keep repeating until we don't run help or quit */ |
| 499 | do { |
| 500 | idx = get_ext_cmd(); |
| 501 | if (idx < 0) |
| 502 | return ECMD_OK; /* quit */ |
| 503 | |
| 504 | func = extcmdlist[idx].ef_funct; |
| 505 | if (!can_do_extcmd(&extcmdlist[idx])) |
| 506 | return ECMD_OK; |
| 507 | if (iflags.menu_requested && !accept_menu_prefix(&extcmdlist[idx])) { |
| 508 | pline("'%s' prefix has no effect for the %s command.", |
| 509 | visctrl(cmd_from_func(do_reqmenu)), |
| 510 | extcmdlist[idx].ef_txt); |
| 511 | iflags.menu_requested = FALSE; |
| 512 | } |
| 513 | /* tell rhack() what command is actually executing */ |
| 514 | ge.ext_tlist = &extcmdlist[idx]; |
| 515 | |
| 516 | retval = (*func)(); |
| 517 | } while (func == doextlist); |
| 518 | |
| 519 | return retval; |
| 520 | } |
| 521 | |
| 522 | /* format extended command flags for display */ |
| 523 | staticfn char * |
nothing calls this directly
no test coverage detected