From fb1e151835e62917eeb93ed2a5f6cef9d8392bf5 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 15 Mar 2003 01:17:04 -0800 Subject: [PATCH] restore old config behaviour for dependencies on 'm' This restores the old config behaviour for dependencies on 'm', such entries are only activ if CONFIG_MODULES is enabled as well. --- scripts/kconfig/menu.c | 29 +++++++++++++++++++++++++++-- scripts/kconfig/zconf.tab.c_shipped | 4 ++-- scripts/kconfig/zconf.y | 3 +-- 3 files changed, 30 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 24be0ec65f3b..abfe8d72fbfe 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -54,9 +54,34 @@ void menu_end_menu(void) current_menu = current_menu->parent; } +struct expr *menu_check_dep(struct expr *e) +{ + if (!e) + return e; + + switch (e->type) { + case E_NOT: + e->left.expr = menu_check_dep(e->left.expr); + break; + case E_OR: + case E_AND: + e->left.expr = menu_check_dep(e->left.expr); + e->right.expr = menu_check_dep(e->right.expr); + break; + case E_SYMBOL: + /* change 'm' into 'm' && MODULES */ + if (e->left.sym == &symbol_mod) + return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); + break; + default: + break; + } + return e; +} + void menu_add_dep(struct expr *dep) { - current_entry->dep = expr_alloc_and(current_entry->dep, dep); + current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); } void menu_set_type(int type) @@ -96,7 +121,7 @@ struct property *menu_add_prop(int token, char *prompt, struct symbol *def, stru prop->menu = current_entry; prop->text = prompt; prop->def = def; - E_EXPR(prop->visible) = dep; + E_EXPR(prop->visible) = menu_check_dep(dep); if (prompt) current_entry->prompt = prop; diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index d312cc10dc88..1ec370f8c91e 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -1726,12 +1726,14 @@ yyreturn: + void conf_parse(const char *name) { zconf_initscan(name); sym_init(); menu_init(); + modules_sym = sym_lookup("MODULES", 0); rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); //zconfdebug = 1; @@ -1740,8 +1742,6 @@ void conf_parse(const char *name) exit(1); menu_finalize(&rootmenu); - modules_sym = sym_lookup("MODULES", 0); - sym_change_count = 1; } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 8d4abc5c1610..dff6a117ae9e 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -423,6 +423,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); + modules_sym = sym_lookup("MODULES", 0); rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); //zconfdebug = 1; @@ -431,8 +432,6 @@ void conf_parse(const char *name) exit(1); menu_finalize(&rootmenu); - modules_sym = sym_lookup("MODULES", 0); - sym_change_count = 1; } -- cgit v1.2.3 From 8f5aa8efddb24a0e46396a037cc1b2f089f23f41 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 15 Mar 2003 01:17:12 -0800 Subject: [PATCH] menu structure fix A menu entry was possibly inserted to high in the menu hierarchie if the previous entry was a derived config symbol. --- scripts/kconfig/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index abfe8d72fbfe..81d764e7230d 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -194,8 +194,8 @@ void menu_finalize(struct menu *parent) } for (menu = parent->list; menu; menu = menu->next) menu_finalize(menu); - } else if (sym && parent->prompt) { - basedep = E_EXPR(parent->prompt->visible); + } else if (sym) { + basedep = parent->prompt ? E_EXPR(parent->prompt->visible) : NULL; basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); basedep = expr_eliminate_dups(expr_transform(basedep)); last_menu = NULL; -- cgit v1.2.3 From bbc115e93ae7844038127301294f9c116db9f5ec Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 15 Mar 2003 01:17:18 -0800 Subject: [PATCH] add menuconfig support This adds the support for the menuconfig keyword, which allows to define a config symbol and a submenu with a single step, e.g. instead of menu "SCSI device support" config SCSI tristate "SCSI device support" this is now enough: menuconfig SCSI tristate "SCSI device support" --- scripts/kconfig/expr.h | 4 +- scripts/kconfig/lex.zconf.c_shipped | 1104 ++++++++++++++++++---------------- scripts/kconfig/symbol.c | 3 + scripts/kconfig/zconf.l | 4 +- scripts/kconfig/zconf.tab.c_shipped | 1119 +++++++++++++++++++---------------- scripts/kconfig/zconf.y | 24 +- 6 files changed, 1236 insertions(+), 1022 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 896a296d17c5..373e8346d5b3 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -155,9 +155,11 @@ struct property { #define for_all_properties(sym, st, tok) \ for (st = sym->prop; st; st = st->next) \ if (st->type == (tok)) -#define for_all_prompts(sym, st) for_all_properties(sym, st, P_PROMPT) #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) #define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE) +#define for_all_prompts(sym, st) \ + for (st = sym->prop; st; st = st->next) \ + if (st->text) struct menu { struct menu *next; diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 290d48114aab..b0300b6ca490 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped @@ -357,18 +357,18 @@ static yyconst short yy_nxt[][37] = }, { - 11, 38, 38, 39, 40, 41, 38, 42, 41, 43, - 44, 45, 46, 46, 47, 48, 46, 46, 46, 46, - 46, 46, 46, 46, 49, 46, 46, 46, 50, 46, - 46, 46, 46, 46, 46, 46, 51 + 11, 38, 38, 39, 40, 41, 42, 43, 41, 44, + 45, 46, 47, 47, 48, 49, 47, 47, 47, 47, + 47, 47, 47, 47, 50, 47, 47, 47, 51, 47, + 47, 47, 47, 47, 47, 47, 52 }, { - 11, 38, 38, 39, 40, 41, 38, 42, 41, 43, - 44, 45, 46, 46, 47, 48, 46, 46, 46, 46, - 46, 46, 46, 46, 49, 46, 46, 46, 50, 46, - 46, 46, 46, 46, 46, 46, 51 + 11, 38, 38, 39, 40, 41, 42, 43, 41, 44, + 45, 46, 47, 47, 48, 49, 47, 47, 47, 47, + 47, 47, 47, 47, 50, 47, 47, 47, 51, 47, + 47, 47, 47, 47, 47, 47, 52 }, { @@ -387,7 +387,7 @@ static yyconst short yy_nxt[][37] = }, { - 11, -13, 52, 53, -13, -13, 54, -13, -13, -13, + 11, -13, 53, 54, -13, -13, 55, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13 @@ -402,10 +402,10 @@ static yyconst short yy_nxt[][37] = }, { - 11, 55, 55, 56, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55 + 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56 }, { @@ -425,109 +425,109 @@ static yyconst short yy_nxt[][37] = { 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, 57, -18, -18, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -18 + -18, -18, -18, 58, -18, -18, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -18 }, { 11, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, 57, -19, -19, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, - 57, 57, 57, 57, 57, 57, -19 + -19, -19, -19, 58, -19, -19, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 59, 58, + 58, 58, 58, 58, 58, 58, -19 }, { 11, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, 57, -20, -20, 57, 57, 57, 57, - 57, 57, 57, 59, 57, 57, 57, 57, 60, 57, - 57, 57, 57, 57, 57, 57, -20 + -20, -20, -20, 58, -20, -20, 58, 58, 58, 58, + 58, 58, 58, 60, 58, 58, 58, 58, 61, 58, + 58, 58, 58, 58, 58, 58, -20 }, { 11, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, 57, -21, -21, 57, 57, 57, 57, - 61, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -21 + -21, -21, -21, 58, -21, -21, 58, 58, 58, 58, + 62, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -21 }, { 11, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, 57, -22, -22, 57, 57, 57, 57, + -22, -22, -22, 58, -22, -22, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 62, 57, 57, - 57, 57, 57, 57, 57, 57, -22 + 58, 58, 58, 58, 58, 58, 58, 63, 58, 58, + 58, 58, 58, 58, 58, 58, -22 }, { 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, 57, -23, -23, 57, 57, 57, 57, - 63, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -23 + -23, -23, -23, 58, -23, -23, 58, 58, 58, 58, + 64, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -23 }, { 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, 57, -24, -24, 57, 57, 57, 57, - 57, 64, 57, 57, 57, 57, 57, 65, 57, 57, - 57, 57, 57, 57, 57, 57, -24 + -24, -24, -24, 58, -24, -24, 58, 58, 58, 58, + 58, 65, 58, 58, 58, 58, 58, 66, 58, 58, + 58, 58, 58, 58, 58, 58, -24 }, { 11, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, 57, -25, -25, 66, 57, 57, 57, - 67, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -25 + -25, -25, -25, 58, -25, -25, 67, 58, 58, 58, + 68, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -25 }, { 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, 57, -26, -26, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 68, - 57, 57, 57, 57, 57, 57, -26 + -26, -26, -26, 58, -26, -26, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 69, + 58, 58, 58, 58, 58, 58, -26 }, { 11, -27, -27, -27, -27, -27, -27, -27, -27, -27, - -27, -27, -27, 57, -27, -27, 57, 57, 57, 57, + -27, -27, -27, 58, -27, -27, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 69, 57, 57, 57, 57, -27 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 70, 58, 58, 58, 58, -27 }, { 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, 57, -28, -28, 57, 57, 57, 57, - 70, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -28 + -28, -28, -28, 58, -28, -28, 58, 58, 58, 58, + 71, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -28 }, { 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, 57, -29, -29, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 71, 57, - 57, 57, 57, 72, 57, 57, -29 + -29, -29, -29, 58, -29, -29, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 72, 58, + 58, 58, 58, 73, 58, 58, -29 }, { 11, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, 57, -30, -30, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 73, 57, 57, 57, 57, -30 + -30, -30, -30, 58, -30, -30, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 74, 58, 58, 58, 58, -30 }, { - 11, 74, 74, -31, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74 + 11, 75, 75, -31, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75 }, { - 11, -32, 75, 76, -32, -32, -32, -32, -32, -32, + 11, -32, 76, 77, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, @@ -535,17 +535,17 @@ static yyconst short yy_nxt[][37] = }, { - 11, 77, -33, -33, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77 + 11, 78, -33, -33, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78 }, { - 11, 78, 78, 79, 78, -34, 78, 78, -34, 78, - 78, 78, 78, 78, 78, -34, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78 + 11, 79, 79, 80, 79, -34, 79, 79, -34, 79, + 79, 79, 79, 79, 79, -34, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79 }, @@ -564,11 +564,11 @@ static yyconst short yy_nxt[][37] = }, { - 11, 80, 80, 81, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 11, 81, 81, 82, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80 + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81 }, { @@ -588,7 +588,7 @@ static yyconst short yy_nxt[][37] = { 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, 82, -40, -40, -40, -40, -40, + -40, -40, -40, -40, 83, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40 }, @@ -601,15 +601,15 @@ static yyconst short yy_nxt[][37] = }, { - 11, -42, -42, -42, -42, -42, -42, 83, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + 11, 84, 84, -42, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42 + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84 }, { - 11, -43, -43, -43, -43, -43, -43, -43, -43, -43, + 11, -43, -43, -43, -43, -43, -43, 85, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43 @@ -625,272 +625,272 @@ static yyconst short yy_nxt[][37] = { 11, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, 84, 85, 85, -45, -45, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -45 + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45 }, { 11, -46, -46, -46, -46, -46, -46, -46, -46, -46, - -46, 85, 85, 85, -46, -46, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -46 + -46, 86, 87, 87, -46, -46, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -46 }, { 11, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, 87, 87, 87, -47, -47, 87, 87, 87, 87, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47 + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -47 }, { - 11, -48, -48, 86, -48, -48, -48, -48, -48, -48, + 11, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48 }, { - 11, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, 85, 85, 85, -49, -49, 85, 85, 85, 85, - 85, 87, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -49 + 11, -49, -49, 88, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49 }, { 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, 85, 85, 85, -50, -50, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 88, 85, 85, - 85, 85, 85, 85, 85, 85, -50 + -50, 87, 87, 87, -50, -50, 87, 87, 87, 87, + 87, 89, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -50 }, { 11, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, 89 + -51, 87, 87, 87, -51, -51, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 90, 87, 87, + 87, 87, 87, 87, 87, 87, -51 }, { - 11, -52, 52, 53, -52, -52, 54, -52, -52, -52, + 11, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52 + -52, -52, -52, -52, -52, -52, 91 }, { - 11, -53, -53, -53, -53, -53, -53, -53, -53, -53, + 11, -53, 53, 54, -53, -53, 55, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53 }, { - 11, 55, 55, 56, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55 + 11, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54 }, { - 11, 55, 55, 56, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55 + 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56 }, { - 11, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56 + 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56 }, { 11, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, 57, -57, -57, 57, 57, 57, 57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -57 + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57 }, { 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, 57, -58, -58, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 90, 57, - 57, 57, 57, 57, 57, 57, -58 + -58, -58, -58, 58, -58, -58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -58 }, { 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, 57, -59, -59, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 91, 57, - 57, 57, 57, 57, 57, 57, -59 + -59, -59, -59, 58, -59, -59, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 92, 58, + 58, 58, 58, 58, 58, 58, -59 }, { 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, 57, -60, -60, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 92, 93, 57, 57, - 57, 57, 57, 57, 57, 57, -60 + -60, -60, -60, 58, -60, -60, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 93, 58, + 58, 58, 58, 58, 58, 58, -60 }, { 11, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, 57, -61, -61, 57, 57, 57, 57, - 57, 94, 57, 57, 57, 57, 57, 57, 57, 95, - 57, 57, 57, 57, 57, 57, -61 + -61, -61, -61, 58, -61, -61, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 94, 95, 58, 58, + 58, 58, 58, 58, 58, 58, -61 }, { 11, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, 57, -62, -62, 57, 57, 57, 96, + -62, -62, -62, 58, -62, -62, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -62 + 58, 96, 58, 58, 58, 58, 58, 58, 58, 97, + 58, 58, 58, 58, 58, 58, -62 }, { 11, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, 57, -63, -63, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 97, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 98, -63 + -63, -63, -63, 58, -63, -63, 58, 58, 58, 98, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -63 }, { 11, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, 57, -64, -64, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -64 + -64, -64, -64, 58, -64, -64, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 99, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 100, -64 }, { 11, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, 57, -65, -65, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 99, 57, 57, -65 + -65, -65, -65, 58, -65, -65, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -65 }, { 11, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, 57, -66, -66, 57, 57, 57, 57, - 57, 57, 57, 57, 100, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -66 + -66, -66, -66, 58, -66, -66, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 101, 58, 58, -66 }, { 11, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, 57, -67, -67, 57, 57, 57, 57, + -67, -67, -67, 58, -67, -67, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 101, 57, 57, - 57, 57, 57, 57, 57, 57, -67 + 58, 58, 58, 58, 102, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -67 }, { 11, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, 57, -68, -68, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 102, 57, 57, -68 + -68, -68, -68, 58, -68, -68, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 103, 58, 58, + 58, 58, 58, 58, 58, 58, -68 }, { 11, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, 57, -69, -69, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 103, 57, - 57, 57, 57, 57, 57, 57, -69 + -69, -69, -69, 58, -69, -69, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 104, 58, 58, -69 }, { 11, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, 57, -70, -70, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 104, 57, 57, 57, 57, 57, -70 + -70, -70, -70, 58, -70, -70, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 105, 58, + 58, 58, 58, 58, 58, 58, -70 }, { 11, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, 57, -71, -71, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 105, 57, -71 + -71, -71, -71, 58, -71, -71, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 106, 58, 58, 58, 58, 58, -71 }, { 11, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, 57, -72, -72, 57, 57, 57, 57, + -72, -72, -72, 58, -72, -72, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 106, 57, 57, 57, 57, -72 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 107, 58, -72 }, { 11, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, 57, -73, -73, 57, 57, 57, 57, - 57, 57, 57, 57, 107, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -73 + -73, -73, -73, 58, -73, -73, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 108, 58, 58, 58, 58, -73 }, { - 11, 74, 74, -74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74 + 11, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, 58, -74, -74, 58, 58, 58, 58, + 58, 58, 58, 58, 109, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -74 }, { - 11, -75, 75, 76, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75 + 11, 75, 75, -75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75 }, { - 11, -76, -76, -76, -76, -76, -76, -76, -76, -76, + 11, -76, 76, 77, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, -76 }, { - 11, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + 11, 78, -77, -77, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77 + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78 }, { - 11, 78, 78, 79, 78, -78, 78, 78, -78, 78, - 78, 78, 78, 78, 78, -78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78 + 11, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78 }, { - 11, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79 + 11, 79, 79, 80, 79, -79, 79, 79, -79, 79, + 79, 79, 79, 79, 79, -79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79 }, { - 11, -80, -80, 81, -80, -80, -80, -80, -80, -80, + 11, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80 }, { - 11, -81, -81, -81, -81, -81, -81, -81, -81, -81, + 11, -81, -81, 82, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81 @@ -912,669 +912,728 @@ static yyconst short yy_nxt[][37] = }, { - 11, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, 108, 85, 85, -84, -84, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -84 + 11, 84, 84, -84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84 }, { 11, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, 85, 85, 85, -85, -85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -85 + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85 }, { 11, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86 + -86, 110, 87, 87, -86, -86, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -86 }, { 11, -87, -87, -87, -87, -87, -87, -87, -87, -87, - -87, 85, 85, 85, -87, -87, 85, 85, 85, 85, + -87, 87, 87, 87, -87, -87, 87, 87, 87, 87, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -87 + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -87 }, { 11, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, 85, 85, 85, -88, -88, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -88 + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88 }, { 11, -89, -89, -89, -89, -89, -89, -89, -89, -89, - -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, - -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, - -89, -89, -89, -89, -89, -89, -89 + -89, 87, 87, 87, -89, -89, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -89 }, { 11, -90, -90, -90, -90, -90, -90, -90, -90, -90, - -90, -90, -90, 57, -90, -90, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 109, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -90 + -90, 87, 87, 87, -90, -90, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -90 }, { 11, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, 57, -91, -91, 57, 57, 57, 57, - 57, 57, 57, 57, 110, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -91 + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91 }, { 11, -92, -92, -92, -92, -92, -92, -92, -92, -92, - -92, -92, -92, 57, -92, -92, 57, 57, 57, 57, + -92, -92, -92, 58, -92, -92, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 111, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -92 + 58, 58, 58, 58, 58, 111, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -92 }, { 11, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, 57, -93, -93, 57, 57, 57, 57, - 57, 112, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -93 + -93, -93, -93, 58, -93, -93, 58, 58, 58, 58, + 58, 58, 58, 58, 112, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -93 }, { 11, -94, -94, -94, -94, -94, -94, -94, -94, -94, - -94, -94, -94, 57, -94, -94, 113, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -94 + -94, -94, -94, 58, -94, -94, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 113, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -94 }, { 11, -95, -95, -95, -95, -95, -95, -95, -95, -95, - -95, -95, -95, 57, -95, -95, 57, 57, 57, 57, - 114, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -95 + -95, -95, -95, 58, -95, -95, 58, 58, 58, 58, + 58, 114, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -95 }, { 11, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 57, -96, -96, 57, 57, 115, 57, - 57, 57, 57, 57, 116, 57, 117, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -96 + -96, -96, -96, 58, -96, -96, 115, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -96 }, { 11, -97, -97, -97, -97, -97, -97, -97, -97, -97, - -97, -97, -97, 57, -97, -97, 57, 57, 57, 57, + -97, -97, -97, 58, -97, -97, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 118, - 57, 57, 57, 57, 57, 57, -97 + 116, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -97 }, { 11, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, 57, -98, -98, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -98 + -98, -98, -98, 58, -98, -98, 58, 58, 117, 58, + 58, 58, 58, 58, 118, 58, 119, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -98 }, { 11, -99, -99, -99, -99, -99, -99, -99, -99, -99, - -99, -99, -99, 57, -99, -99, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -99 + -99, -99, -99, 58, -99, -99, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 120, + 58, 58, 58, 58, 58, 58, -99 }, { 11, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, 57, -100, -100, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 119, 57, 57, - 57, 57, 57, 57, 57, 57, -100 + -100, -100, -100, 58, -100, -100, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -100 }, { 11, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, 57, -101, -101, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 120, 57, -101 + -101, -101, -101, 58, -101, -101, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -101 }, { 11, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, 57, -102, -102, 57, 57, 57, 57, + -102, -102, -102, 58, -102, -102, 58, 58, 58, 58, - 57, 57, 57, 57, 121, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -102 + 58, 58, 58, 58, 58, 58, 58, 121, 58, 58, + 58, 58, 58, 58, 58, 58, -102 }, { 11, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, 57, -103, -103, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 122, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -103 + -103, -103, -103, 58, -103, -103, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 122, 58, -103 }, { 11, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, 57, -104, -104, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 123, 57, -104 + -104, -104, -104, 58, -104, -104, 58, 58, 58, 58, + 58, 58, 58, 58, 123, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -104 }, { 11, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, 57, -105, -105, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 124, 57, 57, 57, 57, -105 + -105, -105, -105, 58, -105, -105, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 124, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -105 }, { 11, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, 57, -106, -106, 57, 57, 57, 57, - 57, 57, 57, 57, 125, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -106 + -106, -106, -106, 58, -106, -106, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 125, 58, -106 }, { 11, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, 57, -107, -107, 57, 57, 57, 57, + -107, -107, -107, 58, -107, -107, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 126, 57, 57, 57, -107 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 126, 58, 58, 58, 58, -107 }, { 11, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, 85, 85, 85, -108, -108, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, -108 + -108, -108, -108, 58, -108, -108, 58, 58, 58, 58, + 58, 58, 58, 58, 127, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -108 }, { 11, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109, -109, -109, 57, -109, -109, 57, 57, 57, 57, - 127, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -109 + -109, -109, -109, 58, -109, -109, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 128, 58, 58, 58, -109 }, { 11, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110, -110, -110, 57, -110, -110, 57, 57, 128, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -110 + -110, 87, 87, 87, -110, -110, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -110 }, { 11, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, 57, -111, -111, 57, 57, 57, 57, - 129, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -111 + -111, -111, -111, 58, -111, -111, 58, 58, 58, 58, + 129, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -111 }, { 11, -112, -112, -112, -112, -112, -112, -112, -112, -112, - -112, -112, -112, 57, -112, -112, 57, 57, 57, 57, + -112, -112, -112, 58, -112, -112, 58, 58, 130, 58, - 57, 57, 57, 57, 130, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -112 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -112 }, { 11, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113, -113, -113, 57, -113, -113, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 131, 57, -113 + -113, -113, -113, 58, -113, -113, 58, 58, 58, 58, + 131, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -113 }, { 11, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114, -114, -114, 57, -114, -114, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 132, 57, 57, - 57, 57, 57, 57, 57, 57, -114 + -114, -114, -114, 58, -114, -114, 58, 58, 58, 58, + 58, 58, 58, 58, 132, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -114 }, { 11, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, 57, -115, -115, 57, 57, 57, 57, - 57, 57, 57, 133, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -115 + -115, -115, -115, 58, -115, -115, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 133, 58, -115 }, { 11, -116, -116, -116, -116, -116, -116, -116, -116, -116, - -116, -116, -116, 57, -116, -116, 57, 57, 57, 57, - 57, 134, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -116 + -116, -116, -116, 58, -116, -116, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 134, 58, 58, + 58, 58, 58, 58, 58, 58, -116 }, { 11, -117, -117, -117, -117, -117, -117, -117, -117, -117, - -117, -117, -117, 57, -117, -117, 57, 57, 57, 57, + -117, -117, -117, 58, -117, -117, 58, 58, 58, 58, - 135, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -117 + 58, 58, 58, 135, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -117 }, { 11, -118, -118, -118, -118, -118, -118, -118, -118, -118, - -118, -118, -118, 57, -118, -118, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -118 + -118, -118, -118, 58, -118, -118, 58, 58, 58, 58, + 58, 136, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -118 }, { 11, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, 57, -119, -119, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 136, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -119 + -119, -119, -119, 58, -119, -119, 58, 58, 58, 58, + 137, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -119 }, { 11, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, 57, -120, -120, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -120 + -120, -120, -120, 58, -120, -120, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -120 }, { 11, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, 57, -121, -121, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 137, 57, - 57, 57, 57, 57, 57, 57, -121 + -121, -121, -121, 58, -121, -121, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 138, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -121 }, { 11, -122, -122, -122, -122, -122, -122, -122, -122, -122, - -122, -122, -122, 57, -122, -122, 57, 57, 57, 57, + -122, -122, -122, 58, -122, -122, 58, 58, 139, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 138, - 57, 57, 57, 57, 57, 57, -122 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -122 }, { 11, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, 57, -123, -123, 57, 57, 57, 57, - 57, 57, 57, 57, 139, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -123 + -123, -123, -123, 58, -123, -123, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 140, 58, + 58, 58, 58, 58, 58, 58, -123 }, { 11, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, 57, -124, -124, 57, 57, 140, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -124 + -124, -124, -124, 58, -124, -124, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 141, + 58, 58, 58, 58, 58, 58, -124 }, { 11, -125, -125, -125, -125, -125, -125, -125, -125, -125, - -125, -125, -125, 57, -125, -125, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 141, 57, 57, - 57, 57, 57, 57, 57, 57, -125 + -125, -125, -125, 58, -125, -125, 58, 58, 58, 58, + 58, 58, 58, 58, 142, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -125 }, { 11, -126, -126, -126, -126, -126, -126, -126, -126, -126, - -126, -126, -126, 57, -126, -126, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 142, 57, 57, -126 + -126, -126, -126, 58, -126, -126, 58, 58, 143, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -126 }, { 11, -127, -127, -127, -127, -127, -127, -127, -127, -127, - -127, -127, -127, 57, -127, -127, 143, 57, 57, 57, + -127, -127, -127, 58, -127, -127, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -127 + 58, 58, 58, 58, 58, 58, 58, 144, 58, 58, + 58, 58, 58, 58, 58, 58, -127 }, { 11, -128, -128, -128, -128, -128, -128, -128, -128, -128, - -128, -128, -128, 57, -128, -128, 57, 57, 57, 57, - 144, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -128 + -128, -128, -128, 58, -128, -128, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 145, 58, 58, -128 }, { 11, -129, -129, -129, -129, -129, -129, -129, -129, -129, - -129, -129, -129, 57, -129, -129, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 145, 57, 57, - 57, 57, 57, 57, 57, 57, -129 + -129, -129, -129, 58, -129, -129, 146, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -129 }, { 11, -130, -130, -130, -130, -130, -130, -130, -130, -130, - -130, -130, -130, 57, -130, -130, 57, 57, 57, 57, - 57, 57, 146, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -130 + -130, -130, -130, 58, -130, -130, 58, 58, 58, 58, + 147, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -130 }, { 11, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, 57, -131, -131, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 147, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -131 + -131, -131, -131, 58, -131, -131, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 148, 58, 58, + 58, 58, 58, 58, 58, 58, -131 }, { 11, -132, -132, -132, -132, -132, -132, -132, -132, -132, - -132, -132, -132, 57, -132, -132, 57, 57, 57, 148, + -132, -132, -132, 58, -132, -132, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -132 + 58, 58, 149, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -132 }, { 11, -133, -133, -133, -133, -133, -133, -133, -133, -133, - -133, -133, -133, 57, -133, -133, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 149, 57, - 57, 57, 57, 57, 57, 57, -133 + -133, -133, -133, 58, -133, -133, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 150, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -133 }, { 11, -134, -134, -134, -134, -134, -134, -134, -134, -134, - -134, -134, -134, 57, -134, -134, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -134 + -134, -134, -134, 58, -134, -134, 58, 58, 58, 151, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -134 }, { 11, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, 57, -135, -135, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 150, 57, 57, - 57, 57, 57, 57, 57, 57, -135 + -135, -135, -135, 58, -135, -135, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 152, 58, + 58, 58, 58, 58, 58, 58, -135 }, { 11, -136, -136, -136, -136, -136, -136, -136, -136, -136, - -136, -136, -136, 57, -136, -136, 57, 57, 57, 57, - 151, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -136 + -136, -136, -136, 58, -136, -136, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -136 }, { 11, -137, -137, -137, -137, -137, -137, -137, -137, -137, - -137, -137, -137, 57, -137, -137, 57, 57, 57, 57, + -137, -137, -137, 58, -137, -137, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 152, 57, 57, - 57, 57, 57, 57, 57, 57, -137 + 58, 58, 58, 58, 58, 58, 58, 153, 58, 58, + 58, 58, 58, 58, 58, 58, -137 }, { 11, -138, -138, -138, -138, -138, -138, -138, -138, -138, - -138, -138, -138, 57, -138, -138, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 153, 57, 57, -138 + -138, -138, -138, 58, -138, -138, 58, 58, 58, 58, + 154, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -138 }, { 11, -139, -139, -139, -139, -139, -139, -139, -139, -139, - -139, -139, -139, 57, -139, -139, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 154, 57, 57, 57, 57, -139 + -139, -139, -139, 58, -139, -139, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 155, 58, + 58, 58, 58, 58, 58, 58, -139 }, { 11, -140, -140, -140, -140, -140, -140, -140, -140, -140, - -140, -140, -140, 57, -140, -140, 57, 57, 57, 57, - 155, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -140 + -140, -140, -140, 58, -140, -140, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 156, 58, 58, + 58, 58, 58, 58, 58, 58, -140 }, { 11, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, 57, -141, -141, 57, 57, 57, 57, - 57, 57, 156, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -141 + -141, -141, -141, 58, -141, -141, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 157, 58, 58, -141 }, { 11, -142, -142, -142, -142, -142, -142, -142, -142, -142, - -142, -142, -142, 57, -142, -142, 157, 57, 57, 57, + -142, -142, -142, 58, -142, -142, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -142 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 158, 58, 58, 58, 58, -142 }, { 11, -143, -143, -143, -143, -143, -143, -143, -143, -143, - -143, -143, -143, 57, -143, -143, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 158, 57, 57, - 57, 57, 57, 57, 57, 57, -143 + -143, -143, -143, 58, -143, -143, 58, 58, 58, 58, + 159, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -143 }, { 11, -144, -144, -144, -144, -144, -144, -144, -144, -144, - -144, -144, -144, 57, -144, -144, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -144 + -144, -144, -144, 58, -144, -144, 58, 58, 58, 58, + 58, 58, 160, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -144 }, { 11, -145, -145, -145, -145, -145, -145, -145, -145, -145, - -145, -145, -145, 57, -145, -145, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 159, 57, 57, -145 + -145, -145, -145, 58, -145, -145, 161, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -145 }, { 11, -146, -146, -146, -146, -146, -146, -146, -146, -146, - -146, -146, -146, 57, -146, -146, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -146 + -146, -146, -146, 58, -146, -146, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 162, 58, 58, + 58, 58, 58, 58, 58, 58, -146 }, { 11, -147, -147, -147, -147, -147, -147, -147, -147, -147, - -147, -147, -147, 57, -147, -147, 57, 57, 57, 57, + -147, -147, -147, 58, -147, -147, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 160, 57, 57, -147 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -147 }, { 11, -148, -148, -148, -148, -148, -148, -148, -148, -148, - -148, -148, -148, 57, -148, -148, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 161, 57, 57, 57, -148 + -148, -148, -148, 58, -148, -148, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 163, 58, 58, -148 }, { 11, -149, -149, -149, -149, -149, -149, -149, -149, -149, - -149, -149, -149, 57, -149, -149, 57, 57, 57, 57, - 57, 57, 57, 57, 162, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -149 + -149, -149, -149, 58, -149, -149, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -149 }, { 11, -150, -150, -150, -150, -150, -150, -150, -150, -150, - -150, -150, -150, 57, -150, -150, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 163, 57, -150 + -150, -150, -150, 58, -150, -150, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 164, 58, 58, -150 }, { 11, -151, -151, -151, -151, -151, -151, -151, -151, -151, - -151, -151, -151, 57, -151, -151, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 164, 57, 57, - 57, 57, 57, 57, 57, 57, -151 + -151, -151, -151, 58, -151, -151, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 165, 58, 58, 58, -151 }, { 11, -152, -152, -152, -152, -152, -152, -152, -152, -152, - -152, -152, -152, 57, -152, -152, 165, 57, 57, 57, + -152, -152, -152, 58, -152, -152, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -152 + 58, 58, 58, 58, 166, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -152 }, { 11, -153, -153, -153, -153, -153, -153, -153, -153, -153, - -153, -153, -153, 57, -153, -153, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -153 + -153, -153, -153, 58, -153, -153, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 167, 58, -153 }, { 11, -154, -154, -154, -154, -154, -154, -154, -154, -154, - -154, -154, -154, 57, -154, -154, 57, 57, 57, 57, - 166, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -154 + -154, -154, -154, 58, -154, -154, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 168, 58, 58, + 58, 58, 58, 58, 58, 58, -154 }, { 11, -155, -155, -155, -155, -155, -155, -155, -155, -155, - -155, -155, -155, 57, -155, -155, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -155 + -155, -155, -155, 58, -155, -155, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 169, 58, 58, + 58, 58, 58, 58, 58, 58, -155 }, { 11, -156, -156, -156, -156, -156, -156, -156, -156, -156, - -156, -156, -156, 57, -156, -156, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -156 + -156, -156, -156, 58, -156, -156, 170, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -156 }, { 11, -157, -157, -157, -157, -157, -157, -157, -157, -157, - -157, -157, -157, 57, -157, -157, 57, 57, 57, 57, + -157, -157, -157, 58, -157, -157, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 167, 57, 57, -157 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -157 }, { 11, -158, -158, -158, -158, -158, -158, -158, -158, -158, - -158, -158, -158, 57, -158, -158, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -158 + -158, -158, -158, 58, -158, -158, 58, 58, 58, 58, + 171, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -158 }, { 11, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, 57, -159, -159, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -159 + -159, -159, -159, 58, -159, -159, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -159 }, { 11, -160, -160, -160, -160, -160, -160, -160, -160, -160, - -160, -160, -160, 57, -160, -160, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -160 + -160, -160, -160, 58, -160, -160, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -160 }, { 11, -161, -161, -161, -161, -161, -161, -161, -161, -161, - -161, -161, -161, 57, -161, -161, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -161 + -161, -161, -161, 58, -161, -161, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 172, 58, 58, -161 }, { 11, -162, -162, -162, -162, -162, -162, -162, -162, -162, - -162, -162, -162, 57, -162, -162, 57, 57, 168, 57, + -162, -162, -162, 58, -162, -162, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -162 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -162 }, { 11, -163, -163, -163, -163, -163, -163, -163, -163, -163, - -163, -163, -163, 57, -163, -163, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -163 + -163, -163, -163, 58, -163, -163, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -163 }, { 11, -164, -164, -164, -164, -164, -164, -164, -164, -164, - -164, -164, -164, 57, -164, -164, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 169, 57, -164 + -164, -164, -164, 58, -164, -164, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -164 }, { 11, -165, -165, -165, -165, -165, -165, -165, -165, -165, - -165, -165, -165, 57, -165, -165, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 170, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -165 + -165, -165, -165, 58, -165, -165, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -165 }, { 11, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, 57, -166, -166, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 171, 57, 57, 57, -166 + -166, -166, -166, 58, -166, -166, 58, 58, 173, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -166 }, { 11, -167, -167, -167, -167, -167, -167, -167, -167, -167, - -167, -167, -167, 57, -167, -167, 57, 57, 57, 57, + -167, -167, -167, 58, -167, -167, 58, 58, 58, 58, - 172, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -167 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -167 }, { 11, -168, -168, -168, -168, -168, -168, -168, -168, -168, - -168, -168, -168, 57, -168, -168, 57, 57, 57, 57, - 173, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -168 + -168, -168, -168, 58, -168, -168, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 174, 58, -168 }, { 11, -169, -169, -169, -169, -169, -169, -169, -169, -169, - -169, -169, -169, 57, -169, -169, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -169 + -169, -169, -169, 58, -169, -169, 58, 58, 58, 58, + 58, 175, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -169 }, { 11, -170, -170, -170, -170, -170, -170, -170, -170, -170, - -170, -170, -170, 57, -170, -170, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -170 + -170, -170, -170, 58, -170, -170, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 176, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -170 }, { 11, -171, -171, -171, -171, -171, -171, -171, -171, -171, - -171, -171, -171, 57, -171, -171, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -171 + -171, -171, -171, 58, -171, -171, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 177, 58, 58, 58, -171 }, { 11, -172, -172, -172, -172, -172, -172, -172, -172, -172, - -172, -172, -172, 57, -172, -172, 57, 57, 57, 57, + -172, -172, -172, 58, -172, -172, 58, 58, 58, 58, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -172 + 178, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -172 }, { 11, -173, -173, -173, -173, -173, -173, -173, -173, -173, - -173, -173, -173, 57, -173, -173, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, -173 + -173, -173, -173, 58, -173, -173, 58, 58, 58, 58, + 179, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -173 + }, + + { + 11, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, 58, -174, -174, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -174 + + }, + + { + 11, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, 58, -175, -175, 58, 58, 58, 58, + 58, 58, 58, 58, 180, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -175 + }, + + { + 11, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, 58, -176, -176, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -176 + }, + + { + 11, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, 58, -177, -177, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -177 + }, + + { + 11, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, 58, -178, -178, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -178 + }, + + { + 11, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, 58, -179, -179, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -179 + + }, + + { + 11, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, 58, -180, -180, 58, 58, 58, 58, + 58, 58, 181, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -180 + }, + + { + 11, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, 58, -181, -181, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, -181 }, } ; @@ -1595,29 +1654,30 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 56 -#define YY_END_OF_BUFFER 57 -static yyconst short int yy_accept[174] = +#define YY_NUM_RULES 58 +#define YY_END_OF_BUFFER 59 +static yyconst short int yy_accept[182] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 57, 5, 4, 3, 2, 29, 30, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 55, 52, 54, 47, 51, 50, 49, 45, 41, 35, - 40, 45, 33, 34, 43, 43, 36, 45, 43, 43, - 45, 4, 3, 2, 2, 1, 28, 28, 28, 28, - 28, 28, 28, 15, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 55, 52, 54, 53, 47, 46, 49, - 48, 37, 31, 43, 43, 44, 38, 39, 32, 28, - 28, 28, 28, 28, 28, 28, 28, 26, 25, 28, - - 28, 28, 28, 28, 28, 28, 28, 42, 23, 28, - 28, 28, 28, 28, 28, 28, 28, 14, 28, 7, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 16, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 10, 28, 13, 28, 28, 28, 28, - 28, 28, 21, 28, 9, 27, 28, 24, 12, 20, - 17, 28, 8, 28, 28, 28, 28, 28, 6, 19, - 18, 22, 11 + 59, 5, 4, 3, 2, 30, 31, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 57, 54, 56, 49, 53, 52, 51, 47, 42, 36, + 41, 45, 47, 34, 35, 44, 44, 37, 47, 44, + 44, 47, 4, 3, 2, 2, 1, 29, 29, 29, + 29, 29, 29, 29, 16, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 57, 54, 56, 55, 49, 48, + 51, 50, 38, 45, 32, 44, 44, 46, 39, 40, + 33, 29, 29, 29, 29, 29, 29, 29, 29, 27, + + 26, 29, 29, 29, 29, 29, 29, 29, 29, 43, + 24, 29, 29, 29, 29, 29, 29, 29, 29, 15, + 29, 7, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 17, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 10, 29, 13, 29, + 29, 29, 29, 29, 29, 29, 22, 29, 9, 28, + 29, 25, 12, 21, 18, 29, 8, 29, 29, 29, + 29, 29, 29, 6, 29, 20, 19, 23, 11, 29, + 14 } ; static yyconst int yy_ec[256] = @@ -1993,43 +2053,43 @@ BEGIN(PARAM); return T_CONFIG; YY_BREAK case 14: YY_RULE_SETUP -BEGIN(PARAM); return T_HELP; +BEGIN(PARAM); return T_MENUCONFIG; YY_BREAK case 15: YY_RULE_SETUP -BEGIN(PARAM); return T_IF; +BEGIN(PARAM); return T_HELP; YY_BREAK case 16: YY_RULE_SETUP -BEGIN(PARAM); return T_ENDIF; +BEGIN(PARAM); return T_IF; YY_BREAK case 17: YY_RULE_SETUP -BEGIN(PARAM); return T_DEPENDS; +BEGIN(PARAM); return T_ENDIF; YY_BREAK case 18: YY_RULE_SETUP -BEGIN(PARAM); return T_REQUIRES; +BEGIN(PARAM); return T_DEPENDS; YY_BREAK case 19: YY_RULE_SETUP -BEGIN(PARAM); return T_OPTIONAL; +BEGIN(PARAM); return T_REQUIRES; YY_BREAK case 20: YY_RULE_SETUP -BEGIN(PARAM); return T_DEFAULT; +BEGIN(PARAM); return T_OPTIONAL; YY_BREAK case 21: YY_RULE_SETUP -BEGIN(PARAM); return T_PROMPT; +BEGIN(PARAM); return T_DEFAULT; YY_BREAK case 22: YY_RULE_SETUP -BEGIN(PARAM); return T_TRISTATE; +BEGIN(PARAM); return T_PROMPT; YY_BREAK case 23: YY_RULE_SETUP -BEGIN(PARAM); return T_BOOLEAN; +BEGIN(PARAM); return T_TRISTATE; YY_BREAK case 24: YY_RULE_SETUP @@ -2037,71 +2097,75 @@ BEGIN(PARAM); return T_BOOLEAN; YY_BREAK case 25: YY_RULE_SETUP -BEGIN(PARAM); return T_INT; +BEGIN(PARAM); return T_BOOLEAN; YY_BREAK case 26: YY_RULE_SETUP -BEGIN(PARAM); return T_HEX; +BEGIN(PARAM); return T_INT; YY_BREAK case 27: YY_RULE_SETUP -BEGIN(PARAM); return T_STRING; +BEGIN(PARAM); return T_HEX; YY_BREAK case 28: YY_RULE_SETUP +BEGIN(PARAM); return T_STRING; + YY_BREAK +case 29: +YY_RULE_SETUP { alloc_string(yytext, yyleng); zconflval.string = text; return T_WORD; } YY_BREAK -case 29: +case 30: YY_RULE_SETUP YY_BREAK -case 30: +case 31: YY_RULE_SETUP current_file->lineno++; BEGIN(INITIAL); YY_BREAK -case 31: +case 32: YY_RULE_SETUP return T_AND; YY_BREAK -case 32: +case 33: YY_RULE_SETUP return T_OR; YY_BREAK -case 33: +case 34: YY_RULE_SETUP return T_OPEN_PAREN; YY_BREAK -case 34: +case 35: YY_RULE_SETUP return T_CLOSE_PAREN; YY_BREAK -case 35: +case 36: YY_RULE_SETUP return T_NOT; YY_BREAK -case 36: +case 37: YY_RULE_SETUP return T_EQUAL; YY_BREAK -case 37: +case 38: YY_RULE_SETUP return T_UNEQUAL; YY_BREAK -case 38: +case 39: YY_RULE_SETUP return T_IF; YY_BREAK -case 39: +case 40: YY_RULE_SETUP return T_ON; YY_BREAK -case 40: +case 41: YY_RULE_SETUP { str = yytext[0]; @@ -2109,15 +2173,15 @@ YY_RULE_SETUP BEGIN(STRING); } YY_BREAK -case 41: +case 42: YY_RULE_SETUP BEGIN(INITIAL); current_file->lineno++; return T_EOL; YY_BREAK -case 42: +case 43: YY_RULE_SETUP /* ignore */ YY_BREAK -case 43: +case 44: YY_RULE_SETUP { alloc_string(yytext, yyleng); @@ -2125,11 +2189,15 @@ YY_RULE_SETUP return T_WORD; } YY_BREAK -case 44: +case 45: +YY_RULE_SETUP +/* comment */ + YY_BREAK +case 46: YY_RULE_SETUP current_file->lineno++; YY_BREAK -case 45: +case 47: YY_RULE_SETUP YY_BREAK @@ -2140,7 +2208,7 @@ case YY_STATE_EOF(PARAM): YY_BREAK -case 46: +case 48: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ @@ -2151,13 +2219,13 @@ YY_RULE_SETUP return T_WORD_QUOTE; } YY_BREAK -case 47: +case 49: YY_RULE_SETUP { append_string(yytext, yyleng); } YY_BREAK -case 48: +case 50: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ @@ -2168,13 +2236,13 @@ YY_RULE_SETUP return T_WORD_QUOTE; } YY_BREAK -case 49: +case 51: YY_RULE_SETUP { append_string(yytext + 1, yyleng - 1); } YY_BREAK -case 50: +case 52: YY_RULE_SETUP { if (str == yytext[0]) { @@ -2185,7 +2253,7 @@ YY_RULE_SETUP append_string(yytext, 1); } YY_BREAK -case 51: +case 53: YY_RULE_SETUP { printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); @@ -2201,7 +2269,7 @@ case YY_STATE_EOF(STRING): YY_BREAK -case 52: +case 54: YY_RULE_SETUP { ts = 0; @@ -2227,9 +2295,9 @@ YY_RULE_SETUP } YY_BREAK -case 53: +case 55: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp = yy_bp + 1; +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP { @@ -2238,14 +2306,14 @@ YY_RULE_SETUP return T_HELPTEXT; } YY_BREAK -case 54: +case 56: YY_RULE_SETUP { current_file->lineno++; append_string("\n", 1); } YY_BREAK -case 55: +case 57: YY_RULE_SETUP { append_string(yytext, yyleng); @@ -2271,7 +2339,7 @@ case YY_STATE_EOF(COMMAND): yyterminate(); } YY_BREAK -case 56: +case 58: YY_RULE_SETUP YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 845d8a37827b..7fa7825f3759 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -160,6 +160,9 @@ void sym_calc_value(struct symbol *sym) struct symbol *def_sym; struct expr *e; + if (!sym) + return; + if (sym->flags & SYMBOL_VALID) return; diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index fbacd970f2a2..2e6b7c95ecfc 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -96,6 +96,7 @@ n [A-Za-z0-9_] "endchoice" BEGIN(PARAM); return T_ENDCHOICE; "comment" BEGIN(PARAM); return T_COMMENT; "config" BEGIN(PARAM); return T_CONFIG; + "menuconfig" BEGIN(PARAM); return T_MENUCONFIG; "help" BEGIN(PARAM); return T_HELP; "if" BEGIN(PARAM); return T_IF; "endif" BEGIN(PARAM); return T_ENDIF; @@ -141,6 +142,7 @@ n [A-Za-z0-9_] zconflval.string = text; return T_WORD; } + #.* /* comment */ \\\n current_file->lineno++; . <> { @@ -208,7 +210,7 @@ n [A-Za-z0-9_] } } - \n/[^ \t\n] { + [ \t]*\n/[^ \t\n] { current_file->lineno++; zconf_endhelp(); return T_HELPTEXT; diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 1ec370f8c91e..e8904d9bf813 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -1,7 +1,7 @@ -/* A Bison parser, made from zconf.y, by GNU bison 1.75. */ +/* A Bison parser, made by GNU Bison 1.875a. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,10 +34,13 @@ USER NAME SPACE" below. */ /* Identify Bison output. */ -#define YYBISON 1 +#define YYBISON 1 + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ -#define YYPURE 0 +#define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 @@ -67,32 +70,33 @@ T_ENDCHOICE = 263, T_COMMENT = 264, T_CONFIG = 265, - T_HELP = 266, - T_HELPTEXT = 267, - T_IF = 268, - T_ENDIF = 269, - T_DEPENDS = 270, - T_REQUIRES = 271, - T_OPTIONAL = 272, - T_PROMPT = 273, - T_DEFAULT = 274, - T_TRISTATE = 275, - T_BOOLEAN = 276, - T_STRING = 277, - T_INT = 278, - T_HEX = 279, - T_WORD = 280, - T_WORD_QUOTE = 281, - T_UNEQUAL = 282, - T_EOF = 283, - T_EOL = 284, - T_CLOSE_PAREN = 285, - T_OPEN_PAREN = 286, - T_ON = 287, - T_OR = 288, - T_AND = 289, - T_EQUAL = 290, - T_NOT = 291 + T_MENUCONFIG = 266, + T_HELP = 267, + T_HELPTEXT = 268, + T_IF = 269, + T_ENDIF = 270, + T_DEPENDS = 271, + T_REQUIRES = 272, + T_OPTIONAL = 273, + T_PROMPT = 274, + T_DEFAULT = 275, + T_TRISTATE = 276, + T_BOOLEAN = 277, + T_STRING = 278, + T_INT = 279, + T_HEX = 280, + T_WORD = 281, + T_WORD_QUOTE = 282, + T_UNEQUAL = 283, + T_EOF = 284, + T_EOL = 285, + T_CLOSE_PAREN = 286, + T_OPEN_PAREN = 287, + T_ON = 288, + T_OR = 289, + T_AND = 290, + T_EQUAL = 291, + T_NOT = 292 }; #endif #define T_MAINMENU 258 @@ -103,38 +107,40 @@ #define T_ENDCHOICE 263 #define T_COMMENT 264 #define T_CONFIG 265 -#define T_HELP 266 -#define T_HELPTEXT 267 -#define T_IF 268 -#define T_ENDIF 269 -#define T_DEPENDS 270 -#define T_REQUIRES 271 -#define T_OPTIONAL 272 -#define T_PROMPT 273 -#define T_DEFAULT 274 -#define T_TRISTATE 275 -#define T_BOOLEAN 276 -#define T_STRING 277 -#define T_INT 278 -#define T_HEX 279 -#define T_WORD 280 -#define T_WORD_QUOTE 281 -#define T_UNEQUAL 282 -#define T_EOF 283 -#define T_EOL 284 -#define T_CLOSE_PAREN 285 -#define T_OPEN_PAREN 286 -#define T_ON 287 -#define T_OR 288 -#define T_AND 289 -#define T_EQUAL 290 -#define T_NOT 291 +#define T_MENUCONFIG 266 +#define T_HELP 267 +#define T_HELPTEXT 268 +#define T_IF 269 +#define T_ENDIF 270 +#define T_DEPENDS 271 +#define T_REQUIRES 272 +#define T_OPTIONAL 273 +#define T_PROMPT 274 +#define T_DEFAULT 275 +#define T_TRISTATE 276 +#define T_BOOLEAN 277 +#define T_STRING 278 +#define T_INT 279 +#define T_HEX 280 +#define T_WORD 281 +#define T_WORD_QUOTE 282 +#define T_UNEQUAL 283 +#define T_EOF 284 +#define T_EOL 285 +#define T_CLOSE_PAREN 286 +#define T_OPEN_PAREN 287 +#define T_ON 288 +#define T_OR 289 +#define T_AND 290 +#define T_EQUAL 291 +#define T_NOT 292 /* Copy the first part of user declarations. */ + /* * Copyright (C) 2002 Roman Zippel * Released under the terms of the GNU GPL v2.0. @@ -166,7 +172,7 @@ struct symbol *symbol_hash[257]; /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG 0 +# define YYDEBUG 1 #endif /* Enabling verbose error messages. */ @@ -177,41 +183,33 @@ struct symbol *symbol_hash[257]; # define YYERROR_VERBOSE 0 #endif -#ifndef YYSTYPE -#line 33 "zconf.y" -typedef union { +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) + +typedef union YYSTYPE { int token; char *string; struct symbol *symbol; struct expr *expr; struct menu *menu; -} yystype; -/* Line 193 of /usr/share/bison/yacc.c. */ -#line 191 "zconf.tab.c" -# define YYSTYPE yystype +} YYSTYPE; +/* Line 191 of yacc.c. */ + +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif -#ifndef YYLTYPE -typedef struct yyltype -{ - int first_line; - int first_column; - int last_line; - int last_column; -} yyltype; -# define YYLTYPE yyltype -# define YYLTYPE_IS_TRIVIAL 1 -#endif + /* Copy the second part of user declarations. */ + #define LKC_DIRECT_LINK #include "lkc.h" -/* Line 213 of /usr/share/bison/yacc.c. */ -#line 215 "zconf.tab.c" +/* Line 214 of yacc.c. */ + #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -247,7 +245,7 @@ typedef struct yyltype #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -257,13 +255,13 @@ union yyalloc }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) + + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ @@ -277,7 +275,7 @@ union yyalloc { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ + (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif @@ -294,7 +292,7 @@ union yyalloc YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) @@ -309,23 +307,24 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 -#define YYLAST 154 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 160 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 37 +#define YYNTOKENS 38 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 39 +#define YYNNTS 41 /* YYNRULES -- Number of rules. */ -#define YYNRULES 96 +#define YYNRULES 99 /* YYNRULES -- Number of states. */ -#define YYNSTATES 146 +#define YYNSTATES 152 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 291 +#define YYMAXUTOK 292 -#define YYTRANSLATE(X) \ - ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = @@ -359,7 +358,7 @@ static const unsigned char yytranslate[] = 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36 + 35, 36, 37 }; #if YYDEBUG @@ -368,63 +367,64 @@ static const unsigned char yytranslate[] = static const unsigned short yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, - 21, 23, 26, 28, 30, 32, 34, 36, 39, 43, - 44, 48, 52, 55, 58, 61, 64, 67, 70, 73, - 77, 81, 83, 87, 89, 94, 97, 98, 102, 106, - 109, 112, 116, 118, 122, 123, 126, 129, 131, 137, - 141, 142, 145, 148, 151, 154, 158, 160, 165, 168, - 169, 172, 175, 178, 182, 185, 188, 191, 195, 198, - 201, 202, 206, 209, 213, 216, 219, 220, 222, 226, - 228, 230, 232, 234, 236, 238, 240, 241, 244, 246, - 250, 254, 258, 261, 265, 269, 271 + 21, 23, 26, 28, 30, 32, 34, 36, 38, 41, + 45, 48, 52, 53, 57, 61, 64, 67, 70, 73, + 76, 79, 82, 86, 90, 92, 96, 98, 103, 106, + 107, 111, 115, 118, 121, 125, 127, 131, 132, 135, + 138, 140, 146, 150, 151, 154, 157, 160, 163, 167, + 169, 174, 177, 178, 181, 184, 187, 191, 194, 197, + 200, 204, 207, 210, 211, 215, 218, 222, 225, 228, + 229, 231, 235, 237, 239, 241, 243, 245, 247, 249, + 250, 253, 255, 259, 263, 267, 270, 274, 278, 280 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { - 38, 0, -1, -1, 38, 39, -1, 40, -1, 48, - -1, 59, -1, 3, 70, 72, -1, 5, -1, 14, - -1, 8, -1, 1, 72, -1, 54, -1, 64, -1, - 42, -1, 62, -1, 72, -1, 10, 25, -1, 41, - 29, 43, -1, -1, 43, 44, 29, -1, 43, 68, - 29, -1, 43, 66, -1, 43, 29, -1, 20, 69, - -1, 21, 69, -1, 23, 69, -1, 24, 69, -1, - 22, 69, -1, 18, 70, 73, -1, 19, 75, 73, - -1, 7, -1, 45, 29, 49, -1, 71, -1, 46, - 51, 47, 29, -1, 46, 51, -1, -1, 49, 50, - 29, -1, 49, 68, 29, -1, 49, 66, -1, 49, - 29, -1, 18, 70, 73, -1, 17, -1, 19, 75, - 73, -1, -1, 51, 40, -1, 13, 74, -1, 71, - -1, 52, 29, 55, 53, 29, -1, 52, 29, 55, - -1, -1, 55, 40, -1, 55, 59, -1, 55, 48, - -1, 4, 70, -1, 56, 29, 67, -1, 71, -1, - 57, 60, 58, 29, -1, 57, 60, -1, -1, 60, - 40, -1, 60, 59, -1, 60, 48, -1, 60, 1, - 29, -1, 6, 70, -1, 61, 29, -1, 9, 70, - -1, 63, 29, 67, -1, 11, 29, -1, 65, 12, - -1, -1, 67, 68, 29, -1, 67, 29, -1, 15, - 32, 74, -1, 15, 74, -1, 16, 74, -1, -1, - 70, -1, 70, 13, 74, -1, 25, -1, 26, -1, - 5, -1, 8, -1, 14, -1, 29, -1, 28, -1, - -1, 13, 74, -1, 75, -1, 75, 35, 75, -1, - 75, 27, 75, -1, 31, 74, 30, -1, 36, 74, - -1, 74, 33, 74, -1, 74, 34, 74, -1, 25, - -1, 26, -1 + 39, 0, -1, -1, 39, 40, -1, 41, -1, 51, + -1, 62, -1, 3, 73, 75, -1, 5, -1, 15, + -1, 8, -1, 1, 75, -1, 57, -1, 67, -1, + 43, -1, 45, -1, 65, -1, 75, -1, 10, 26, + -1, 42, 30, 46, -1, 11, 26, -1, 44, 30, + 46, -1, -1, 46, 47, 30, -1, 46, 71, 30, + -1, 46, 69, -1, 46, 30, -1, 21, 72, -1, + 22, 72, -1, 24, 72, -1, 25, 72, -1, 23, + 72, -1, 19, 73, 76, -1, 20, 78, 76, -1, + 7, -1, 48, 30, 52, -1, 74, -1, 49, 54, + 50, 30, -1, 49, 54, -1, -1, 52, 53, 30, + -1, 52, 71, 30, -1, 52, 69, -1, 52, 30, + -1, 19, 73, 76, -1, 18, -1, 20, 78, 76, + -1, -1, 54, 41, -1, 14, 77, -1, 74, -1, + 55, 30, 58, 56, 30, -1, 55, 30, 58, -1, + -1, 58, 41, -1, 58, 62, -1, 58, 51, -1, + 4, 73, -1, 59, 30, 70, -1, 74, -1, 60, + 63, 61, 30, -1, 60, 63, -1, -1, 63, 41, + -1, 63, 62, -1, 63, 51, -1, 63, 1, 30, + -1, 6, 73, -1, 64, 30, -1, 9, 73, -1, + 66, 30, 70, -1, 12, 30, -1, 68, 13, -1, + -1, 70, 71, 30, -1, 70, 30, -1, 16, 33, + 77, -1, 16, 77, -1, 17, 77, -1, -1, 73, + -1, 73, 14, 77, -1, 26, -1, 27, -1, 5, + -1, 8, -1, 15, -1, 30, -1, 29, -1, -1, + 14, 77, -1, 78, -1, 78, 36, 78, -1, 78, + 28, 78, -1, 32, 77, 31, -1, 37, 77, -1, + 77, 34, 77, -1, 77, 35, 77, -1, 26, -1, + 27, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { - 0, 89, 89, 90, 93, 94, 95, 96, 97, 98, - 99, 100, 103, 105, 106, 107, 108, 114, 122, 128, - 130, 131, 132, 133, 136, 142, 148, 154, 160, 166, - 172, 180, 189, 195, 203, 205, 211, 213, 214, 215, - 216, 219, 225, 231, 237, 239, 244, 253, 261, 263, - 269, 271, 272, 273, 278, 285, 291, 299, 301, 307, - 309, 310, 311, 312, 315, 321, 328, 335, 342, 348, - 355, 356, 357, 360, 365, 370, 378, 380, 384, 389, - 390, 393, 394, 395, 398, 399, 401, 402, 405, 406, - 407, 408, 409, 410, 411, 414, 415 + 0, 90, 90, 91, 94, 95, 96, 97, 98, 99, + 100, 101, 105, 106, 107, 108, 109, 110, 116, 124, + 130, 138, 148, 150, 151, 152, 153, 156, 162, 168, + 174, 180, 186, 192, 200, 209, 215, 224, 225, 231, + 233, 234, 235, 236, 239, 245, 251, 257, 259, 264, + 273, 282, 283, 289, 291, 292, 293, 298, 305, 311, + 320, 321, 327, 329, 330, 331, 332, 335, 341, 348, + 355, 362, 368, 375, 376, 377, 380, 385, 390, 398, + 400, 404, 409, 410, 413, 414, 415, 419, 419, 421, + 422, 425, 426, 427, 428, 429, 430, 431, 434, 435 }; #endif @@ -435,19 +435,19 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", - "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", "T_REQUIRES", - "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", "T_BOOLEAN", - "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", - "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_OR", - "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", + "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", + "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", + "T_BOOLEAN", "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", + "T_UNEQUAL", "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", + "T_OR", "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block", "config_entry_start", "config_stmt", - "config_option_list", "config_option", "choice", "choice_entry", - "choice_end", "choice_stmt", "choice_option_list", "choice_option", - "choice_block", "if", "if_end", "if_stmt", "if_block", "menu", - "menu_entry", "menu_end", "menu_stmt", "menu_block", "source", - "source_stmt", "comment", "comment_stmt", "help_start", "help", - "depends_list", "depends", "prompt_stmt_opt", "prompt", "end", - "nl_or_eof", "if_expr", "expr", "symbol", 0 + "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", + "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", + "choice_option_list", "choice_option", "choice_block", "if", "if_end", + "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", + "menu_block", "source", "source_stmt", "comment", "comment_stmt", + "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", + "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0 }; #endif @@ -459,38 +459,38 @@ static const unsigned short yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291 + 285, 286, 287, 288, 289, 290, 291, 292 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 37, 38, 38, 39, 39, 39, 39, 39, 39, - 39, 39, 40, 40, 40, 40, 40, 41, 42, 43, - 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, - 44, 45, 46, 47, 48, 48, 49, 49, 49, 49, - 49, 50, 50, 50, 51, 51, 52, 53, 54, 54, - 55, 55, 55, 55, 56, 57, 58, 59, 59, 60, - 60, 60, 60, 60, 61, 62, 63, 64, 65, 66, - 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, - 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, - 74, 74, 74, 74, 74, 75, 75 + 0, 38, 39, 39, 40, 40, 40, 40, 40, 40, + 40, 40, 41, 41, 41, 41, 41, 41, 42, 43, + 44, 45, 46, 46, 46, 46, 46, 47, 47, 47, + 47, 47, 47, 47, 48, 49, 50, 51, 51, 52, + 52, 52, 52, 52, 53, 53, 53, 54, 54, 55, + 56, 57, 57, 58, 58, 58, 58, 59, 60, 61, + 62, 62, 63, 63, 63, 63, 63, 64, 65, 66, + 67, 68, 69, 70, 70, 70, 71, 71, 71, 72, + 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, + 76, 77, 77, 77, 77, 77, 77, 77, 78, 78 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 3, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 2, 3, 0, - 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, - 3, 1, 3, 1, 4, 2, 0, 3, 3, 2, - 2, 3, 1, 3, 0, 2, 2, 1, 5, 3, - 0, 2, 2, 2, 2, 3, 1, 4, 2, 0, - 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, - 0, 3, 2, 3, 2, 2, 0, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 0, 2, 1, 3, - 3, 3, 2, 3, 3, 1, 1 + 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 3, 0, 3, 3, 2, 2, 2, 2, 2, + 2, 2, 3, 3, 1, 3, 1, 4, 2, 0, + 3, 3, 2, 2, 3, 1, 3, 0, 2, 2, + 1, 5, 3, 0, 2, 2, 2, 2, 3, 1, + 4, 2, 0, 2, 2, 2, 3, 2, 2, 2, + 3, 2, 2, 0, 3, 2, 3, 2, 2, 0, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 1, 3, 3, 3, 2, 3, 3, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -498,127 +498,134 @@ static const unsigned char yyr2[] = means the default is an error. */ static const unsigned char yydefact[] = { - 2, 0, 1, 0, 0, 0, 8, 0, 31, 10, - 0, 0, 0, 9, 85, 84, 3, 4, 0, 14, - 0, 44, 5, 0, 12, 0, 59, 6, 0, 15, - 0, 13, 16, 11, 79, 80, 0, 54, 64, 66, - 17, 95, 96, 0, 0, 46, 88, 19, 36, 35, - 50, 70, 0, 65, 70, 7, 0, 92, 0, 0, - 0, 0, 18, 32, 81, 82, 83, 45, 0, 33, - 49, 55, 0, 60, 62, 0, 61, 56, 67, 91, - 93, 94, 90, 89, 0, 0, 0, 0, 0, 76, - 76, 76, 76, 76, 23, 0, 0, 22, 0, 42, - 0, 0, 40, 0, 39, 0, 34, 51, 53, 0, - 52, 47, 72, 0, 63, 57, 68, 0, 74, 75, - 86, 86, 24, 77, 25, 28, 26, 27, 20, 69, - 21, 86, 86, 37, 38, 48, 71, 73, 0, 29, - 30, 0, 41, 43, 87, 78 + 2, 0, 1, 0, 0, 0, 8, 0, 34, 10, + 0, 0, 0, 0, 9, 88, 87, 3, 4, 0, + 14, 0, 15, 0, 47, 5, 0, 12, 0, 62, + 6, 0, 16, 0, 13, 17, 11, 82, 83, 0, + 57, 67, 69, 18, 20, 98, 99, 0, 0, 49, + 91, 22, 22, 39, 38, 53, 73, 0, 68, 73, + 7, 0, 95, 0, 0, 0, 0, 19, 21, 35, + 84, 85, 86, 48, 0, 36, 52, 58, 0, 63, + 65, 0, 64, 59, 70, 94, 96, 97, 93, 92, + 0, 0, 0, 0, 0, 79, 79, 79, 79, 79, + 26, 0, 0, 25, 0, 45, 0, 0, 43, 0, + 42, 0, 37, 54, 56, 0, 55, 50, 75, 0, + 66, 60, 71, 0, 77, 78, 89, 89, 27, 80, + 28, 31, 29, 30, 23, 72, 24, 89, 89, 40, + 41, 51, 74, 76, 0, 32, 33, 0, 44, 46, + 90, 81 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { - -1, 1, 16, 17, 18, 19, 62, 95, 20, 21, - 68, 22, 63, 103, 49, 23, 109, 24, 70, 25, - 26, 75, 27, 52, 28, 29, 30, 31, 96, 97, - 71, 113, 122, 123, 69, 32, 139, 45, 46 + -1, 1, 17, 18, 19, 20, 21, 22, 67, 101, + 23, 24, 74, 25, 69, 109, 54, 26, 115, 27, + 76, 28, 29, 81, 30, 57, 31, 32, 33, 34, + 102, 103, 77, 104, 128, 129, 75, 35, 145, 49, + 50 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -120 +#define YYPACT_NINF -121 static const short yypact[] = { - -120, 17, -120, 32, 71, 71, -120, 71, -120, -120, - 71, 11, 99, -120, -120, -120, -120, -120, 12, -120, - 22, -120, -120, 35, -120, 52, -120, -120, 56, -120, - 60, -120, -120, -120, -120, -120, 32, -120, -120, -120, - -120, -120, -120, 99, 99, 83, 38, -120, -120, 74, - -120, -120, 49, -120, -120, -120, 98, -120, 99, 99, - 101, 101, 89, 104, -120, -120, -120, -120, 65, -120, - 62, 77, 72, -120, -120, 85, -120, -120, 77, -120, - 95, -120, -120, -120, 105, 8, 99, 71, 101, 71, - 71, 71, 71, 71, -120, 113, 131, -120, 115, -120, - 71, 101, -120, 116, -120, 117, -120, -120, -120, 118, - -120, -120, -120, 119, -120, -120, -120, 99, 83, 83, - 136, 136, -120, 137, -120, -120, -120, -120, -120, -120, - -120, 136, 136, -120, -120, -120, -120, 83, 99, -120, - -120, 99, -120, -120, 83, 83 + -121, 25, -121, -18, -11, -11, -121, -11, -121, -121, + -11, 21, 27, 112, -121, -121, -121, -121, -121, 51, + -121, 54, -121, 57, -121, -121, 58, -121, 62, -121, + -121, 80, -121, 96, -121, -121, -121, -121, -121, -18, + -121, -121, -121, -121, -121, -121, -121, 112, 112, 17, + 77, -121, -121, -121, 85, -121, -121, 56, -121, -121, + -121, -21, -121, 112, 112, 42, 42, 100, 100, 115, + -121, -121, -121, -121, 98, -121, 68, 28, 99, -121, + -121, 111, -121, -121, 28, -121, 105, -121, -121, -121, + 116, 110, 112, -11, 42, -11, -11, -11, -11, -11, + -121, 118, 137, -121, 121, -121, -11, 42, -121, 122, + -121, 123, -121, -121, -121, 124, -121, -121, -121, 125, + -121, -121, -121, 112, 17, 17, 142, 142, -121, 143, + -121, -121, -121, -121, -121, -121, -121, 142, 142, -121, + -121, -121, -121, 17, 112, -121, -121, 112, -121, -121, + 17, 17 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { - -120, -120, -120, -38, -120, -120, -120, -120, -120, -120, - -120, -42, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -33, -120, -120, -120, -120, -120, -120, 88, - 100, 78, 46, -1, -23, 2, -119, -43, -53 + -121, -121, -121, -35, -121, -121, -121, -121, 106, -121, + -121, -121, -121, -34, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -33, -121, -121, -121, -121, -121, + -121, 90, 101, 34, 10, -4, -30, -1, -120, -43, + -57 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, parse error. */ -#define YYTABLE_NINF -59 + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -62 static const short yytable[] = { - 56, 57, 140, 36, 37, 33, 38, 82, 83, 39, - 74, 67, 142, 143, 73, 80, 81, 2, 3, 76, - 4, 5, 6, 7, 8, 9, 10, 11, 108, 77, - 12, 13, 107, 41, 42, 121, 40, 110, 55, 43, - 117, 47, 118, 119, 44, 14, 15, 111, 132, -58, - 72, 48, -58, 5, 64, 7, 8, 65, 10, 11, - 14, 15, 12, 66, 50, 60, 5, 64, 7, 8, - 65, 10, 11, 61, 137, 12, 66, 14, 15, 64, - 7, 51, 65, 10, 11, 53, 120, 12, 66, 54, - 14, 15, 85, 86, 106, 144, 34, 35, 145, 131, - 84, 114, 14, 15, 85, 86, 112, 87, 88, 89, - 90, 91, 92, 93, 115, 84, 58, 59, 94, 85, - 86, 99, 100, 101, 41, 42, 41, 42, 79, 59, - 43, 58, 59, 102, 116, 44, 124, 125, 126, 127, - 98, 105, 128, 129, 130, 133, 134, 135, 136, 138, - 141, 104, 0, 0, 78 + 39, 40, 36, 41, 61, 62, 42, 146, 88, 89, + 85, 15, 16, 63, 64, 37, 38, 148, 149, 73, + 86, 87, 79, 80, 82, 2, 3, 83, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 127, 60, 13, + 14, 113, 114, 116, 91, 92, 117, 43, 124, 125, + 138, 63, 64, 44, 15, 16, -61, 78, 118, -61, + 5, 70, 7, 8, 71, 10, 11, 12, 45, 46, + 13, 72, 5, 70, 7, 8, 71, 10, 11, 12, + 143, 51, 13, 72, 52, 15, 16, 53, 55, 126, + 70, 7, 56, 71, 10, 11, 12, 15, 16, 13, + 72, 150, 137, 111, 151, 65, 130, 131, 132, 133, + 58, 119, 90, 66, 15, 16, 91, 92, 119, 93, + 94, 95, 96, 97, 98, 99, 59, 90, 112, 120, + 100, 91, 92, 105, 106, 107, 45, 46, 45, 46, + 64, 121, 47, 123, 47, 108, 122, 48, 134, 48, + 135, 136, 139, 140, 141, 142, 144, 147, 68, 110, + 84 }; -static const short yycheck[] = +static const unsigned char yycheck[] = { - 43, 44, 121, 4, 5, 3, 7, 60, 61, 10, - 52, 49, 131, 132, 52, 58, 59, 0, 1, 52, - 3, 4, 5, 6, 7, 8, 9, 10, 70, 52, - 13, 14, 70, 25, 26, 88, 25, 70, 36, 31, - 32, 29, 85, 86, 36, 28, 29, 70, 101, 0, - 1, 29, 3, 4, 5, 6, 7, 8, 9, 10, - 28, 29, 13, 14, 29, 27, 4, 5, 6, 7, - 8, 9, 10, 35, 117, 13, 14, 28, 29, 5, - 6, 29, 8, 9, 10, 29, 87, 13, 14, 29, - 28, 29, 15, 16, 29, 138, 25, 26, 141, 100, - 11, 29, 28, 29, 15, 16, 29, 18, 19, 20, - 21, 22, 23, 24, 29, 11, 33, 34, 29, 15, - 16, 17, 18, 19, 25, 26, 25, 26, 30, 34, - 31, 33, 34, 29, 29, 36, 90, 91, 92, 93, - 62, 63, 29, 12, 29, 29, 29, 29, 29, 13, - 13, 63, -1, -1, 54 + 4, 5, 3, 7, 47, 48, 10, 127, 65, 66, + 31, 29, 30, 34, 35, 26, 27, 137, 138, 54, + 63, 64, 57, 57, 57, 0, 1, 57, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 94, 39, 14, + 15, 76, 76, 76, 16, 17, 76, 26, 91, 92, + 107, 34, 35, 26, 29, 30, 0, 1, 30, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 26, 27, + 14, 15, 4, 5, 6, 7, 8, 9, 10, 11, + 123, 30, 14, 15, 30, 29, 30, 30, 30, 93, + 5, 6, 30, 8, 9, 10, 11, 29, 30, 14, + 15, 144, 106, 69, 147, 28, 96, 97, 98, 99, + 30, 77, 12, 36, 29, 30, 16, 17, 84, 19, + 20, 21, 22, 23, 24, 25, 30, 12, 30, 30, + 30, 16, 17, 18, 19, 20, 26, 27, 26, 27, + 35, 30, 32, 33, 32, 30, 30, 37, 30, 37, + 13, 30, 30, 30, 30, 30, 14, 14, 52, 69, + 59 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 38, 0, 1, 3, 4, 5, 6, 7, 8, - 9, 10, 13, 14, 28, 29, 39, 40, 41, 42, - 45, 46, 48, 52, 54, 56, 57, 59, 61, 62, - 63, 64, 72, 72, 25, 26, 70, 70, 70, 70, - 25, 25, 26, 31, 36, 74, 75, 29, 29, 51, - 29, 29, 60, 29, 29, 72, 74, 74, 33, 34, - 27, 35, 43, 49, 5, 8, 14, 40, 47, 71, - 55, 67, 1, 40, 48, 58, 59, 71, 67, 30, - 74, 74, 75, 75, 11, 15, 16, 18, 19, 20, - 21, 22, 23, 24, 29, 44, 65, 66, 68, 17, - 18, 19, 29, 50, 66, 68, 29, 40, 48, 53, - 59, 71, 29, 68, 29, 29, 29, 32, 74, 74, - 70, 75, 69, 70, 69, 69, 69, 69, 29, 12, - 29, 70, 75, 29, 29, 29, 29, 74, 13, 73, - 73, 13, 73, 73, 74, 74 + 0, 39, 0, 1, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 14, 15, 29, 30, 40, 41, 42, + 43, 44, 45, 48, 49, 51, 55, 57, 59, 60, + 62, 64, 65, 66, 67, 75, 75, 26, 27, 73, + 73, 73, 73, 26, 26, 26, 27, 32, 37, 77, + 78, 30, 30, 30, 54, 30, 30, 63, 30, 30, + 75, 77, 77, 34, 35, 28, 36, 46, 46, 52, + 5, 8, 15, 41, 50, 74, 58, 70, 1, 41, + 51, 61, 62, 74, 70, 31, 77, 77, 78, 78, + 12, 16, 17, 19, 20, 21, 22, 23, 24, 25, + 30, 47, 68, 69, 71, 18, 19, 20, 30, 53, + 69, 71, 30, 41, 51, 56, 62, 74, 30, 71, + 30, 30, 30, 33, 77, 77, 73, 78, 72, 73, + 72, 72, 72, 72, 30, 13, 30, 73, 78, 30, + 30, 30, 30, 77, 14, 76, 76, 14, 76, 76, + 77, 77 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) @@ -639,13 +646,14 @@ static const unsigned char yystos[] = #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ @@ -660,13 +668,13 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ - yyerror ("syntax error: cannot back up"); \ + yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) @@ -678,7 +686,7 @@ while (0) are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ @@ -687,7 +695,11 @@ while (0) /* YYLEX -- calling `yylex' with the right arguments. */ -#define YYLEX yylex () +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -702,19 +714,93 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) + # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) + +# define YYDSYMPRINTF(Title, Token, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Token, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (cinluded). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short *bottom, short *top) +#else +static void +yy_stack_print (bottom, top) + short *bottom; + short *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned int yylineno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylineno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) +# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ + /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 @@ -793,95 +879,85 @@ yystpcpy (yydest, yysrc) #if YYDEBUG -/*-----------------------------. -| Print this symbol on YYOUT. | -`-----------------------------*/ +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -static void #if defined (__STDC__) || defined (__cplusplus) -yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else -yysymprint (yyout, yytype, yyvalue) - FILE* yyout; +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; int yytype; - YYSTYPE yyvalue; + YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ - (void) yyvalue; + (void) yyvaluep; if (yytype < YYNTOKENS) { - YYFPRINTF (yyout, "token %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT - YYPRINT (yyout, yytoknum[yytype], yyvalue); + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else - YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } - YYFPRINTF (yyout, ")"); + YYFPRINTF (yyoutput, ")"); } -#endif /* YYDEBUG. */ - +#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -static void #if defined (__STDC__) || defined (__cplusplus) -yydestruct (int yytype, YYSTYPE yyvalue) +static void +yydestruct (int yytype, YYSTYPE *yyvaluep) #else -yydestruct (yytype, yyvalue) +static void +yydestruct (yytype, yyvaluep) int yytype; - YYSTYPE yyvalue; + YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ - (void) yyvalue; + (void) yyvaluep; switch (yytype) { + default: break; } } - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL +int yyparse (void *YYPARSE_PARAM); # else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +int yyparse (); # endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); -# endif +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ + /* The lookahead symbol. */ @@ -890,13 +966,32 @@ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -/* Number of parse errors so far. */ +/* Number of syntax errors so far. */ int yynerrs; + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL +yyparse (void) +#else +int +yyparse () + +#endif +#endif { register int yystate; @@ -905,7 +1000,7 @@ yyparse (YYPARSE_PARAM_ARG) /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; + int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, @@ -969,7 +1064,7 @@ yyparse (YYPARSE_PARAM_ARG) yysetstate: *yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; @@ -1001,10 +1096,10 @@ yyparse (YYPARSE_PARAM_ARG) goto yyoverflowlab; # else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) + if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { @@ -1030,7 +1125,7 @@ yyparse (YYPARSE_PARAM_ARG) YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } @@ -1055,39 +1150,28 @@ yybackup: /* Not known => get a lookahead token if don't already have one. */ - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with. */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more. */ - + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE (yychar); - - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - YYDPRINTF ((stderr, "Next token is ")); - YYDSYMPRINT ((stderr, yychar1, yylval)); - YYDPRINTF ((stderr, "\n")); + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } - /* If the proper action on seeing token YYCHAR1 is to reduce or to + /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ - yyn += yychar1; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) @@ -1102,8 +1186,7 @@ yybackup: YYACCEPT; /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) @@ -1149,378 +1232,430 @@ yyreduce: yyval = yyvsp[1-yylen]; - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn - 1, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif + YY_REDUCE_PRINT (yyn); switch (yyn) { case 8: - { zconfprint("unexpected 'endmenu' statement"); } + + { zconfprint("unexpected 'endmenu' statement"); ;} break; case 9: - { zconfprint("unexpected 'endif' statement"); } + + { zconfprint("unexpected 'endif' statement"); ;} break; case 10: - { zconfprint("unexpected 'endchoice' statement"); } + + { zconfprint("unexpected 'endchoice' statement"); ;} break; case 11: - { zconfprint("syntax error"); yyerrok; } + + { zconfprint("syntax error"); yyerrok; ;} break; - case 17: + case 18: + { struct symbol *sym = sym_lookup(yyvsp[0].string, 0); sym->flags |= SYMBOL_OPTIONAL; menu_add_entry(sym); printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); -} +;} break; - case 18: + case 19: + { menu_end_entry(); printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 23: - { } + case 20: + + { + struct symbol *sym = sym_lookup(yyvsp[0].string, 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); +;} break; - case 24: + case 21: + + { + if (current_entry->prompt) + current_entry->prompt->type = P_MENU; + else + zconfprint("warning: menuconfig statement without prompt"); + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 26: + + { ;} + break; + + case 27: + { menu_set_type(S_TRISTATE); printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 25: + case 28: + { menu_set_type(S_BOOLEAN); printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 26: + case 29: + { menu_set_type(S_INT); printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 27: + case 30: + { menu_set_type(S_HEX); printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 28: + case 31: + { menu_set_type(S_STRING); printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 29: + case 32: + { menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 30: + case 33: + { menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 31: + case 34: + { struct symbol *sym = sym_lookup(NULL, 0); sym->flags |= SYMBOL_CHOICE; menu_add_entry(sym); menu_add_prop(P_CHOICE, NULL, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 32: + case 35: + { menu_end_entry(); menu_add_menu(); -} +;} break; - case 33: + case 36: + { if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); } -} +;} break; - case 35: + case 38: + { printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno); zconfnerrs++; -} +;} break; - case 41: + case 44: + { menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 42: + case 45: + { current_entry->sym->flags |= SYMBOL_OPTIONAL; printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 43: + case 46: + { menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 46: + case 49: + { printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); menu_add_entry(NULL); menu_add_dep(yyvsp[0].expr); menu_end_entry(); menu_add_menu(); -} +;} break; - case 47: + case 50: + { if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); } -} +;} break; - case 49: + case 52: + { printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno); zconfnerrs++; -} +;} break; - case 54: + case 57: + { menu_add_entry(NULL); menu_add_prop(P_MENU, yyvsp[0].string, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 55: + case 58: + { menu_end_entry(); menu_add_menu(); -} +;} break; - case 56: + case 59: + { if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); } -} +;} break; - case 58: + case 61: + { printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno); zconfnerrs++; -} +;} break; - case 63: - { zconfprint("invalid menu option"); yyerrok; } + case 66: + + { zconfprint("invalid menu option"); yyerrok; ;} break; - case 64: + case 67: + { yyval.string = yyvsp[0].string; printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); -} +;} break; - case 65: + case 68: + { zconf_nextfile(yyvsp[-1].string); -} +;} break; - case 66: + case 69: + { menu_add_entry(NULL); menu_add_prop(P_COMMENT, yyvsp[0].string, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 67: + case 70: + { menu_end_entry(); -} +;} break; - case 68: + case 71: + { printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); zconf_starthelp(); -} +;} break; - case 69: + case 72: + { current_entry->sym->help = yyvsp[0].string; -} +;} break; - case 72: - { } + case 75: + + { ;} break; - case 73: + case 76: + { menu_add_dep(yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 74: + case 77: + { menu_add_dep(yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 75: + case 78: + { menu_add_dep(yyvsp[0].expr); printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); -} +;} break; - case 77: + case 80: + { menu_add_prop(P_PROMPT, yyvsp[0].string, NULL, NULL); -} +;} break; - case 78: + case 81: + { menu_add_prop(P_PROMPT, yyvsp[-2].string, NULL, yyvsp[0].expr); -} +;} break; - case 81: - { yyval.token = T_ENDMENU; } - break; + case 84: - case 82: - { yyval.token = T_ENDCHOICE; } + { yyval.token = T_ENDMENU; ;} break; - case 83: - { yyval.token = T_ENDIF; } - break; + case 85: - case 86: - { yyval.expr = NULL; } + { yyval.token = T_ENDCHOICE; ;} break; - case 87: - { yyval.expr = yyvsp[0].expr; } - break; + case 86: - case 88: - { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); } + { yyval.token = T_ENDIF; ;} break; case 89: - { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); } + + { yyval.expr = NULL; ;} break; case 90: - { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); } + + { yyval.expr = yyvsp[0].expr; ;} break; case 91: - { yyval.expr = yyvsp[-1].expr; } + + { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;} break; case 92: - { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); } + + { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} break; case 93: - { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); } + + { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} break; case 94: - { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); } + + { yyval.expr = yyvsp[-1].expr; ;} break; case 95: - { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); } + + { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;} break; case 96: - { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); } + + { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 97: + + { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;} + break; + + case 98: + + { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;} + break; + + case 99: + + { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;} break; } -/* Line 1016 of /usr/share/bison/yacc.c. */ -#line 1509 "zconf.tab.c" +/* Line 999 of yacc.c. */ + yyvsp -= yylen; yyssp -= yylen; -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1565,12 +1700,12 @@ yyerrlab: yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) @@ -1591,19 +1726,15 @@ yyerrlab: YYSTACK_FREE (yymsg); } else - yyerror ("parse error; also virtual memory exhausted"); + yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ - yyerror ("parse error"); + yyerror ("syntax error"); } - goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -1615,28 +1746,30 @@ yyerrlab1: /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ - while (yyssp > yyss) + while (yyss < yyssp) { - YYDPRINTF ((stderr, "Error: popping ")); - YYDSYMPRINT ((stderr, - yystos[*yyssp], - *yyvsp)); - YYDPRINTF ((stderr, "\n")); - yydestruct (yystos[*yyssp], *yyvsp); + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); - yydestruct (yychar1, yylval); + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); yychar = YYEMPTY; + } /* Else will try to reuse lookahead token after shifting the error token. */ + goto yyerrlab1; + +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1657,26 +1790,12 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - YYDPRINTF ((stderr, "Error: popping ")); - YYDSYMPRINT ((stderr, - yystos[*yyssp], *yyvsp)); - YYDPRINTF ((stderr, "\n")); - - yydestruct (yystos[yystate], *yyvsp); + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; - -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index dff6a117ae9e..04e949903894 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -27,7 +27,7 @@ struct symbol *symbol_hash[257]; #define YYERROR_VERBOSE %} -%expect 36 +%expect 40 %union { @@ -46,6 +46,7 @@ struct symbol *symbol_hash[257]; %token T_ENDCHOICE %token T_COMMENT %token T_CONFIG +%token T_MENUCONFIG %token T_HELP %token T_HELPTEXT %token T_IF @@ -104,12 +105,13 @@ common_block: if_stmt | comment_stmt | config_stmt + | menuconfig_stmt | source_stmt | nl_or_eof ; -/* config entry */ +/* config/menuconfig entry */ config_entry_start: T_CONFIG T_WORD { @@ -125,6 +127,24 @@ config_stmt: config_entry_start T_EOL config_option_list printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); }; +menuconfig_entry_start: T_MENUCONFIG T_WORD +{ + struct symbol *sym = sym_lookup($2, 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2); +}; + +menuconfig_stmt: menuconfig_entry_start T_EOL config_option_list +{ + if (current_entry->prompt) + current_entry->prompt->type = P_MENU; + else + zconfprint("warning: menuconfig statement without prompt"); + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +}; + config_option_list: /* empty */ | config_option_list config_option T_EOL -- cgit v1.2.3 From 6faef31d755656e095037f60bb18f1d0d2b3d780 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 15 Mar 2003 01:17:30 -0800 Subject: [PATCH] add menuconfig support to the front ends This adds the support for the menuconfig to the front ends. qconf also has now an ".." entry to make it more obvious how to get to a parent menu. --- scripts/kconfig/mconf.c | 23 ++-- scripts/kconfig/qconf.cc | 312 ++++++++++++++++++++++++++++------------------- scripts/kconfig/qconf.h | 20 ++- 3 files changed, 218 insertions(+), 137 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 48a2c02334b0..4cca5835fb13 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -302,11 +302,8 @@ static void build_conf(struct menu *menu) cprint1("%s%*c%s", menu->data ? "-->" : "++>", indent + 1, ' ', prompt); - } else { - if (menu->parent != &rootmenu) - cprint1(" %*c", indent + 1, ' '); - cprint1("%s --->", prompt); - } + } else + cprint1(" %*c%s --->", indent + 1, ' ', prompt); cprint_done(); if (single_menu_mode && menu->data) @@ -373,6 +370,11 @@ static void build_conf(struct menu *menu) } cprint_done(); } else { + if (menu == current_menu) { + cprint(":%p", menu); + cprint("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); + goto conf_childs; + } child_count++; val = sym_get_tristate_value(sym); if (sym_is_choice_value(sym) && val == yes) { @@ -407,6 +409,11 @@ static void build_conf(struct menu *menu) } cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), sym_has_value(sym) ? "" : " (NEW)"); + if (menu->prompt->type == P_MENU) { + cprint1(" --->"); + cprint_done(); + return; + } cprint_done(); } @@ -445,9 +452,9 @@ static void conf(struct menu *menu) cprint(":"); cprint("--- "); cprint("L"); - cprint("Load an Alternate Configuration File"); + cprint(" Load an Alternate Configuration File"); cprint("S"); - cprint("Save Configuration to an Alternate File"); + cprint(" Save Configuration to an Alternate File"); } stat = exec_conf(); if (stat < 0) @@ -484,6 +491,8 @@ static void conf(struct menu *menu) case 't': if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) conf_choice(submenu); + else if (submenu->prompt->type == P_MENU) + conf(submenu); break; case 's': conf_string(submenu); diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index bed541dc6b1f..df1577f4b6d7 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -42,15 +42,12 @@ static QSettings *configSettings; * menu: entry to be updated */ template -static void updateMenuList(P* parent, struct menu* menu) +void ConfigList::updateMenuList(P* parent, struct menu* menu) { struct menu* child; - ConfigList* list = parent->listView(); ConfigItem* item; ConfigItem* last; bool visible; - bool showAll = list->showAll; - enum listMode mode = list->mode; enum prop_type type; if (!menu) { @@ -59,7 +56,9 @@ static void updateMenuList(P* parent, struct menu* menu) return; } - last = 0; + last = parent->firstChild(); + if (last && !last->goParent) + last = 0; for (child = menu->list; child; child = child->next) { item = last ? last->nextSibling() : parent->firstChild(); type = child->prompt ? child->prompt->type : P_UNKNOWN; @@ -81,16 +80,8 @@ static void updateMenuList(P* parent, struct menu* menu) if (showAll || visible) { if (!item || item->menu != child) item = new ConfigItem(parent, last, child, visible); - else { - item->visible = visible; - if (item->updateNeeded()) { - ConfigItem* i = (ConfigItem*)child->data; - for (; i; i = i->nextItem) { - i->updateMenu(); - } - } else if (list->updateAll) - item->updateMenu(); - } + else + item->testUpdateMenu(visible); if (mode == fullMode || mode == menuMode || (type != P_MENU && type != P_ROOTMENU)) @@ -100,7 +91,7 @@ static void updateMenuList(P* parent, struct menu* menu) last = item; continue; } - hide: + hide: if (item && item->menu == child) { last = parent->firstChild(); if (last == item) @@ -131,24 +122,46 @@ void ConfigItem::updateMenu(void) { ConfigList* list; struct symbol* sym; + struct property *prop; QString prompt; int type; - enum prop_type ptype; tristate expr; list = listView(); + if (goParent) { + setPixmap(promptColIdx, list->menuBackPix); + prompt = ".."; + goto set_prompt; + } sym = menu->sym; - if (!sym) { - setText(promptColIdx, menu_get_prompt(menu)); - ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; - if ((ptype == P_ROOTMENU || ptype == P_MENU) && - (list->mode == singleMode || list->mode == symbolMode)) + prop = menu->prompt; + prompt = menu_get_prompt(menu); + + if (prop) switch (prop->type) { + case P_MENU: + case P_ROOTMENU: + if (list->mode == singleMode || list->mode == symbolMode) { + /* a menuconfig entry is displayed differently + * depending whether it's at the view root or a child. + */ + if (sym && list->rootEntry == menu) + break; setPixmap(promptColIdx, list->menuPix); - else + } else { + if (sym) + break; setPixmap(promptColIdx, 0); - return; + } + goto set_prompt; + case P_COMMENT: + setPixmap(promptColIdx, 0); + goto set_prompt; + default: + ; } + if (!sym) + goto set_prompt; setText(nameColIdx, sym->name); @@ -158,7 +171,6 @@ void ConfigItem::updateMenu(void) case S_TRISTATE: char ch; - prompt = menu_get_prompt(menu); if (!sym_is_changable(sym) && !list->showAll) { setText(noColIdx, 0); setText(modColIdx, 0); @@ -211,26 +223,33 @@ void ConfigItem::updateMenu(void) #endif setText(dataColIdx, data); if (type == S_STRING) - prompt.sprintf("%s: %s", menu_get_prompt(menu), data); + prompt.sprintf("%s: %s", prompt.latin1(), data); else - prompt.sprintf("(%s) %s", data, menu_get_prompt(menu)); + prompt.sprintf("(%s) %s", data, prompt.latin1()); break; } if (!sym_has_value(sym) && visible) prompt += " (NEW)"; +set_prompt: setText(promptColIdx, prompt); } -bool ConfigItem::updateNeeded(void) +void ConfigItem::testUpdateMenu(bool v) { - struct symbol* sym = menu->sym; - if (sym) - sym_calc_value(sym); + ConfigItem* i; + + visible = v; + if (!menu) + return; + + sym_calc_value(menu->sym); if (menu->flags & MENU_CHANGED) { + /* the menu entry changed, so update all list items */ menu->flags &= ~MENU_CHANGED; - return true; - } - return false; + for (i = (ConfigItem*)menu->data; i; i = i->nextItem) + i->updateMenu(); + } else if (listView()->updateAll) + updateMenu(); } void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align) @@ -251,14 +270,15 @@ void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int w */ void ConfigItem::init(void) { - ConfigList* list = listView(); - nextItem = (ConfigItem*)menu->data; - menu->data = this; + if (menu) { + ConfigList* list = listView(); + nextItem = (ConfigItem*)menu->data; + menu->data = this; - if (list->mode != fullMode) - setOpen(TRUE); - if (menu->sym) + if (list->mode != fullMode) + setOpen(TRUE); sym_calc_value(menu->sym); + } updateMenu(); } @@ -267,11 +287,13 @@ void ConfigItem::init(void) */ ConfigItem::~ConfigItem(void) { - ConfigItem** ip = &(ConfigItem*)menu->data; - for (; *ip; ip = &(*ip)->nextItem) { - if (*ip == this) { - *ip = nextItem; - break; + if (menu) { + ConfigItem** ip = &(ConfigItem*)menu->data; + for (; *ip; ip = &(*ip)->nextItem) { + if (*ip == this) { + *ip = nextItem; + break; + } } } } @@ -310,7 +332,8 @@ ConfigList::ConfigList(ConfigView* p, ConfigMainWindow* cv) : Parent(p), cview(cv), updateAll(false), symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no), - choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), menuPix(xpm_menu), menuInvPix(xpm_menu_inv), + choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), + menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), showAll(false), showName(false), showRange(false), showData(false), rootEntry(0) { @@ -366,6 +389,8 @@ void ConfigList::updateSelection(void) cview->setHelp(item); menu = item->menu; + if (!menu) + return; type = menu->prompt ? menu->prompt->type : P_UNKNOWN; if (mode == menuMode && (type == P_MENU || type == P_ROOTMENU)) emit menuSelected(menu); @@ -373,7 +398,27 @@ void ConfigList::updateSelection(void) void ConfigList::updateList(ConfigItem* item) { - (void)item; // unused so far + ConfigItem* last = 0; + + if (!rootEntry) + goto update; + + if ((mode == singleMode || mode == symbolMode) && rootEntry != &rootmenu) { + item = firstChild(); + if (!item) + item = new ConfigItem(this, 0, true); + last = item; + } + if (mode == singleMode && rootEntry->sym && rootEntry->prompt) { + item = last ? last->nextSibling() : firstChild(); + if (!item) + item = new ConfigItem(this, last, rootEntry, true); + + updateMenuList(item, rootEntry); + triggerUpdate(); + return; + } +update: updateMenuList(this, rootEntry); triggerUpdate(); } @@ -392,7 +437,7 @@ void ConfigList::setValue(ConfigItem* item, tristate val) int type; tristate oldval; - sym = item->menu->sym; + sym = item->menu ? item->menu->sym : 0; if (!sym) return; @@ -418,6 +463,8 @@ void ConfigList::changeValue(ConfigItem* item) int type, oldexpr, newexpr; menu = item->menu; + if (!menu) + return; sym = menu->sym; if (!sym) { if (item->menu->list) @@ -511,7 +558,13 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) switch (ev->key()) { case Key_Return: case Key_Enter: + if (item->goParent) { + emit parentSelected(); + break; + } menu = item->menu; + if (!menu) + break; type = menu->prompt ? menu->prompt->type : P_UNKNOWN; if ((type == P_MENU || type == P_ROOTMENU) && mode != fullMode) { emit menuSelected(menu); @@ -564,7 +617,11 @@ void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e) int off = header()->sectionPos(0) + itemMargin() + treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)); if (x >= off && x < off + pm->width()) { - if (menu->sym) + if (item->goParent) + emit parentSelected(); + else if (!menu) + break; + else if (menu->sym) changeValue(item); else emit menuSelected(menu); @@ -606,7 +663,13 @@ void ConfigList::contentsMouseDoubleClickEvent(QMouseEvent* e) if (!item) goto skip; + if (item->goParent) { + emit parentSelected(); + goto skip; + } menu = item->menu; + if (!menu) + goto skip; ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; if ((ptype == P_ROOTMENU || ptype == P_MENU) && (mode == singleMode || mode == symbolMode)) @@ -677,7 +740,6 @@ void ConfigView::updateListAll(void) */ ConfigMainWindow::ConfigMainWindow(void) { - ConfigView* view; QMenuBar* menu; QSplitter* split1; QSplitter* split2; @@ -707,15 +769,15 @@ ConfigMainWindow::ConfigMainWindow(void) split1->setOrientation(QSplitter::Horizontal); setCentralWidget(split1); - view = new ConfigView(split1, this); - menuList = view->list; + menuView = new ConfigView(split1, this); + menuList = menuView->list; split2 = new QSplitter(split1); split2->setOrientation(QSplitter::Vertical); // create config tree - view = new ConfigView(split2, this); - configList = view->list; + configView = new ConfigView(split2, this); + configList = configView->list; helpText = new QTextView(split2); helpText->setTextFormat(Qt::RichText); @@ -864,89 +926,87 @@ static void expr_print_help(void *data, const char *str) void ConfigMainWindow::setHelp(QListViewItem* item) { struct symbol* sym; - struct menu* menu; + struct menu* menu = 0; configList->parent()->lineEdit->hide(); - if (item) { - QString head, debug, help; + if (item) menu = ((ConfigItem*)item)->menu; - sym = menu->sym; - if (sym) { - if (menu->prompt) { - head += ""; - head += print_filter(menu->prompt->text); - head += ""; - if (sym->name) { - head += " ("; - head += print_filter(sym->name); - head += ")"; - } - } else if (sym->name) { - head += ""; + if (!menu) { + helpText->setText(NULL); + return; + } + + QString head, debug, help; + menu = ((ConfigItem*)item)->menu; + sym = menu->sym; + if (sym) { + if (menu->prompt) { + head += ""; + head += print_filter(menu->prompt->text); + head += ""; + if (sym->name) { + head += " ("; head += print_filter(sym->name); - head += ""; + head += ")"; } - head += "

"; - - if (showDebug) { - debug += "type: "; - debug += print_filter(sym_type_name(sym->type)); - debug += "
"; - for (struct property *prop = sym->prop; prop; prop = prop->next) { - switch (prop->type) { - case P_PROMPT: - debug += "prompt: "; - debug += print_filter(prop->text); - debug += "
"; - if (prop->visible.expr) { - debug += "  dep: "; - expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); - debug += "
"; - } - break; - case P_DEFAULT: - debug += "default: "; - if (sym_is_choice(sym)) - debug += print_filter(prop->def->name); - else { - sym_calc_value(prop->def); - debug += print_filter(sym_get_string_value(prop->def)); - } + } else if (sym->name) { + head += ""; + head += print_filter(sym->name); + head += ""; + } + head += "

"; + + if (showDebug) { + debug += "type: "; + debug += print_filter(sym_type_name(sym->type)); + debug += "
"; + for (struct property *prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_PROMPT: + debug += "prompt: "; + debug += print_filter(prop->text); + debug += "
"; + if (prop->visible.expr) { + debug += "  dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); debug += "
"; - if (prop->visible.expr) { - debug += "  dep: "; - expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); - debug += "
"; - } - break; - case P_CHOICE: - break; - default: - debug += "unknown property: "; - debug += prop_get_type_name(prop->type); + } + break; + case P_DEFAULT: + debug += "default: "; + debug += print_filter(prop->def->name); + debug += "
"; + if (prop->visible.expr) { + debug += "  dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); debug += "
"; } + break; + case P_CHOICE: + break; + default: + debug += "unknown property: "; + debug += prop_get_type_name(prop->type); + debug += "
"; } - debug += "
"; } + debug += "
"; + } - help = print_filter(sym->help); - } else if (menu->prompt) { - head += ""; - head += print_filter(menu->prompt->text); - head += "

