Changeset aca4a04 in mainline for kernel/generic/src/console/prompt.c


Ignore:
Timestamp:
2012-07-10T12:38:05Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
550af2b
Parents:
f0d7bd9
Message:

Extract common code into function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/prompt.c

    rf0d7bd9 raca4a04  
    3939#include <console/prompt.h>
    4040
     41bool console_prompt_display_all_hints(indev_t *indev, size_t hints)
     42{
     43        printf("Display all %zu possibilities? (y or n)", hints);
     44
     45        while (true) {
     46                wchar_t answer = indev_pop_character(indev);
     47
     48                if (answer == 'y' || answer == 'Y') {
     49                        printf(" y");
     50                        return true;
     51                }
     52
     53                if (answer == 'n' || answer == 'N') {
     54                        printf(" n");
     55                        return false;
     56                }
     57        }
     58}
     59
    4160bool console_prompt_more_hints(indev_t *indev, size_t *display_hints)
    4261{
Note: See TracChangeset for help on using the changeset viewer.