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

Function curses_get_count

win/curses/cursmisc.c:711–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709in int form. */
710
711long
712curses_get_count(int first_digit)
713{
714 int current_char;
715 long current_count = 0L;
716
717 /* use core's count routine; we have the first digit; if any more
718 are typed, get_count() will send "Count:123" to the message window;
719 curses's message window will display that in count window instead */
720 current_char = get_count(NULL, (char) first_digit,
721 /* 0L => no limit on value unless it wraps
722 * to negative */
723 0L, &current_count,
724 /* don't put into message history, echo full
725 * number rather than waiting until 2nd digit */
726 GC_ECHOFIRST);
727
728 ungetch(current_char);
729 if (current_char == '\033') { /* Cancelled with escape */
730 current_count = -1;
731 }
732 return current_count;
733}
734
735
736/* Convert the given NetHack text attributes into the format curses

Callers 2

menu_get_selectionsFunction · 0.85

Calls 1

get_countFunction · 0.85

Tested by

no test coverage detected