"; - if (showDebug) { - if (menu->prompt->visible.expr) { - debug += "  dep: "; - expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); - debug += "
"; - } + help = print_filter(sym->help); + } else if (menu->prompt) { + head += ""; + head += print_filter(menu->prompt->text); + head += "

"; + if (showDebug) { + if (menu->prompt->visible.expr) { + debug += "  dep: "; + expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + debug += "
"; } } - helpText->setText(head + debug + help); - return; } - helpText->setText(NULL); + helpText->setText(head + debug + help); } void ConfigMainWindow::loadConfig(void) @@ -1010,7 +1070,7 @@ void ConfigMainWindow::goBack(void) void ConfigMainWindow::showSingleView(void) { - menuList->hide(); + menuView->hide(); menuList->setRootMenu(0); configList->mode = singleMode; if (configList->rootEntry == &rootmenu) @@ -1032,14 +1092,14 @@ void ConfigMainWindow::showSplitView(void) configApp->processEvents(); menuList->mode = menuMode; menuList->setRootMenu(&rootmenu); - menuList->show(); menuList->setAllOpen(TRUE); + menuView->show(); menuList->setFocus(); } void ConfigMainWindow::showFullView(void) { - menuList->hide(); + menuView->hide(); menuList->setRootMenu(0); configList->mode = fullMode; if (configList->rootEntry == &rootmenu) diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 6f096b4e8d40..6ed5a0ceb90f 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -101,10 +101,14 @@ public: void setAllOpen(bool open); void setParentMenu(void); + template + void ConfigList::updateMenuList(P*, struct menu*); + bool updateAll; QPixmap symbolYesPix, symbolModPix, symbolNoPix; - QPixmap choiceYesPix, choiceNoPix, menuPix, menuInvPix; + QPixmap choiceYesPix, choiceNoPix; + QPixmap menuPix, menuInvPix, menuBackPix; bool showAll, showName, showRange, showData; enum listMode mode; @@ -121,12 +125,17 @@ class ConfigItem : public QListViewItem { typedef class QListViewItem Parent; public: ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) - : Parent(parent, after), menu(m), visible(v) + : Parent(parent, after), menu(m), visible(v), goParent(false) { init(); } ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) - : Parent(parent, after), menu(m), visible(v) + : Parent(parent, after), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(QListView *parent, ConfigItem *after, bool v) + : Parent(parent, after), menu(0), visible(v), goParent(true) { init(); } @@ -136,7 +145,7 @@ public: void okRename(int col); #endif void updateMenu(void); - bool updateNeeded(void); + void testUpdateMenu(bool v); ConfigList* listView() const { return (ConfigList*)Parent::listView(); @@ -170,6 +179,7 @@ public: ConfigItem* nextItem; struct menu *menu; bool visible; + bool goParent; }; class ConfigLineEdit : public QLineEdit { @@ -216,7 +226,9 @@ public slots: protected: void closeEvent(QCloseEvent *e); + ConfigView *menuView; ConfigList *menuList; + ConfigView *configView; ConfigList *configList; QTextView *helpText; QToolBar *toolBar; -- cgit v1.2.3 From f4f01597e7533ed4cfccd25a76d254865729a89a Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 15 Mar 2003 01:17:45 -0800 Subject: [PATCH] gtk front end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the gtk front end by Romain Liévin --- Makefile | 9 +- scripts/kconfig/Makefile | 50 +- scripts/kconfig/gconf.c | 1580 +++++++++++++++++++++++++++++++++++++++++++ scripts/kconfig/gconf.glade | 543 +++++++++++++++ scripts/kconfig/images.c | 34 + 5 files changed, 2208 insertions(+), 8 deletions(-) create mode 100644 scripts/kconfig/gconf.c create mode 100644 scripts/kconfig/gconf.glade (limited to 'scripts') diff --git a/Makefile b/Makefile index e619acc6a4ad..c1286afaac10 100644 --- a/Makefile +++ b/Makefile @@ -198,7 +198,7 @@ export MODVERDIR := .tmp_versions comma := , depfile = $(subst $(comma),_,$(@D)/.$(@F).d) -noconfig_targets := xconfig menuconfig config oldconfig randconfig \ +noconfig_targets := xconfig gconfig menuconfig config oldconfig randconfig \ defconfig allyesconfig allnoconfig allmodconfig \ clean mrproper distclean rpm \ help tags TAGS cscope sgmldocs psdocs pdfdocs htmldocs \ @@ -604,15 +604,18 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) # Kernel configuration # --------------------------------------------------------------------------- -.PHONY: oldconfig xconfig menuconfig config \ +.PHONY: oldconfig xconfig gconfig menuconfig config \ make_with_config rpm -scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf: scripts/fixdep FORCE +scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf scripts/kconfig/gconf: scripts/fixdep FORCE $(Q)$(MAKE) $(build)=scripts/kconfig $@ xconfig: scripts/kconfig/qconf ./scripts/kconfig/qconf arch/$(ARCH)/Kconfig +gconfig: scripts/kconfig/gconf + ./scripts/kconfig/gconf arch/$(ARCH)/Kconfig + menuconfig: scripts/kconfig/mconf $(Q)$(MAKE) $(build)=scripts/lxdialog ./scripts/kconfig/mconf arch/$(ARCH)/Kconfig diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 927d00fe7814..bae5e29352da 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -6,20 +6,29 @@ # Utilizes the lxdialog package # qconf: Used for the xconfig target # Based on QT which needs to be installed to compile it +# gconf: Used for the gconfig target +# Based on GTK which needs to be installed to compile it # +################# # object files used by all lkc flavours libkconfig-objs := zconf.tab.o -host-progs := conf mconf qconf +host-progs := conf mconf qconf gconf conf-objs := conf.o libkconfig.so mconf-objs := mconf.o libkconfig.so -qconf-objs := kconfig_load.o +ifeq ($(MAKECMDGOALS),$(obj)/qconf) qconf-cxxobjs := qconf.o +qconf-objs := kconfig_load.o +endif + +ifeq ($(MAKECMDGOALS),$(obj)/gconf) +gconf-objs := gconf.o kconfig_load.o +endif clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ - zconf.tab.c zconf.tab.h lex.zconf.c + .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c # generated files seem to need this to find local include files HOSTCFLAGS_lex.zconf.o := -I$(src) @@ -28,7 +37,10 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) HOSTLOADLIBES_qconf = -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib -l$(QTLIB) -ldl HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o: $(obj)/zconf.tab.h +HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` +HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` + +$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h $(obj)/qconf.o: $(obj)/.tmp_qtcheck @@ -38,7 +50,7 @@ MOC = $(QTDIR)/bin/moc # QT needs some extra effort... $(obj)/.tmp_qtcheck: - @set -e; for d in $$QTDIR /usr/share/qt /usr/lib/qt*3*; do \ + @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \ done; \ if [ -z "$$DIR" ]; then \ @@ -60,12 +72,40 @@ $(obj)/.tmp_qtcheck: fi endif +$(obj)/gconf.o: $(obj)/.tmp_gtkcheck + +ifeq ($(MAKECMDGOALS),$(obj)/gconf) +-include $(obj)/.tmp_gtkcheck + +# GTK needs some extra effort, too... +$(obj)/.tmp_gtkcheck: + @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \ + if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \ + touch $@; \ + else \ + echo "*"; \ + echo "* GTK+ is present but version >= 2.0.0 is required."; \ + echo "*"; \ + false; \ + fi \ + else \ + echo "*"; \ + echo "* Unable to find the GTK+ installation. Please make sure that"; \ + echo "* the GTK+ 2.0 development package is correctly installed..."; \ + echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ + echo "*"; \ + false; \ + fi +endif + $(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/kconfig_load.o: $(obj)/lkc_defs.h $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h +$(obj)/gconf.o: $(obj)/lkc_defs.h + $(obj)/%.moc: $(src)/%.h $(MOC) -i $< -o $@ diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c new file mode 100644 index 000000000000..8baeb63dfaf7 --- /dev/null +++ b/scripts/kconfig/gconf.c @@ -0,0 +1,1580 @@ +/* Hey EMACS -*- linux-c -*- */ +/* + * + * Copyright (C) 2002-2003 Romain Lievin + * Released under the terms of the GNU GPL v2.0. + * + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lkc.h" +#include "images.c" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define DEBUG + +enum { + SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW +}; + +static gint view_mode = SPLIT_VIEW; +static gboolean show_name = TRUE; +static gboolean show_range = TRUE; +static gboolean show_value = TRUE; +static gboolean show_all = FALSE; +static gboolean show_debug = FALSE; +static gboolean resizeable = FALSE; + +static gboolean config_changed = FALSE; + +static char nohelp_text[] = + "Sorry, no help available for this option yet.\n"; + +GtkWidget *main_wnd = NULL; +GtkWidget *tree1_w = NULL; // left frame +GtkWidget *tree2_w = NULL; // right frame +GtkWidget *text_w = NULL; +GtkWidget *hpaned = NULL; +GtkWidget *vpaned = NULL; +GtkWidget *back_btn = NULL; + +GtkTextTag *tag1, *tag2; +GdkColor color; + +GtkTreeStore *tree1, *tree2, *tree; +GtkTreeModel *model1, *model2; +static GtkTreeIter *parents[256] = { 0 }; +static gint indent; + +static struct menu *current; + +enum { + COL_OPTION, COL_NAME, COL_NO, COL_MOD, COL_YES, COL_VALUE, + COL_MENU, COL_COLOR, COL_EDIT, COL_PIXBUF, + COL_PIXVIS, COL_BTNVIS, COL_BTNACT, COL_BTNINC, + COL_NUMBER +}; + +static void display_list(void); +static void display_tree(struct menu *menu); +static void display_tree_part(void); +static void update_tree(struct menu *src, GtkTreeIter * dst); +static void set_node2(GtkTreeIter * node, struct menu *menu, gchar ** row); +static gchar **fill_row(struct menu *menu); + + +/* Helping/Debugging Functions */ + + +const char *dbg_print_stype(int val) +{ + static char buf[256]; + + bzero(buf, 256); + + if (val == S_UNKNOWN) + strcpy(buf, "unknown"); + if (val == S_BOOLEAN) + strcpy(buf, "boolean"); + if (val == S_TRISTATE) + strcpy(buf, "tristate"); + if (val == S_INT) + strcpy(buf, "int"); + if (val == S_HEX) + strcpy(buf, "hex"); + if (val == S_STRING) + strcpy(buf, "string"); + if (val == S_OTHER) + strcpy(buf, "other"); + +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + +const char *dbg_print_flags(int val) +{ + static char buf[256] = { 0 }; + + bzero(buf, 256); + + if (val & SYMBOL_YES) + strcat(buf, "yes/"); + if (val & SYMBOL_MOD) + strcat(buf, "mod/"); + if (val & SYMBOL_NO) + strcat(buf, "no/"); + if (val & SYMBOL_CONST) + strcat(buf, "const/"); + if (val & SYMBOL_CHECK) + strcat(buf, "check/"); + if (val & SYMBOL_CHOICE) + strcat(buf, "choice/"); + if (val & SYMBOL_CHOICEVAL) + strcat(buf, "choiceval/"); + if (val & SYMBOL_PRINTED) + strcat(buf, "printed/"); + if (val & SYMBOL_VALID) + strcat(buf, "valid/"); + if (val & SYMBOL_OPTIONAL) + strcat(buf, "optional/"); + if (val & SYMBOL_WRITE) + strcat(buf, "write/"); + if (val & SYMBOL_CHANGED) + strcat(buf, "changed/"); + if (val & SYMBOL_NEW) + strcat(buf, "new/"); + if (val & SYMBOL_AUTO) + strcat(buf, "auto/"); + + buf[strlen(buf) - 1] = '\0'; +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + +const char *dbg_print_ptype(int val) +{ + static char buf[256]; + + bzero(buf, 256); + + if (val == P_UNKNOWN) + strcpy(buf, "unknown"); + if (val == P_PROMPT) + strcpy(buf, "prompt"); + if (val == P_COMMENT) + strcpy(buf, "comment"); + if (val == P_MENU) + strcpy(buf, "menu"); + if (val == P_ROOTMENU) + strcpy(buf, "rootmenu"); + if (val == P_DEFAULT) + strcpy(buf, "default"); + if (val == P_CHOICE) + strcpy(buf, "choice"); + +#ifdef DEBUG + printf("%s", buf); +#endif + + return buf; +} + + +/* Main Window Initialization */ + + +void init_main_window(const gchar * glade_file) +{ + GladeXML *xml; + GtkWidget *widget; + GtkTextBuffer *txtbuf; + char title[256]; + GdkPixmap *pixmap; + GdkBitmap *mask; + GtkStyle *style; + + xml = glade_xml_new(glade_file, "window1", NULL); + if (!xml) + g_error("GUI loading failed !\n"); + glade_xml_signal_autoconnect(xml); + + main_wnd = glade_xml_get_widget(xml, "window1"); + hpaned = glade_xml_get_widget(xml, "hpaned1"); + vpaned = glade_xml_get_widget(xml, "vpaned1"); + tree1_w = glade_xml_get_widget(xml, "treeview1"); + tree2_w = glade_xml_get_widget(xml, "treeview2"); + text_w = glade_xml_get_widget(xml, "textview3"); + + back_btn = glade_xml_get_widget(xml, "button1"); + gtk_widget_set_sensitive(back_btn, FALSE); + + widget = glade_xml_get_widget(xml, "show_name1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_name); + + widget = glade_xml_get_widget(xml, "show_range1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_range); + + widget = glade_xml_get_widget(xml, "show_data1"); + gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, + show_value); + + style = gtk_widget_get_style(main_wnd); + widget = glade_xml_get_widget(xml, "toolbar1"); + + pixmap = gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) xpm_single_view); + gtk_image_set_from_pixmap(GTK_IMAGE + (((GtkToolbarChild + *) (g_list_nth(GTK_TOOLBAR(widget)-> + children, + 5)->data))->icon), + pixmap, mask); + pixmap = + gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) xpm_split_view); + gtk_image_set_from_pixmap(GTK_IMAGE + (((GtkToolbarChild + *) (g_list_nth(GTK_TOOLBAR(widget)-> + children, + 6)->data))->icon), + pixmap, mask); + pixmap = + gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) xpm_tree_view); + gtk_image_set_from_pixmap(GTK_IMAGE + (((GtkToolbarChild + *) (g_list_nth(GTK_TOOLBAR(widget)-> + children, + 7)->data))->icon), + pixmap, mask); + + switch (view_mode) { + case SINGLE_VIEW: + widget = glade_xml_get_widget(xml, "button4"); + gtk_button_clicked(GTK_BUTTON(widget)); + break; + case SPLIT_VIEW: + widget = glade_xml_get_widget(xml, "button5"); + gtk_button_clicked(GTK_BUTTON(widget)); + break; + case FULL_VIEW: + widget = glade_xml_get_widget(xml, "button6"); + gtk_button_clicked(GTK_BUTTON(widget)); + break; + } + + txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1", + "foreground", "red", + "weight", PANGO_WEIGHT_BOLD, + NULL); + tag2 = gtk_text_buffer_create_tag(txtbuf, "mytag2", + /*"style", PANGO_STYLE_OBLIQUE, */ + NULL); + + sprintf(title, "Linux Kernel v%s.%s.%s%s Configuration", + getenv("VERSION"), getenv("PATCHLEVEL"), + getenv("SUBLEVEL"), getenv("EXTRAVERSION")); + gtk_window_set_title(GTK_WINDOW(main_wnd), title); + + gtk_widget_show(main_wnd); +} + +void init_tree_model(void) +{ + gint i; + + tree = tree2 = gtk_tree_store_new(COL_NUMBER, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_POINTER, GDK_TYPE_COLOR, + G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); + model2 = GTK_TREE_MODEL(tree2); + + for (parents[0] = NULL, i = 1; i < 256; i++) + parents[i] = (GtkTreeIter *) g_malloc(sizeof(GtkTreeIter)); + + tree1 = gtk_tree_store_new(COL_NUMBER, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_POINTER, GDK_TYPE_COLOR, + G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); + model1 = GTK_TREE_MODEL(tree1); +} + +void init_left_tree(void) +{ + GtkTreeView *view = GTK_TREE_VIEW(tree1_w); + GtkCellRenderer *renderer; + GtkTreeSelection *sel; + + gtk_tree_view_set_model(view, model1); + gtk_tree_view_set_headers_visible(view, TRUE); + gtk_tree_view_set_rules_hint(view, FALSE); + + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "Options", renderer, + "text", COL_OPTION, + "foreground-gdk", + COL_COLOR, NULL); + + sel = gtk_tree_view_get_selection(view); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); + gtk_widget_realize(tree1_w); +} + +static void renderer_edited(GtkCellRendererText * cell, + const gchar * path_string, + const gchar * new_text, gpointer user_data); +static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle, + gchar * arg1, gpointer user_data); + +void init_right_tree(void) +{ + GtkTreeView *view = GTK_TREE_VIEW(tree2_w); + GtkCellRenderer *renderer; + GtkTreeSelection *sel; + GtkTreeViewColumn *column; + gint i; + + gtk_tree_view_set_model(view, model2); + gtk_tree_view_set_headers_visible(view, TRUE); + gtk_tree_view_set_rules_hint(view, FALSE); + + column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(view, column); + gtk_tree_view_column_set_title(column, "Options"); + + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "pixbuf", COL_PIXBUF, + "visible", COL_PIXVIS, NULL); + renderer = gtk_cell_renderer_toggle_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "active", COL_BTNACT, + "inconsistent", COL_BTNINC, + "visible", COL_BTNVIS, NULL); + g_signal_connect(G_OBJECT(renderer), "toggled", + G_CALLBACK(renderer_toggled), NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), + renderer, FALSE); + gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column), + renderer, + "text", COL_OPTION, + "foreground-gdk", + COL_COLOR, NULL); + + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "Name", renderer, + "text", COL_NAME, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "N", renderer, + "text", COL_NO, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "M", renderer, + "text", COL_MOD, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "Y", renderer, + "text", COL_YES, + "foreground-gdk", + COL_COLOR, NULL); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(view, -1, + "Value", renderer, + "text", COL_VALUE, + "editable", + COL_EDIT, + "foreground-gdk", + COL_COLOR, NULL); + g_signal_connect(G_OBJECT(renderer), "edited", + G_CALLBACK(renderer_edited), NULL); + + column = gtk_tree_view_get_column(view, COL_NAME); + gtk_tree_view_column_set_visible(column, show_name); + column = gtk_tree_view_get_column(view, COL_NO); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_MOD); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_YES); + gtk_tree_view_column_set_visible(column, show_range); + column = gtk_tree_view_get_column(view, COL_VALUE); + gtk_tree_view_column_set_visible(column, show_value); + + if (resizeable) { + for (i = 0; i < COL_VALUE; i++) { + column = gtk_tree_view_get_column(view, i); + gtk_tree_view_column_set_resizable(column, TRUE); + } + } + + sel = gtk_tree_view_get_selection(view); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); +} + + +/* Utility Functions */ + + +static void text_insert_help(struct menu *menu) +{ + GtkTextBuffer *buffer; + GtkTextIter start, end; + const char *prompt = menu_get_prompt(menu); + gchar *name; + const char *help = nohelp_text; + + if (!menu->sym) + help = ""; + else if (menu->sym->help) + help = menu->sym->help; + + if (menu->sym && menu->sym->name) + name = g_strdup_printf(menu->sym->name); + else + name = g_strdup(""); + + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + gtk_text_buffer_get_bounds(buffer, &start, &end); + gtk_text_buffer_delete(buffer, &start, &end); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15); + + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, " ", 1); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2, + NULL); +} + + +static void text_insert_msg(const char *title, const char *message) +{ + GtkTextBuffer *buffer; + GtkTextIter start, end; + const char *msg = message; + + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); + gtk_text_buffer_get_bounds(buffer, &start, &end); + gtk_text_buffer_delete(buffer, &start, &end); + gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15); + + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, title, -1, tag1, + NULL); + gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); + gtk_text_buffer_get_end_iter(buffer, &end); + gtk_text_buffer_insert_with_tags(buffer, &end, msg, -1, tag2, + NULL); +} + + +/* Main Windows Callbacks */ + +void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data); +gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, + gpointer user_data) +{ + GtkWidget *dialog, *label; + gint result; + + if (config_changed == FALSE) + return FALSE; + + dialog = gtk_dialog_new_with_buttons("Warning !", + GTK_WINDOW(main_wnd), + (GtkDialogFlags) + (GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT), + GTK_STOCK_OK, + GTK_RESPONSE_YES, + GTK_STOCK_NO, + GTK_RESPONSE_NO, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, NULL); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), + GTK_RESPONSE_CANCEL); + + label = gtk_label_new("\nSave configuration ?\n"); + gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label); + gtk_widget_show(label); + + result = gtk_dialog_run(GTK_DIALOG(dialog)); + switch (result) { + case GTK_RESPONSE_YES: + on_save1_activate(NULL, NULL); + return FALSE; + case GTK_RESPONSE_NO: + return FALSE; + case GTK_RESPONSE_CANCEL: + case GTK_RESPONSE_DELETE_EVENT: + default: + gtk_widget_destroy(dialog); + return TRUE; + } + + return FALSE; +} + + +void on_window1_destroy(GtkObject * object, gpointer user_data) +{ + gtk_main_quit(); +} + + +void +on_window1_size_request(GtkWidget * widget, + GtkRequisition * requisition, gpointer user_data) +{ + static gint old_h = 0; + gint w, h; + + if (widget->window == NULL) + gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h); + else + gdk_window_get_size(widget->window, &w, &h); + + if (h == old_h) + return; + old_h = h; + + gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3); +} + + +/* Menu & Toolbar Callbacks */ + + +static void +load_filename(GtkFileSelection * file_selector, gpointer user_data) +{ + const gchar *fn; + + fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION + (user_data)); + + if (conf_read(fn)) + text_insert_msg("Error", "Unable to load configuration !"); + else + display_tree(&rootmenu); +} + +void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *fs; + + fs = gtk_file_selection_new("Load file..."); + g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", + G_CALLBACK(load_filename), (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->ok_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->cancel_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + gtk_widget_show(fs); +} + + +void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + if (conf_write(NULL)) + text_insert_msg("Error", "Unable to save configuration !"); + + config_changed = FALSE; +} + + +static void +store_filename(GtkFileSelection * file_selector, gpointer user_data) +{ + const gchar *fn; + + fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION + (user_data)); + + if (conf_write(fn)) + text_insert_msg("Error", "Unable to save configuration !"); + + gtk_widget_destroy(GTK_WIDGET(user_data)); +} + +void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *fs; + + fs = gtk_file_selection_new("Save file as..."); + g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", + G_CALLBACK(store_filename), (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->ok_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + g_signal_connect_swapped(GTK_OBJECT + (GTK_FILE_SELECTION(fs)->cancel_button), + "clicked", G_CALLBACK(gtk_widget_destroy), + (gpointer) fs); + gtk_widget_show(fs); +} + + +void on_quit1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + if (!on_window1_delete_event(NULL, NULL, NULL)) + gtk_widget_destroy(GTK_WIDGET(main_wnd)); +} + + +void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_name = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NAME); + if (col) + gtk_tree_view_column_set_visible(col, show_name); +} + + +void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_range = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NO); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_MOD); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_YES); + if (col) + gtk_tree_view_column_set_visible(col, show_range); + +} + + +void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkTreeViewColumn *col; + + show_value = GTK_CHECK_MENU_ITEM(menuitem)->active; + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_VALUE); + if (col) + gtk_tree_view_column_set_visible(col, show_value); +} + + +void +on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + show_all = GTK_CHECK_MENU_ITEM(menuitem)->active; + + gtk_tree_store_clear(tree2); + display_tree(&rootmenu); // instead of update_tree for speed reasons +} + + +void +on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active; + update_tree(&rootmenu, NULL); +} + + +void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *intro_text = + "Welcome to gkc, the GTK+ graphical kernel configuration tool\n" + "for Linux.\n" + "For each option, a blank box indicates the feature is disabled, a\n" + "check indicates it is enabled, and a dot indicates that it is to\n" + "be compiled as a module. Clicking on the box will cycle through the three states.\n" + "\n" + "If you do not see an option (e.g., a device driver) that you\n" + "believe should be present, try turning on Show All Options\n" + "under the Options menu.\n" + "Although there is no cross reference yet to help you figure out\n" + "what other options must be enabled to support the option you\n" + "are interested in, you can still view the help of a grayed-out\n" + "option.\n" + "\n" + "Toggling Show Debug Info under the Options menu will show \n" + "the dependencies, which you can then match by examining other options."; + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, intro_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *about_text = + "gkc is copyright (c) 2002 Romain Lievin .\n" + "Based on the source code from Roman Zippel.\n"; + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, about_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data) +{ + GtkWidget *dialog; + const gchar *license_text = + "gkc is released under the terms of the GNU GPL v2.\n" + "For more information, please see the source code or\n" + "visit http://www.fsf.org/licenses/licenses.html\n"; + + dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, license_text); + g_signal_connect_swapped(GTK_OBJECT(dialog), "response", + G_CALLBACK(gtk_widget_destroy), + GTK_OBJECT(dialog)); + gtk_widget_show_all(dialog); +} + + +void on_back_pressed(GtkButton * button, gpointer user_data) +{ + enum prop_type type; + + current = current->parent; + type = current->prompt ? current->prompt->type : P_UNKNOWN; + if ((type != P_ROOTMENU) && (type != P_MENU)) + current = current->parent; + display_tree_part(); + + if (current == &rootmenu) + gtk_widget_set_sensitive(back_btn, FALSE); +} + + +void on_load_pressed(GtkButton * button, gpointer user_data) +{ + on_load1_activate(NULL, user_data); +} + + +void on_save_pressed(GtkButton * button, gpointer user_data) +{ + on_save1_activate(NULL, user_data); +} + + +void on_single_clicked(GtkButton * button, gpointer user_data) +{ + view_mode = SINGLE_VIEW; + gtk_paned_set_position(GTK_PANED(hpaned), 0); + gtk_widget_hide(tree1_w); + if (tree2) + gtk_tree_store_clear(tree2); + current = &rootmenu; + display_tree_part(); +} + + +void on_split_clicked(GtkButton * button, gpointer user_data) +{ + gint w, h; + view_mode = SPLIT_VIEW; + gtk_widget_show(tree1_w); + gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h); + gtk_paned_set_position(GTK_PANED(hpaned), w / 2); + if (tree2) + gtk_tree_store_clear(tree2); + display_list(); +} + + +void on_full_clicked(GtkButton * button, gpointer user_data) +{ + view_mode = FULL_VIEW; + gtk_paned_set_position(GTK_PANED(hpaned), 0); + gtk_widget_hide(tree1_w); + if (tree2) + gtk_tree_store_clear(tree2); + display_tree(&rootmenu); + gtk_widget_set_sensitive(back_btn, FALSE); +} + + +void on_collapse_pressed(GtkButton * button, gpointer user_data) +{ + gtk_tree_view_collapse_all(GTK_TREE_VIEW(tree2_w)); +} + + +void on_expand_pressed(GtkButton * button, gpointer user_data) +{ + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w)); +} + + +/* CTree Callbacks */ + +/* Change hex/int/string value in the cell */ +static void renderer_edited(GtkCellRendererText * cell, + const gchar * path_string, + const gchar * new_text, gpointer user_data) +{ + GtkTreePath *path = gtk_tree_path_new_from_string(path_string); + GtkTreeIter iter; + const char *old_def, *new_def; + struct menu *menu; + struct symbol *sym; + + if (!gtk_tree_model_get_iter(model2, &iter, path)) + return; + + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + sym = menu->sym; + + gtk_tree_model_get(model2, &iter, COL_VALUE, &old_def, -1); + new_def = new_text; + + sym_set_string_value(sym, new_def); + + config_changed = TRUE; + update_tree(&rootmenu, NULL); + + gtk_tree_path_free(path); +} + +/* Change the value of a symbol and update the tree */ +static void change_sym_value(struct menu *menu, gint col) +{ + struct symbol *sym = menu->sym; + int stype; + tristate oldval, newval; + + newval = no; + switch (col) { + case COL_OPTION: + return; + case COL_NAME: + return; + case COL_NO: + newval = no; + break; + case COL_MOD: + newval = mod; + break; + case COL_YES: + newval = yes; + break; + default: + break; + } + + if (!sym) + return; + + stype = sym_get_type(sym); + switch (stype) { + case S_BOOLEAN: + case S_TRISTATE: + if (col == COL_VALUE) + return; + else { + oldval = sym_get_tristate_value(sym); + if (!sym_tristate_within_range(sym, newval)) + newval = yes; + sym_set_tristate_value(sym, newval); + config_changed = TRUE; + if (view_mode == FULL_VIEW) + update_tree(&rootmenu, NULL); + else + //display_tree_part(); //fixme: keep exp/coll + update_tree(current, NULL); + } + break; + case S_INT: + case S_HEX: + case S_STRING: + break; + } +} + +static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle, + gchar * path_string, gpointer user_data) +{ + GtkTreePath *path = gtk_tree_path_new_from_string(path_string); + GtkTreeIter iter; + gint col; + struct menu *menu; + const int next_col[3] = { COL_NO, COL_MOD, COL_YES }; + + if (!gtk_tree_model_get_iter(model2, &iter, path)) + return; + + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + gtk_tree_model_get(model2, &iter, COL_BTNINC, &col, -1); + if (col) + col = COL_MOD; + else { + gtk_tree_model_get(model2, &iter, COL_BTNACT, &col, -1); + col = col ? COL_YES : COL_NO; + } + + change_sym_value(menu, next_col[((col - COL_NO) + 1) % 3]); + + gtk_tree_path_free(path); +} + +static gint column2index(GtkTreeViewColumn * column) +{ + gint i; + + for (i = 0; i < COL_NUMBER; i++) { + GtkTreeViewColumn *col; + + col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), i); + if (col == column) + return i; + } + + return -1; +} + + +//#define GTK_BUG_FIXED // GTK+ 2.1.4 mini + +/* User click: update choice (full) or goes down (single) */ +gboolean +on_treeview2_button_press_event(GtkWidget * widget, + GdkEventButton * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + gint col; + +#ifdef GTK_BUG_FIXED + gint tx = (gint) event->x; + gint ty = (gint) event->y; + gint cx, cy; + + gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx, + &cy); +#else + gtk_tree_view_get_cursor(view, &path, &column); +#endif + if (path == NULL) + return FALSE; + + gtk_tree_model_get_iter(model2, &iter, path); + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + + col = column2index(column); + if ((col == COL_OPTION) && (event->type == GDK_2BUTTON_PRESS) && + (view_mode != FULL_VIEW) && menu->list) { + enum prop_type type; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if ((type != P_MENU) && (type != P_ROOTMENU)) + return FALSE; + current = menu; + display_tree_part(); + gtk_widget_set_sensitive(back_btn, TRUE); + } else + change_sym_value(menu, col); + + return FALSE; +} + +/* Key pressed: update choice */ +gboolean +on_treeview2_key_press_event(GtkWidget * widget, + GdkEventKey * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + gint col; + + gtk_tree_view_get_cursor(view, &path, &column); + if (path == NULL) { + //g_warning("key_press_event: path is NULL !\n"); + return FALSE; + } + + if (event->keyval == GDK_space) { + if (gtk_tree_view_row_expanded(view, path)) + gtk_tree_view_collapse_row(view, path); + else + gtk_tree_view_expand_row(view, path, FALSE); + return FALSE; + } + if (widget == tree1_w) + return FALSE; + + gtk_tree_model_get_iter(model2, &iter, path); + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + + if (!strcasecmp(event->string, "n")) + col = COL_NO; + else if (!strcasecmp(event->string, "m")) + col = COL_MOD; + else if (!strcasecmp(event->string, "y")) + col = COL_YES; + else if (!strcasecmp(event->string, "e")) + col = COL_VALUE; + else + col = 0; + + change_sym_value(menu, col); + + return FALSE; +} + + +/* Row selection changed: update help */ +void +on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data) +{ + GtkTreeSelection *selection; + GtkTreeIter iter; + struct menu *menu; + + selection = gtk_tree_view_get_selection(treeview); + if (gtk_tree_selection_get_selected(selection, &model2, &iter)) { + gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1); + text_insert_help(menu); + } +} + + +/* User click: display sub-tree in the right frame. */ +gboolean +on_treeview1_button_press_event(GtkWidget * widget, + GdkEventButton * event, gpointer user_data) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreePath *path; + GtkTreeViewColumn *column; + GtkTreeIter iter; + struct menu *menu; + + gint tx = (gint) event->x; + gint ty = (gint) event->y; + gint cx, cy; + + gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx, + &cy); + if (path == NULL) + return FALSE; + + gtk_tree_model_get_iter(model1, &iter, path); + gtk_tree_model_get(model1, &iter, COL_MENU, &menu, -1); + + current = menu; + display_tree_part(); + + return FALSE; +} + + +/* Conf management */ + + +/* Fill a row of strings */ +static gchar **fill_row(struct menu *menu) +{ + static gchar **row; + struct symbol *sym = menu->sym; + const char *def; + int stype; + tristate val; + enum prop_type type; + + //g_strfreev(row); //to fix... + row = (gchar **) g_malloc0(COL_NUMBER * sizeof(gchar *)); + row[COL_OPTION] = + g_strdup_printf("%s %s", menu_get_prompt(menu), + sym ? (sym-> + flags & SYMBOL_NEW ? "(NEW)" : "") : + ""); + + if (show_all && !menu_is_visible(menu)) + row[COL_COLOR] = g_strdup("DarkGray"); + else + row[COL_COLOR] = g_strdup("Black"); + + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + switch (type) { + case P_MENU: + case P_ROOTMENU: + row[COL_PIXBUF] = + (gchar *) (view_mode != + FULL_VIEW ? xpm_menu : xpm_void); + row[COL_PIXVIS] = GINT_TO_POINTER(TRUE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + case P_COMMENT: + row[COL_PIXBUF] = (gchar *) xpm_void; + row[COL_PIXVIS] = GINT_TO_POINTER(FALSE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + default: + row[COL_PIXBUF] = (gchar *) xpm_void; + row[COL_PIXVIS] = GINT_TO_POINTER(FALSE); + row[COL_BTNVIS] = GINT_TO_POINTER(TRUE); + break; + } + + if (!sym) + return row; + row[COL_NAME] = g_strdup(sym->name); + + sym_calc_value(sym); + sym->flags &= ~SYMBOL_CHANGED; + + if (sym_is_choice(sym)) { // parse childs for getting final value + struct menu *child; + struct symbol *def_sym = sym_get_choice_value(sym); + struct menu *def_menu = NULL; + + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child) + && child->sym == def_sym) + def_menu = child; + } + + if (def_menu) + row[COL_VALUE] = + g_strdup(menu_get_prompt(def_menu)); + } + + stype = sym_get_type(sym); + switch (stype) { + case S_BOOLEAN: + if (sym_is_choice(sym)) + break; + case S_TRISTATE: + val = sym_get_tristate_value(sym); + switch (val) { + case no: + row[COL_NO] = g_strdup("N"); + row[COL_VALUE] = g_strdup("N"); + row[COL_BTNACT] = GINT_TO_POINTER(FALSE); + row[COL_BTNINC] = GINT_TO_POINTER(FALSE); + break; + case mod: + row[COL_MOD] = g_strdup("M"); + row[COL_VALUE] = g_strdup("M"); + row[COL_BTNINC] = GINT_TO_POINTER(TRUE); + break; + case yes: + row[COL_YES] = g_strdup("Y"); + row[COL_VALUE] = g_strdup("Y"); + row[COL_BTNACT] = GINT_TO_POINTER(TRUE); + row[COL_BTNINC] = GINT_TO_POINTER(FALSE); + break; + } + + if (val != no && sym_tristate_within_range(sym, no)) + row[COL_NO] = g_strdup("_"); + if (val != mod && sym_tristate_within_range(sym, mod)) + row[COL_MOD] = g_strdup("_"); + if (val != yes && sym_tristate_within_range(sym, yes)) + row[COL_YES] = g_strdup("_"); + break; + case S_INT: + case S_HEX: + case S_STRING: + def = sym_get_string_value(sym); + row[COL_VALUE] = g_strdup(def); + row[COL_EDIT] = GINT_TO_POINTER(TRUE); + row[COL_BTNVIS] = GINT_TO_POINTER(FALSE); + break; + } + + return row; +} + + +/* Set the node content with a row of strings */ +static void set_node2(GtkTreeIter * node, struct menu *menu, gchar ** row) +{ + GdkColor color; + gboolean success; + GdkPixbuf *pix; + + pix = gdk_pixbuf_new_from_xpm_data((const char **) + row[COL_PIXBUF]); + + gdk_color_parse(row[COL_COLOR], &color); + gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1, + FALSE, FALSE, &success); + + gtk_tree_store_set(tree, node, + COL_OPTION, row[COL_OPTION], + COL_NAME, row[COL_NAME], + COL_NO, row[COL_NO], + COL_MOD, row[COL_MOD], + COL_YES, row[COL_YES], + COL_VALUE, row[COL_VALUE], + COL_MENU, (gpointer) menu, + COL_COLOR, &color, + COL_EDIT, GPOINTER_TO_INT(row[COL_EDIT]), + COL_PIXBUF, pix, + COL_PIXVIS, GPOINTER_TO_INT(row[COL_PIXVIS]), + COL_BTNVIS, GPOINTER_TO_INT(row[COL_BTNVIS]), + COL_BTNACT, GPOINTER_TO_INT(row[COL_BTNACT]), + COL_BTNINC, GPOINTER_TO_INT(row[COL_BTNINC]), + -1); + + g_object_unref(pix); + g_strfreev(row); +} + + +/* Add a node to the tree */ +static void place_node2(struct menu *menu, char **row) +{ + GtkTreeIter *parent = parents[indent - 1]; + GtkTreeIter *node = parents[indent]; + + gtk_tree_store_append(tree, node, parent); + set_node2(node, menu, row); +} + + +/* Find a node in the GTK+ tree */ +static GtkTreeIter found; + +/* + * Find a menu in the GtkTree starting at parent. + */ +GtkTreeIter *gtktree_iter_find_node(GtkTreeIter * parent, + struct menu *tofind) +{ + GtkTreeIter iter; + GtkTreeIter *child = &iter; + gboolean valid; + GtkTreeIter *ret; + + valid = gtk_tree_model_iter_children(model2, child, parent); + while (valid) { + struct menu *menu; + + gtk_tree_model_get(model2, child, 6, &menu, -1); + + if (menu == tofind) { + memcpy(&found, child, sizeof(GtkTreeIter)); + return &found; + } + + ret = gtktree_iter_find_node(child, tofind); + if (ret) + return ret; + + valid = gtk_tree_model_iter_next(model2, child); + } + + return NULL; +} + + +/* + * Update the tree by adding/removing entries + * Does not change other nodes + */ +static void update_tree(struct menu *src, GtkTreeIter * dst) +{ + struct menu *child1; + GtkTreeIter iter, tmp; + GtkTreeIter *child2 = &iter; + gboolean valid; + GtkTreeIter *sibling; + struct symbol *sym; + struct property *prop; + struct menu *menu1, *menu2; + + if (src == &rootmenu) + indent = 1; + + valid = gtk_tree_model_iter_children(model2, child2, dst); + for (child1 = src->list; child1; child1 = child1->next) { + + prop = child1->prompt; + sym = child1->sym; + + reparse: + menu1 = child1; + if (valid) + gtk_tree_model_get(model2, child2, COL_MENU, + &menu2, -1); + else + menu2 = NULL; // force adding of a first child + +#ifdef DEBUG + printf("%*c%s | %s\n", indent, ' ', + menu1 ? menu_get_prompt(menu1) : "nil", + menu2 ? menu_get_prompt(menu2) : "nil"); +#endif + + if (!menu_is_visible(child1) && !show_all) { // remove node + if (gtktree_iter_find_node(dst, menu1) != NULL) { + memcpy(&tmp, child2, sizeof(GtkTreeIter)); + valid = gtk_tree_model_iter_next(model2, + child2); + gtk_tree_store_remove(tree2, &tmp); + if (!valid) + return; // next parent + else + goto reparse; // next child + } else + continue; + } + + if (menu1 != menu2) { + if (gtktree_iter_find_node(dst, menu1) == NULL) { // add node + if (!valid && !menu2) + sibling = NULL; + else + sibling = child2; + gtk_tree_store_insert_before(tree2, + child2, + dst, sibling); + set_node2(child2, menu1, fill_row(menu1)); + if (menu2 == NULL) + valid = TRUE; + } else { // remove node + memcpy(&tmp, child2, sizeof(GtkTreeIter)); + valid = gtk_tree_model_iter_next(model2, + child2); + gtk_tree_store_remove(tree2, &tmp); + if (!valid) + return; // next parent + else + goto reparse; // next child + } + } else if (sym && (sym->flags & SYMBOL_CHANGED)) { + set_node2(child2, menu1, fill_row(menu1)); + } + + indent++; + update_tree(child1, child2); + indent--; + + valid = gtk_tree_model_iter_next(model2, child2); + } +} + + +/* Display the whole tree (single/split/full view) */ +static void display_tree(struct menu *menu) +{ + struct symbol *sym; + struct property *prop; + struct menu *child; + enum prop_type ptype; + + if (menu == &rootmenu) { + indent = 1; + current = &rootmenu; + } + + for (child = menu->list; child; child = child->next) { + prop = child->prompt; + sym = child->sym; + ptype = prop ? prop->type : P_UNKNOWN; + + if (sym) + sym->flags &= ~SYMBOL_CHANGED; + + if ((view_mode == SPLIT_VIEW) && (ptype != P_ROOTMENU) && + (tree == tree1)) + continue; + + if ((view_mode == SPLIT_VIEW) && (ptype == P_ROOTMENU) && + (tree == tree2)) + continue; + + if (menu_is_visible(child) || show_all) + place_node2(child, fill_row(child)); +#ifdef DEBUG + printf("%*c%s: ", indent, ' ', menu_get_prompt(child)); + dbg_print_ptype(ptype); + printf(" | "); + if (sym) { + dbg_print_stype(sym->type); + printf(" | "); + dbg_print_flags(sym->flags); + printf("\n"); + } else + printf("\n"); +#endif + if ((view_mode != FULL_VIEW) && (ptype == P_MENU) + && (tree == tree2)) + continue; + + if (((menu != &rootmenu) && (ptype != P_ROOTMENU)) || + (view_mode == FULL_VIEW) + || (view_mode == SPLIT_VIEW)) { + indent++; + display_tree(child); + indent--; + } + } +} + +/* Display a part of the tree starting at current node (single/split view) */ +static void display_tree_part(void) +{ + if (tree2) + gtk_tree_store_clear(tree2); + display_tree(current); + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w)); +} + +/* Display the list in the left frame (split view) */ +static void display_list(void) +{ + tree = tree1; + display_tree(&rootmenu); + gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w)); + tree = tree2; +} + +static void fixup_rootmenu(struct menu *menu) +{ + struct menu *child; + + if (!menu->prompt || menu->prompt->type != P_MENU) + return; + menu->prompt->type = P_ROOTMENU; + for (child = menu->list; child; child = child->next) + fixup_rootmenu(child); +} + + +/* Main */ + + +int main(int ac, char *av[]) +{ + const char *name; + gchar *cur_dir, *exe_path; + gchar *glade_file; + +#ifndef LKC_DIRECT_LINK + kconfig_load(); +#endif + + /* GTK stuffs */ + gtk_set_locale(); + gtk_init(&ac, &av); + glade_init(); + + //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); + //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); + + /* Determine GUI path */ + cur_dir = g_get_current_dir(); + exe_path = g_strdup(av[0]); + exe_path[0] = '/'; + glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL); + g_free(cur_dir); + g_free(exe_path); + + /* Load the interface and connect signals */ + init_main_window(glade_file); + init_tree_model(); + init_left_tree(); + init_right_tree(); + + /* Conf stuffs */ + if (ac > 1 && av[1][0] == '-') { + switch (av[1][1]) { + case 'a': + //showAll = 1; + break; + case 'h': + case '?': + printf("%s \n", av[0]); + exit(0); + } + name = av[2]; + } else + name = av[1]; + + conf_parse(name); + fixup_rootmenu(&rootmenu); + conf_read(NULL); + + switch (view_mode) { + case SINGLE_VIEW: + display_tree_part(); + break; + case SPLIT_VIEW: + display_list(); + break; + case FULL_VIEW: + display_tree(&rootmenu); + break; + } + + gtk_main(); + + return 0; +} diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade new file mode 100644 index 000000000000..1e1736d81ee9 --- /dev/null +++ b/scripts/kconfig/gconf.glade @@ -0,0 +1,543 @@ + + + + + + + True + Gtk Kernel Configurator + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 640 + 480 + True + False + + + + + + + True + False + 0 + + + + True + + + + True + _File + True + + + + + + + True + Load a config file + _Load + True + + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save the config in .config + _Save + True + + + + + + True + gtk-save + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save the config in a file + Save _as + True + + + + + True + gtk-save-as + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Quit + True + + + + + + True + gtk-quit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Options + True + + + + + + + True + Show name + Show _name + True + False + + + + + + + True + Show range (Y/M/N) + Show _range + True + False + + + + + + + True + Show value of the option + Show _data + True + False + + + + + + + True + + + + + + True + Show all options + Show all _options + True + False + + + + + + + True + Show masked options + Show _debug info + True + False + + + + + + + + + + + True + _Help + True + + + + + + + True + _Introduction + True + + + + + + True + gtk-dialog-question + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _About + True + + + + + + True + gtk-properties + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _License + True + + + + + True + gtk-justify-fill + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + 0 + False + False + + + + + + True + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + True + + + + True + Goes up of one level (single view) + Back + True + gtk-undo + + + + + + + True + + + + + + True + Load a config file + Load + True + gtk-open + + + + + + + True + Save a config file + Save + True + gtk-save + + + + + + + True + + + + + + True + Single view + Single + True + gtk-missing-image + + + + + + + True + Split view + Split + True + gtk-missing-image + + + + + + + True + Full view + Full + True + gtk-missing-image + + + + + + + True + + + + + + True + Collapse the whole tree in the right frame + Collapse + True + + + + + + + True + Expand the whole tree in the right frame + Expand + True + + + + + + + + 0 + False + False + + + + + + 1 + True + True + 0 + + + + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + + + + + + + + True + False + + + + + + True + True + 0 + + + + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + False + False + True + + + + + + + + True + False + + + + + + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + True + 0 + 0 + 0 + 0 + 0 + 0 + Sorry, no help available for this option yet. + + + + + True + True + + + + + True + True + + + + + 0 + True + True + + + + + + + diff --git a/scripts/kconfig/images.c b/scripts/kconfig/images.c index 65a5d67f8488..d4f84bd4a96b 100644 --- a/scripts/kconfig/images.c +++ b/scripts/kconfig/images.c @@ -290,3 +290,37 @@ static const char *xpm_menu_inv[] = { " .......... ", " .......... ", " "}; + +static const char *xpm_menuback[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_void[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; -- cgit v1.2.3