| 709 | in int form. */ |
| 710 | |
| 711 | long |
| 712 | curses_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, ¤t_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 |
no test coverage detected