summaryrefslogtreecommitdiff
path: root/scripts/kconfig/nconf.h
AgeCommit message (Collapse)Author
2021-04-14kconfig: nconf: refactor in print_in_middle()Masahiro Yamada
This helper is the same as the sample code in the NCURSES HOWTO [1], but it is over-engineering to be used for nconf. I do not see any good reason to use the 'float' type just for the division by 2. All the call-sites pass a non-NULL pointer to the first argument, so 'if (win == NULL) win = stdscr;' is dead code. 'if (startx != 0) x = startx;' is dead code because 'x' will be overridden some lines below, by 'x = startx + (int)temp;'. All the call-sites pass a non-zero value to the second argument, so 'if (starty != 0)' is always true. getyx(win, y, x) is also dead-code because both 'y' and 'x' are overridden. All the call-sites pass 0 to the third parameter, so 'startx' can be removed. All the call-sites pass a non-zero value to the fourth parameter, so 'if (width == 0) width = 80;' is dead code. The window will be refreshed later, so there is no need to call refresh() in this function. Change the type of the last parameter from 'chtype' to 'int' to be aligned with the prototype, 'int wattrset(WINDOW *win, int attrs);' I also slightly cleaned up the indentation style. [1]: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: refactor attributes setup codeMasahiro Yamada
The current attributes setup code is strange; the array attribute[] is set to values outside the range of the attribute_t enum. At least, attributes_t attributes[ATTR_MAX+1] = {0}; ... should be int attribute[ATTR_MAX+1] = {0}; Also, there is no need to hard-code the color-pair numbers in attributes_t. The current code is messy. Rewrite it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2018-12-28kconfig: convert to SPDX License IdentifierMasahiro Yamada
All files in lxdialog/ are licensed under GPL-2.0+, and the rest are under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/. Documentation/process/license-rules.rst does not suggest anything about the flex/bison files. Because flex does not accept the C++ comment style at the very top of a file, I used the C style for zconf.l, and so for zconf.y for consistency. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-28kconfig: drop localization supportSam Ravnborg
The localization support is broken and appears unused. There is no google hits on the update-po-config target. And there is no recent (5 years) activity related to the localization. So lets just drop this as it is no longer used. Suggested-by: Ulf Magnusson <ulfalizer@gmail.com> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-26kconfig: do not include both curses.h and ncurses.h for nconfigMasahiro Yamada
nconf.h includes <curses.h> and "ncurses.h", but it does not need to include both. Generally, it should fall back to curses.h only when ncurses.h is not found. But, looks like it has never happened; these includes have been here for many years since commit 692d97c380c6 ("kconfig: new configuration interface (nconfig)"), and nobody has complained about hard-coding of ncurses.h . Let's simply drop the curses.h inclusion. I replaced "ncurses.h" with <ncurses.h> since it is not a local file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2011-09-09scripts/kconfig/nconf: dynamically alloc dialog_input_resultCheng Renquan
To support unlimited length string config items; No check for realloc return value keeps code simple, and to be consistent with other existing unchecked malloc in kconfig. Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2010-08-16nconfig: add search supportNir Tzachar
Remove the old hotkeys feature, and replace it by an interactive string search. From nconfig help: Searching: pressing '/' triggers interactive search mode. nconfig performs a case insensitive search for the string in the menu prompts (no regex support). Pressing the up/down keys highlights the previous/next matching item. Backspace removes one character from the match string. Pressing either '/' again or ESC exits search mode. All other keys behave normally. Miscellaneous other changes (including Rundy's and Justin's input). Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-02-02kconfig: new configuration interface (nconfig)nir.tzachar@gmail.com
This patch was inspired by the kernel projects page, where an ncurses replacement for menuconfig was mentioned (by Sam Ravnborg). Building on menuconfig, this patch implements a more modern look interface using ncurses and ncurses' satellite libraries (menu, panel, form). The implementation does not depend on lxdialog, which is currently distributed with the kernel. Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>