History log of /linux-master/scripts/kconfig/nconf.h
Revision Date Author Comments
# 1ba67cd3 08-Aug-2023 Jesse Taube <mr.bossman075@gmail.com>

kconfig: nconf: Add search jump feature

Menuconfig has a feature where you can "press the key in the (#) prefix
to jump directly to that location. You will be returned to the current
search results after exiting this new menu."

This commit adds this feature to nconfig, with almost identical code.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 08718745 11-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: refactor in print_in_middle()

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>


# 93487b17 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: refactor attributes setup code

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>


# 0c874100 18-Dec-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: convert to SPDX License Identifier

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>


# 694c49a7 22-May-2018 Sam Ravnborg <sam@ravnborg.org>

kconfig: drop localization support

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>


# 26561514 15-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: do not include both curses.h and ncurses.h for nconfig

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>


# 5ea9f64f 01-Sep-2011 Cheng Renquan <crquan@gmail.com>

scripts/kconfig/nconf: dynamically alloc dialog_input_result

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>


# a72f3e2b 08-Aug-2010 Nir Tzachar <nir.tzachar@gmail.com>

nconfig: add search support

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>


# 692d97c3 24-Nov-2009 nir.tzachar@gmail.com <nir.tzachar@gmail.com>

kconfig: new configuration interface (nconfig)

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>