diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/expr.h | 2 | ||||
| -rw-r--r-- | scripts/kconfig/lkc_proto.h | 6 | ||||
| -rw-r--r-- | scripts/kconfig/mconf.c | 64 | ||||
| -rw-r--r-- | scripts/kconfig/menu.c | 55 | ||||
| -rw-r--r-- | scripts/kconfig/nconf.c | 2 |
5 files changed, 94 insertions, 35 deletions
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index d4ecce8bc3a6..52f4246bd34d 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -173,6 +173,8 @@ struct menu { | |||
| 173 | #define MENU_CHANGED 0x0001 | 173 | #define MENU_CHANGED 0x0001 |
| 174 | #define MENU_ROOT 0x0002 | 174 | #define MENU_ROOT 0x0002 |
| 175 | 175 | ||
| 176 | #define JUMP_NB 9 | ||
| 177 | |||
| 176 | extern struct file *file_list; | 178 | extern struct file *file_list; |
| 177 | extern struct file *current_file; | 179 | extern struct file *current_file; |
| 178 | struct file *lookup_file(const char *name); | 180 | struct file *lookup_file(const char *name); |
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 47fe9c340f9a..946c2cb367f9 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
| @@ -21,8 +21,10 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu)); | |||
| 21 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); | 21 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); |
| 22 | P(menu_has_help,bool,(struct menu *menu)); | 22 | P(menu_has_help,bool,(struct menu *menu)); |
| 23 | P(menu_get_help,const char *,(struct menu *menu)); | 23 | P(menu_get_help,const char *,(struct menu *menu)); |
| 24 | P(get_symbol_str, void, (struct gstr *r, struct symbol *sym)); | 24 | P(get_symbol_str, int, (struct gstr *r, struct symbol *sym, struct menu |
| 25 | P(get_relations_str, struct gstr, (struct symbol **sym_arr)); | 25 | **jumps, int jump_nb)); |
| 26 | P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct menu | ||
| 27 | **jumps)); | ||
| 26 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); | 28 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); |
| 27 | 29 | ||
| 28 | /* symbol.c */ | 30 | /* symbol.c */ |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index b3a37c2b16ae..6f409745b373 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -236,16 +236,19 @@ search_help[] = N_( | |||
| 236 | "Result:\n" | 236 | "Result:\n" |
| 237 | "-----------------------------------------------------------------\n" | 237 | "-----------------------------------------------------------------\n" |
| 238 | "Symbol: FOO [=m]\n" | 238 | "Symbol: FOO [=m]\n" |
| 239 | "Type : tristate\n" | ||
| 239 | "Prompt: Foo bus is used to drive the bar HW\n" | 240 | "Prompt: Foo bus is used to drive the bar HW\n" |
| 240 | "Defined at drivers/pci/Kconfig:47\n" | 241 | " Defined at drivers/pci/Kconfig:47\n" |
| 241 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" | 242 | " Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" |
| 242 | "Location:\n" | 243 | " Location:\n" |
| 243 | " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" | 244 | " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" |
| 244 | " -> PCI support (PCI [=y])\n" | 245 | " -> PCI support (PCI [=y])\n" |
| 245 | " -> PCI access mode (<choice> [=y])\n" | 246 | "(1) -> PCI access mode (<choice> [=y])\n" |
| 246 | "Selects: LIBCRC32\n" | 247 | " Selects: LIBCRC32\n" |
| 247 | "Selected by: BAR\n" | 248 | " Selected by: BAR\n" |
| 248 | "-----------------------------------------------------------------\n" | 249 | "-----------------------------------------------------------------\n" |
| 250 | "o The line 'Type:' shows the type of the configuration option for\n" | ||
| 251 | " this symbol (boolean, tristate, string, ...)\n" | ||
| 249 | "o The line 'Prompt:' shows the text used in the menu structure for\n" | 252 | "o The line 'Prompt:' shows the text used in the menu structure for\n" |
| 250 | " this symbol\n" | 253 | " this symbol\n" |
| 251 | "o The 'Defined at' line tell at what file / line number the symbol\n" | 254 | "o The 'Defined at' line tell at what file / line number the symbol\n" |
| @@ -254,8 +257,12 @@ search_help[] = N_( | |||
| 254 | " this symbol to be visible in the menu (selectable)\n" | 257 | " this symbol to be visible in the menu (selectable)\n" |
| 255 | "o The 'Location:' lines tell where in the menu structure this symbol\n" | 258 | "o The 'Location:' lines tell where in the menu structure this symbol\n" |
| 256 | " is located\n" | 259 | " is located\n" |
| 257 | " A location followed by a [=y] indicate that this is a selectable\n" | 260 | " A location followed by a [=y] indicates that this is a\n" |
| 258 | " menu item - and current value is displayed inside brackets.\n" | 261 | " selectable menu item - and the current value is displayed inside\n" |
| 262 | " brackets.\n" | ||
| 263 | " Press the key in the (#) prefix to jump directly to that\n" | ||
| 264 | " location. You will be returned to the current search results\n" | ||
| 265 | " after exiting this new menu.\n" | ||
| 259 | "o The 'Selects:' line tell what symbol will be automatically\n" | 266 | "o The 'Selects:' line tell what symbol will be automatically\n" |
| 260 | " selected if this symbol is selected (y or m)\n" | 267 | " selected if this symbol is selected (y or m)\n" |
| 261 | "o The 'Selected by' line tell what symbol has selected this symbol\n" | 268 | "o The 'Selected by' line tell what symbol has selected this symbol\n" |
| @@ -274,7 +281,7 @@ static int child_count; | |||
| 274 | static int single_menu_mode; | 281 | static int single_menu_mode; |
| 275 | static int show_all_options; | 282 | static int show_all_options; |
| 276 | 283 | ||
| 277 | static void conf(struct menu *menu); | 284 | static void conf(struct menu *menu, struct menu *active_menu); |
| 278 | static void conf_choice(struct menu *menu); | 285 | static void conf_choice(struct menu *menu); |
| 279 | static void conf_string(struct menu *menu); | 286 | static void conf_string(struct menu *menu); |
| 280 | static void conf_load(void); | 287 | static void conf_load(void); |
| @@ -308,7 +315,9 @@ static void search_conf(void) | |||
| 308 | struct symbol **sym_arr; | 315 | struct symbol **sym_arr; |
| 309 | struct gstr res; | 316 | struct gstr res; |
| 310 | char *dialog_input; | 317 | char *dialog_input; |
| 311 | int dres; | 318 | int dres, vscroll = 0, hscroll = 0; |
| 319 | bool again; | ||
| 320 | |||
| 312 | again: | 321 | again: |
| 313 | dialog_clear(); | 322 | dialog_clear(); |
| 314 | dres = dialog_inputbox(_("Search Configuration Parameter"), | 323 | dres = dialog_inputbox(_("Search Configuration Parameter"), |
| @@ -331,10 +340,24 @@ again: | |||
| 331 | dialog_input += strlen(CONFIG_); | 340 | dialog_input += strlen(CONFIG_); |
| 332 | 341 | ||
| 333 | sym_arr = sym_re_search(dialog_input); | 342 | sym_arr = sym_re_search(dialog_input); |
| 334 | res = get_relations_str(sym_arr); | 343 | do { |
| 344 | struct menu *jumps[JUMP_NB] = {0}; | ||
| 345 | int keys[JUMP_NB + 1] = {0}, i; | ||
| 346 | |||
| 347 | res = get_relations_str(sym_arr, jumps); | ||
| 348 | for (i = 0; i < JUMP_NB && jumps[i]; i++) | ||
| 349 | keys[i] = '1' + i; | ||
| 350 | dres = show_textbox_ext(_("Search Results"), str_get(&res), 0, | ||
| 351 | 0, keys, &vscroll, &hscroll); | ||
| 352 | again = false; | ||
| 353 | for (i = 0; i < JUMP_NB && jumps[i]; i++) | ||
| 354 | if (dres == keys[i]) { | ||
| 355 | conf(jumps[i]->parent, jumps[i]); | ||
| 356 | again = true; | ||
| 357 | } | ||
| 358 | str_free(&res); | ||
| 359 | } while (again); | ||
| 335 | free(sym_arr); | 360 | free(sym_arr); |
| 336 | show_textbox(_("Search Results"), str_get(&res), 0, 0); | ||
| 337 | str_free(&res); | ||
| 338 | } | 361 | } |
| 339 | 362 | ||
| 340 | static void build_conf(struct menu *menu) | 363 | static void build_conf(struct menu *menu) |
| @@ -515,12 +538,11 @@ conf_childs: | |||
| 515 | indent -= doint; | 538 | indent -= doint; |
| 516 | } | 539 | } |
| 517 | 540 | ||
| 518 | static void conf(struct menu *menu) | 541 | static void conf(struct menu *menu, struct menu *active_menu) |
| 519 | { | 542 | { |
| 520 | struct menu *submenu; | 543 | struct menu *submenu; |
| 521 | const char *prompt = menu_get_prompt(menu); | 544 | const char *prompt = menu_get_prompt(menu); |
| 522 | struct symbol *sym; | 545 | struct symbol *sym; |
| 523 | struct menu *active_menu = NULL; | ||
| 524 | int res; | 546 | int res; |
| 525 | int s_scroll = 0; | 547 | int s_scroll = 0; |
| 526 | 548 | ||
| @@ -563,13 +585,13 @@ static void conf(struct menu *menu) | |||
| 563 | if (single_menu_mode) | 585 | if (single_menu_mode) |
| 564 | submenu->data = (void *) (long) !submenu->data; | 586 | submenu->data = (void *) (long) !submenu->data; |
| 565 | else | 587 | else |
| 566 | conf(submenu); | 588 | conf(submenu, NULL); |
| 567 | break; | 589 | break; |
| 568 | case 't': | 590 | case 't': |
| 569 | if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) | 591 | if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) |
| 570 | conf_choice(submenu); | 592 | conf_choice(submenu); |
| 571 | else if (submenu->prompt->type == P_MENU) | 593 | else if (submenu->prompt->type == P_MENU) |
| 572 | conf(submenu); | 594 | conf(submenu, NULL); |
| 573 | break; | 595 | break; |
| 574 | case 's': | 596 | case 's': |
| 575 | conf_string(submenu); | 597 | conf_string(submenu); |
| @@ -608,7 +630,7 @@ static void conf(struct menu *menu) | |||
| 608 | if (item_is_tag('t')) | 630 | if (item_is_tag('t')) |
| 609 | sym_toggle_tristate_value(sym); | 631 | sym_toggle_tristate_value(sym); |
| 610 | else if (item_is_tag('m')) | 632 | else if (item_is_tag('m')) |
| 611 | conf(submenu); | 633 | conf(submenu, NULL); |
| 612 | break; | 634 | break; |
| 613 | case 7: | 635 | case 7: |
| 614 | search_conf(); | 636 | search_conf(); |
| @@ -877,7 +899,7 @@ int main(int ac, char **av) | |||
| 877 | 899 | ||
| 878 | set_config_filename(conf_get_configname()); | 900 | set_config_filename(conf_get_configname()); |
| 879 | do { | 901 | do { |
