Changes in kernel/generic/src/console/prompt.c [dfc07c1:f4a8734] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/prompt.c
rdfc07c1 rf4a8734 43 43 * @param indev Where to read characters from. 44 44 * @param hints Number of hints that would be displayed. 45 *46 45 * @return Whether to print all hints. 47 *48 46 */ 49 47 bool console_prompt_display_all_hints(indev_t *indev, size_t hints) … … 51 49 ASSERT(indev); 52 50 ASSERT(hints > 0); 53 54 printf("Display all %zu possibilities? (y or n) 55 51 52 printf("Display all %zu possibilities? (y or n)", hints); 53 56 54 while (true) { 57 55 wchar_t answer = indev_pop_character(indev); 58 59 if ( (answer == 'y') || (answer == 'Y')) {60 printf(" y");56 57 if (answer == 'y' || answer == 'Y') { 58 printf(" y"); 61 59 return true; 62 60 } 63 64 if ( (answer == 'n') || (answer == 'N')) {65 printf(" n");61 62 if (answer == 'n' || answer == 'N') { 63 printf(" n"); 66 64 return false; 67 65 } … … 73 71 * When the function returns false, @p display_hints is set to zero. 74 72 * 75 * @param[in] indevWhere to read characters from.73 * @param[in] indev Where to read characters from. 76 74 * @param[out] display_hints How many hints to display. 77 *78 75 * @return Whether to display more hints. 79 *80 76 */ 81 77 bool console_prompt_more_hints(indev_t *indev, size_t *display_hints) … … 83 79 ASSERT(indev); 84 80 ASSERT(display_hints != NULL); 85 81 86 82 printf("--More--"); 87 83 while (true) { 88 84 wchar_t continue_showing_hints = indev_pop_character(indev); 89 85 /* Display a full page again? */ 90 if ( (continue_showing_hints == 'y') ||91 (continue_showing_hints == 'Y') ||92 (continue_showing_hints == ' ')) {86 if (continue_showing_hints == 'y' 87 || continue_showing_hints == 'Y' 88 || continue_showing_hints == ' ') { 93 89 *display_hints = MAX_TAB_HINTS - 1; 94 90 break; 95 91 } 96 92 97 93 /* Stop displaying hints? */ 98 if ( (continue_showing_hints == 'n') ||99 (continue_showing_hints == 'N') ||100 (continue_showing_hints == 'q') ||101 (continue_showing_hints == 'Q')) {94 if (continue_showing_hints == 'n' 95 || continue_showing_hints == 'N' 96 || continue_showing_hints == 'q' 97 || continue_showing_hints == 'Q') { 102 98 *display_hints = 0; 103 99 break; 104 100 } 105 101 106 102 /* Show one more hint? */ 107 103 if (continue_showing_hints == '\n') { … … 110 106 } 111 107 } 112 108 113 109 /* Delete the --More-- option */ 114 110 printf("\r \r"); 115 111 116 112 return *display_hints > 0; 117 113 }
Note:
See TracChangeset
for help on using the changeset viewer.