aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 059a2465c574..203632cc30bd 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -38,7 +38,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...)
38 va_end(ap); 38 va_end(ap);
39} 39}
40 40
41void menu_init(void) 41void _menu_init(void)
42{ 42{
43 current_entry = current_menu = &rootmenu; 43 current_entry = current_menu = &rootmenu;
44 last_entry_ptr = &rootmenu.list; 44 last_entry_ptr = &rootmenu.list;
@@ -197,7 +197,7 @@ static void sym_check_prop(struct symbol *sym)
197 if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && 197 if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
198 prop->expr->type != E_SYMBOL) 198 prop->expr->type != E_SYMBOL)
199 prop_warn(prop, 199 prop_warn(prop,
200 "default for config symbol '%'" 200 "default for config symbol '%s'"
201 " must be a single symbol", sym->name); 201 " must be a single symbol", sym->name);
202 break; 202 break;
203 case P_SELECT: 203 case P_SELECT:
@@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent)
390 } 390 }
391} 391}
392 392
393bool menu_has_prompt(struct menu *menu)
394{
395 if (!menu->prompt)
396 return false;
397 return true;
398}
399
393bool menu_is_visible(struct menu *menu) 400bool menu_is_visible(struct menu *menu)
394{ 401{
395 struct menu *child; 402 struct menu *child;
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu)
398 405
399 if (!menu->prompt) 406 if (!menu->prompt)
400 return false; 407 return false;
408
401 sym = menu->sym; 409 sym = menu->sym;
402 if (sym) { 410 if (sym) {
403 sym_calc_value(sym); 411 sym_calc_value(sym);
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu)
407 415
408 if (visible != no) 416 if (visible != no)
409 return true; 417 return true;
418
410 if (!sym || sym_get_tristate_value(menu->sym) == no) 419 if (!sym || sym_get_tristate_value(menu->sym) == no)
411 return false; 420 return false;
412 421
413 for (child = menu->list; child; child = child->next) 422 for (child = menu->list; child; child = child->next)
414 if (menu_is_visible(child)) 423 if (menu_is_visible(child))
415 return true; 424 return true;
425
416 return false; 426 return false;
417} 427}
418 428
@@ -515,6 +525,20 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
515 str_append(r, "\n\n"); 525 str_append(r, "\n\n");
516} 526}
517 527
528struct gstr get_relations_str(struct symbol **sym_arr)
529{
530 struct symbol *sym;
531 struct gstr res = str_new();
532 int i;
533
534 for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
535 get_symbol_str(&res, sym);
536 if (!i)
537 str_append(&res, _("No matches found.\n"));
538 return res;
539}
540
541
518void menu_get_ext_help(struct menu *menu, struct gstr *help) 542void menu_get_ext_help(struct menu *menu, struct gstr *help)
519{ 543{
520 struct symbol *sym = menu->sym; 544 struct symbol *sym = menu->sym;