summaryrefslogtreecommitdiff
path: root/common/menu.c
Commit message (Collapse)AuthorAgeLines
* Fix typo choosen in comments and printf logsAlexander Merkle2016-03-27-1/+1
| | | | | | | | Minor change: chosen is written with one "o". No code change here, only comment & printf. Signed-off-by: Alexander Merkle <alexander.merkle@lauterbach.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* menu: Return an error code if Ctrl-C is pressedTuomas Tynkkynen2015-05-27-0/+3
| | | | | | | | | | Previously, if the menu activated by the 'sysboot' command gets interrupted by a Ctrl-C, the behaviour is as if the menu timeout was reached - i.e. boot the default menu entry. This patch fixes that so a Ctrl-C now terminates the command as the user would expect. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* misc: use __weakJeroen Hofstee2014-10-25-4/+1
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Add cli_ prefix to readline functionsSimon Glass2014-05-29-2/+3
| | | | | | This makes it clear where the code resides. Signed-off-by: Simon Glass <sjg@chromium.org>
* move CLI prototypes to cli.h and add commentsSimon Glass2014-05-29-0/+1
| | | | | | | Move the CLI prototypes from common.h to cli.h as part of an effort to reduce the size of common.h. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-12/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* menu: export menu_default_choice() functionAnatolij Gustschin2013-03-29-1/+1
| | | | | | | | Checking the default menu item and obtaining its data can be useful in custom menu code. Export menu_default_choice() function which serves this purpose. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* menu: Add support for user defined item choice functionPali Rohár2013-03-29-11/+31
| | | | | | | | | | | | Selecting menu items is currently done in menu_interactive_choice() by reading the user input strings from standard input. Extend menu_interactive_choice() to support user defined function for selecting menu items. This function and its argument can be specified when creating the menu. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
* menu: only timeout when menu is displayedRob Herring2012-06-21-32/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the menu timeout apply only when prompt flag is set and after the menu is displayed. This allows auto boot to work no matter whether prompt is set or cleared. Use the default selection if the menu times out. This also fixes the timeout value given to readline_into_buffer to be seconds instead of 10th of seconds. Old behavior: if prompt display menu and wait for choice else wait for timeout if key pressed display menu and wait for choice else exit command New behavior: if prompt display menu if key pressed wait for choice else boot default entry on timeout else boot default entry Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* common, menu: do not trigger timeout again, if a line is readHeiko Schocher2012-02-12-1/+3
| | | | | | Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Jason Hobbs <jason.hobbs@calxeda.com> Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
* common, menu: add statusline supportHeiko Schocher2012-02-12-0/+8
| | | | | | | | | add the possibility to show a statusline when printing a menu Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Jason Hobbs <jason.hobbs@calxeda.com> Cc: Mike Frysinger <vapier@gentoo.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* common: add possibility for readline_into_buffer timeoutHeiko Schocher2012-02-12-1/+2
| | | | | | | | | add possibility to add a timeout when reading a line into a buffer. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Mike Frysinger <vapier@gentoo.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* common/menu.c: Fix build warningAnatolij Gustschin2011-12-05-1/+1
| | | | | | | | | | | | Fix: menu.c: In function 'menu_item_print': menu.c:91: warning: passing argument 1 of 'putc' makes integer from pointer without a cast Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Acked-by: Marek Vasut <marek.vasut@gmail.com>
* menu.c: use puts() instead of printf() where possibleWolfgang Denk2011-11-29-6/+10
| | | | | | | | | | | | | common/menu.c used printf() in a number of places to print user provided, constant strings (like the "title" string). printf() is dangerous here for example in case the user unwittingly embeds some '%' caracters that printf() would interpret as formatting and then pick up random arguments. Use puts() instead. We also omit the trailing ':' in the title line - if a user wants this, he can provide it as part of the title string. Signed-off-by: Wolfgang Denk <wd@denx.de>
* common, menu: use abortboot for menu timeoutJason Hobbs2011-10-17-8/+32
| | | | Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
* Add generic, reusable menu codeJason Hobbs2011-10-17-0/+393
This will be used first by the pxe code, but is intended to be generic and reusable for other jobs in U-boot. Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>