Update the kconfig stuff to match the one in the linux-2.6.27 version.
/trunk/kconfig/zconf.hash.c | 225 110 115 0 +++----
/trunk/kconfig/lkc_proto.h | 4 3 1 0 +
/trunk/kconfig/mconf.c | 217 110 107 0 +++---
/trunk/kconfig/menu.c | 86 60 26 0 ++-
/trunk/kconfig/symbol.c | 212 156 56 0 ++++--
/trunk/kconfig/kconfig.mk | 24 9 15 0 -
/trunk/kconfig/lex.zconf.c | 97 80 17 0 ++-
/trunk/kconfig/util.c | 38 30 8 0 +
/trunk/kconfig/lkc.h | 22 18 4 0 +
/trunk/kconfig/expr.c | 32 19 13 0 +
/trunk/kconfig/confdata.c | 254 172 82 0 +++++---
/trunk/kconfig/lxdialog/dialog.h | 12 9 3 0 +
/trunk/kconfig/lxdialog/inputbox.c | 6 3 3 0
/trunk/kconfig/lxdialog/checklist.c | 4 2 2 0
/trunk/kconfig/lxdialog/menubox.c | 6 3 3 0
/trunk/kconfig/lxdialog/textbox.c | 2 1 1 0
/trunk/kconfig/lxdialog/util.c | 47 30 17 0 +
/trunk/kconfig/lxdialog/yesno.c | 4 2 2 0
/trunk/kconfig/expr.h | 20 10 10 0
/trunk/kconfig/zconf.tab.c | 1441 793 648 0 ++++++++++++++++++++++++-------------------
/trunk/kconfig/conf.c | 276 124 152 0 ++++----
/trunk/kconfig/check-gettext.sh | 14 14 0 0 +
/trunk/ct-ng.in | 2 1 1 0
23 files changed, 1759 insertions(+), 1286 deletions(-)
1.1 --- a/ct-ng.in Fri Oct 17 09:51:19 2008 +0000
1.2 +++ b/ct-ng.in Fri Oct 17 12:47:53 2008 +0000
1.3 @@ -107,7 +107,7 @@
1.4 # End help system
1.5
1.6 .config:
1.7 - @echo 'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first'
1.8 + @echo ' There is no existing .config file!'
1.9 @false
1.10
1.11 # Actual build
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/kconfig/check-gettext.sh Fri Oct 17 12:47:53 2008 +0000
2.3 @@ -0,0 +1,14 @@
2.4 +#!/bin/sh
2.5 +# Needed for systems without gettext
2.6 +$* -xc -o /dev/null - > /dev/null 2>&1 << EOF
2.7 +#include <libintl.h>
2.8 +int main()
2.9 +{
2.10 + gettext("");
2.11 + return 0;
2.12 +}
2.13 +EOF
2.14 +if [ ! "$?" -eq "0" ]; then
2.15 + echo -DKBUILD_NO_NLS;
2.16 +fi
2.17 +
3.1 --- a/kconfig/conf.c Fri Oct 17 09:51:19 2008 +0000
3.2 +++ b/kconfig/conf.c Fri Oct 17 12:47:53 2008 +0000
3.3 @@ -3,12 +3,13 @@
3.4 * Released under the terms of the GNU GPL v2.0.
3.5 */
3.6
3.7 +#include <locale.h>
3.8 #include <ctype.h>
3.9 +#include <stdio.h>
3.10 #include <stdlib.h>
3.11 -#include <stdio.h>
3.12 #include <string.h>
3.13 +#include <time.h>
3.14 #include <unistd.h>
3.15 -#include <time.h>
3.16 #include <sys/stat.h>
3.17
3.18 #define LKC_DIRECT_LINK
3.19 @@ -31,12 +32,21 @@
3.20
3.21 static int indent = 1;
3.22 static int valid_stdin = 1;
3.23 +static int sync_kconfig;
3.24 static int conf_cnt;
3.25 static char line[128];
3.26 static struct menu *rootEntry;
3.27
3.28 static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
3.29
3.30 +static const char *get_help(struct menu *menu)
3.31 +{
3.32 + if (menu_has_help(menu))
3.33 + return _(menu_get_help(menu));
3.34 + else
3.35 + return nohelp_text;
3.36 +}
3.37 +
3.38 static void strip(char *str)
3.39 {
3.40 char *p = str;
3.41 @@ -56,7 +66,7 @@
3.42
3.43 static void check_stdin(void)
3.44 {
3.45 - if (!valid_stdin && input_mode == ask_silent) {
3.46 + if (!valid_stdin) {
3.47 printf(_("aborted!\n\n"));
3.48 printf(_("Console input/output is redirected. "));
3.49 printf(_("Run 'make oldconfig' to update configuration.\n\n"));
3.50 @@ -64,13 +74,12 @@
3.51 }
3.52 }
3.53
3.54 -static void conf_askvalue(struct symbol *sym, const char *def)
3.55 +static int conf_askvalue(struct symbol *sym, const char *def)
3.56 {
3.57 enum symbol_type type = sym_get_type(sym);
3.58 - tristate val;
3.59
3.60 if (!sym_has_value(sym))
3.61 - printf("(NEW) ");
3.62 + printf(_("(NEW) "));
3.63
3.64 line[0] = '\n';
3.65 line[1] = 0;
3.66 @@ -79,33 +88,21 @@
3.67 printf("%s\n", def);
3.68 line[0] = '\n';
3.69 line[1] = 0;
3.70 - return;
3.71 + return 0;
3.72 }
3.73
3.74 switch (input_mode) {
3.75 - case set_no:
3.76 - case set_mod:
3.77 - case set_yes:
3.78 - case set_random:
3.79 - if (sym_has_value(sym)) {
3.80 - printf("%s\n", def);
3.81 - return;
3.82 - }
3.83 - break;
3.84 case ask_new:
3.85 case ask_silent:
3.86 if (sym_has_value(sym)) {
3.87 printf("%s\n", def);
3.88 - return;
3.89 + return 0;
3.90 }
3.91 check_stdin();
3.92 case ask_all:
3.93 fflush(stdout);
3.94 fgets(line, 128, stdin);
3.95 - return;
3.96 - case set_default:
3.97 - printf("%s\n", def);
3.98 - return;
3.99 + return 1;
3.100 default:
3.101 break;
3.102 }
3.103 @@ -115,81 +112,34 @@
3.104 case S_HEX:
3.105 case S_STRING:
3.106 printf("%s\n", def);
3.107 - return;
3.108 + return 1;
3.109 default:
3.110 ;
3.111 }
3.112 - switch (input_mode) {
3.113 - case set_yes:
3.114 - if (sym_tristate_within_range(sym, yes)) {
3.115 - line[0] = 'y';
3.116 - line[1] = '\n';
3.117 - line[2] = 0;
3.118 - break;
3.119 - }
3.120 - case set_mod:
3.121 - if (type == S_TRISTATE) {
3.122 - if (sym_tristate_within_range(sym, mod)) {
3.123 - line[0] = 'm';
3.124 - line[1] = '\n';
3.125 - line[2] = 0;
3.126 - break;
3.127 - }
3.128 - } else {
3.129 - if (sym_tristate_within_range(sym, yes)) {
3.130 - line[0] = 'y';
3.131 - line[1] = '\n';
3.132 - line[2] = 0;
3.133 - break;
3.134 - }
3.135 - }
3.136 - case set_no:
3.137 - if (sym_tristate_within_range(sym, no)) {
3.138 - line[0] = 'n';
3.139 - line[1] = '\n';
3.140 - line[2] = 0;
3.141 - break;
3.142 - }
3.143 - case set_random:
3.144 - do {
3.145 - val = (tristate)(random() % 3);
3.146 - } while (!sym_tristate_within_range(sym, val));
3.147 - switch (val) {
3.148 - case no: line[0] = 'n'; break;
3.149 - case mod: line[0] = 'm'; break;
3.150 - case yes: line[0] = 'y'; break;
3.151 - }
3.152 - line[1] = '\n';
3.153 - line[2] = 0;
3.154 - break;
3.155 - default:
3.156 - break;
3.157 - }
3.158 printf("%s", line);
3.159 + return 1;
3.160 }
3.161
3.162 int conf_string(struct menu *menu)
3.163 {
3.164 struct symbol *sym = menu->sym;
3.165 - const char *def, *help;
3.166 + const char *def;
3.167
3.168 while (1) {
3.169 - printf("%*s%s ", indent - 1, "", menu->prompt->text);
3.170 + printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
3.171 printf("(%s) ", sym->name);
3.172 def = sym_get_string_value(sym);
3.173 if (sym_get_string_value(sym))
3.174 printf("[%s] ", def);
3.175 - conf_askvalue(sym, def);
3.176 + if (!conf_askvalue(sym, def))
3.177 + return 0;
3.178 switch (line[0]) {
3.179 case '\n':
3.180 break;
3.181 case '?':
3.182 /* print help */
3.183 if (line[1] == '\n') {
3.184 - help = nohelp_text;
3.185 - if (menu->sym->help)
3.186 - help = menu->sym->help;
3.187 - printf("\n%s\n", menu->sym->help);
3.188 + printf("\n%s\n", get_help(menu));
3.189 def = NULL;
3.190 break;
3.191 }
3.192 @@ -207,10 +157,9 @@
3.193 struct symbol *sym = menu->sym;
3.194 int type;
3.195 tristate oldval, newval;
3.196 - const char *help;
3.197
3.198 while (1) {
3.199 - printf("%*s%s ", indent - 1, "", menu->prompt->text);
3.200 + printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
3.201 if (sym->name)
3.202 printf("(%s) ", sym->name);
3.203 type = sym_get_type(sym);
3.204 @@ -233,10 +182,11 @@
3.205 printf("/m");
3.206 if (oldval != yes && sym_tristate_within_range(sym, yes))
3.207 printf("/y");
3.208 - if (sym->help)
3.209 + if (menu_has_help(menu))
3.210 printf("/?");
3.211 printf("] ");
3.212 - conf_askvalue(sym, sym_get_string_value(sym));
3.213 + if (!conf_askvalue(sym, sym_get_string_value(sym)))
3.214 + return 0;
3.215 strip(line);
3.216
3.217 switch (line[0]) {
3.218 @@ -269,10 +219,7 @@
3.219 if (sym_set_tristate_value(sym, newval))
3.220 return 0;
3.221 help:
3.222 - help = nohelp_text;
3.223 - if (sym->help)
3.224 - help = sym->help;
3.225 - printf("\n%s\n", help);
3.226 + printf("\n%s\n", get_help(menu));
3.227 }
3.228 }
3.229
3.230 @@ -302,7 +249,7 @@
3.231 case no:
3.232 return 1;
3.233 case mod:
3.234 - printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
3.235 + printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
3.236 return 0;
3.237 case yes:
3.238 break;
3.239 @@ -312,7 +259,7 @@
3.240 while (1) {
3.241 int cnt, def;
3.242
3.243 - printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
3.244 + printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
3.245 def_sym = sym_get_choice_value(sym);
3.246 cnt = def = 0;
3.247 line[0] = 0;
3.248 @@ -320,7 +267,7 @@
3.249 if (!menu_is_visible(child))
3.250 continue;
3.251 if (!child->sym) {
3.252 - printf("%*c %s\n", indent, '*', menu_get_prompt(child));
3.253 + printf("%*c %s\n", indent, '*', _(menu_get_prompt(child)));
3.254 continue;
3.255 }
3.256 cnt++;
3.257 @@ -329,20 +276,20 @@
3.258 printf("%*c", indent, '>');
3.259 } else
3.260 printf("%*c", indent, ' ');
3.261 - printf(" %d. %s", cnt, menu_get_prompt(child));
3.262 + printf(" %d. %s", cnt, _(menu_get_prompt(child)));
3.263 if (child->sym->name)
3.264 printf(" (%s)", child->sym->name);
3.265 if (!sym_has_value(child->sym))
3.266 - printf(" (NEW)");
3.267 + printf(_(" (NEW)"));
3.268 printf("\n");
3.269 }
3.270 - printf("%*schoice", indent - 1, "");
3.271 + printf(_("%*schoice"), indent - 1, "");
3.272 if (cnt == 1) {
3.273 printf("[1]: 1\n");
3.274 goto conf_childs;
3.275 }
3.276 printf("[1-%d", cnt);
3.277 - if (sym->help)
3.278 + if (menu_has_help(menu))
3.279 printf("?");
3.280 printf("]: ");
3.281 switch (input_mode) {
3.282 @@ -359,8 +306,7 @@
3.283 fgets(line, 128, stdin);
3.284 strip(line);
3.285 if (line[0] == '?') {
3.286 - printf("\n%s\n", menu->sym->help ?
3.287 - menu->sym->help : nohelp_text);
3.288 + printf("\n%s\n", get_help(menu));
3.289 continue;
3.290 }
3.291 if (!line[0])
3.292 @@ -370,14 +316,7 @@
3.293 else
3.294 continue;
3.295 break;
3.296 - case set_random:
3.297 - def = (random() % cnt) + 1;
3.298 - case set_default:
3.299 - case set_yes:
3.300 - case set_mod:
3.301 - case set_no:
3.302 - cnt = def;
3.303 - printf("%d\n", cnt);
3.304 + default:
3.305 break;
3.306 }
3.307
3.308 @@ -391,14 +330,13 @@
3.309 if (!child)
3.310 continue;
3.311 if (line[strlen(line) - 1] == '?') {
3.312 - printf("\n%s\n", child->sym->help ?
3.313 - child->sym->help : nohelp_text);
3.314 + printf("\n%s\n", get_help(child));
3.315 continue;
3.316 }
3.317 sym_set_choice_value(sym, child->sym);
3.318 - if (child->list) {
3.319 + for (child = child->list; child; child = child->next) {
3.320 indent += 2;
3.321 - conf(child->list);
3.322 + conf(child);
3.323 indent -= 2;
3.324 }
3.325 return 1;
3.326 @@ -430,7 +368,7 @@
3.327 if (prompt)
3.328 printf("%*c\n%*c %s\n%*c\n",
3.329 indent, '*',
3.330 - indent, '*', prompt,
3.331 + indent, '*', _(prompt),
3.332 indent, '*');
3.333 default:
3.334 ;
3.335 @@ -492,29 +430,29 @@
3.336
3.337 int main(int ac, char **av)
3.338 {
3.339 - int i = 1;
3.340 + int opt;
3.341 const char *name;
3.342 struct stat tmpstat;
3.343
3.344 - if (ac > i && av[i][0] == '-') {
3.345 - switch (av[i++][1]) {
3.346 + setlocale(LC_ALL, "");
3.347 + bindtextdomain(PACKAGE, LOCALEDIR);
3.348 + textdomain(PACKAGE);
3.349 +
3.350 + while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
3.351 + switch (opt) {
3.352 case 'o':
3.353 - input_mode = ask_new;
3.354 + input_mode = ask_silent;
3.355 break;
3.356 case 's':
3.357 input_mode = ask_silent;
3.358 + sync_kconfig = 1;
3.359 break;
3.360 case 'd':
3.361 input_mode = set_default;
3.362 break;
3.363 case 'D':
3.364 input_mode = set_default;
3.365 - defconfig_file = av[i++];
3.366 - if (!defconfig_file) {
3.367 - printf(_("%s: No default config file specified\n"),
3.368 - av[0]);
3.369 - exit(1);
3.370 - }
3.371 + defconfig_file = optarg;
3.372 break;
3.373 case 'n':
3.374 input_mode = set_no;
3.375 @@ -527,42 +465,45 @@
3.376 break;
3.377 case 'r':
3.378 input_mode = set_random;
3.379 - srandom(time(NULL));
3.380 + srand(time(NULL));
3.381 break;
3.382 case 'h':
3.383 - case '?':
3.384 - fprintf(stderr, "See README for usage info\n");
3.385 + printf(_("See README for usage info\n"));
3.386 exit(0);
3.387 + break;
3.388 + default:
3.389 + fprintf(stderr, _("See README for usage info\n"));
3.390 + exit(1);
3.391 }
3.392 }
3.393 - name = av[i];
3.394 - if (!name) {
3.395 + if (ac == optind) {
3.396 printf(_("%s: Kconfig file missing\n"), av[0]);
3.397 exit(1);
3.398 }
3.399 + name = av[optind];
3.400 conf_parse(name);
3.401 //zconfdump(stdout);
3.402 + if (sync_kconfig) {
3.403 + if (stat(".config", &tmpstat)) {
3.404 + fprintf(stderr, _("***\n"
3.405 + "*** Please run some configurator (e.g. \"make menuconfig\").\n"
3.406 + "***\n"));
3.407 + exit(1);
3.408 + }
3.409 + }
3.410 +
3.411 switch (input_mode) {
3.412 case set_default:
3.413 if (!defconfig_file)
3.414 defconfig_file = conf_get_default_confname();
3.415 if (conf_read(defconfig_file)) {
3.416 - printf("***\n"
3.417 + printf(_("***\n"
3.418 "*** Can't find default configuration \"%s\"!\n"
3.419 - "***\n", defconfig_file);
3.420 + "***\n"), defconfig_file);
3.421 exit(1);
3.422 }
3.423 break;
3.424 case ask_silent:
3.425 - if (stat(".config", &tmpstat)) {
3.426 - printf(_("***\n"
3.427 - "*** You have not yet configured "PROJECT_NAME"!\n"
3.428 - "***\n"
3.429 - "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
3.430 - "*** \"make menuconfig\" or \"make config\").\n"
3.431 - "***\n"));
3.432 - exit(1);
3.433 - }
3.434 case ask_all:
3.435 case ask_new:
3.436 conf_read(NULL);
3.437 @@ -592,31 +533,62 @@
3.438 break;
3.439 }
3.440
3.441 - if (input_mode != ask_silent) {
3.442 + if (sync_kconfig) {
3.443 + if (conf_get_changed()) {
3.444 + name = getenv("KCONFIG_NOSILENTUPDATE");
3.445 + if (name && *name) {
3.446 + fprintf(stderr,
3.447 + _("\n*** Configuration requires explicit update.\n\n"));
3.448 + return 1;
3.449 + }
3.450 + }
3.451 + valid_stdin = isatty(0) && isatty(1) && isatty(2);
3.452 + }
3.453 +
3.454 + switch (input_mode) {
3.455 + case set_no:
3.456 + conf_set_all_new_symbols(def_no);
3.457 + break;
3.458 + case set_yes:
3.459 + conf_set_all_new_symbols(def_yes);
3.460 + break;
3.461 + case set_mod:
3.462 + conf_set_all_new_symbols(def_mod);
3.463 + break;
3.464 + case set_random:
3.465 + conf_set_all_new_symbols(def_random);
3.466 + break;
3.467 + case set_default:
3.468 + conf_set_all_new_symbols(def_default);
3.469 + break;
3.470 + case ask_new:
3.471 + case ask_all:
3.472 rootEntry = &rootmenu;
3.473 conf(&rootmenu);
3.474 - if (input_mode == ask_all) {
3.475 - input_mode = ask_silent;
3.476 - valid_stdin = 1;
3.477 + input_mode = ask_silent;
3.478 + /* fall through */
3.479 + case ask_silent:
3.480 + /* Update until a loop caused no more changes */
3.481 + do {
3.482 + conf_cnt = 0;
3.483 + check_conf(&rootmenu);
3.484 + } while (conf_cnt);
3.485 + break;
3.486 + }
3.487 +
3.488 + if (sync_kconfig) {
3.489 + /* silentoldconfig is used during the build so we shall update autoconf.
3.490 + * All other commands are only used to generate a config.
3.491 + */
3.492 + if (conf_get_changed() && conf_write(NULL)) {
3.493 + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
3.494 + exit(1);
3.495 }
3.496 - } else if (conf_get_changed()) {
3.497 - name = getenv("KCONFIG_NOSILENTUPDATE");
3.498 - if (name && *name) {
3.499 - fprintf(stderr, _("\n*** "PROJECT_NAME" configuration requires explicit update.\n\n"));
3.500 - return 1;
3.501 + } else {
3.502 + if (conf_write(NULL)) {
3.503 + fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
3.504 + exit(1);
3.505 }
3.506 - } else
3.507 - goto skip_check;
3.508 -
3.509 - do {
3.510 - conf_cnt = 0;
3.511 - check_conf(&rootmenu);
3.512 - } while (conf_cnt);
3.513 - if (conf_write(NULL)) {
3.514 - fprintf(stderr, _("\n*** Error during writing of "PROJECT_NAME" configuration.\n\n"));
3.515 - return 1;
3.516 }
3.517 -skip_check:
3.518 -
3.519 return 0;
3.520 }
4.1 --- a/kconfig/confdata.c Fri Oct 17 09:51:19 2008 +0000
4.2 +++ b/kconfig/confdata.c Fri Oct 17 12:47:53 2008 +0000
4.3 @@ -83,6 +83,68 @@
4.4 return name;
4.5 }
4.6
4.7 +static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
4.8 +{
4.9 + char *p2;
4.10 +
4.11 + switch (sym->type) {
4.12 + case S_TRISTATE:
4.13 + if (p[0] == 'm') {
4.14 + sym->def[def].tri = mod;
4.15 + sym->flags |= def_flags;
4.16 + break;
4.17 + }
4.18 + case S_BOOLEAN:
4.19 + if (p[0] == 'y') {
4.20 + sym->def[def].tri = yes;
4.21 + sym->flags |= def_flags;
4.22 + break;
4.23 + }
4.24 + if (p[0] == 'n') {
4.25 + sym->def[def].tri = no;
4.26 + sym->flags |= def_flags;
4.27 + break;
4.28 + }
4.29 + conf_warning("symbol value '%s' invalid for %s", p, sym->name);
4.30 + break;
4.31 + case S_OTHER:
4.32 + if (*p != '"') {
4.33 + for (p2 = p; *p2 && !isspace(*p2); p2++)
4.34 + ;
4.35 + sym->type = S_STRING;
4.36 + goto done;
4.37 + }
4.38 + case S_STRING:
4.39 + if (*p++ != '"')
4.40 + break;
4.41 + for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
4.42 + if (*p2 == '"') {
4.43 + *p2 = 0;
4.44 + break;
4.45 + }
4.46 + memmove(p2, p2 + 1, strlen(p2));
4.47 + }
4.48 + if (!p2) {
4.49 + conf_warning("invalid string found");
4.50 + return 1;
4.51 + }
4.52 + case S_INT:
4.53 + case S_HEX:
4.54 + done:
4.55 + if (sym_string_valid(sym, p)) {
4.56 + sym->def[def].val = strdup(p);
4.57 + sym->flags |= def_flags;
4.58 + } else {
4.59 + conf_warning("symbol value '%s' invalid for %s", p, sym->name);
4.60 + return 1;
4.61 + }
4.62 + break;
4.63 + default:
4.64 + ;
4.65 + }
4.66 + return 0;
4.67 +}
4.68 +
4.69 int conf_read_simple(const char *name, int def)
4.70 {
4.71 FILE *in = NULL;
4.72 @@ -161,7 +223,7 @@
4.73 if (def == S_DEF_USER) {
4.74 sym = sym_find(line + 5);
4.75 if (!sym) {
4.76 - conf_warning("trying to assign nonexistent symbol %s", line + 5);
4.77 + sym_add_change_count(1);
4.78 break;
4.79 }
4.80 } else {
4.81 @@ -170,8 +232,7 @@
4.82 sym->type = S_BOOLEAN;
4.83 }
4.84 if (sym->flags & def_flags) {
4.85 - conf_warning("trying to reassign symbol %s", sym->name);
4.86 - break;
4.87 + conf_warning("override: reassigning to symbol %s", sym->name);
4.88 }
4.89 switch (sym->type) {
4.90 case S_BOOLEAN:
4.91 @@ -201,7 +262,7 @@
4.92 if (def == S_DEF_USER) {
4.93 sym = sym_find(line + 3);
4.94 if (!sym) {
4.95 - conf_warning("trying to assign nonexistent symbol %s", line + 3);
4.96 + sym_add_change_count(1);
4.97 break;
4.98 }
4.99 } else {
4.100 @@ -210,64 +271,10 @@
4.101 sym->type = S_OTHER;
4.102 }
4.103 if (sym->flags & def_flags) {
4.104 - conf_warning("trying to reassign symbol %s", sym->name);
4.105 - break;
4.106 + conf_warning("override: reassigning to symbol %s", sym->name);
4.107 }
4.108 - switch (sym->type) {
4.109 - case S_TRISTATE:
4.110 - if (p[0] == 'm') {
4.111 - sym->def[def].tri = mod;
4.112 - sym->flags |= def_flags;
4.113 - break;
4.114 - }
4.115 - case S_BOOLEAN:
4.116 - if (p[0] == 'y') {
4.117 - sym->def[def].tri = yes;
4.118 - sym->flags |= def_flags;
4.119 - break;
4.120 - }
4.121 - if (p[0] == 'n') {
4.122 - sym->def[def].tri = no;
4.123 - sym->flags |= def_flags;
4.124 - break;
4.125 - }
4.126 - conf_warning("symbol value '%s' invalid for %s", p, sym->name);
4.127 - break;
4.128 - case S_OTHER:
4.129 - if (*p != '"') {
4.130 - for (p2 = p; *p2 && !isspace(*p2); p2++)
4.131 - ;
4.132 - sym->type = S_STRING;
4.133 - goto done;
4.134 - }
4.135 - case S_STRING:
4.136 - if (*p++ != '"')
4.137 - break;
4.138 - for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
4.139 - if (*p2 == '"') {
4.140 - *p2 = 0;
4.141 - break;
4.142 - }
4.143 - memmove(p2, p2 + 1, strlen(p2));
4.144 - }
4.145 - if (!p2) {
4.146 - conf_warning("invalid string found");
4.147 - continue;
4.148 - }
4.149 - case S_INT:
4.150 - case S_HEX:
4.151 - done:
4.152 - if (sym_string_valid(sym, p)) {
4.153 - sym->def[def].val = strdup(p);
4.154 - sym->flags |= def_flags;
4.155 - } else {
4.156 - conf_warning("symbol value '%s' invalid for %s", p, sym->name);
4.157 - continue;
4.158 - }
4.159 - break;
4.160 - default:
4.161 - ;
4.162 - }
4.163 + if (conf_set_sym_val(sym, def, def_flags, p))
4.164 + continue;
4.165 break;
4.166 case '\r':
4.167 case '\n':
4.168 @@ -288,14 +295,12 @@
4.169 }
4.170 break;
4.171 case yes:
4.172 - if (cs->def[def].tri != no) {
4.173 - conf_warning("%s creates inconsistent choice state", sym->name);
4.174 - cs->flags &= ~def_flags;
4.175 - } else
4.176 - cs->def[def].val = sym;
4.177 + if (cs->def[def].tri != no)
4.178 + conf_warning("override: %s changes choice state", sym->name);
4.179 + cs->def[def].val = sym;
4.180 break;
4.181 }
4.182 - cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
4.183 + cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
4.184 }
4.185 }
4.186 fclose(in);
4.187 @@ -307,7 +312,7 @@
4.188
4.189 int conf_read(const char *name)
4.190 {
4.191 - struct symbol *sym;
4.192 + struct symbol *sym, *choice_sym;
4.193 struct property *prop;
4.194 struct expr *e;
4.195 int i, flags;
4.196 @@ -341,27 +346,42 @@
4.197 conf_unsaved++;
4.198 /* maybe print value in verbose mode... */
4.199 sym_ok:
4.200 + if (!sym_is_choice(sym))
4.201 + continue;
4.202 + /* The choice symbol only has a set value (and thus is not new)
4.203 + * if all its visible childs have values.
4.204 + */
4.205 + prop = sym_get_choice_prop(sym);
4.206 + flags = sym->flags;
4.207 + expr_list_for_each_sym(prop->expr, e, choice_sym)
4.208 + if (choice_sym->visible != no)
4.209 + flags &= choice_sym->flags;
4.210 + sym->flags &= flags | ~SYMBOL_DEF_USER;
4.211 + }
4.212 +
4.213 + for_all_symbols(i, sym) {
4.214 if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
4.215 - if (sym->visible == no)
4.216 + /* Reset values of generates values, so they'll appear
4.217 + * as new, if they should become visible, but that
4.218 + * doesn't quite work if the Kconfig and the saved
4.219 + * configuration disagree.
4.220 + */
4.221 + if (sym->visible == no && !conf_unsaved)
4.222 sym->flags &= ~SYMBOL_DEF_USER;
4.223 switch (sym->type) {
4.224 case S_STRING:
4.225 case S_INT:
4.226 case S_HEX:
4.227 - if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val))
4.228 - sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
4.229 + /* Reset a string value if it's out of range */
4.230 + if (sym_string_within_range(sym, sym->def[S_DEF_USER].val))
4.231 + break;
4.232 + sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
4.233 + conf_unsaved++;
4.234 + break;
4.235 default:
4.236 break;
4.237 }
4.238 }
4.239 - if (!sym_is_choice(sym))
4.240 - continue;
4.241 - prop = sym_get_choice_prop(sym);
4.242 - flags = sym->flags;
4.243 - for (e = prop->expr; e; e = e->left.expr)
4.244 - if (e->right.sym->visible != no)
4.245 - flags &= e->right.sym->flags;
4.246 - sym->flags &= flags | ~SYMBOL_DEF_USER;
4.247 }
4.248
4.249 sym_add_change_count(conf_warnings || conf_unsaved);
4.250 @@ -425,7 +445,7 @@
4.251
4.252 fprintf(out, _("#\n"
4.253 "# Automatically generated make config: don't edit\n"
4.254 - "# "PROJECT_NAME" version: %s\n"
4.255 + "# " PACKAGE " version: %s\n"
4.256 "%s%s"
4.257 "#\n"),
4.258 sym_get_string_value(sym),
4.259 @@ -673,13 +693,13 @@
4.260 time(&now);
4.261 fprintf(out, "#\n"
4.262 "# Automatically generated make config: don't edit\n"
4.263 - "# "PROJECT_NAME" version: %s\n"
4.264 + "# " PACKAGE " version: %s\n"
4.265 "# %s"
4.266 "#\n",
4.267 sym_get_string_value(sym), ctime(&now));
4.268 fprintf(out_h, "/*\n"
4.269 " * Automatically generated C config: don't edit\n"
4.270 - " * "PROJECT_NAME" version: %s\n"
4.271 + " * " PACKAGE " version: %s\n"
4.272 " * %s"
4.273 " */\n"
4.274 "#define AUTOCONF_INCLUDED\n",
4.275 @@ -788,3 +808,73 @@
4.276 {
4.277 conf_changed_callback = fn;
4.278 }
4.279 +
4.280 +
4.281 +void conf_set_all_new_symbols(enum conf_def_mode mode)
4.282 +{
4.283 + struct symbol *sym, *csym;
4.284 + struct property *prop;
4.285 + struct expr *e;
4.286 + int i, cnt, def;
4.287 +
4.288 + for_all_symbols(i, sym) {
4.289 + if (sym_has_value(sym))
4.290 + continue;
4.291 + switch (sym_get_type(sym)) {
4.292 + case S_BOOLEAN:
4.293 + case S_TRISTATE:
4.294 + switch (mode) {
4.295 + case def_yes:
4.296 + sym->def[S_DEF_USER].tri = yes;
4.297 + break;
4.298 + case def_mod:
4.299 + sym->def[S_DEF_USER].tri = mod;
4.300 + break;
4.301 + case def_no:
4.302 + sym->def[S_DEF_USER].tri = no;
4.303 + break;
4.304 + case def_random:
4.305 + sym->def[S_DEF_USER].tri = (tristate)(rand() % 3);
4.306 + break;
4.307 + default:
4.308 + continue;
4.309 + }
4.310 + if (!sym_is_choice(sym) || mode != def_random)
4.311 + sym->flags |= SYMBOL_DEF_USER;
4.312 + break;
4.313 + default:
4.314 + break;
4.315 + }
4.316 +
4.317 + }
4.318 +
4.319 + if (modules_sym)
4.320 + sym_calc_value(modules_sym);
4.321 +
4.322 + if (mode != def_random)
4.323 + return;
4.324 +
4.325 + for_all_symbols(i, csym) {
4.326 + if (sym_has_value(csym) || !sym_is_choice(csym))
4.327 + continue;
4.328 +
4.329 + sym_calc_value(csym);
4.330 + prop = sym_get_choice_prop(csym);
4.331 + def = -1;
4.332 + while (1) {
4.333 + cnt = 0;
4.334 + expr_list_for_each_sym(prop->expr, e, sym) {
4.335 + if (sym->visible == no)
4.336 + continue;
4.337 + if (def == cnt++) {
4.338 + csym->def[S_DEF_USER].val = sym;
4.339 + break;
4.340 + }
4.341 + }
4.342 + if (def >= 0 || cnt < 2)
4.343 + break;
4.344 + def = (rand() % cnt) + 1;
4.345 + }
4.346 + csym->flags |= SYMBOL_DEF_USER;
4.347 + }
4.348 +}
5.1 --- a/kconfig/expr.c Fri Oct 17 09:51:19 2008 +0000
5.2 +++ b/kconfig/expr.c Fri Oct 17 12:47:53 2008 +0000
5.3 @@ -87,7 +87,7 @@
5.4 break;
5.5 case E_AND:
5.6 case E_OR:
5.7 - case E_CHOICE:
5.8 + case E_LIST:
5.9 e->left.expr = expr_copy(org->left.expr);
5.10 e->right.expr = expr_copy(org->right.expr);
5.11 break;
5.12 @@ -217,7 +217,7 @@
5.13 expr_free(e2);
5.14 trans_count = old_count;
5.15 return res;
5.16 - case E_CHOICE:
5.17 + case E_LIST:
5.18 case E_RANGE:
5.19 case E_NONE:
5.20 /* panic */;
5.21 @@ -648,7 +648,7 @@
5.22 case E_EQUAL:
5.23 case E_UNEQUAL:
5.24 case E_SYMBOL:
5.25 - case E_CHOICE:
5.26 + case E_LIST:
5.27 break;
5.28 default:
5.29 e->left.expr = expr_transform(e->left.expr);
5.30 @@ -932,7 +932,7 @@
5.31 break;
5.32 case E_SYMBOL:
5.33 return expr_alloc_comp(type, e->left.sym, sym);
5.34 - case E_CHOICE:
5.35 + case E_LIST:
5.36 case E_RANGE:
5.37 case E_NONE:
5.38 /* panic */;
5.39 @@ -955,14 +955,14 @@
5.40 case E_AND:
5.41 val1 = expr_calc_value(e->left.expr);
5.42 val2 = expr_calc_value(e->right.expr);
5.43 - return E_AND(val1, val2);
5.44 + return EXPR_AND(val1, val2);
5.45 case E_OR:
5.46 val1 = expr_calc_value(e->left.expr);
5.47 val2 = expr_calc_value(e->right.expr);
5.48 - return E_OR(val1, val2);
5.49 + return EXPR_OR(val1, val2);
5.50 case E_NOT:
5.51 val1 = expr_calc_value(e->left.expr);
5.52 - return E_NOT(val1);
5.53 + return EXPR_NOT(val1);
5.54 case E_EQUAL:
5.55 sym_calc_value(e->left.sym);
5.56 sym_calc_value(e->right.sym);
5.57 @@ -1000,9 +1000,9 @@
5.58 if (t2 == E_OR)
5.59 return 1;
5.60 case E_OR:
5.61 - if (t2 == E_CHOICE)
5.62 + if (t2 == E_LIST)
5.63 return 1;
5.64 - case E_CHOICE:
5.65 + case E_LIST:
5.66 if (t2 == 0)
5.67 return 1;
5.68 default:
5.69 @@ -1034,12 +1034,18 @@
5.70 expr_print(e->left.expr, fn, data, E_NOT);
5.71 break;
5.72 case E_EQUAL:
5.73 - fn(data, e->left.sym, e->left.sym->name);
5.74 + if (e->left.sym->name)
5.75 + fn(data, e->left.sym, e->left.sym->name);
5.76 + else
5.77 + fn(data, NULL, "<choice>");
5.78 fn(data, NULL, "=");
5.79 fn(data, e->right.sym, e->right.sym->name);
5.80 break;
5.81 case E_UNEQUAL:
5.82 - fn(data, e->left.sym, e->left.sym->name);
5.83 + if (e->left.sym->name)
5.84 + fn(data, e->left.sym, e->left.sym->name);
5.85 + else
5.86 + fn(data, NULL, "<choice>");
5.87 fn(data, NULL, "!=");
5.88 fn(data, e->right.sym, e->right.sym->name);
5.89 break;
5.90 @@ -1053,11 +1059,11 @@
5.91 fn(data, NULL, " && ");
5.92 expr_print(e->right.expr, fn, data, E_AND);
5.93 break;
5.94 - case E_CHOICE:
5.95 + case E_LIST:
5.96 fn(data, e->right.sym, e->right.sym->name);
5.97 if (e->left.expr) {
5.98 fn(data, NULL, " ^ ");
5.99 - expr_print(e->left.expr, fn, data, E_CHOICE);
5.100 + expr_print(e->left.expr, fn, data, E_LIST);
5.101 }
5.102 break;
5.103 case E_RANGE:
6.1 --- a/kconfig/expr.h Fri Oct 17 09:51:19 2008 +0000
6.2 +++ b/kconfig/expr.h Fri Oct 17 12:47:53 2008 +0000
6.3 @@ -25,14 +25,13 @@
6.4
6.5 #define FILE_BUSY 0x0001
6.6 #define FILE_SCANNED 0x0002
6.7 -#define FILE_PRINTED 0x0004
6.8
6.9 typedef enum tristate {
6.10 no, mod, yes
6.11 } tristate;
6.12
6.13 enum expr_type {
6.14 - E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, E_RANGE
6.15 + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, E_RANGE
6.16 };
6.17
6.18 union expr_data {
6.19 @@ -45,9 +44,12 @@
6.20 union expr_data left, right;
6.21 };
6.22
6.23 -#define E_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2))
6.24 -#define E_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2))
6.25 -#define E_NOT(dep) (2-(dep))
6.26 +#define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2))
6.27 +#define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2))
6.28 +#define EXPR_NOT(dep) (2-(dep))
6.29 +
6.30 +#define expr_list_for_each_sym(l, e, s) \
6.31 + for (e = (l); e && (s = e->right.sym); e = e->left.expr)
6.32
6.33 struct expr_value {
6.34 struct expr *expr;
6.35 @@ -71,14 +73,12 @@
6.36 struct symbol {
6.37 struct symbol *next;
6.38 char *name;
6.39 - char *help;
6.40 enum symbol_type type;
6.41 struct symbol_value curr;
6.42 struct symbol_value def[4];
6.43 tristate visible;
6.44 int flags;
6.45 struct property *prop;
6.46 - struct expr *dep, *dep2;
6.47 struct expr_value rev_dep;
6.48 };
6.49
6.50 @@ -88,7 +88,6 @@
6.51 #define SYMBOL_CHECK 0x0008
6.52 #define SYMBOL_CHOICE 0x0010
6.53 #define SYMBOL_CHOICEVAL 0x0020
6.54 -#define SYMBOL_PRINTED 0x0040
6.55 #define SYMBOL_VALID 0x0080
6.56 #define SYMBOL_OPTIONAL 0x0100
6.57 #define SYMBOL_WRITE 0x0200
6.58 @@ -107,7 +106,8 @@
6.59 #define SYMBOL_HASHMASK 0xff
6.60
6.61 enum prop_type {
6.62 - P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE
6.63 + P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE,
6.64 + P_SELECT, P_RANGE, P_ENV
6.65 };
6.66
6.67 struct property {
6.68 @@ -139,7 +139,7 @@
6.69 struct property *prompt;
6.70 struct expr *dep;
6.71 unsigned int flags;
6.72 - //char *help;
6.73 + char *help;
6.74 struct file *file;
6.75 int lineno;
6.76 void *data;
7.1 --- a/kconfig/kconfig.mk Fri Oct 17 09:51:19 2008 +0000
7.2 +++ b/kconfig/kconfig.mk Fri Oct 17 12:47:53 2008 +0000
7.3 @@ -12,15 +12,6 @@
7.4 obj = kconfig
7.5 PHONY += clean help oldconfig menuconfig defoldconfig
7.6
7.7 -# Darwin (MacOS-X) does not have proper libintl support
7.8 -ifeq ($(shell uname -s),Darwin)
7.9 -KBUILD_NO_NLS:=1
7.10 -endif
7.11 -
7.12 -ifneq ($(KBUILD_NO_NLS),)
7.13 -CFLAGS += -DKBUILD_NO_NLS
7.14 -endif
7.15 -
7.16 #-----------------------------------------------------------
7.17 # List all config files, source and generated
7.18
7.19 @@ -212,9 +203,12 @@
7.20 # What is the compiler?
7.21 HOST_CC ?= gcc -funsigned-char
7.22
7.23 +# Compiler flags to use gettext
7.24 +EXTRA_CFLAGS += $(shell $(SHELL) $(CT_LIB_DIR)/kconfig/check-gettext.sh $(HOST_CC) $(CFLAGS))
7.25 +
7.26 # Compiler and linker flags to use ncurses
7.27 -CFLAGS += $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags)
7.28 -LDFLAGS += $(shell $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
7.29 +EXTRA_CFLAGS += $(shell $(SHELL) $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ccflags)
7.30 +EXTRA_LDFLAGS += $(shell $(SHELL) $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh -ldflags $(HOST_CC))
7.31
7.32 # Common source files, and lxdialog source files
7.33 SRC = kconfig/zconf.tab.c
7.34 @@ -241,7 +235,7 @@
7.35 mkdir -p $(obj)/lxdialog; \
7.36 fi
7.37 @$(ECHO) " DEP $@"
7.38 - $(SILENT)$(HOST_CC) $(CFLAGS) -MM $< |sed -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
7.39 + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |sed -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
7.40 -include $(DEPS)
7.41
7.42 # Each .o must depend on the corresponding .c (obvious, isn't it?),
7.43 @@ -259,15 +253,15 @@
7.44 mkdir -p $(obj)/lxdialog; \
7.45 fi
7.46 @$(ECHO) " CC $@"
7.47 - $(SILENT)$(HOST_CC) $(CFLAGS) -o $@ -c $<
7.48 + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
7.49
7.50 $(obj)/mconf: $(mconf_OBJ)
7.51 @$(ECHO) ' LD $@'
7.52 - $(SILENT)$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
7.53 + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^
7.54
7.55 $(obj)/conf: $(conf_OBJ)
7.56 @$(ECHO) ' LD $@'
7.57 - $(SILENT)$(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
7.58 + $(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^
7.59
7.60 #-----------------------------------------------------------
7.61 # Cleaning up the mess...
8.1 --- a/kconfig/lex.zconf.c Fri Oct 17 09:51:19 2008 +0000
8.2 +++ b/kconfig/lex.zconf.c Fri Oct 17 12:47:53 2008 +0000
8.3 @@ -5,10 +5,29 @@
8.4
8.5 /* A lexical scanner generated by flex */
8.6
8.7 +#define yy_create_buffer zconf_create_buffer
8.8 +#define yy_delete_buffer zconf_delete_buffer
8.9 +#define yy_flex_debug zconf_flex_debug
8.10 +#define yy_init_buffer zconf_init_buffer
8.11 +#define yy_flush_buffer zconf_flush_buffer
8.12 +#define yy_load_buffer_state zconf_load_buffer_state
8.13 +#define yy_switch_to_buffer zconf_switch_to_buffer
8.14 +#define yyin zconfin
8.15 +#define yyleng zconfleng
8.16 +#define yylex zconflex
8.17 +#define yylineno zconflineno
8.18 +#define yyout zconfout
8.19 +#define yyrestart zconfrestart
8.20 +#define yytext zconftext
8.21 +#define yywrap zconfwrap
8.22 +#define yyalloc zconfalloc
8.23 +#define yyrealloc zconfrealloc
8.24 +#define yyfree zconffree
8.25 +
8.26 #define FLEX_SCANNER
8.27 #define YY_FLEX_MAJOR_VERSION 2
8.28 #define YY_FLEX_MINOR_VERSION 5
8.29 -#define YY_FLEX_SUBMINOR_VERSION 33
8.30 +#define YY_FLEX_SUBMINOR_VERSION 35
8.31 #if YY_FLEX_SUBMINOR_VERSION > 0
8.32 #define FLEX_BETA
8.33 #endif
8.34 @@ -30,10 +49,10 @@
8.35
8.36 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
8.37
8.38 -#if __STDC_VERSION__ >= 199901L
8.39 +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
8.40
8.41 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
8.42 - * if you want the limit (max/min) macros for int types.
8.43 + * if you want the limit (max/min) macros for int types.
8.44 */
8.45 #ifndef __STDC_LIMIT_MACROS
8.46 #define __STDC_LIMIT_MACROS 1
8.47 @@ -53,7 +72,6 @@
8.48 typedef unsigned char flex_uint8_t;
8.49 typedef unsigned short int flex_uint16_t;
8.50 typedef unsigned int flex_uint32_t;
8.51 -#endif /* ! C99 */
8.52
8.53 /* Limits of integral types. */
8.54 #ifndef INT8_MIN
8.55 @@ -84,6 +102,8 @@
8.56 #define UINT32_MAX (4294967295U)
8.57 #endif
8.58
8.59 +#endif /* ! C99 */
8.60 +
8.61 #endif /* ! FLEXINT_H */
8.62
8.63 #ifdef __cplusplus
8.64 @@ -93,11 +113,12 @@
8.65
8.66 #else /* ! __cplusplus */
8.67
8.68 -#if __STDC__
8.69 +/* C99 requires __STDC__ to be defined as 1. */
8.70 +#if defined (__STDC__)
8.71
8.72 #define YY_USE_CONST
8.73
8.74 -#endif /* __STDC__ */
8.75 +#endif /* defined (__STDC__) */
8.76 #endif /* ! __cplusplus */
8.77
8.78 #ifdef YY_USE_CONST
8.79 @@ -177,14 +198,9 @@
8.80
8.81 #define unput(c) yyunput( c, (yytext_ptr) )
8.82
8.83 -/* The following is because we cannot portably get our hands on size_t
8.84 - * (without autoconf's help, which isn't available because we want
8.85 - * flex-generated scanners to compile on their own).
8.86 - */
8.87 -
8.88 #ifndef YY_TYPEDEF_YY_SIZE_T
8.89 #define YY_TYPEDEF_YY_SIZE_T
8.90 -typedef unsigned int yy_size_t;
8.91 +typedef size_t yy_size_t;
8.92 #endif
8.93
8.94 #ifndef YY_STRUCT_YY_BUFFER_STATE
8.95 @@ -335,7 +351,7 @@
8.96
8.97 /* Begin user sect3 */
8.98
8.99 -#define zconfwrap() 1
8.100 +#define zconfwrap(n) 1
8.101 #define YY_SKIP_YYWRAP
8.102
8.103 typedef unsigned char YY_CHAR;
8.104 @@ -748,6 +764,7 @@
8.105 #define YY_MORE_ADJ 0
8.106 #define YY_RESTORE_YY_MORE_OFFSET
8.107 char *zconftext;
8.108 +#define YY_NO_INPUT 1
8.109
8.110 /*
8.111 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
8.112 @@ -834,6 +851,35 @@
8.113
8.114 static int yy_init_globals (void );
8.115
8.116 +/* Accessor methods to globals.
8.117 + These are made visible to non-reentrant scanners for convenience. */
8.118 +
8.119 +int zconflex_destroy (void );
8.120 +
8.121 +int zconfget_debug (void );
8.122 +
8.123 +void zconfset_debug (int debug_flag );
8.124 +
8.125 +YY_EXTRA_TYPE zconfget_extra (void );
8.126 +
8.127 +void zconfset_extra (YY_EXTRA_TYPE user_defined );
8.128 +
8.129 +FILE *zconfget_in (void );
8.130 +
8.131 +void zconfset_in (FILE * in_str );
8.132 +
8.133 +FILE *zconfget_out (void );
8.134 +
8.135 +void zconfset_out (FILE * out_str );
8.136 +
8.137 +int zconfget_leng (void );
8.138 +
8.139 +char *zconfget_text (void );
8.140 +
8.141 +int zconfget_lineno (void );
8.142 +
8.143 +void zconfset_lineno (int line_number );
8.144 +
8.145 /* Macros after this point can all be overridden by user definitions in
8.146 * section 1.
8.147 */
8.148 @@ -876,7 +922,7 @@
8.149 /* This used to be an fputs(), but since the string might contain NUL's,
8.150 * we now use fwrite().
8.151 */
8.152 -#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
8.153 +#define ECHO fwrite( zconftext, zconfleng, 1, zconfout )
8.154 #endif
8.155
8.156 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
8.157 @@ -1256,6 +1302,11 @@
8.158 case 32:
8.159 YY_RULE_SETUP
8.160 {
8.161 + while (zconfleng) {
8.162 + if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
8.163 + break;
8.164 + zconfleng--;
8.165 + }
8.166 append_string(zconftext, zconfleng);
8.167 if (!first_ts)
8.168 first_ts = last_ts;
8.169 @@ -1511,7 +1562,7 @@
8.170
8.171 /* Read in more data. */
8.172 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
8.173 - (yy_n_chars), num_to_read );
8.174 + (yy_n_chars), (size_t) num_to_read );
8.175
8.176 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
8.177 }
8.178 @@ -1535,6 +1586,14 @@
8.179 else
8.180 ret_val = EOB_ACT_CONTINUE_SCAN;
8.181
8.182 + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
8.183 + /* Extend the array by 50%, plus the number we really need. */
8.184 + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
8.185 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
8.186 + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
8.187 + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
8.188 + }
8.189 +
8.190 (yy_n_chars) += number_to_move;
8.191 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
8.192 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
8.193 @@ -1921,7 +1980,9 @@
8.194 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
8.195 (num_to_alloc * sizeof(struct yy_buffer_state*)
8.196 );
8.197 -
8.198 + if ( ! (yy_buffer_stack) )
8.199 + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
8.200 +
8.201 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
8.202
8.203 (yy_buffer_stack_max) = num_to_alloc;
8.204 @@ -1939,6 +2000,8 @@
8.205 ((yy_buffer_stack),
8.206 num_to_alloc * sizeof(struct yy_buffer_state*)
8.207 );
8.208 + if ( ! (yy_buffer_stack) )
8.209 + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
8.210
8.211 /* zero only the new slots.*/
8.212 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
8.213 @@ -2264,7 +2327,7 @@
8.214 FILE *f;
8.215
8.216 f = fopen(name, "r");
8.217 - if (!f && name[0] != '/') {
8.218 + if (!f && name != NULL && name[0] != '/') {
8.219 env = getenv(SRCTREE);
8.220 if (env) {
8.221 sprintf(fullname, "%s/%s", env, name);
9.1 --- a/kconfig/lkc.h Fri Oct 17 09:51:19 2008 +0000
9.2 +++ b/kconfig/lkc.h Fri Oct 17 12:47:53 2008 +0000
9.3 @@ -11,9 +11,9 @@
9.4 #ifndef KBUILD_NO_NLS
9.5 # include <libintl.h>
9.6 #else
9.7 -# define gettext(Msgid) ((const char *) (Msgid))
9.8 -# define textdomain(Domainname) ((const char *) (Domainname))
9.9 -# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
9.10 +static inline const char *gettext(const char *txt) { return txt; }
9.11 +static inline void textdomain(const char *domainname) {}
9.12 +static inline void bindtextdomain(const char *name, const char *dir) {}
9.13 #endif
9.14
9.15 #ifdef __cplusplus
9.16 @@ -31,7 +31,6 @@
9.17
9.18 #define SRCTREE "srctree"
9.19
9.20 -#define PROJECT_NAME "crosstool-NG"
9.21 #define PACKAGE "crosstool-NG"
9.22 #define LOCALEDIR "/usr/share/locale"
9.23
9.24 @@ -43,8 +42,17 @@
9.25 #define TF_PARAM 0x0002
9.26 #define TF_OPTION 0x0004
9.27
9.28 +enum conf_def_mode {
9.29 + def_default,
9.30 + def_yes,
9.31 + def_mod,
9.32 + def_no,
9.33 + def_random
9.34 +};
9.35 +
9.36 #define T_OPT_MODULES 1
9.37 #define T_OPT_DEFCONFIG_LIST 2
9.38 +#define T_OPT_ENV 3
9.39
9.40 struct kconf_id {
9.41 int name;
9.42 @@ -65,15 +73,18 @@
9.43 char *zconf_curname(void);
9.44
9.45 /* confdata.c */
9.46 +const char *conf_get_configname(void);
9.47 char *conf_get_default_confname(void);
9.48 void sym_set_change_count(int count);
9.49 void sym_add_change_count(int count);
9.50 +void conf_set_all_new_symbols(enum conf_def_mode mode);
9.51
9.52 /* kconfig_load.c */
9.53 void kconfig_load(void);
9.54
9.55 /* menu.c */
9.56 void menu_init(void);
9.57 +void menu_warn(struct menu *menu, const char *fmt, ...);
9.58 struct menu *menu_add_menu(void);
9.59 void menu_end_menu(void);
9.60 void menu_add_entry(struct symbol *sym);
9.61 @@ -103,6 +114,8 @@
9.62 const char *str_get(struct gstr *gs);
9.63
9.64 /* symbol.c */
9.65 +extern struct expr *sym_env_list;
9.66 +
9.67 void sym_init(void);
9.68 void sym_clear_all_valid(void);
9.69 void sym_set_all_changed(void);
9.70 @@ -110,6 +123,7 @@
9.71 struct symbol *sym_check_deps(struct symbol *sym);
9.72 struct property *prop_alloc(enum prop_type type, struct symbol *sym);
9.73 struct symbol *prop_get_symbol(struct property *prop);
9.74 +struct property *sym_get_env_prop(struct symbol *sym);
9.75
9.76 static inline tristate sym_get_tristate_value(struct symbol *sym)
9.77 {
10.1 --- a/kconfig/lkc_proto.h Fri Oct 17 09:51:19 2008 +0000
10.2 +++ b/kconfig/lkc_proto.h Fri Oct 17 12:47:53 2008 +0000
10.3 @@ -15,11 +15,13 @@
10.4 P(menu_get_prompt,const char *,(struct menu *menu));
10.5 P(menu_get_root_menu,struct menu *,(struct menu *menu));
10.6 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
10.7 +P(menu_has_help,bool,(struct menu *menu));
10.8 +P(menu_get_help,const char *,(struct menu *menu));
10.9
10.10 /* symbol.c */
10.11 P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
10.12
10.13 -P(sym_lookup,struct symbol *,(const char *name, int isconst));
10.14 +P(sym_lookup,struct symbol *,(const char *name, int flags));
10.15 P(sym_find,struct symbol *,(const char *name));
10.16 P(sym_re_search,struct symbol **,(const char *pattern));
10.17 P(sym_type_name,const char *,(enum symbol_type type));
11.1 --- a/kconfig/lxdialog/checklist.c Fri Oct 17 09:51:19 2008 +0000
11.2 +++ b/kconfig/lxdialog/checklist.c Fri Oct 17 12:47:53 2008 +0000
11.3 @@ -97,8 +97,8 @@
11.4 int x = width / 2 - 11;
11.5 int y = height - 2;
11.6
11.7 - print_button(dialog, "Select", y, x, selected == 0);
11.8 - print_button(dialog, " Help ", y, x + 14, selected == 1);
11.9 + print_button(dialog, gettext("Select"), y, x, selected == 0);
11.10 + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
11.11
11.12 wmove(dialog, y, x + 1 + 14 * selected);
11.13 wrefresh(dialog);
12.1 --- a/kconfig/lxdialog/dialog.h Fri Oct 17 09:51:19 2008 +0000
12.2 +++ b/kconfig/lxdialog/dialog.h Fri Oct 17 12:47:53 2008 +0000
12.3 @@ -26,6 +26,12 @@
12.4 #include <string.h>
12.5 #include <stdbool.h>
12.6
12.7 +#ifndef KBUILD_NO_NLS
12.8 +# include <libintl.h>
12.9 +#else
12.10 +# define gettext(Msgid) ((const char *) (Msgid))
12.11 +#endif
12.12 +
12.13 #ifdef __sun__
12.14 #define CURS_MACROS
12.15 #endif
12.16 @@ -187,9 +193,9 @@
12.17 int on_key_esc(WINDOW *win);
12.18 int on_key_resize(void);
12.19
12.20 -void init_dialog(const char *backtitle);
12.21 -void reset_dialog(void);
12.22 -void end_dialog(void);
12.23 +int init_dialog(const char *backtitle);
12.24 +void set_dialog_backtitle(const char *backtitle);
12.25 +void end_dialog(int x, int y);
12.26 void attr_clear(WINDOW * win, int height, int width, chtype attr);
12.27 void dialog_clear(void);
12.28 void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x);
13.1 --- a/kconfig/lxdialog/inputbox.c Fri Oct 17 09:51:19 2008 +0000
13.2 +++ b/kconfig/lxdialog/inputbox.c Fri Oct 17 12:47:53 2008 +0000
13.3 @@ -31,8 +31,8 @@
13.4 int x = width / 2 - 11;
13.5 int y = height - 2;
13.6
13.7 - print_button(dialog, " Ok ", y, x, selected == 0);
13.8 - print_button(dialog, " Help ", y, x + 14, selected == 1);
13.9 + print_button(dialog, gettext(" Ok "), y, x, selected == 0);
13.10 + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
13.11
13.12 wmove(dialog, y, x + 1 + 14 * selected);
13.13 wrefresh(dialog);
13.14 @@ -89,7 +89,7 @@
13.15 box_y = y + 2;
13.16 box_x = (width - box_width) / 2;
13.17 draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
13.18 - dlg.border.atr, dlg.dialog.atr);
13.19 + dlg.dialog.atr, dlg.border.atr);
13.20
13.21 print_buttons(dialog, height, width, 0);
13.22
14.1 --- a/kconfig/lxdialog/menubox.c Fri Oct 17 09:51:19 2008 +0000
14.2 +++ b/kconfig/lxdialog/menubox.c Fri Oct 17 12:47:53 2008 +0000
14.3 @@ -157,9 +157,9 @@
14.4 int x = width / 2 - 16;
14.5 int y = height - 2;
14.6
14.7 - print_button(win, "Select", y, x, selected == 0);
14.8 - print_button(win, " Exit ", y, x + 12, selected == 1);
14.9 - print_button(win, " Help ", y, x + 24, selected == 2);
14.10 + print_button(win, gettext("Select"), y, x, selected == 0);
14.11 + print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
14.12 + print_button(win, gettext(" Help "), y, x + 24, selected == 2);
14.13
14.14 wmove(win, y, x + 1 + 12 * selected);
14.15 wrefresh(win);
15.1 --- a/kconfig/lxdialog/textbox.c Fri Oct 17 09:51:19 2008 +0000
15.2 +++ b/kconfig/lxdialog/textbox.c Fri Oct 17 12:47:53 2008 +0000
15.3 @@ -114,7 +114,7 @@
15.4
15.5 print_title(dialog, title, width);
15.6
15.7 - print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
15.8 + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE);
15.9 wnoutrefresh(dialog);
15.10 getyx(dialog, cur_y, cur_x); /* Save cursor position */
15.11
16.1 --- a/kconfig/lxdialog/util.c Fri Oct 17 09:51:19 2008 +0000
16.2 +++ b/kconfig/lxdialog/util.c Fri Oct 17 12:47:53 2008 +0000
16.3 @@ -221,16 +221,14 @@
16.4 */
16.5 static void color_setup(const char *theme)
16.6 {
16.7 - if (set_theme(theme)) {
16.8 - if (has_colors()) { /* Terminal supports color? */
16.9 - start_color();
16.10 - init_dialog_colors();
16.11 - }
16.12 - }
16.13 - else
16.14 - {
16.15 + int use_color;
16.16 +
16.17 + use_color = set_theme(theme);
16.18 + if (use_color && has_colors()) {
16.19 + start_color();
16.20 + init_dialog_colors();
16.21 + } else
16.22 set_mono_theme();
16.23 - }
16.24 }
16.25
16.26 /*
16.27 @@ -268,26 +266,41 @@
16.28 /*
16.29 * Do some initialization for dialog
16.30 */
16.31 -void init_dialog(const char *backtitle)
16.32 +int init_dialog(const char *backtitle)
16.33 {
16.34 + int height, width;
16.35 +
16.36 + initscr(); /* Init curses */
16.37 + getmaxyx(stdscr, height, width);
16.38 + if (height < 19 || width < 80) {
16.39 + endwin();
16.40 + return -ERRDISPLAYTOOSMALL;
16.41 + }
16.42 +
16.43 dlg.backtitle = backtitle;
16.44 color_setup(getenv("MENUCONFIG_COLOR"));
16.45 -}
16.46
16.47 -void reset_dialog(void)
16.48 -{
16.49 - initscr(); /* Init curses */
16.50 keypad(stdscr, TRUE);
16.51 cbreak();
16.52 noecho();
16.53 dialog_clear();
16.54 +
16.55 + return 0;
16.56 +}
16.57 +
16.58 +void set_dialog_backtitle(const char *backtitle)
16.59 +{
16.60 + dlg.backtitle = backtitle;
16.61 }
16.62
16.63 /*
16.64 * End using dialog functions.
16.65 */
16.66 -void end_dialog(void)
16.67 +void end_dialog(int x, int y)
16.68 {
16.69 + /* move cursor back to original position */
16.70 + move(y, x);
16.71 + refresh();
16.72 endwin();
16.73 }
16.74
16.75 @@ -338,7 +351,7 @@
16.76 newl = 1;
16.77 word = tempstr;
16.78 while (word && *word) {
16.79 - sp = index(word, ' ');
16.80 + sp = strchr(word, ' ');
16.81 if (sp)
16.82 *sp++ = 0;
16.83
16.84 @@ -350,7 +363,7 @@
16.85 if (wlen > room ||
16.86 (newl && wlen < 4 && sp
16.87 && wlen + 1 + strlen(sp) > room
16.88 - && (!(sp2 = index(sp, ' '))
16.89 + && (!(sp2 = strchr(sp, ' '))
16.90 || wlen + 1 + (sp2 - sp) > room))) {
16.91 cur_y++;
16.92 cur_x = x;
17.1 --- a/kconfig/lxdialog/yesno.c Fri Oct 17 09:51:19 2008 +0000
17.2 +++ b/kconfig/lxdialog/yesno.c Fri Oct 17 12:47:53 2008 +0000
17.3 @@ -29,8 +29,8 @@
17.4 int x = width / 2 - 10;
17.5 int y = height - 2;
17.6
17.7 - print_button(dialog, " Yes ", y, x, selected == 0);
17.8 - print_button(dialog, " No ", y, x + 13, selected == 1);
17.9 + print_button(dialog, gettext(" Yes "), y, x, selected == 0);
17.10 + print_button(dialog, gettext(" No "), y, x + 13, selected == 1);
17.11
17.12 wmove(dialog, y, x + 1 + 13 * selected);
17.13 wrefresh(dialog);
18.1 --- a/kconfig/mconf.c Fri Oct 17 09:51:19 2008 +0000
18.2 +++ b/kconfig/mconf.c Fri Oct 17 12:47:53 2008 +0000
18.3 @@ -8,17 +8,13 @@
18.4 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br>
18.5 */
18.6
18.7 -#include <sys/ioctl.h>
18.8 -#include <sys/wait.h>
18.9 #include <ctype.h>
18.10 #include <errno.h>
18.11 #include <fcntl.h>
18.12 #include <limits.h>
18.13 -#include <signal.h>
18.14 #include <stdarg.h>
18.15 #include <stdlib.h>
18.16 #include <string.h>
18.17 -#include <termios.h>
18.18 #include <unistd.h>
18.19 #include <locale.h>
18.20
18.21 @@ -26,7 +22,6 @@
18.22 #include "lkc.h"
18.23 #include "lxdialog/dialog.h"
18.24
18.25 -static char menu_backtitle[128];
18.26 static const char mconf_readme[] = N_(
18.27 "Overview\n"
18.28 "--------\n"
18.29 @@ -36,9 +31,13 @@
18.30 "kernel parameters which are not really features, but must be\n"
18.31 "entered in as decimal or hexadecimal numbers or possibly text.\n"
18.32 "\n"
18.33 -"Menu items beginning with [*], <M> or [ ] represent features\n"
18.34 -"configured to be built in, modularized or removed respectively.\n"
18.35 -"Pointed brackets <> represent module capable features.\n"
18.36 +"Menu items beginning with following braces represent features that\n"
18.37 +" [ ] can be built in or removed\n"
18.38 +" < > can be built in, modularized or removed\n"
18.39 +" { } can be built in or modularized (selected by other feature)\n"
18.40 +" - - are selected by other feature,\n"
18.41 +"while *, M or whitespace inside braces means to build in, build as\n"
18.42 +"a module or to exclude the feature respectively.\n"
18.43 "\n"
18.44 "To change any of these features, highlight it with the cursor\n"
18.45 "keys and press <Y> to build it in, <M> to make it a module or\n"
18.46 @@ -271,10 +270,7 @@
18.47 " USB$ => find all CT_ symbols ending with USB\n"
18.48 "\n");
18.49
18.50 -static char filename[PATH_MAX+1] = ".config";
18.51 static int indent;
18.52 -static struct termios ios_org;
18.53 -static int rows = 0, cols = 0;
18.54 static struct menu *current_menu;
18.55 static int child_count;
18.56 static int single_menu_mode;
18.57 @@ -288,51 +284,16 @@
18.58 static void show_helptext(const char *title, const char *text);
18.59 static void show_help(struct menu *menu);
18.60
18.61 -static void init_wsize(void)
18.62 -{
18.63 - struct winsize ws;
18.64 - char *env;
18.65 -
18.66 - if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws)) {
18.67 - rows = ws.ws_row;
18.68 - cols = ws.ws_col;
18.69 - }
18.70 -
18.71 - if (!rows) {
18.72 - env = getenv("LINES");
18.73 - if (env)
18.74 - rows = atoi(env);
18.75 - if (!rows)
18.76 - rows = 24;
18.77 - }
18.78 - if (!cols) {
18.79 - env = getenv("COLUMNS");
18.80 - if (env)
18.81 - cols = atoi(env);
18.82 - if (!cols)
18.83 - cols = 80;
18.84 - }
18.85 -
18.86 - if (rows < 19 || cols < 80) {
18.87 - fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
18.88 - fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
18.89 - exit(1);
18.90 - }
18.91 -
18.92 - rows -= 4;
18.93 - cols -= 5;
18.94 -}
18.95 -
18.96 static void get_prompt_str(struct gstr *r, struct property *prop)
18.97 {
18.98 int i, j;
18.99 struct menu *submenu[8], *menu;
18.100
18.101 - str_printf(r, "Prompt: %s\n", prop->text);
18.102 - str_printf(r, " Defined at %s:%d\n", prop->menu->file->name,
18.103 + str_printf(r, _("Prompt: %s\n"), _(prop->text));
18.104 + str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
18.105 prop->menu->lineno);
18.106 if (!expr_is_yes(prop->visible.expr)) {
18.107 - str_append(r, " Depends on: ");
18.108 + str_append(r, _(" Depends on: "));
18.109 expr_gstr_print(prop->visible.expr, r);
18.110 str_append(r, "\n");
18.111 }
18.112 @@ -340,13 +301,13 @@
18.113 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent)
18.114 submenu[i++] = menu;
18.115 if (i > 0) {
18.116 - str_printf(r, " Location:\n");
18.117 + str_printf(r, _(" Location:\n"));
18.118 for (j = 4; --i >= 0; j += 2) {
18.119 menu = submenu[i];
18.120 - str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu));
18.121 + str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu)));
18.122 if (menu->sym) {
18.123 str_printf(r, " (%s [=%s])", menu->sym->name ?
18.124 - menu->sym->name : "<choice>",
18.125 + menu->sym->name : _("<choice>"),
18.126 sym_get_string_value(menu->sym));
18.127 }
18.128 str_append(r, "\n");
18.129 @@ -359,8 +320,9 @@
18.130 bool hit;
18.131 struct property *prop;
18.132
18.133 - str_printf(r, "Symbol: %s [=%s]\n", sym->name,
18.134 - sym_get_string_value(sym));
18.135 + if (sym && sym->name)
18.136 + str_printf(r, "Symbol: %s [=%s]\n", sym->name,
18.137 + sym_get_string_value(sym));
18.138 for_all_prompts(sym, prop)
18.139 get_prompt_str(r, prop);
18.140 hit = false;
18.141 @@ -375,7 +337,7 @@
18.142 if (hit)
18.143 str_append(r, "\n");
18.144 if (sym->rev_dep.expr) {
18.145 - str_append(r, " Selected by: ");
18.146 + str_append(r, _(" Selected by: "));
18.147 expr_gstr_print(sym->rev_dep.expr, r);
18.148 str_append(r, "\n");
18.149 }
18.150 @@ -391,19 +353,43 @@
18.151 for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
18.152 get_symbol_str(&res, sym);
18.153 if (!i)
18.154 - str_append(&res, "No matches found.\n");
18.155 + str_append(&res, _("No matches found.\n"));
18.156 return res;
18.157 }
18.158
18.159 +static char filename[PATH_MAX+1];
18.160 +static void set_config_filename(const char *config_filename)
18.161 +{
18.162 + static char menu_backtitle[PATH_MAX+128];
18.163 + int size;
18.164 + struct symbol *sym;
18.165 +
18.166 + sym = sym_lookup("PROJECTVERSION", 0);
18.167 + sym_calc_value(sym);
18.168 + size = snprintf(menu_backtitle, sizeof(menu_backtitle),
18.169 + _(PACKAGE " v%s Configuration - %s"),
18.170 + sym_get_string_value(sym), config_filename);
18.171 + if (size >= sizeof(menu_backtitle))
18.172 + menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
18.173 + set_dialog_backtitle(menu_backtitle);
18.174 +
18.175 + size = snprintf(filename, sizeof(filename), "%s", config_filename);
18.176 + if (size >= sizeof(filename))
18.177 + filename[sizeof(filename)-1] = '\0';
18.178 +}
18.179 +
18.180 +
18.181 static void search_conf(void)
18.182 {
18.183 struct symbol **sym_arr;
18.184 struct gstr res;
18.185 + char *dialog_input;
18.186 int dres;
18.187 again:
18.188 dialog_clear();
18.189 dres = dialog_inputbox(_("Search Configuration Parameter"),
18.190 - _("Enter CT_ (sub)string to search for (omit CT_)"),
18.191 + _("Enter CT_ (sub)string to search for "
18.192 + "(with or without \"CT\")"),
18.193 10, 75, "");
18.194 switch (dres) {
18.195 case 0:
18.196 @@ -415,7 +401,12 @@
18.197 return;
18.198 }
18.199
18.200 - sym_arr = sym_re_search(dialog_input_result);
18.201 + /* strip CT_ if necessary */
18.202 + dialog_input = dialog_input_result;
18.203 + if (strncasecmp(dialog_input_result, "CT_", 3) == 0)
18.204 + dialog_input += 7;
18.205 +
18.206 + sym_arr = sym_re_search(dialog_input);
18.207 res = get_relations_str(sym_arr);
18.208 free(sym_arr);
18.209 show_textbox(_("Search Results"), str_get(&res), 0, 0);
18.210 @@ -442,6 +433,7 @@
18.211 switch (prop->type) {
18.212 case P_MENU:
18.213 child_count++;
18.214 + prompt = _(prompt);
18.215 if (single_menu_mode) {
18.216 item_make("%s%*c%s",
18.217 menu->data ? "-->" : "++>",
18.218 @@ -454,10 +446,18 @@
18.219 if (single_menu_mode && menu->data)
18.220 goto conf_childs;
18.221 return;
18.222 + case P_COMMENT:
18.223 + if (prompt) {
18.224 + child_count++;
18.225 + item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt));
18.226 + item_set_tag(':');
18.227 + item_set_data(menu);
18.228 + }
18.229 + break;
18.230 default:
18.231 if (prompt) {
18.232 child_count++;
18.233 - item_make("---%*c%s", indent + 1, ' ', prompt);
18.234 + item_make("---%*c%s", indent + 1, ' ', _(prompt));
18.235 item_set_tag(':');
18.236 item_set_data(menu);
18.237 }
18.238 @@ -501,10 +501,10 @@
18.239 item_set_data(menu);
18.240 }
18.241
18.242 - item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu));
18.243 + item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));
18.244 if (val == yes) {
18.245 if (def_menu) {
18.246 - item_add_str(" (%s)", menu_get_prompt(def_menu));
18.247 + item_add_str(" (%s)", _(menu_get_prompt(def_menu)));
18.248 item_add_str(" --->");
18.249 if (def_menu->list) {
18.250 indent += 2;
18.251 @@ -516,7 +516,7 @@
18.252 }
18.253 } else {
18.254 if (menu == current_menu) {
18.255 - item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
18.256 + item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));
18.257 item_set_tag(':');
18.258 item_set_data(menu);
18.259 goto conf_childs;
18.260 @@ -533,7 +533,7 @@
18.261 if (sym_is_changable(sym))
18.262 item_make("[%c]", val == no ? ' ' : '*');
18.263 else
18.264 - item_make("---");
18.265 + item_make("-%c-", val == no ? ' ' : '*');
18.266 item_set_tag('t');
18.267 item_set_data(menu);
18.268 break;
18.269 @@ -543,10 +543,13 @@
18.270 case mod: ch = 'M'; break;
18.271 default: ch = ' '; break;
18.272 }
18.273 - if (sym_is_changable(sym))
18.274 - item_make("<%c>", ch);
18.275 - else
18.276 - item_make("---");
18.277 + if (sym_is_changable(sym)) {
18.278 + if (sym->rev_dep.tri == mod)
18.279 + item_make("{%c}", ch);
18.280 + else
18.281 + item_make("<%c>", ch);
18.282 + } else
18.283 + item_make("-%c-", ch);
18.284 item_set_tag('t');
18.285 item_set_data(menu);
18.286 break;
18.287 @@ -556,17 +559,17 @@
18.288 tmp = indent - tmp + 4;
18.289 if (tmp < 0)
18.290 tmp = 0;
18.291 - item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
18.292 + item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)),
18.293 (sym_has_value(sym) || !sym_is_changable(sym)) ?
18.294 - "" : " (NEW)");
18.295 + "" : _(" (NEW)"));
18.296 item_set_tag('s');
18.297 item_set_data(menu);
18.298 goto conf_childs;
18.299 }
18.300 }
18.301 - item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
18.302 + item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)),
18.303 (sym_has_value(sym) || !sym_is_changable(sym)) ?
18.304 - "" : " (NEW)");
18.305 + "" : _(" (NEW)"));
18.306 if (menu->prompt->type == P_MENU) {
18.307 item_add_str(" --->");
18.308 return;
18.309 @@ -604,7 +607,7 @@
18.310 item_set_tag('S');
18.311 }
18.312 dialog_clear();
18.313 - res = dialog_menu(prompt ? prompt : _("Main Menu"),
18.314 + res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
18.315 _(menu_instructions),
18.316 active_menu, &s_scroll);
18.317 if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
18.318 @@ -651,7 +654,7 @@
18.319 if (sym)
18.320 show_help(submenu);
18.321 else
18.322 - show_helptext("README", _(mconf_readme));
18.323 + show_helptext(_("README"), _(mconf_readme));
18.324 break;
18.325 case 3:
18.326 if (item_is_tag('t')) {
18.327 @@ -698,24 +701,24 @@
18.328 struct gstr help = str_new();
18.329 struct symbol *sym = menu->sym;
18.330
18.331 - if (sym->help)
18.332 + if (menu_has_help(menu))
18.333 {
18.334 if (sym->name) {
18.335 str_printf(&help, "CT_%s:\n\n", sym->name);
18.336 - str_append(&help, _(sym->help));
18.337 + str_append(&help, _(menu_get_help(menu)));
18.338 str_append(&help, "\n");
18.339 }
18.340 } else {
18.341 str_append(&help, nohelp_text);
18.342 }
18.343 get_symbol_str(&help, sym);
18.344 - show_helptext(menu_get_prompt(menu), str_get(&help));
18.345 + show_helptext(_(menu_get_prompt(menu)), str_get(&help));
18.346 str_free(&help);
18.347 }
18.348
18.349 static void conf_choice(struct menu *menu)
18.350 {
18.351 - const char *prompt = menu_get_prompt(menu);
18.352 + const char *prompt = _(menu_get_prompt(menu));
18.353 struct menu *child;
18.354 struct symbol *active;
18.355
18.356 @@ -729,7 +732,7 @@
18.357 for (child = menu->list; child; child = child->next) {
18.358 if (!menu_is_visible(child))
18.359 continue;
18.360 - item_make("%s", menu_get_prompt(child));
18.361 + item_make("%s", _(menu_get_prompt(child)));
18.362 item_set_data(child);
18.363 if (child->sym == active)
18.364 item_set_selected(1);
18.365 @@ -737,7 +740,7 @@
18.366 item_set_tag('X');
18.367 }
18.368 dialog_clear();
18.369 - res = dialog_checklist(prompt ? prompt : _("Main Menu"),
18.370 + res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"),
18.371 _(radiolist_instructions),
18.372 15, 70, 6);
18.373 selected = item_activate_selected();
18.374 @@ -770,7 +773,7 @@
18.375
18.376 while (1) {
18.377 int res;
18.378 - char *heading;
18.379 + const char *heading;
18.380
18.381 switch (sym_get_type(menu->sym)) {
18.382 case S_INT:
18.383 @@ -783,10 +786,10 @@
18.384 heading = _(inputbox_instructions_string);
18.385 break;
18.386 default:
18.387 - heading = "Internal mconf error!";
18.388 + heading = _("Internal mconf error!");
18.389 }
18.390 dialog_clear();
18.391 - res = dialog_inputbox(prompt ? prompt : _("Main Menu"),
18.392 + res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"),
18.393 heading, 10, 75,
18.394 sym_get_string_value(menu->sym));
18.395 switch (res) {
18.396 @@ -816,8 +819,11 @@
18.397 case 0:
18.398 if (!dialog_input_result[0])
18.399 return;
18.400 - if (!conf_read(dialog_input_result))
18.401 + if (!conf_read(dialog_input_result)) {
18.402 + set_config_filename(dialog_input_result);
18.403 + sym_set_change_count(1);
18.404 return;
18.405 + }
18.406 show_textbox(NULL, _("File does not exist!"), 5, 38);
18.407 break;
18.408 case 1:
18.409 @@ -840,8 +846,10 @@
18.410 case 0:
18.411 if (!dialog_input_result[0])
18.412 return;
18.413 - if (!conf_write(dialog_input_result))
18.414 + if (!conf_write(dialog_input_result)) {
18.415 + set_config_filename(dialog_input_result);
18.416 return;
18.417 + }
18.418 show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60);
18.419 break;
18.420 case 1:
18.421 @@ -853,14 +861,9 @@
18.422 }
18.423 }
18.424
18.425 -static void conf_cleanup(void)
18.426 -{
18.427 - tcsetattr(1, TCSAFLUSH, &ios_org);
18.428 -}
18.429 -
18.430 int main(int ac, char **av)
18.431 {
18.432 - struct symbol *sym;
18.433 + int saved_x, saved_y;
18.434 char *mode;
18.435 int res;
18.436
18.437 @@ -871,49 +874,49 @@
18.438 conf_parse(av[1]);
18.439 conf_read(NULL);
18.440
18.441 - sym = sym_lookup("PROJECTVERSION", 0);
18.442 - sym_calc_value(sym);
18.443 - sprintf(menu_backtitle, _(PROJECT_NAME" v%s Configuration"),
18.444 - sym_get_string_value(sym));
18.445 -
18.446 mode = getenv("MENUCONFIG_MODE");
18.447 if (mode) {
18.448 if (!strcasecmp(mode, "single_menu"))
18.449 single_menu_mode = 1;
18.450 }
18.451
18.452 - tcgetattr(1, &ios_org);
18.453 - atexit(conf_cleanup);
18.454 - init_wsize();
18.455 - reset_dialog();
18.456 - init_dialog(menu_backtitle);
18.457 + getyx(stdscr, saved_y, saved_x);
18.458 + if (init_dialog(NULL)) {
18.459 + fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
18.460 + fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
18.461 + return 1;
18.462 + }
18.463 +
18.464 + set_config_filename(conf_get_configname());
18.465 do {
18.466 conf(&rootmenu);
18.467 dialog_clear();
18.468 if (conf_get_changed())
18.469 res = dialog_yesno(NULL,
18.470 _("Do you wish to save your "
18.471 - "new "PROJECT_NAME" configuration?\n"
18.472 + "new " PACKAGE " configuration?\n"
18.473 "<ESC><ESC> to continue."),
18.474 6, 60);
18.475 else
18.476 res = -1;
18.477 } while (res == KEY_ESC);
18.478 - end_dialog();
18.479 + end_dialog(saved_x, saved_y);
18.480
18.481 switch (res) {
18.482 case 0:
18.483 - if (conf_write(NULL)) {
18.484 - fprintf(stderr,
18.485 - _( "Error during writing of "PROJECT_NAME" configuration.\n"
18.486 - "Your configuration changes were NOT saved.\n"));
18.487 + if (conf_write(filename)) {
18.488 + fprintf(stderr, _("\n\n"
18.489 + "Error during writing of " PACKAGE " configuration.\n"
18.490 + "Your " PACKAGE " configuration changes were NOT saved."
18.491 + "\n\n"));
18.492 return 1;
18.493 }
18.494 case -1:
18.495 break;
18.496 default:
18.497 - fprintf(stderr, _( "Your configuration changes were NOT saved.\n"));
18.498 + fprintf(stderr, _("Your configuration changes were NOT saved.\n"));
18.499 }
18.500
18.501 return 0;
18.502 }
18.503 +
19.1 --- a/kconfig/menu.c Fri Oct 17 09:51:19 2008 +0000
19.2 +++ b/kconfig/menu.c Fri Oct 17 12:47:53 2008 +0000
19.3 @@ -15,7 +15,7 @@
19.4 struct file *file_list;
19.5 struct file *current_file;
19.6
19.7 -static void menu_warn(struct menu *menu, const char *fmt, ...)
19.8 +void menu_warn(struct menu *menu, const char *fmt, ...)
19.9 {
19.10 va_list ap;
19.11 va_start(ap, fmt);
19.12 @@ -172,6 +172,9 @@
19.13 else if (sym_defconfig_list != current_entry->sym)
19.14 zconf_error("trying to redefine defconfig symbol");
19.15 break;
19.16 + case T_OPT_ENV:
19.17 + prop_add_env(arg);
19.18 + break;
19.19 }
19.20 }
19.21
19.22 @@ -200,12 +203,9 @@
19.23 prop_warn(prop,
19.24 "config symbol '%s' uses select, but is "
19.25 "not boolean or tristate", sym->name);
19.26 - else if (sym2->type == S_UNKNOWN)
19.27 - prop_warn(prop,
19.28 - "'select' used by config symbol '%s' "
19.29 - "refer to undefined symbol '%s'",
19.30 - sym->name, sym2->name);
19.31 - else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
19.32 + else if (sym2->type != S_UNKNOWN &&
19.33 + sym2->type != S_BOOLEAN &&
19.34 + sym2->type != S_TRISTATE)
19.35 prop_warn(prop,
19.36 "'%s' has wrong type. 'select' only "
19.37 "accept arguments of boolean and "
19.38 @@ -235,15 +235,21 @@
19.39 sym = parent->sym;
19.40 if (parent->list) {
19.41 if (sym && sym_is_choice(sym)) {
19.42 - /* find the first choice value and find out choice type */
19.43 + if (sym->type == S_UNKNOWN) {
19.44 + /* find the first choice value to find out choice type */
19.45 + current_entry = parent;
19.46 + for (menu = parent->list; menu; menu = menu->next) {
19.47 + if (menu->sym && menu->sym->type != S_UNKNOWN) {
19.48 + menu_set_type(menu->sym->type);
19.49 + break;
19.50 + }
19.51 + }
19.52 + }
19.53 + /* set the type of the remaining choice values */
19.54 for (menu = parent->list; menu; menu = menu->next) {
19.55 - if (menu->sym) {
19.56 - current_entry = parent;
19.57 - menu_set_type(menu->sym->type);
19.58 - current_entry = menu;
19.59 + current_entry = menu;
19.60 + if (menu->sym && menu->sym->type == S_UNKNOWN)
19.61 menu_set_type(sym->type);
19.62 - break;
19.63 - }
19.64 }
19.65 parentdep = expr_alloc_symbol(sym);
19.66 } else if (parent->prompt)
19.67 @@ -311,27 +317,43 @@
19.68 }
19.69 }
19.70 for (menu = parent->list; menu; menu = menu->next) {
19.71 - if (sym && sym_is_choice(sym) && menu->sym) {
19.72 + if (sym && sym_is_choice(sym) &&
19.73 + menu->sym && !sym_is_choice_value(menu->sym)) {
19.74 + current_entry = menu;
19.75 menu->sym->flags |= SYMBOL_CHOICEVAL;
19.76 if (!menu->prompt)
19.77 menu_warn(menu, "choice value must have a prompt");
19.78 for (prop = menu->sym->prop; prop; prop = prop->next) {
19.79 - if (prop->type == P_PROMPT && prop->menu != menu) {
19.80 - prop_warn(prop, "choice values "
19.81 - "currently only support a "
19.82 - "single prompt");
19.83 - }
19.84 if (prop->type == P_DEFAULT)
19.85 prop_warn(prop, "defaults for choice "
19.86 - "values not supported");
19.87 + "values not supported");
19.88 + if (prop->menu == menu)
19.89 + continue;
19.90 + if (prop->type == P_PROMPT &&
19.91 + prop->menu->parent->sym != sym)
19.92 + prop_warn(prop, "choice value used outside its choice group");
19.93 }
19.94 - current_entry = menu;
19.95 - menu_set_type(sym->type);
19.96 + /* Non-tristate choice values of tristate choices must
19.97 + * depend on the choice being set to Y. The choice
19.98 + * values' dependencies were propagated to their
19.99 + * properties above, so the change here must be re-
19.100 + * propagated.
19.101 + */
19.102 + if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
19.103 + basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
19.104 + menu->dep = expr_alloc_and(basedep, menu->dep);
19.105 + for (prop = menu->sym->prop; prop; prop = prop->next) {
19.106 + if (prop->menu != menu)
19.107 + continue;
19.108 + prop->visible.expr = expr_alloc_and(expr_copy(basedep),
19.109 + prop->visible.expr);
19.110 + }
19.111 + }
19.112 menu_add_symbol(P_CHOICE, sym, NULL);
19.113 prop = sym_get_choice_prop(sym);
19.114 for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
19.115 ;
19.116 - *ep = expr_alloc_one(E_CHOICE, NULL);
19.117 + *ep = expr_alloc_one(E_LIST, NULL);
19.118 (*ep)->right.sym = menu->sym;
19.119 }
19.120 if (menu->list && (!menu->prompt || !menu->prompt->text)) {
19.121 @@ -394,9 +416,9 @@
19.122 const char *menu_get_prompt(struct menu *menu)
19.123 {
19.124 if (menu->prompt)
19.125 - return _(menu->prompt->text);
19.126 + return menu->prompt->text;
19.127 else if (menu->sym)
19.128 - return _(menu->sym->name);
19.129 + return menu->sym->name;
19.130 return NULL;
19.131 }
19.132
19.133 @@ -417,3 +439,15 @@
19.134 return menu;
19.135 }
19.136
19.137 +bool menu_has_help(struct menu *menu)
19.138 +{
19.139 + return menu->help != NULL;
19.140 +}
19.141 +
19.142 +const char *menu_get_help(struct menu *menu)
19.143 +{
19.144 + if (menu->help)
19.145 + return menu->help;
19.146 + else
19.147 + return "";
19.148 +}
20.1 --- a/kconfig/symbol.c Fri Oct 17 09:51:19 2008 +0000
20.2 +++ b/kconfig/symbol.c Fri Oct 17 12:47:53 2008 +0000
20.3 @@ -34,19 +34,21 @@
20.4 struct symbol *modules_sym;
20.5 tristate modules_val;
20.6
20.7 +struct expr *sym_env_list;
20.8 +
20.9 void sym_add_default(struct symbol *sym, const char *def)
20.10 {
20.11 struct property *prop = prop_alloc(P_DEFAULT, sym);
20.12
20.13 - prop->expr = expr_alloc_symbol(sym_lookup(def, 1));
20.14 + prop->expr = expr_alloc_symbol(sym_lookup(def, SYMBOL_CONST));
20.15 }
20.16
20.17 void sym_init(void)
20.18 {
20.19 struct symbol *sym;
20.20 struct utsname uts;
20.21 - char *p;
20.22 static bool inited = false;
20.23 + char* p;
20.24
20.25 if (inited)
20.26 return;
20.27 @@ -54,12 +56,10 @@
20.28
20.29 uname(&uts);
20.30
20.31 - sym = sym_lookup("ARCH", 0);
20.32 + sym = sym_lookup("UNAME_RELEASE", 0);
20.33 sym->type = S_STRING;
20.34 sym->flags |= SYMBOL_AUTO;
20.35 - p = getenv("ARCH");
20.36 - if (p)
20.37 - sym_add_default(sym, p);
20.38 + sym_add_default(sym, uts.release);
20.39
20.40 sym = sym_lookup("PROJECTVERSION", 0);
20.41 sym->type = S_STRING;
20.42 @@ -67,11 +67,6 @@
20.43 p = getenv("PROJECTVERSION");
20.44 if (p)
20.45 sym_add_default(sym, p);
20.46 -
20.47 - sym = sym_lookup("UNAME_RELEASE", 0);
20.48 - sym->type = S_STRING;
20.49 - sym->flags |= SYMBOL_AUTO;
20.50 - sym_add_default(sym, uts.release);
20.51 }
20.52
20.53 enum symbol_type sym_get_type(struct symbol *sym)
20.54 @@ -117,6 +112,15 @@
20.55 return NULL;
20.56 }
20.57
20.58 +struct property *sym_get_env_prop(struct symbol *sym)
20.59 +{
20.60 + struct property *prop;
20.61 +
20.62 + for_all_properties(sym, prop, P_ENV)
20.63 + return prop;
20.64 + return NULL;
20.65 +}
20.66 +
20.67 struct property *sym_get_default_prop(struct symbol *sym)
20.68 {
20.69 struct property *prop;
20.70 @@ -199,7 +203,7 @@
20.71 tri = no;
20.72 for_all_prompts(sym, prop) {
20.73 prop->visible.tri = expr_calc_value(prop->visible.expr);
20.74 - tri = E_OR(tri, prop->visible.tri);
20.75 + tri = EXPR_OR(tri, prop->visible.tri);
20.76 }
20.77 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
20.78 tri = yes;
20.79 @@ -247,8 +251,7 @@
20.80
20.81 /* just get the first visible value */
20.82 prop = sym_get_choice_prop(sym);
20.83 - for (e = prop->expr; e; e = e->left.expr) {
20.84 - def_sym = e->right.sym;
20.85 + expr_list_for_each_sym(prop->expr, e, def_sym) {
20.86 sym_calc_visibility(def_sym);
20.87 if (def_sym->visible != no)
20.88 return def_sym;
20.89 @@ -303,22 +306,30 @@
20.90 if (sym_is_choice_value(sym) && sym->visible == yes) {
20.91 prop = sym_get_choice_prop(sym);
20.92 newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no;
20.93 - } else if (E_OR(sym->visible, sym->rev_dep.tri) != no) {
20.94 - sym->flags |= SYMBOL_WRITE;
20.95 - if (sym_has_value(sym))
20.96 - newval.tri = sym->def[S_DEF_USER].tri;
20.97 - else if (!sym_is_choice(sym)) {
20.98 + } else {
20.99 + if (sym->visible != no) {
20.100 + /* if the symbol is visible use the user value
20.101 + * if available, otherwise try the default value
20.102 + */
20.103 + sym->flags |= SYMBOL_WRITE;
20.104 + if (sym_has_value(sym)) {
20.105 + newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri,
20.106 + sym->visible);
20.107 + goto calc_newval;
20.108 + }
20.109 + }
20.110 + if (sym->rev_dep.tri != no)
20.111 + sym->flags |= SYMBOL_WRITE;
20.112 + if (!sym_is_choice(sym)) {
20.113 prop = sym_get_default_prop(sym);
20.114 - if (prop)
20.115 - newval.tri = expr_calc_value(prop->expr);
20.116 + if (prop) {
20.117 + sym->flags |= SYMBOL_WRITE;
20.118 + newval.tri = EXPR_AND(expr_calc_value(prop->expr),
20.119 + prop->visible.tri);
20.120 + }
20.121 }
20.122 - newval.tri = E_OR(E_AND(newval.tri, sym->visible), sym->rev_dep.tri);
20.123 - } else if (!sym_is_choice(sym)) {
20.124 - prop = sym_get_default_prop(sym);
20.125 - if (prop) {
20.126 - sym->flags |= SYMBOL_WRITE;
20.127 - newval.tri = expr_calc_value(prop->expr);
20.128 - }
20.129 + calc_newval:
20.130 + newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
20.131 }
20.132 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
20.133 newval.tri = yes;
20.134 @@ -361,14 +372,19 @@
20.135 }
20.136
20.137 if (sym_is_choice(sym)) {
20.138 + struct symbol *choice_sym;
20.139 int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
20.140 +
20.141 prop = sym_get_choice_prop(sym);
20.142 - for (e = prop->expr; e; e = e->left.expr) {
20.143 - e->right.sym->flags |= flags;
20.144 + expr_list_for_each_sym(prop->expr, e, choice_sym) {
20.145 + choice_sym->flags |= flags;
20.146 if (flags & SYMBOL_CHANGED)
20.147 - sym_set_changed(e->right.sym);
20.148 + sym_set_changed(choice_sym);
20.149 }
20.150 }
20.151 +
20.152 + if (sym->flags & SYMBOL_AUTO)
20.153 + sym->flags &= ~SYMBOL_WRITE;
20.154 }
20.155
20.156 void sym_clear_all_valid(void)
20.157 @@ -643,7 +659,7 @@
20.158 return sym->visible > sym->rev_dep.tri;
20.159 }
20.160
20.161 -struct symbol *sym_lookup(const char *name, int isconst)
20.162 +struct symbol *sym_lookup(const char *name, int flags)
20.163 {
20.164 struct symbol *symbol;
20.165 const char *ptr;
20.166 @@ -663,11 +679,10 @@
20.167 hash &= 0xff;
20.168
20.169 for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
20.170 - if (!strcmp(symbol->name, name)) {
20.171 - if ((isconst && symbol->flags & SYMBOL_CONST) ||
20.172 - (!isconst && !(symbol->flags & SYMBOL_CONST)))
20.173 - return symbol;
20.174 - }
20.175 + if (!strcmp(symbol->name, name) &&
20.176 + (flags ? symbol->flags & flags
20.177 + : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
20.178 + return symbol;
20.179 }
20.180 new_name = strdup(name);
20.181 } else {
20.182 @@ -679,8 +694,7 @@
20.183 memset(symbol, 0, sizeof(*symbol));
20.184 symbol->name = new_name;
20.185 symbol->type = S_UNKNOWN;
20.186 - if (isconst)
20.187 - symbol->flags |= SYMBOL_CONST;
20.188 + symbol->flags |= flags;
20.189
20.190 symbol->next = symbol_hash[hash];
20.191 symbol_hash[hash] = symbol;
20.192 @@ -754,8 +768,6 @@
20.193 }
20.194
20.195
20.196 -struct symbol *sym_check_deps(struct symbol *sym);
20.197 -
20.198 static struct symbol *sym_check_expr_deps(struct expr *e)
20.199 {
20.200 struct symbol *sym;
20.201 @@ -786,44 +798,101 @@
20.202 return NULL;
20.203 }
20.204
20.205 +/* return NULL when dependencies are OK */
20.206 +static struct symbol *sym_check_sym_deps(struct symbol *sym)
20.207 +{
20.208 + struct symbol *sym2;
20.209 + struct property *prop;
20.210 +
20.211 + sym2 = sym_check_expr_deps(sym->rev_dep.expr);
20.212 + if (sym2)
20.213 + return sym2;
20.214 +
20.215 + for (prop = sym->prop; prop; prop = prop->next) {
20.216 + if (prop->type == P_CHOICE || prop->type == P_SELECT)
20.217 + continue;
20.218 + sym2 = sym_check_expr_deps(prop->visible.expr);
20.219 + if (sym2)
20.220 + break;
20.221 + if (prop->type != P_DEFAULT || sym_is_choice(sym))
20.222 + continue;
20.223 + sym2 = sym_check_expr_deps(prop->expr);
20.224 + if (sym2)
20.225 + break;
20.226 + }
20.227 +
20.228 + return sym2;
20.229 +}
20.230 +
20.231 +static struct symbol *sym_check_choice_deps(struct symbol *choice)
20.232 +{
20.233 + struct symbol *sym, *sym2;
20.234 + struct property *prop;
20.235 + struct expr *e;
20.236 +
20.237 + prop = sym_get_choice_prop(choice);
20.238 + expr_list_for_each_sym(prop->expr, e, sym)
20.239 + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
20.240 +
20.241 + choice->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
20.242 + sym2 = sym_check_sym_deps(choice);
20.243 + choice->flags &= ~SYMBOL_CHECK;
20.244 + if (sym2)
20.245 + goto out;
20.246 +
20.247 + expr_list_for_each_sym(prop->expr, e, sym) {
20.248 + sym2 = sym_check_sym_deps(sym);
20.249 + if (sym2) {
20.250 + fprintf(stderr, " -> %s", sym->name);
20.251 + break;
20.252 + }
20.253 + }
20.254 +out:
20.255 + expr_list_for_each_sym(prop->expr, e, sym)
20.256 + sym->flags &= ~SYMBOL_CHECK;
20.257 +
20.258 + if (sym2 && sym_is_choice_value(sym2) &&
20.259 + prop_get_symbol(sym_get_choice_prop(sym2)) == choice)
20.260 + sym2 = choice;
20.261 +
20.262 + return sym2;
20.263 +}
20.264 +
20.265 struct symbol *sym_check_deps(struct symbol *sym)
20.266 {
20.267 struct symbol *sym2;
20.268 struct property *prop;
20.269
20.270 if (sym->flags & SYMBOL_CHECK) {
20.271 - printf("Warning! Found recursive dependency: %s", sym->name);
20.272 + fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
20.273 + sym->prop->file->name, sym->prop->lineno,
20.274 + sym->name ? sym->name : "<choice>");
20.275 return sym;
20.276 }
20.277 if (sym->flags & SYMBOL_CHECKED)
20.278 return NULL;
20.279
20.280 - sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
20.281 - sym2 = sym_check_expr_deps(sym->rev_dep.expr);
20.282 - if (sym2)
20.283 - goto out;
20.284 + if (sym_is_choice_value(sym)) {
20.285 + /* for choice groups start the check with main choice symbol */
20.286 + prop = sym_get_choice_prop(sym);
20.287 + sym2 = sym_check_deps(prop_get_symbol(prop));
20.288 + } else if (sym_is_choice(sym)) {
20.289 + sym2 = sym_check_choice_deps(sym);
20.290 + } else {
20.291 + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
20.292 + sym2 = sym_check_sym_deps(sym);
20.293 + sym->flags &= ~SYMBOL_CHECK;
20.294 + }
20.295
20.296 - for (prop = sym->prop; prop; prop = prop->next) {
20.297 - if (prop->type == P_CHOICE || prop->type == P_SELECT)
20.298 - continue;
20.299 - sym2 = sym_check_expr_deps(prop->visible.expr);
20.300 - if (sym2)
20.301 - goto out;
20.302 - if (prop->type != P_DEFAULT || sym_is_choice(sym))
20.303 - continue;
20.304 - sym2 = sym_check_expr_deps(prop->expr);
20.305 - if (sym2)
20.306 - goto out;
20.307 - }
20.308 -out:
20.309 if (sym2) {
20.310 - printf(" %s", sym->name);
20.311 + fprintf(stderr, " -> %s", sym->name ? sym->name : "<choice>");
20.312 if (sym2 == sym) {
20.313 - printf("\n");
20.314 + fprintf(stderr, "\n");
20.315 + zconfnerrs++;
20.316 sym2 = NULL;
20.317 }
20.318 }
20.319 - sym->flags &= ~SYMBOL_CHECK;
20.320 +
20.321 return sym2;
20.322 }
20.323
20.324 @@ -852,7 +921,7 @@
20.325 struct symbol *prop_get_symbol(struct property *prop)
20.326 {
20.327 if (prop->expr && (prop->expr->type == E_SYMBOL ||
20.328 - prop->expr->type == E_CHOICE))
20.329 + prop->expr->type == E_LIST))
20.330 return prop->expr->left.sym;
20.331 return NULL;
20.332 }
20.333 @@ -862,6 +931,8 @@
20.334 switch (type) {
20.335 case P_PROMPT:
20.336 return "prompt";
20.337 + case P_ENV:
20.338 + return "env";
20.339 case P_COMMENT:
20.340 return "comment";
20.341 case P_MENU:
20.342 @@ -879,3 +950,32 @@
20.343 }
20.344 return "unknown";
20.345 }
20.346 +
20.347 +void prop_add_env(const char *env)
20.348 +{
20.349 + struct symbol *sym, *sym2;
20.350 + struct property *prop;
20.351 + char *p;
20.352 +
20.353 + sym = current_entry->sym;
20.354 + sym->flags |= SYMBOL_AUTO;
20.355 + for_all_properties(sym, prop, P_ENV) {
20.356 + sym2 = prop_get_symbol(prop);
20.357 + if (strcmp(sym2->name, env))
20.358 + menu_warn(current_entry, "redefining environment symbol from %s",
20.359 + sym2->name);
20.360 + return;
20.361 + }
20.362 +
20.363 + prop = prop_alloc(P_ENV, sym);
20.364 + prop->expr = expr_alloc_symbol(sym_lookup(env, SYMBOL_CONST));
20.365 +
20.366 + sym_env_list = expr_alloc_one(E_LIST, sym_env_list);
20.367 + sym_env_list->right.sym = sym;
20.368 +
20.369 + p = getenv(env);
20.370 + if (p)
20.371 + sym_add_default(sym, p);
20.372 + else
20.373 + menu_warn(current_entry, "environment variable %s undefined", env);
20.374 +}
21.1 --- a/kconfig/util.c Fri Oct 17 09:51:19 2008 +0000
21.2 +++ b/kconfig/util.c Fri Oct 17 12:47:53 2008 +0000
21.3 @@ -29,6 +29,8 @@
21.4 /* write a dependency file as used by kbuild to track dependencies */
21.5 int file_write_dep(const char *name)
21.6 {
21.7 + struct symbol *sym, *env_sym;
21.8 + struct expr *e;
21.9 struct file *file;
21.10 FILE *out;
21.11
21.12 @@ -45,8 +47,25 @@
21.13 fprintf(out, "\t%s\n", file->name);
21.14 }
21.15 fprintf(out, "\ninclude/config/auto.conf: \\\n"
21.16 - "\t$(deps_config)\n\n"
21.17 - "$(deps_config): ;\n");
21.18 + "\t$(deps_config)\n\n");
21.19 +
21.20 + expr_list_for_each_sym(sym_env_list, e, sym) {
21.21 + struct property *prop;
21.22 + const char *value;
21.23 +
21.24 + prop = sym_get_env_prop(sym);
21.25 + env_sym = prop_get_symbol(prop);
21.26 + if (!env_sym)
21.27 + continue;
21.28 + value = getenv(env_sym->name);
21.29 + if (!value)
21.30 + value = "";
21.31 + fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
21.32 + fprintf(out, "include/config/auto.conf: FORCE\n");
21.33 + fprintf(out, "endif\n");
21.34 + }
21.35 +
21.36 + fprintf(out, "\n$(deps_config): ;\n");
21.37 fclose(out);
21.38 rename("..config.tmp", name);
21.39 return 0;
21.40 @@ -58,7 +77,7 @@
21.41 {
21.42 struct gstr gs;
21.43 gs.s = malloc(sizeof(char) * 64);
21.44 - gs.len = 16;
21.45 + gs.len = 64;
21.46 strcpy(gs.s, "\0");
21.47 return gs;
21.48 }
21.49 @@ -84,12 +103,15 @@
21.50 /* Append to growable string */
21.51 void str_append(struct gstr *gs, const char *s)
21.52 {
21.53 - size_t l = strlen(gs->s) + strlen(s) + 1;
21.54 - if (l > gs->len) {
21.55 - gs->s = realloc(gs->s, l);
21.56 - gs->len = l;
21.57 + size_t l;
21.58 + if (s) {
21.59 + l = strlen(gs->s) + strlen(s) + 1;
21.60 + if (l > gs->len) {
21.61 + gs->s = realloc(gs->s, l);
21.62 + gs->len = l;
21.63 + }
21.64 + strcat(gs->s, s);
21.65 }
21.66 - strcat(gs->s, s);
21.67 }
21.68
21.69 /* Append printf formatted string to growable string */
22.1 --- a/kconfig/zconf.hash.c Fri Oct 17 09:51:19 2008 +0000
22.2 +++ b/kconfig/zconf.hash.c Fri Oct 17 12:47:53 2008 +0000
22.3 @@ -1,4 +1,4 @@
22.4 -/* ANSI-C code produced by gperf version 3.0.1 */
22.5 +/* ANSI-C code produced by gperf version 3.0.3 */
22.6 /* Command-line: gperf */
22.7 /* Computed positions: -k'1,3' */
22.8
22.9 @@ -30,7 +30,7 @@
22.10 #endif
22.11
22.12 struct kconf_id;
22.13 -/* maximum key range = 45, duplicates = 0 */
22.14 +/* maximum key range = 47, duplicates = 0 */
22.15
22.16 #ifdef __GNUC__
22.17 __inline
22.18 @@ -44,32 +44,32 @@
22.19 {
22.20 static unsigned char asso_values[] =
22.21 {
22.22 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.23 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.24 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.25 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.26 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.27 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.28 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.29 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.30 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.31 - 47, 47, 47, 47, 47, 47, 47, 25, 30, 15,
22.32 - 0, 15, 0, 47, 5, 15, 47, 47, 30, 20,
22.33 - 5, 0, 25, 15, 0, 0, 10, 35, 47, 47,
22.34 - 5, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.35 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.36 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.37 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.38 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.39 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.40 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.41 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.42 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.43 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.44 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.45 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.46 - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
22.47 - 47, 47, 47, 47, 47, 47
22.48 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.49 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.50 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.51 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.52 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.53 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.54 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.55 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.56 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.57 + 49, 49, 49, 49, 49, 49, 49, 49, 11, 5,
22.58 + 0, 0, 5, 49, 5, 20, 49, 49, 5, 20,
22.59 + 5, 0, 30, 49, 0, 15, 0, 10, 0, 49,
22.60 + 25, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.61 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.62 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.63 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.64 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.65 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.66 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.67 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.68 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.69 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.70 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.71 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.72 + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
22.73 + 49, 49, 49, 49, 49, 49
22.74 };
22.75 register int hval = len;
22.76
22.77 @@ -89,136 +89,131 @@
22.78 struct kconf_id_strings_t
22.79 {
22.80 char kconf_id_strings_str2[sizeof("on")];
22.81 - char kconf_id_strings_str6[sizeof("string")];
22.82 - char kconf_id_strings_str7[sizeof("default")];
22.83 - char kconf_id_strings_str8[sizeof("def_bool")];
22.84 + char kconf_id_strings_str3[sizeof("env")];
22.85 + char kconf_id_strings_str5[sizeof("endif")];
22.86 + char kconf_id_strings_str6[sizeof("option")];
22.87 + char kconf_id_strings_str7[sizeof("endmenu")];
22.88 + char kconf_id_strings_str8[sizeof("optional")];
22.89 + char kconf_id_strings_str9[sizeof("endchoice")];
22.90 char kconf_id_strings_str10[sizeof("range")];
22.91 - char kconf_id_strings_str11[sizeof("def_boolean")];
22.92 - char kconf_id_strings_str12[sizeof("def_tristate")];
22.93 - char kconf_id_strings_str13[sizeof("hex")];
22.94 - char kconf_id_strings_str14[sizeof("defconfig_list")];
22.95 - char kconf_id_strings_str16[sizeof("option")];
22.96 - char kconf_id_strings_str17[sizeof("if")];
22.97 - char kconf_id_strings_str18[sizeof("optional")];
22.98 - char kconf_id_strings_str20[sizeof("endif")];
22.99 - char kconf_id_strings_str21[sizeof("choice")];
22.100 - char kconf_id_strings_str22[sizeof("endmenu")];
22.101 - char kconf_id_strings_str23[sizeof("requires")];
22.102 - char kconf_id_strings_str24[sizeof("endchoice")];
22.103 - char kconf_id_strings_str26[sizeof("config")];
22.104 + char kconf_id_strings_str11[sizeof("choice")];
22.105 + char kconf_id_strings_str12[sizeof("default")];
22.106 + char kconf_id_strings_str13[sizeof("def_bool")];
22.107 + char kconf_id_strings_str14[sizeof("help")];
22.108 + char kconf_id_strings_str15[sizeof("bool")];
22.109 + char kconf_id_strings_str16[sizeof("config")];
22.110 + char kconf_id_strings_str17[sizeof("def_tristate")];
22.111 + char kconf_id_strings_str18[sizeof("boolean")];
22.112 + char kconf_id_strings_str19[sizeof("defconfig_list")];
22.113 + char kconf_id_strings_str21[sizeof("string")];
22.114 + char kconf_id_strings_str22[sizeof("if")];
22.115 + char kconf_id_strings_str23[sizeof("int")];
22.116 + char kconf_id_strings_str26[sizeof("select")];
22.117 char kconf_id_strings_str27[sizeof("modules")];
22.118 - char kconf_id_strings_str28[sizeof("int")];
22.119 + char kconf_id_strings_str28[sizeof("tristate")];
22.120 char kconf_id_strings_str29[sizeof("menu")];
22.121 - char kconf_id_strings_str31[sizeof("prompt")];
22.122 - char kconf_id_strings_str32[sizeof("depends")];
22.123 - char kconf_id_strings_str33[sizeof("tristate")];
22.124 - char kconf_id_strings_str34[sizeof("bool")];
22.125 + char kconf_id_strings_str31[sizeof("source")];
22.126 + char kconf_id_strings_str32[sizeof("comment")];
22.127 + char kconf_id_strings_str33[sizeof("hex")];
22.128 char kconf_id_strings_str35[sizeof("menuconfig")];
22.129 - char kconf_id_strings_str36[sizeof("select")];
22.130 - char kconf_id_strings_str37[sizeof("boolean")];
22.131 - char kconf_id_strings_str39[sizeof("help")];
22.132 - char kconf_id_strings_str41[sizeof("source")];
22.133 - char kconf_id_strings_str42[sizeof("comment")];
22.134 - char kconf_id_strings_str43[sizeof("mainmenu")];
22.135 - char kconf_id_strings_str46[sizeof("enable")];
22.136 + char kconf_id_strings_str36[sizeof("prompt")];
22.137 + char kconf_id_strings_str37[sizeof("depends")];
22.138 + char kconf_id_strings_str48[sizeof("mainmenu")];
22.139 };
22.140 static struct kconf_id_strings_t kconf_id_strings_contents =
22.141 {
22.142 "on",
22.143 - "string",
22.144 + "env",
22.145 + "endif",
22.146 + "option",
22.147 + "endmenu",
22.148 + "optional",
22.149 + "endchoice",
22.150 + "range",
22.151 + "choice",
22.152 "default",
22.153 "def_bool",
22.154 - "range",
22.155 - "def_boolean",
22.156 + "help",
22.157 + "bool",
22.158 + "config",
22.159 "def_tristate",
22.160 + "boolean",
22.161 + "defconfig_list",
22.162 + "string",
22.163 + "if",
22.164 + "int",
22.165 + "select",
22.166 + "modules",
22.167 + "tristate",
22.168 + "menu",
22.169 + "source",
22.170 + "comment",
22.171 "hex",
22.172 - "defconfig_list",
22.173 - "option",
22.174 - "if",
22.175 - "optional",
22.176 - "endif",
22.177 - "choice",
22.178 - "endmenu",
22.179 - "requires",
22.180 - "endchoice",
22.181 - "config",
22.182 - "modules",
22.183 - "int",
22.184 - "menu",
22.185 + "menuconfig",
22.186 "prompt",
22.187 "depends",
22.188 - "tristate",
22.189 - "bool",
22.190 - "menuconfig",
22.191 - "select",
22.192 - "boolean",
22.193 - "help",
22.194 - "source",
22.195 - "comment",
22.196 - "mainmenu",
22.197 - "enable"
22.198 + "mainmenu"
22.199 };
22.200 #define kconf_id_strings ((const char *) &kconf_id_strings_contents)
22.201 #ifdef __GNUC__
22.202 __inline
22.203 +#ifdef __GNUC_STDC_INLINE__
22.204 +__attribute__ ((__gnu_inline__))
22.205 +#endif
22.206 #endif
22.207 struct kconf_id *
22.208 kconf_id_lookup (register const char *str, register unsigned int len)
22.209 {
22.210 enum
22.211 {
22.212 - TOTAL_KEYWORDS = 33,
22.213 + TOTAL_KEYWORDS = 31,
22.214 MIN_WORD_LENGTH = 2,
22.215 MAX_WORD_LENGTH = 14,
22.216 MIN_HASH_VALUE = 2,
22.217 - MAX_HASH_VALUE = 46
22.218 + MAX_HASH_VALUE = 48
22.219 };
22.220
22.221 static struct kconf_id wordlist[] =
22.222 {
22.223 {-1}, {-1},
22.224 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM},
22.225 - {-1}, {-1}, {-1},
22.226 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_TYPE, TF_COMMAND, S_STRING},
22.227 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
22.228 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
22.229 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION},
22.230 {-1},
22.231 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND},
22.232 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND},
22.233 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND},
22.234 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND},
22.235 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND},
22.236 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND},
22.237 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
22.238 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE},
22.239 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_TYPE, TF_COMMAND, S_HEX},
22.240 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION},
22.241 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND},
22.242 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
22.243 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
22.244 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND},
22.245 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str15, T_TYPE, TF_COMMAND, S_BOOLEAN},
22.246 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND},
22.247 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE},
22.248 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_BOOLEAN},
22.249 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION},
22.250 {-1},
22.251 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_OPTION, TF_COMMAND},
22.252 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_IF, TF_COMMAND|TF_PARAM},
22.253 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND},
22.254 - {-1},
22.255 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_ENDIF, TF_COMMAND},
22.256 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CHOICE, TF_COMMAND},
22.257 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND},
22.258 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_REQUIRES, TF_COMMAND},
22.259 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str24, T_ENDCHOICE, TF_COMMAND},
22.260 - {-1},
22.261 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_CONFIG, TF_COMMAND},
22.262 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_TYPE, TF_COMMAND, S_STRING},
22.263 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM},
22.264 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT},
22.265 + {-1}, {-1},
22.266 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SELECT, TF_COMMAND},
22.267 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
22.268 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_INT},
22.269 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE},
22.270 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
22.271 {-1},
22.272 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_PROMPT, TF_COMMAND},
22.273 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_DEPENDS, TF_COMMAND},
22.274 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_TYPE, TF_COMMAND, S_TRISTATE},
22.275 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN},
22.276 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SOURCE, TF_COMMAND},
22.277 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND},
22.278 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_TYPE, TF_COMMAND, S_HEX},
22.279 + {-1},
22.280 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND},
22.281 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_SELECT, TF_COMMAND},
22.282 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN},
22.283 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_PROMPT, TF_COMMAND},
22.284 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_DEPENDS, TF_COMMAND},
22.285 + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
22.286 {-1},
22.287 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_HELP, TF_COMMAND},
22.288 - {-1},
22.289 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND},
22.290 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_COMMENT, TF_COMMAND},
22.291 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_MAINMENU, TF_COMMAND},
22.292 - {-1}, {-1},
22.293 - {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}
22.294 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND}
22.295 };
22.296
22.297 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
23.1 --- a/kconfig/zconf.tab.c Fri Oct 17 09:51:19 2008 +0000
23.2 +++ b/kconfig/zconf.tab.c Fri Oct 17 12:47:53 2008 +0000
23.3 @@ -1,7 +1,9 @@
23.4 -/* A Bison parser, made by GNU Bison 2.1. */
23.5 +/* A Bison parser, made by GNU Bison 2.3. */
23.6
23.7 -/* Skeleton parser for Yacc-like parsing with Bison,
23.8 - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
23.9 +/* Skeleton implementation for Bison's Yacc-like parsers in C
23.10 +
23.11 + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
23.12 + Free Software Foundation, Inc.
23.13
23.14 This program is free software; you can redistribute it and/or modify
23.15 it under the terms of the GNU General Public License as published by
23.16 @@ -18,13 +20,21 @@
23.17 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23.18 Boston, MA 02110-1301, USA. */
23.19
23.20 -/* As a special exception, when this file is copied by Bison into a
23.21 - Bison output file, you may use that output file without restriction.
23.22 - This special exception was added by the Free Software Foundation
23.23 - in version 1.24 of Bison. */
23.24 +/* As a special exception, you may create a larger work that contains
23.25 + part or all of the Bison parser skeleton and distribute that work
23.26 + under terms of your choice, so long as that work isn't itself a
23.27 + parser generator using the skeleton or a modified version thereof
23.28 + as a parser skeleton. Alternatively, if you modify or redistribute
23.29 + the parser skeleton itself, you may (at your option) remove this
23.30 + special exception, which will cause the skeleton and the resulting
23.31 + Bison output files to be licensed under the GNU General Public
23.32 + License without this special exception.
23.33
23.34 -/* Written by Richard Stallman by simplifying the original so called
23.35 - ``semantic'' parser. */
23.36 + This special exception was added by the Free Software Foundation in
23.37 + version 2.2 of Bison. */
23.38 +
23.39 +/* C LALR(1) parser skeleton written by Richard Stallman, by
23.40 + simplifying the original so-called "semantic" parser. */
23.41
23.42 /* All symbols defined below should begin with yy or YY, to avoid
23.43 infringing on user name space. This should be done even for local
23.44 @@ -37,7 +47,7 @@
23.45 #define YYBISON 1
23.46
23.47 /* Bison version. */
23.48 -#define YYBISON_VERSION "2.1"
23.49 +#define YYBISON_VERSION "2.3"
23.50
23.51 /* Skeleton name. */
23.52 #define YYSKELETON_NAME "yacc.c"
23.53 @@ -78,25 +88,24 @@
23.54 T_IF = 269,
23.55 T_ENDIF = 270,
23.56 T_DEPENDS = 271,
23.57 - T_REQUIRES = 272,
23.58 - T_OPTIONAL = 273,
23.59 - T_PROMPT = 274,
23.60 - T_TYPE = 275,
23.61 - T_DEFAULT = 276,
23.62 - T_SELECT = 277,
23.63 - T_RANGE = 278,
23.64 - T_OPTION = 279,
23.65 - T_ON = 280,
23.66 - T_WORD = 281,
23.67 - T_WORD_QUOTE = 282,
23.68 - T_UNEQUAL = 283,
23.69 - T_CLOSE_PAREN = 284,
23.70 - T_OPEN_PAREN = 285,
23.71 - T_EOL = 286,
23.72 - T_OR = 287,
23.73 - T_AND = 288,
23.74 - T_EQUAL = 289,
23.75 - T_NOT = 290
23.76 + T_OPTIONAL = 272,
23.77 + T_PROMPT = 273,
23.78 + T_TYPE = 274,
23.79 + T_DEFAULT = 275,
23.80 + T_SELECT = 276,
23.81 + T_RANGE = 277,
23.82 + T_OPTION = 278,
23.83 + T_ON = 279,
23.84 + T_WORD = 280,
23.85 + T_WORD_QUOTE = 281,
23.86 + T_UNEQUAL = 282,
23.87 + T_CLOSE_PAREN = 283,
23.88 + T_OPEN_PAREN = 284,
23.89 + T_EOL = 285,
23.90 + T_OR = 286,
23.91 + T_AND = 287,
23.92 + T_EQUAL = 288,
23.93 + T_NOT = 289
23.94 };
23.95 #endif
23.96 /* Tokens. */
23.97 @@ -114,25 +123,24 @@
23.98 #define T_IF 269
23.99 #define T_ENDIF 270
23.100 #define T_DEPENDS 271
23.101 -#define T_REQUIRES 272
23.102 -#define T_OPTIONAL 273
23.103 -#define T_PROMPT 274
23.104 -#define T_TYPE 275
23.105 -#define T_DEFAULT 276
23.106 -#define T_SELECT 277
23.107 -#define T_RANGE 278
23.108 -#define T_OPTION 279
23.109 -#define T_ON 280
23.110 -#define T_WORD 281
23.111 -#define T_WORD_QUOTE 282
23.112 -#define T_UNEQUAL 283
23.113 -#define T_CLOSE_PAREN 284
23.114 -#define T_OPEN_PAREN 285
23.115 -#define T_EOL 286
23.116 -#define T_OR 287
23.117 -#define T_AND 288
23.118 -#define T_EQUAL 289
23.119 -#define T_NOT 290
23.120 +#define T_OPTIONAL 272
23.121 +#define T_PROMPT 273
23.122 +#define T_TYPE 274
23.123 +#define T_DEFAULT 275
23.124 +#define T_SELECT 276
23.125 +#define T_RANGE 277
23.126 +#define T_OPTION 278
23.127 +#define T_ON 279
23.128 +#define T_WORD 280
23.129 +#define T_WORD_QUOTE 281
23.130 +#define T_UNEQUAL 282
23.131 +#define T_CLOSE_PAREN 283
23.132 +#define T_OPEN_PAREN 284
23.133 +#define T_EOL 285
23.134 +#define T_OR 286
23.135 +#define T_AND 287
23.136 +#define T_EQUAL 288
23.137 +#define T_NOT 289
23.138
23.139
23.140
23.141 @@ -198,18 +206,20 @@
23.142 # define YYTOKEN_TABLE 0
23.143 #endif
23.144
23.145 -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
23.146 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
23.147 +typedef union YYSTYPE
23.148
23.149 -typedef union YYSTYPE {
23.150 +{
23.151 char *string;
23.152 struct file *file;
23.153 struct symbol *symbol;
23.154 struct expr *expr;
23.155 struct menu *menu;
23.156 struct kconf_id *id;
23.157 -} YYSTYPE;
23.158 -/* Line 196 of yacc.c. */
23.159 +}
23.160 +/* Line 187 of yacc.c. */
23.161
23.162 + YYSTYPE;
23.163 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
23.164 # define YYSTYPE_IS_DECLARED 1
23.165 # define YYSTYPE_IS_TRIVIAL 1
23.166 @@ -220,23 +230,56 @@
23.167 /* Copy the second part of user declarations. */
23.168
23.169
23.170 -/* Line 219 of yacc.c. */
23.171 +/* Line 216 of yacc.c. */
23.172
23.173
23.174 -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
23.175 -# define YYSIZE_T __SIZE_TYPE__
23.176 +#ifdef short
23.177 +# undef short
23.178 #endif
23.179 -#if ! defined (YYSIZE_T) && defined (size_t)
23.180 -# define YYSIZE_T size_t
23.181 +
23.182 +#ifdef YYTYPE_UINT8
23.183 +typedef YYTYPE_UINT8 yytype_uint8;
23.184 +#else
23.185 +typedef unsigned char yytype_uint8;
23.186 #endif
23.187 -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
23.188 -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
23.189 -# define YYSIZE_T size_t
23.190 +
23.191 +#ifdef YYTYPE_INT8
23.192 +typedef YYTYPE_INT8 yytype_int8;
23.193 +#elif (defined __STDC__ || defined __C99__FUNC__ \
23.194 + || defined __cplusplus || defined _MSC_VER)
23.195 +typedef signed char yytype_int8;
23.196 +#else
23.197 +typedef short int yytype_int8;
23.198 #endif
23.199 -#if ! defined (YYSIZE_T)
23.200 -# define YYSIZE_T unsigned int
23.201 +
23.202 +#ifdef YYTYPE_UINT16
23.203 +typedef YYTYPE_UINT16 yytype_uint16;
23.204 +#else
23.205 +typedef unsigned short int yytype_uint16;
23.206 #endif
23.207
23.208 +#ifdef YYTYPE_INT16
23.209 +typedef YYTYPE_INT16 yytype_int16;
23.210 +#else
23.211 +typedef short int yytype_int16;
23.212 +#endif
23.213 +
23.214 +#ifndef YYSIZE_T
23.215 +# ifdef __SIZE_TYPE__
23.216 +# define YYSIZE_T __SIZE_TYPE__
23.217 +# elif defined size_t
23.218 +# define YYSIZE_T size_t
23.219 +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
23.220 + || defined __cplusplus || defined _MSC_VER)
23.221 +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
23.222 +# define YYSIZE_T size_t
23.223 +# else
23.224 +# define YYSIZE_T unsigned int
23.225 +# endif
23.226 +#endif
23.227 +
23.228 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
23.229 +
23.230 #ifndef YY_
23.231 # if YYENABLE_NLS
23.232 # if ENABLE_NLS
23.233 @@ -249,7 +292,32 @@
23.234 # endif
23.235 #endif
23.236
23.237 -#if ! defined (yyoverflow) || YYERROR_VERBOSE
23.238 +/* Suppress unused-variable warnings by "using" E. */
23.239 +#if ! defined lint || defined __GNUC__
23.240 +# define YYUSE(e) ((void) (e))
23.241 +#else
23.242 +# define YYUSE(e) /* empty */
23.243 +#endif
23.244 +
23.245 +/* Identity function, used to suppress warnings about constant conditions. */
23.246 +#ifndef lint
23.247 +# define YYID(n) (n)
23.248 +#else
23.249 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.250 + || defined __cplusplus || defined _MSC_VER)
23.251 +static int
23.252 +YYID (int i)
23.253 +#else
23.254 +static int
23.255 +YYID (i)
23.256 + int i;
23.257 +#endif
23.258 +{
23.259 + return i;
23.260 +}
23.261 +#endif
23.262 +
23.263 +#if ! defined yyoverflow || YYERROR_VERBOSE
23.264
23.265 /* The parser invokes alloca or malloc; define the necessary symbols. */
23.266
23.267 @@ -257,64 +325,76 @@
23.268 # if YYSTACK_USE_ALLOCA
23.269 # ifdef __GNUC__
23.270 # define YYSTACK_ALLOC __builtin_alloca
23.271 +# elif defined __BUILTIN_VA_ARG_INCR
23.272 +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
23.273 +# elif defined _AIX
23.274 +# define YYSTACK_ALLOC __alloca
23.275 +# elif defined _MSC_VER
23.276 +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
23.277 +# define alloca _alloca
23.278 # else
23.279 # define YYSTACK_ALLOC alloca
23.280 -# if defined (__STDC__) || defined (__cplusplus)
23.281 +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
23.282 + || defined __cplusplus || defined _MSC_VER)
23.283 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
23.284 -# define YYINCLUDED_STDLIB_H
23.285 +# ifndef _STDLIB_H
23.286 +# define _STDLIB_H 1
23.287 +# endif
23.288 # endif
23.289 # endif
23.290 # endif
23.291 # endif
23.292
23.293 # ifdef YYSTACK_ALLOC
23.294 - /* Pacify GCC's `empty if-body' warning. */
23.295 -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
23.296 + /* Pacify GCC's `empty if-body' warning. */
23.297 +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
23.298 # ifndef YYSTACK_ALLOC_MAXIMUM
23.299 /* The OS might guarantee only one guard page at the bottom of the stack,
23.300 and a page size can be as small as 4096 bytes. So we cannot safely
23.301 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
23.302 to allow for a few compiler-allocated temporary stack slots. */
23.303 -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
23.304 +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
23.305 # endif
23.306 # else
23.307 # define YYSTACK_ALLOC YYMALLOC
23.308 # define YYSTACK_FREE YYFREE
23.309 # ifndef YYSTACK_ALLOC_MAXIMUM
23.310 -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
23.311 +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
23.312 # endif
23.313 -# ifdef __cplusplus
23.314 -extern "C" {
23.315 +# if (defined __cplusplus && ! defined _STDLIB_H \
23.316 + && ! ((defined YYMALLOC || defined malloc) \
23.317 + && (defined YYFREE || defined free)))
23.318 +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
23.319 +# ifndef _STDLIB_H
23.320 +# define _STDLIB_H 1
23.321 +# endif
23.322 # endif
23.323 # ifndef YYMALLOC
23.324 # define YYMALLOC malloc
23.325 -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
23.326 - && (defined (__STDC__) || defined (__cplusplus)))
23.327 +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
23.328 + || defined __cplusplus || defined _MSC_VER)
23.329 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
23.330 # endif
23.331 # endif
23.332 # ifndef YYFREE
23.333 # define YYFREE free
23.334 -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
23.335 - && (defined (__STDC__) || defined (__cplusplus)))
23.336 +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
23.337 + || defined __cplusplus || defined _MSC_VER)
23.338 void free (void *); /* INFRINGES ON USER NAME SPACE */
23.339 # endif
23.340 # endif
23.341 -# ifdef __cplusplus
23.342 -}
23.343 -# endif
23.344 # endif
23.345 -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
23.346 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
23.347
23.348
23.349 -#if (! defined (yyoverflow) \
23.350 - && (! defined (__cplusplus) \
23.351 - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
23.352 +#if (! defined yyoverflow \
23.353 + && (! defined __cplusplus \
23.354 + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
23.355
23.356 /* A type that is properly aligned for any stack member. */
23.357 union yyalloc
23.358 {
23.359 - short int yyss;
23.360 + yytype_int16 yyss;
23.361 YYSTYPE yyvs;
23.362 };
23.363
23.364 @@ -324,13 +404,13 @@
23.365 /* The size of an array large to enough to hold all stacks, each with
23.366 N elements. */
23.367 # define YYSTACK_BYTES(N) \
23.368 - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
23.369 + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
23.370 + YYSTACK_GAP_MAXIMUM)
23.371
23.372 /* Copy COUNT objects from FROM to TO. The source and destination do
23.373 not overlap. */
23.374 # ifndef YYCOPY
23.375 -# if defined (__GNUC__) && 1 < __GNUC__
23.376 +# if defined __GNUC__ && 1 < __GNUC__
23.377 # define YYCOPY(To, From, Count) \
23.378 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
23.379 # else
23.380 @@ -341,7 +421,7 @@
23.381 for (yyi = 0; yyi < (Count); yyi++) \
23.382 (To)[yyi] = (From)[yyi]; \
23.383 } \
23.384 - while (0)
23.385 + while (YYID (0))
23.386 # endif
23.387 # endif
23.388
23.389 @@ -359,39 +439,33 @@
23.390 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
23.391 yyptr += yynewbytes / sizeof (*yyptr); \
23.392 } \
23.393 - while (0)
23.394 + while (YYID (0))
23.395
23.396 #endif
23.397
23.398 -#if defined (__STDC__) || defined (__cplusplus)
23.399 - typedef signed char yysigned_char;
23.400 -#else
23.401 - typedef short int yysigned_char;
23.402 -#endif
23.403 -
23.404 -/* YYFINAL -- State number of the termination state. */
23.405 +/* YYFINAL -- State number of the termination state. */
23.406 #define YYFINAL 3
23.407 /* YYLAST -- Last index in YYTABLE. */
23.408 -#define YYLAST 275
23.409 +#define YYLAST 259
23.410
23.411 -/* YYNTOKENS -- Number of terminals. */
23.412 -#define YYNTOKENS 36
23.413 -/* YYNNTS -- Number of nonterminals. */
23.414 -#define YYNNTS 45
23.415 -/* YYNRULES -- Number of rules. */
23.416 +/* YYNTOKENS -- Number of terminals. */
23.417 +#define YYNTOKENS 35
23.418 +/* YYNNTS -- Number of nonterminals. */
23.419 +#define YYNNTS 46
23.420 +/* YYNRULES -- Number of rules. */
23.421 #define YYNRULES 110
23.422 -/* YYNRULES -- Number of states. */
23.423 -#define YYNSTATES 183
23.424 +/* YYNRULES -- Number of states. */
23.425 +#define YYNSTATES 180
23.426
23.427 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
23.428 #define YYUNDEFTOK 2
23.429 -#define YYMAXUTOK 290
23.430 +#define YYMAXUTOK 289
23.431
23.432 #define YYTRANSLATE(YYX) \
23.433 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
23.434
23.435 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
23.436 -static const unsigned char yytranslate[] =
23.437 +static const yytype_uint8 yytranslate[] =
23.438 {
23.439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
23.440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
23.441 @@ -421,98 +495,97 @@
23.442 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
23.443 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
23.444 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
23.445 - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
23.446 - 35
23.447 + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
23.448 };
23.449
23.450 #if YYDEBUG
23.451 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
23.452 YYRHS. */
23.453 -static const unsigned short int yyprhs[] =
23.454 +static const yytype_uint16 yyprhs[] =
23.455 {
23.456 0, 0, 3, 5, 6, 9, 12, 15, 20, 23,
23.457 28, 33, 37, 39, 41, 43, 45, 47, 49, 51,
23.458 53, 55, 57, 59, 61, 63, 67, 70, 74, 77,
23.459 81, 84, 85, 88, 91, 94, 97, 100, 103, 107,
23.460 - 112, 117, 122, 128, 132, 133, 137, 138, 141, 144,
23.461 - 147, 149, 153, 154, 157, 160, 163, 166, 169, 174,
23.462 - 178, 181, 186, 187, 190, 194, 196, 200, 201, 204,
23.463 - 207, 210, 214, 217, 219, 223, 224, 227, 230, 233,
23.464 - 237, 241, 244, 247, 250, 251, 254, 257, 260, 265,
23.465 - 269, 273, 274, 277, 279, 281, 284, 287, 290, 292,
23.466 - 295, 296, 299, 301, 305, 309, 313, 316, 320, 324,
23.467 - 326
23.468 + 112, 117, 122, 128, 132, 133, 137, 138, 141, 145,
23.469 + 148, 150, 154, 155, 158, 161, 164, 167, 170, 175,
23.470 + 179, 182, 187, 188, 191, 195, 197, 201, 202, 205,
23.471 + 208, 211, 215, 218, 220, 224, 225, 228, 231, 234,
23.472 + 238, 242, 245, 248, 251, 252, 255, 258, 261, 266,
23.473 + 267, 270, 272, 274, 277, 280, 283, 285, 288, 289,
23.474 + 292, 294, 298, 302, 306, 309, 313, 317, 319, 321,
23.475 + 322
23.476 };
23.477
23.478 -/* YYRHS -- A `-1'-separated list of the rules' RHS. */
23.479 -static const yysigned_char yyrhs[] =
23.480 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */
23.481 +static const yytype_int8 yyrhs[] =
23.482 {
23.483 - 37, 0, -1, 38, -1, -1, 38, 40, -1, 38,
23.484 - 54, -1, 38, 65, -1, 38, 3, 75, 77, -1,
23.485 - 38, 76, -1, 38, 26, 1, 31, -1, 38, 39,
23.486 - 1, 31, -1, 38, 1, 31, -1, 16, -1, 19,
23.487 - -1, 20, -1, 22, -1, 18, -1, 23, -1, 21,
23.488 - -1, 31, -1, 60, -1, 69, -1, 43, -1, 45,
23.489 - -1, 67, -1, 26, 1, 31, -1, 1, 31, -1,
23.490 - 10, 26, 31, -1, 42, 46, -1, 11, 26, 31,
23.491 - -1, 44, 46, -1, -1, 46, 47, -1, 46, 48,
23.492 - -1, 46, 73, -1, 46, 71, -1, 46, 41, -1,
23.493 - 46, 31, -1, 20, 74, 31, -1, 19, 75, 78,
23.494 - 31, -1, 21, 79, 78, 31, -1, 22, 26, 78,
23.495 - 31, -1, 23, 80, 80, 78, 31, -1, 24, 49,
23.496 - 31, -1, -1, 49, 26, 50, -1, -1, 34, 75,
23.497 - -1, 7, 31, -1, 51, 55, -1, 76, -1, 52,
23.498 - 57, 53, -1, -1, 55, 56, -1, 55, 73, -1,
23.499 - 55, 71, -1, 55, 31, -1, 55, 41, -1, 19,
23.500 - 75, 78, 31, -1, 20, 74, 31, -1, 18, 31,
23.501 - -1, 21, 26, 78, 31, -1, -1, 57, 40, -1,
23.502 - 14, 79, 77, -1, 76, -1, 58, 61, 59, -1,
23.503 - -1, 61, 40, -1, 61, 65, -1, 61, 54, -1,
23.504 - 4, 75, 31, -1, 62, 72, -1, 76, -1, 63,
23.505 - 66, 64, -1, -1, 66, 40, -1, 66, 65, -1,
23.506 - 66, 54, -1, 6, 75, 31, -1, 9, 75, 31,
23.507 - -1, 68, 72, -1, 12, 31, -1, 70, 13, -1,
23.508 - -1, 72, 73, -1, 72, 31, -1, 72, 41, -1,
23.509 - 16, 25, 79, 31, -1, 16, 79, 31, -1, 17,
23.510 - 79, 31, -1, -1, 75, 78, -1, 26, -1, 27,
23.511 - -1, 5, 31, -1, 8, 31, -1, 15, 31, -1,
23.512 - 31, -1, 77, 31, -1, -1, 14, 79, -1, 80,
23.513 - -1, 80, 34, 80, -1, 80, 28, 80, -1, 30,
23.514 - 79, 29, -1, 35, 79, -1, 79, 32, 79, -1,
23.515 - 79, 33, 79, -1, 26, -1, 27, -1
23.516 + 36, 0, -1, 37, -1, -1, 37, 39, -1, 37,
23.517 + 53, -1, 37, 64, -1, 37, 3, 74, 76, -1,
23.518 + 37, 75, -1, 37, 25, 1, 30, -1, 37, 38,
23.519 + 1, 30, -1, 37, 1, 30, -1, 16, -1, 18,
23.520 + -1, 19, -1, 21, -1, 17, -1, 22, -1, 20,
23.521 + -1, 30, -1, 59, -1, 68, -1, 42, -1, 44,
23.522 + -1, 66, -1, 25, 1, 30, -1, 1, 30, -1,
23.523 + 10, 25, 30, -1, 41, 45, -1, 11, 25, 30,
23.524 + -1, 43, 45, -1, -1, 45, 46, -1, 45, 47,
23.525 + -1, 45, 72, -1, 45, 70, -1, 45, 40, -1,
23.526 + 45, 30, -1, 19, 73, 30, -1, 18, 74, 77,
23.527 + 30, -1, 20, 78, 77, 30, -1, 21, 25, 77,
23.528 + 30, -1, 22, 79, 79, 77, 30, -1, 23, 48,
23.529 + 30, -1, -1, 48, 25, 49, -1, -1, 33, 74,
23.530 + -1, 7, 80, 30, -1, 50, 54, -1, 75, -1,
23.531 + 51, 56, 52, -1, -1, 54, 55, -1, 54, 72,
23.532 + -1, 54, 70, -1, 54, 30, -1, 54, 40, -1,
23.533 + 18, 74, 77, 30, -1, 19, 73, 30, -1, 17,
23.534 + 30, -1, 20, 25, 77, 30, -1, -1, 56, 39,
23.535 + -1, 14, 78, 76, -1, 75, -1, 57, 60, 58,
23.536 + -1, -1, 60, 39, -1, 60, 64, -1, 60, 53,
23.537 + -1, 4, 74, 30, -1, 61, 71, -1, 75, -1,
23.538 + 62, 65, 63, -1, -1, 65, 39, -1, 65, 64,
23.539 + -1, 65, 53, -1, 6, 74, 30, -1, 9, 74,
23.540 + 30, -1, 67, 71, -1, 12, 30, -1, 69, 13,
23.541 + -1, -1, 71, 72, -1, 71, 30, -1, 71, 40,
23.542 + -1, 16, 24, 78, 30, -1, -1, 74, 77, -1,
23.543 + 25, -1, 26, -1, 5, 30, -1, 8, 30, -1,
23.544 + 15, 30, -1, 30, -1, 76, 30, -1, -1, 14,
23.545 + 78, -1, 79, -1, 79, 33, 79, -1, 79, 27,
23.546 + 79, -1, 29, 78, 28, -1, 34, 78, -1, 78,
23.547 + 31, 78, -1, 78, 32, 78, -1, 25, -1, 26,
23.548 + -1, -1, 25, -1
23.549 };
23.550
23.551 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
23.552 -static const unsigned short int yyrline[] =
23.553 +static const yytype_uint16 yyrline[] =
23.554 {
23.555 - 0, 105, 105, 107, 109, 110, 111, 112, 113, 114,
23.556 - 115, 119, 123, 123, 123, 123, 123, 123, 123, 127,
23.557 - 128, 129, 130, 131, 132, 136, 137, 143, 151, 157,
23.558 - 165, 175, 177, 178, 179, 180, 181, 182, 185, 193,
23.559 - 199, 209, 215, 221, 224, 226, 237, 238, 243, 252,
23.560 - 257, 265, 268, 270, 271, 272, 273, 274, 277, 283,
23.561 - 294, 300, 310, 312, 317, 325, 333, 336, 338, 339,
23.562 - 340, 345, 352, 357, 365, 368, 370, 371, 372, 375,
23.563 - 383, 390, 397, 403, 410, 412, 413, 414, 417, 422,
23.564 - 427, 435, 437, 442, 443, 446, 447, 448, 452, 453,
23.565 - 456, 457, 460, 461, 462, 463, 464, 465, 466, 469,
23.566 - 470
23.567 + 0, 104, 104, 106, 108, 109, 110, 111, 112, 113,
23.568 + 114, 118, 122, 122, 122, 122, 122, 122, 122, 126,
23.569 + 127, 128, 129, 130, 131, 135, 136, 142, 150, 156,
23.570 + 164, 174, 176, 177, 178, 179, 180, 181, 184, 192,
23.571 + 198, 208, 214, 220, 223, 225, 236, 237, 242, 251,
23.572 + 256, 264, 267, 269, 270, 271, 272, 273, 276, 282,
23.573 + 293, 299, 309, 311, 316, 324, 332, 335, 337, 338,
23.574 + 339, 344, 351, 356, 364, 367, 369, 370, 371, 374,
23.575 + 382, 389, 396, 402, 409, 411, 412, 413, 416, 424,
23.576 + 426, 431, 432, 435, 436, 437, 441, 442, 445, 446,
23.577 + 449, 450, 451, 452, 453, 454, 455, 458, 459, 462,
23.578 + 463
23.579 };
23.580 #endif
23.581
23.582 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
23.583 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
23.584 - First, the terminals, then, starting at YYNTOKENS, nonterminals. */
23.585 + First, the terminals, then, starting at YYNTOKENS, nonterminals. */
23.586 static const char *const yytname[] =
23.587 {
23.588 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
23.589 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
23.590 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
23.591 - "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT",
23.592 - "T_SELECT", "T_RANGE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE",
23.593 - "T_UNEQUAL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND",
23.594 - "T_EQUAL", "T_NOT", "$accept", "input", "stmt_list", "option_name",
23.595 - "common_stmt", "option_error", "config_entry_start", "config_stmt",
23.596 + "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
23.597 + "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
23.598 + "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
23.599 + "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt",
23.600 + "option_error", "config_entry_start", "config_stmt",
23.601 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
23.602 "config_option", "symbol_option", "symbol_option_list",
23.603 "symbol_option_arg", "choice", "choice_entry", "choice_end",
23.604 @@ -520,126 +593,125 @@
23.605 "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry",
23.606 "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment",
23.607 "comment_stmt", "help_start", "help", "depends_list", "depends",
23.608 - "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol", 0
23.609 + "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol",
23.610 + "word_opt", 0
23.611 };
23.612 #endif
23.613
23.614 # ifdef YYPRINT
23.615 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
23.616 token YYLEX-NUM. */
23.617 -static const unsigned short int yytoknum[] =
23.618 +static const yytype_uint16 yytoknum[] =
23.619 {
23.620 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
23.621 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
23.622 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
23.623 - 285, 286, 287, 288, 289, 290
23.624 + 285, 286, 287, 288, 289
23.625 };
23.626 # endif
23.627
23.628 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
23.629 -static const unsigned char yyr1[] =
23.630 +static const yytype_uint8 yyr1[] =
23.631 {
23.632 - 0, 36, 37, 38, 38, 38, 38, 38, 38, 38,
23.633 - 38, 38, 39, 39, 39, 39, 39, 39, 39, 40,
23.634 - 40, 40, 40, 40, 40, 41, 41, 42, 43, 44,
23.635 - 45, 46, 46, 46, 46, 46, 46, 46, 47, 47,
23.636 - 47, 47, 47, 48, 49, 49, 50, 50, 51, 52,
23.637 - 53, 54, 55, 55, 55, 55, 55, 55, 56, 56,
23.638 - 56, 56, 57, 57, 58, 59, 60, 61, 61, 61,
23.639 - 61, 62, 63, 64, 65, 66, 66, 66, 66, 67,
23.640 - 68, 69, 70, 71, 72, 72, 72, 72, 73, 73,
23.641 - 73, 74, 74, 75, 75, 76, 76, 76, 77, 77,
23.642 - 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
23.643 + 0, 35, 36, 37, 37, 37, 37, 37, 37, 37,
23.644 + 37, 37, 38, 38, 38, 38, 38, 38, 38, 39,
23.645 + 39, 39, 39, 39, 39, 40, 40, 41, 42, 43,
23.646 + 44, 45, 45, 45, 45, 45, 45, 45, 46, 46,
23.647 + 46, 46, 46, 47, 48, 48, 49, 49, 50, 51,
23.648 + 52, 53, 54, 54, 54, 54, 54, 54, 55, 55,
23.649 + 55, 55, 56, 56, 57, 58, 59, 60, 60, 60,
23.650 + 60, 61, 62, 63, 64, 65, 65, 65, 65, 66,
23.651 + 67, 68, 69, 70, 71, 71, 71, 71, 72, 73,
23.652 + 73, 74, 74, 75, 75, 75, 76, 76, 77, 77,
23.653 + 78, 78, 78, 78, 78, 78, 78, 79, 79, 80,
23.654 80
23.655 };
23.656
23.657 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
23.658 -static const unsigned char yyr2[] =
23.659 +static const yytype_uint8 yyr2[] =
23.660 {
23.661 0, 2, 1, 0, 2, 2, 2, 4, 2, 4,
23.662 4, 3, 1, 1, 1, 1, 1, 1, 1, 1,
23.663 1, 1, 1, 1, 1, 3, 2, 3, 2, 3,
23.664 2, 0, 2, 2, 2, 2, 2, 2, 3, 4,
23.665 - 4, 4, 5, 3, 0, 3, 0, 2, 2, 2,
23.666 + 4, 4, 5, 3, 0, 3, 0, 2, 3, 2,
23.667 1, 3, 0, 2, 2, 2, 2, 2, 4, 3,
23.668 2, 4, 0, 2, 3, 1, 3, 0, 2, 2,
23.669 2, 3, 2, 1, 3, 0, 2, 2, 2, 3,
23.670 - 3, 2, 2, 2, 0, 2, 2, 2, 4, 3,
23.671 - 3, 0, 2, 1, 1, 2, 2, 2, 1, 2,
23.672 - 0, 2, 1, 3, 3, 3, 2, 3, 3, 1,
23.673 + 3, 2, 2, 2, 0, 2, 2, 2, 4, 0,
23.674 + 2, 1, 1, 2, 2, 2, 1, 2, 0, 2,
23.675 + 1, 3, 3, 3, 2, 3, 3, 1, 1, 0,
23.676 1
23.677 };
23.678
23.679 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
23.680 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
23.681 means the default is an error. */
23.682 -static const unsigned char yydefact[] =
23.683 +static const yytype_uint8 yydefact[] =
23.684 {
23.685 - 3, 0, 0, 1, 0, 0, 0, 0, 0, 0,
23.686 + 3, 0, 0, 1, 0, 0, 0, 0, 0, 109,
23.687 0, 0, 0, 0, 0, 0, 12, 16, 13, 14,
23.688 18, 15, 17, 0, 19, 0, 4, 31, 22, 31,
23.689 23, 52, 62, 5, 67, 20, 84, 75, 6, 24,
23.690 - 84, 21, 8, 11, 93, 94, 0, 0, 95, 0,
23.691 - 48, 96, 0, 0, 0, 109, 110, 0, 0, 0,
23.692 - 102, 97, 0, 0, 0, 0, 0, 0, 0, 0,
23.693 - 0, 0, 98, 7, 71, 79, 80, 27, 29, 0,
23.694 - 106, 0, 0, 64, 0, 0, 9, 10, 0, 0,
23.695 - 0, 0, 0, 91, 0, 0, 0, 44, 0, 37,
23.696 - 36, 32, 33, 0, 35, 34, 0, 0, 91, 0,
23.697 - 56, 57, 53, 55, 54, 63, 51, 50, 68, 70,
23.698 - 66, 69, 65, 86, 87, 85, 76, 78, 74, 77,
23.699 - 73, 99, 105, 107, 108, 104, 103, 26, 82, 0,
23.700 - 0, 0, 100, 0, 100, 100, 100, 0, 0, 0,
23.701 - 83, 60, 100, 0, 100, 0, 89, 90, 0, 0,
23.702 - 38, 92, 0, 0, 100, 46, 43, 25, 0, 59,
23.703 - 0, 88, 101, 39, 40, 41, 0, 0, 45, 58,
23.704 - 61, 42, 47
23.705 + 84, 21, 8, 11, 91, 92, 0, 0, 93, 0,
23.706 + 110, 0, 94, 0, 0, 0, 107, 108, 0, 0,
23.707 + 0, 100, 95, 0, 0, 0, 0, 0, 0, 0,
23.708 + 0, 0, 0, 96, 7, 71, 79, 48, 80, 27,
23.709 + 29, 0, 104, 0, 0, 64, 0, 0, 9, 10,
23.710 + 0, 0, 0, 0, 89, 0, 0, 0, 44, 0,
23.711 + 37, 36, 32, 33, 0, 35, 34, 0, 0, 89,
23.712 + 0, 56, 57, 53, 55, 54, 63, 51, 50, 68,
23.713 + 70, 66, 69, 65, 86, 87, 85, 76, 78, 74,
23.714 + 77, 73, 97, 103, 105, 106, 102, 101, 26, 82,
23.715 + 0, 98, 0, 98, 98, 98, 0, 0, 0, 83,
23.716 + 60, 98, 0, 98, 0, 0, 0, 38, 90, 0,
23.717 + 0, 98, 46, 43, 25, 0, 59, 0, 88, 99,
23.718 + 39, 40, 41, 0, 0, 45, 58, 61, 42, 47
23.719 };
23.720
23.721 -/* YYDEFGOTO[NTERM-NUM]. */
23.722 -static const short int yydefgoto[] =
23.723 +/* YYDEFGOTO[NTERM-NUM]. */
23.724 +static const yytype_int16 yydefgoto[] =
23.725 {
23.726 - -1, 1, 2, 25, 26, 100, 27, 28, 29, 30,
23.727 - 64, 101, 102, 148, 178, 31, 32, 116, 33, 66,
23.728 - 112, 67, 34, 120, 35, 68, 36, 37, 128, 38,
23.729 - 70, 39, 40, 41, 103, 104, 69, 105, 143, 144,
23.730 - 42, 73, 159, 59, 60
23.731 + -1, 1, 2, 25, 26, 101, 27, 28, 29, 30,
23.732 + 65, 102, 103, 147, 175, 31, 32, 117, 33, 67,
23.733 + 113, 68, 34, 121, 35, 69, 36, 37, 129, 38,
23.734 + 71, 39, 40, 41, 104, 105, 70, 106, 142, 143,
23.735 + 42, 74, 156, 60, 61, 51
23.736 };
23.737
23.738 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
23.739 STATE-NUM. */
23.740 -#define YYPACT_NINF -135
23.741 -static const short int yypact[] =
23.742 +#define YYPACT_NINF -80
23.743 +static const yytype_int16 yypact[] =
23.744 {
23.745 - -135, 2, 170, -135, -14, 56, 56, -8, 56, 24,
23.746 - 67, 56, 7, 14, 62, 97, -135, -135, -135, -135,
23.747 - -135, -135, -135, 156, -135, 166, -135, -135, -135, -135,
23.748 - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
23.749 - -135, -135, -135, -135, -135, -135, 138, 151, -135, 152,
23.750 - -135, -135, 163, 167, 176, -135, -135, 62, 62, 185,
23.751 - -19, -135, 188, 190, 42, 103, 194, 85, 70, 222,
23.752 - 70, 132, -135, 191, -135, -135, -135, -135, -135, 127,
23.753 - -135, 62, 62, 191, 104, 104, -135, -135, 193, 203,
23.754 - 9, 62, 56, 56, 62, 161, 104, -135, 196, -135,
23.755 - -135, -135, -135, 233, -135, -135, 204, 56, 56, 221,
23.756 - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
23.757 - -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
23.758 - -135, -135, -135, 219, -135, -135, -135, -135, -135, 62,
23.759 - 209, 212, 240, 224, 240, -1, 240, 104, 41, 225,
23.760 - -135, -135, 240, 226, 240, 218, -135, -135, 62, 227,
23.761 - -135, -135, 228, 229, 240, 230, -135, -135, 231, -135,
23.762 - 232, -135, 112, -135, -135, -135, 234, 56, -135, -135,
23.763 - -135, -135, -135
23.764 + -80, 2, 132, -80, -13, -1, -1, -2, -1, 9,
23.765 + 33, -1, 27, 40, -3, 38, -80, -80, -80, -80,
23.766 + -80, -80, -80, 71, -80, 77, -80, -80, -80, -80,
23.767 + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
23.768 + -80, -80, -80, -80, -80, -80, 57, 61, -80, 63,
23.769 + -80, 76, -80, 87, 101, 133, -80, -80, -3, -3,
23.770 + 195, -6, -80, 136, 149, 39, 104, 65, 150, 5,
23.771 + 194, 5, 167, -80, 176, -80, -80, -80, -80, -80,
23.772 + -80, 68, -80, -3, -3, 176, 72, 72, -80, -80,
23.773 + 177, 187, 78, -1, -1, -3, 196, 72, -80, 222,
23.774 + -80, -80, -80, -80, 221, -80, -80, 205, -1, -1,
23.775 + 211, -80, -80, -80, -80, -80, -80, -80, -80, -80,
23.776 + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
23.777 + -80, -80, -80, -80, 206, -80, -80, -80, -80, -80,
23.778 + -3, 223, 209, 223, 197, 223, 72, 7, 210, -80,
23.779 + -80, 223, 212, 223, 201, -3, 213, -80, -80, 214,
23.780 + 215, 223, 208, -80, -80, 216, -80, 217, -80, 113,
23.781 + -80, -80, -80, 218, -1, -80, -80, -80, -80, -80
23.782 };
23.783
23.784 /* YYPGOTO[NTERM-NUM]. */
23.785 -static const short int yypgoto[] =
23.786 +static const yytype_int16 yypgoto[] =
23.787 {
23.788 - -135, -135, -135, -135, 94, -45, -135, -135, -135, -135,
23.789 - 237, -135, -135, -135, -135, -135, -135, -135, -54, -135,
23.790 - -135, -135, -135, -135, -135, -135, -135, -135, -135, 1,
23.791 - -135, -135, -135, -135, -135, 195, 235, -44, 159, -5,
23.792 - 98, 210, -134, -53, -77
23.793 + -80, -80, -80, -80, 122, -34, -80, -80, -80, -80,
23.794 + 220, -80, -80, -80, -80, -80, -80, -80, 59, -80,
23.795 + -80, -80, -80, -80, -80, -80, -80, -80, -80, 125,
23.796 + -80, -80, -80, -80, -80, 183, 219, 22, 142, -5,
23.797 + 147, 192, 69, -54, -79, -80
23.798 };
23.799
23.800 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
23.801 @@ -647,93 +719,88 @@
23.802 number is the opposite. If zero, do what YYDEFACT says.
23.803 If YYTABLE_NINF, syntax error. */
23.804 #define YYTABLE_NINF -82
23.805 -static const short int yytable[] =
23.806 +static const yytype_int16 yytable[] =
23.807 {
23.808 - 46, 47, 3, 49, 79, 80, 52, 135, 136, 84,
23.809 - 161, 162, 163, 158, 119, 85, 127, 43, 168, 147,
23.810 - 170, 111, 114, 48, 124, 125, 124, 125, 133, 134,
23.811 - 176, 81, 82, 53, 139, 55, 56, 140, 141, 57,
23.812 - 54, 145, -28, 88, 58, -28, -28, -28, -28, -28,
23.813 - -28, -28, -28, -28, 89, 50, -28, -28, 90, 91,
23.814 - -28, 92, 93, 94, 95, 96, 97, 165, 98, 121,
23.815 - 164, 129, 166, 99, 6, 7, 8, 9, 10, 11,
23.816 - 12, 13, 44, 45, 14, 15, 155, 142, 55, 56,
23.817 - 7, 8, 57, 10, 11, 12, 13, 58, 51, 14,
23.818 - 15, 24, 152, -30, 88, 172, -30, -30, -30, -30,
23.819 - -30, -30, -30, -30, -30, 89, 24, -30, -30, 90,
23.820 - 91, -30, 92, 93, 94, 95, 96, 97, 61, 98,
23.821 - 55, 56, -81, 88, 99, -81, -81, -81, -81, -81,
23.822 - -81, -81, -81, -81, 81, 82, -81, -81, 90, 91,
23.823 - -81, -81, -81, -81, -81, -81, 132, 62, 98, 81,
23.824 - 82, 115, 118, 123, 126, 117, 122, 63, 130, 72,
23.825 - -2, 4, 182, 5, 6, 7, 8, 9, 10, 11,
23.826 - 12, 13, 74, 75, 14, 15, 16, 146, 17, 18,
23.827 - 19, 20, 21, 22, 76, 88, 23, 149, 77, -49,
23.828 - -49, 24, -49, -49, -49, -49, 89, 78, -49, -49,
23.829 - 90, 91, 106, 107, 108, 109, 72, 81, 82, 86,
23.830 - 98, 87, 131, 88, 137, 110, -72, -72, -72, -72,
23.831 - -72, -72, -72, -72, 138, 151, -72, -72, 90, 91,
23.832 - 156, 81, 82, 157, 81, 82, 150, 154, 98, 171,
23.833 - 81, 82, 82, 123, 158, 160, 167, 169, 173, 174,
23.834 - 175, 113, 179, 180, 177, 181, 65, 153, 0, 83,
23.835 - 0, 0, 0, 0, 0, 71
23.836 + 46, 47, 3, 49, 81, 82, 53, 136, 137, 6,
23.837 + 7, 8, 9, 10, 11, 12, 13, 43, 146, 14,
23.838 + 15, 86, 56, 57, 44, 45, 58, 87, 48, 134,
23.839 + 135, 59, 162, 112, 50, 24, 125, 163, 125, -28,
23.840 + 90, 144, -28, -28, -28, -28, -28, -28, -28, -28,
23.841 + -28, 91, 54, -28, -28, 92, -28, 93, 94, 95,
23.842 + 96, 97, 98, 52, 99, 55, 90, 161, 62, 100,
23.843 + -49, -49, 63, -49, -49, -49, -49, 91, 64, -49,
23.844 + -49, 92, 107, 108, 109, 110, 154, 73, 141, 115,
23.845 + 99, 75, 126, 76, 126, 111, 133, 56, 57, 83,
23.846 + 84, 169, 140, 151, -30, 90, 77, -30, -30, -30,
23.847 + -30, -30, -30, -30, -30, -30, 91, 78, -30, -30,
23.848 + 92, -30, 93, 94, 95, 96, 97, 98, 120, 99,
23.849 + 128, 79, -2, 4, 100, 5, 6, 7, 8, 9,
23.850 + 10, 11, 12, 13, 83, 84, 14, 15, 16, 17,
23.851 + 18, 19, 20, 21, 22, 7, 8, 23, 10, 11,
23.852 + 12, 13, 24, 80, 14, 15, 88, -81, 90, 179,
23.853 + -81, -81, -81, -81, -81, -81, -81, -81, -81, 89,
23.854 + 24, -81, -81, 92, -81, -81, -81, -81, -81, -81,
23.855 + 116, 119, 99, 127, 122, 90, 130, 124, -72, -72,
23.856 + -72, -72, -72, -72, -72, -72, 132, 138, -72, -72,
23.857 + 92, 155, 158, 159, 160, 118, 123, 139, 131, 99,
23.858 + 165, 145, 167, 148, 124, 73, 83, 84, 83, 84,
23.859 + 173, 168, 83, 84, 149, 150, 153, 155, 84, 157,
23.860 + 164, 174, 166, 170, 171, 172, 176, 177, 178, 66,
23.861 + 114, 152, 85, 0, 0, 0, 0, 0, 0, 72
23.862 };
23.863
23.864 -static const short int yycheck[] =
23.865 +static const yytype_int16 yycheck[] =
23.866 {
23.867 - 5, 6, 0, 8, 57, 58, 11, 84, 85, 28,
23.868 - 144, 145, 146, 14, 68, 34, 70, 31, 152, 96,
23.869 - 154, 66, 66, 31, 69, 69, 71, 71, 81, 82,
23.870 - 164, 32, 33, 26, 25, 26, 27, 90, 91, 30,
23.871 - 26, 94, 0, 1, 35, 3, 4, 5, 6, 7,
23.872 - 8, 9, 10, 11, 12, 31, 14, 15, 16, 17,
23.873 - 18, 19, 20, 21, 22, 23, 24, 26, 26, 68,
23.874 - 147, 70, 31, 31, 4, 5, 6, 7, 8, 9,
23.875 - 10, 11, 26, 27, 14, 15, 139, 92, 26, 27,
23.876 - 5, 6, 30, 8, 9, 10, 11, 35, 31, 14,
23.877 - 15, 31, 107, 0, 1, 158, 3, 4, 5, 6,
23.878 - 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
23.879 - 17, 18, 19, 20, 21, 22, 23, 24, 31, 26,
23.880 - 26, 27, 0, 1, 31, 3, 4, 5, 6, 7,
23.881 - 8, 9, 10, 11, 32, 33, 14, 15, 16, 17,
23.882 - 18, 19, 20, 21, 22, 23, 29, 1, 26, 32,
23.883 - 33, 67, 68, 31, 70, 67, 68, 1, 70, 31,
23.884 - 0, 1, 177, 3, 4, 5, 6, 7, 8, 9,
23.885 - 10, 11, 31, 31, 14, 15, 16, 26, 18, 19,
23.886 - 20, 21, 22, 23, 31, 1, 26, 1, 31, 5,
23.887 - 6, 31, 8, 9, 10, 11, 12, 31, 14, 15,
23.888 - 16, 17, 18, 19, 20, 21, 31, 32, 33, 31,
23.889 - 26, 31, 31, 1, 31, 31, 4, 5, 6, 7,
23.890 - 8, 9, 10, 11, 31, 31, 14, 15, 16, 17,
23.891 - 31, 32, 33, 31, 32, 33, 13, 26, 26, 31,
23.892 - 32, 33, 33, 31, 14, 31, 31, 31, 31, 31,
23.893 - 31, 66, 31, 31, 34, 31, 29, 108, -1, 59,
23.894 - -1, -1, -1, -1, -1, 40
23.895 + 5, 6, 0, 8, 58, 59, 11, 86, 87, 4,
23.896 + 5, 6, 7, 8, 9, 10, 11, 30, 97, 14,
23.897 + 15, 27, 25, 26, 25, 26, 29, 33, 30, 83,
23.898 + 84, 34, 25, 67, 25, 30, 70, 30, 72, 0,
23.899 + 1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
23.900 + 11, 12, 25, 14, 15, 16, 17, 18, 19, 20,
23.901 + 21, 22, 23, 30, 25, 25, 1, 146, 30, 30,
23.902 + 5, 6, 1, 8, 9, 10, 11, 12, 1, 14,
23.903 + 15, 16, 17, 18, 19, 20, 140, 30, 93, 67,
23.904 + 25, 30, 70, 30, 72, 30, 28, 25, 26, 31,
23.905 + 32, 155, 24, 108, 0, 1, 30, 3, 4, 5,
23.906 + 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
23.907 + 16, 17, 18, 19, 20, 21, 22, 23, 69, 25,
23.908 + 71, 30, 0, 1, 30, 3, 4, 5, 6, 7,
23.909 + 8, 9, 10, 11, 31, 32, 14, 15, 16, 17,
23.910 + 18, 19, 20, 21, 22, 5, 6, 25, 8, 9,
23.911 + 10, 11, 30, 30, 14, 15, 30, 0, 1, 174,
23.912 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 30,
23.913 + 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23.914 + 68, 69, 25, 71, 69, 1, 71, 30, 4, 5,
23.915 + 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
23.916 + 16, 14, 143, 144, 145, 68, 69, 30, 71, 25,
23.917 + 151, 25, 153, 1, 30, 30, 31, 32, 31, 32,
23.918 + 161, 30, 31, 32, 13, 30, 25, 14, 32, 30,
23.919 + 30, 33, 30, 30, 30, 30, 30, 30, 30, 29,
23.920 + 67, 109, 60, -1, -1, -1, -1, -1, -1, 40
23.921 };
23.922
23.923 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
23.924 symbol of state STATE-NUM. */
23.925 -static const unsigned char yystos[] =
23.926 +static const yytype_uint8 yystos[] =
23.927 {
23.928 - 0, 37, 38, 0, 1, 3, 4, 5, 6, 7,
23.929 - 8, 9, 10, 11, 14, 15, 16, 18, 19, 20,
23.930 - 21, 22, 23, 26, 31, 39, 40, 42, 43, 44,
23.931 - 45, 51, 52, 54, 58, 60, 62, 63, 65, 67,
23.932 - 68, 69, 76, 31, 26, 27, 75, 75, 31, 75,
23.933 - 31, 31, 75, 26, 26, 26, 27, 30, 35, 79,
23.934 - 80, 31, 1, 1, 46, 46, 55, 57, 61, 72,
23.935 - 66, 72, 31, 77, 31, 31, 31, 31, 31, 79,
23.936 - 79, 32, 33, 77, 28, 34, 31, 31, 1, 12,
23.937 - 16, 17, 19, 20, 21, 22, 23, 24, 26, 31,
23.938 - 41, 47, 48, 70, 71, 73, 18, 19, 20, 21,
23.939 - 31, 41, 56, 71, 73, 40, 53, 76, 40, 54,
23.940 - 59, 65, 76, 31, 41, 73, 40, 54, 64, 65,
23.941 - 76, 31, 29, 79, 79, 80, 80, 31, 31, 25,
23.942 - 79, 79, 75, 74, 75, 79, 26, 80, 49, 1,
23.943 - 13, 31, 75, 74, 26, 79, 31, 31, 14, 78,
23.944 - 31, 78, 78, 78, 80, 26, 31, 31, 78, 31,
23.945 - 78, 31, 79, 31, 31, 31, 78, 34, 50, 31,
23.946 - 31, 31, 75
23.947 + 0, 36, 37, 0, 1, 3, 4, 5, 6, 7,
23.948 + 8, 9, 10, 11, 14, 15, 16, 17, 18, 19,
23.949 + 20, 21, 22, 25, 30, 38, 39, 41, 42, 43,
23.950 + 44, 50, 51, 53, 57, 59, 61, 62, 64, 66,
23.951 + 67, 68, 75, 30, 25, 26, 74, 74, 30, 74,
23.952 + 25, 80, 30, 74, 25, 25, 25, 26, 29, 34,
23.953 + 78, 79, 30, 1, 1, 45, 45, 54, 56, 60,
23.954 + 71, 65, 71, 30, 76, 30, 30, 30, 30, 30,
23.955 + 30, 78, 78, 31, 32, 76, 27, 33, 30, 30,
23.956 + 1, 12, 16, 18, 19, 20, 21, 22, 23, 25,
23.957 + 30, 40, 46, 47, 69, 70, 72, 17, 18, 19,
23.958 + 20, 30, 40, 55, 70, 72, 39, 52, 75, 39,
23.959 + 53, 58, 64, 75, 30, 40, 72, 39, 53, 63,
23.960 + 64, 75, 30, 28, 78, 78, 79, 79, 30, 30,
23.961 + 24, 74, 73, 74, 78, 25, 79, 48, 1, 13,
23.962 + 30, 74, 73, 25, 78, 14, 77, 30, 77, 77,
23.963 + 77, 79, 25, 30, 30, 77, 30, 77, 30, 78,
23.964 + 30, 30, 30, 77, 33, 49, 30, 30, 30, 74
23.965 };
23.966
23.967 #define yyerrok (yyerrstatus = 0)
23.968 @@ -761,7 +828,7 @@
23.969 yychar = (Token); \
23.970 yylval = (Value); \
23.971 yytoken = YYTRANSLATE (yychar); \
23.972 - YYPOPSTACK; \
23.973 + YYPOPSTACK (1); \
23.974 goto yybackup; \
23.975 } \
23.976 else \
23.977 @@ -769,7 +836,7 @@
23.978 yyerror (YY_("syntax error: cannot back up")); \
23.979 YYERROR; \
23.980 } \
23.981 -while (0)
23.982 +while (YYID (0))
23.983
23.984
23.985 #define YYTERROR 1
23.986 @@ -784,7 +851,7 @@
23.987 #ifndef YYLLOC_DEFAULT
23.988 # define YYLLOC_DEFAULT(Current, Rhs, N) \
23.989 do \
23.990 - if (N) \
23.991 + if (YYID (N)) \
23.992 { \
23.993 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
23.994 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
23.995 @@ -798,7 +865,7 @@
23.996 (Current).first_column = (Current).last_column = \
23.997 YYRHSLOC (Rhs, 0).last_column; \
23.998 } \
23.999 - while (0)
23.1000 + while (YYID (0))
23.1001 #endif
23.1002
23.1003
23.1004 @@ -810,8 +877,8 @@
23.1005 # if YYLTYPE_IS_TRIVIAL
23.1006 # define YY_LOCATION_PRINT(File, Loc) \
23.1007 fprintf (File, "%d.%d-%d.%d", \
23.1008 - (Loc).first_line, (Loc).first_column, \
23.1009 - (Loc).last_line, (Loc).last_column)
23.1010 + (Loc).first_line, (Loc).first_column, \
23.1011 + (Loc).last_line, (Loc).last_column)
23.1012 # else
23.1013 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
23.1014 # endif
23.1015 @@ -838,36 +905,96 @@
23.1016 do { \
23.1017 if (yydebug) \
23.1018 YYFPRINTF Args; \
23.1019 -} while (0)
23.1020 +} while (YYID (0))
23.1021
23.1022 -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
23.1023 -do { \
23.1024 - if (yydebug) \
23.1025 - { \
23.1026 - YYFPRINTF (stderr, "%s ", Title); \
23.1027 - yysymprint (stderr, \
23.1028 - Type, Value); \
23.1029 - YYFPRINTF (stderr, "\n"); \
23.1030 - } \
23.1031 -} while (0)
23.1032 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
23.1033 +do { \
23.1034 + if (yydebug) \
23.1035 + { \
23.1036 + YYFPRINTF (stderr, "%s ", Title); \
23.1037 + yy_symbol_print (stderr, \
23.1038 + Type, Value); \
23.1039 + YYFPRINTF (stderr, "\n"); \
23.1040 + } \
23.1041 +} while (YYID (0))
23.1042 +
23.1043 +
23.1044 +/*--------------------------------.
23.1045 +| Print this symbol on YYOUTPUT. |
23.1046 +`--------------------------------*/
23.1047 +
23.1048 +/*ARGSUSED*/
23.1049 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1050 + || defined __cplusplus || defined _MSC_VER)
23.1051 +static void
23.1052 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
23.1053 +#else
23.1054 +static void
23.1055 +yy_symbol_value_print (yyoutput, yytype, yyvaluep)
23.1056 + FILE *yyoutput;
23.1057 + int yytype;
23.1058 + YYSTYPE const * const yyvaluep;
23.1059 +#endif
23.1060 +{
23.1061 + if (!yyvaluep)
23.1062 + return;
23.1063 +# ifdef YYPRINT
23.1064 + if (yytype < YYNTOKENS)
23.1065 + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
23.1066 +# else
23.1067 + YYUSE (yyoutput);
23.1068 +# endif
23.1069 + switch (yytype)
23.1070 + {
23.1071 + default:
23.1072 + break;
23.1073 + }
23.1074 +}
23.1075 +
23.1076 +
23.1077 +/*--------------------------------.
23.1078 +| Print this symbol on YYOUTPUT. |
23.1079 +`--------------------------------*/
23.1080 +
23.1081 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1082 + || defined __cplusplus || defined _MSC_VER)
23.1083 +static void
23.1084 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
23.1085 +#else
23.1086 +static void
23.1087 +yy_symbol_print (yyoutput, yytype, yyvaluep)
23.1088 + FILE *yyoutput;
23.1089 + int yytype;
23.1090 + YYSTYPE const * const yyvaluep;
23.1091 +#endif
23.1092 +{
23.1093 + if (yytype < YYNTOKENS)
23.1094 + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
23.1095 + else
23.1096 + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
23.1097 +
23.1098 + yy_symbol_value_print (yyoutput, yytype, yyvaluep);
23.1099 + YYFPRINTF (yyoutput, ")");
23.1100 +}
23.1101
23.1102 /*------------------------------------------------------------------.
23.1103 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
23.1104 | TOP (included). |
23.1105 `------------------------------------------------------------------*/
23.1106
23.1107 -#if defined (__STDC__) || defined (__cplusplus)
23.1108 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1109 + || defined __cplusplus || defined _MSC_VER)
23.1110 static void
23.1111 -yy_stack_print (short int *bottom, short int *top)
23.1112 +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
23.1113 #else
23.1114 static void
23.1115 yy_stack_print (bottom, top)
23.1116 - short int *bottom;
23.1117 - short int *top;
23.1118 + yytype_int16 *bottom;
23.1119 + yytype_int16 *top;
23.1120 #endif
23.1121 {
23.1122 YYFPRINTF (stderr, "Stack now");
23.1123 - for (/* Nothing. */; bottom <= top; ++bottom)
23.1124 + for (; bottom <= top; ++bottom)
23.1125 YYFPRINTF (stderr, " %d", *bottom);
23.1126 YYFPRINTF (stderr, "\n");
23.1127 }
23.1128 @@ -876,37 +1003,45 @@
23.1129 do { \
23.1130 if (yydebug) \
23.1131 yy_stack_print ((Bottom), (Top)); \
23.1132 -} while (0)
23.1133 +} while (YYID (0))
23.1134
23.1135
23.1136 /*------------------------------------------------.
23.1137 | Report that the YYRULE is going to be reduced. |
23.1138 `------------------------------------------------*/
23.1139
23.1140 -#if defined (__STDC__) || defined (__cplusplus)
23.1141 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1142 + || defined __cplusplus || defined _MSC_VER)
23.1143 static void
23.1144 -yy_reduce_print (int yyrule)
23.1145 +yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
23.1146 #else
23.1147 static void
23.1148 -yy_reduce_print (yyrule)
23.1149 +yy_reduce_print (yyvsp, yyrule)
23.1150 + YYSTYPE *yyvsp;
23.1151 int yyrule;
23.1152 #endif
23.1153 {
23.1154 + int yynrhs = yyr2[yyrule];
23.1155 int yyi;
23.1156 unsigned long int yylno = yyrline[yyrule];
23.1157 - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
23.1158 - yyrule - 1, yylno);
23.1159 - /* Print the symbols being reduced, and their result. */
23.1160 - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
23.1161 - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
23.1162 - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
23.1163 + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
23.1164 + yyrule - 1, yylno);
23.1165 + /* The symbols being reduced. */
23.1166 + for (yyi = 0; yyi < yynrhs; yyi++)
23.1167 + {
23.1168 + fprintf (stderr, " $%d = ", yyi + 1);
23.1169 + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
23.1170 + &(yyvsp[(yyi + 1) - (yynrhs)])
23.1171 + );
23.1172 + fprintf (stderr, "\n");
23.1173 + }
23.1174 }
23.1175
23.1176 # define YY_REDUCE_PRINT(Rule) \
23.1177 do { \
23.1178 if (yydebug) \
23.1179 - yy_reduce_print (Rule); \
23.1180 -} while (0)
23.1181 + yy_reduce_print (yyvsp, Rule); \
23.1182 +} while (YYID (0))
23.1183
23.1184 /* Nonzero means print parse trace. It is left uninitialized so that
23.1185 multiple parsers can coexist. */
23.1186 @@ -940,42 +1075,44 @@
23.1187 #if YYERROR_VERBOSE
23.1188
23.1189 # ifndef yystrlen
23.1190 -# if defined (__GLIBC__) && defined (_STRING_H)
23.1191 +# if defined __GLIBC__ && defined _STRING_H
23.1192 # define yystrlen strlen
23.1193 # else
23.1194 /* Return the length of YYSTR. */
23.1195 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1196 + || defined __cplusplus || defined _MSC_VER)
23.1197 static YYSIZE_T
23.1198 -# if defined (__STDC__) || defined (__cplusplus)
23.1199 yystrlen (const char *yystr)
23.1200 -# else
23.1201 +#else
23.1202 +static YYSIZE_T
23.1203 yystrlen (yystr)
23.1204 - const char *yystr;
23.1205 -# endif
23.1206 + const char *yystr;
23.1207 +#endif
23.1208 {
23.1209 - const char *yys = yystr;
23.1210 -
23.1211 - while (*yys++ != '\0')
23.1212 + YYSIZE_T yylen;
23.1213 + for (yylen = 0; yystr[yylen]; yylen++)
23.1214 continue;
23.1215 -
23.1216 - return yys - yystr - 1;
23.1217 + return yylen;
23.1218 }
23.1219 # endif
23.1220 # endif
23.1221
23.1222 # ifndef yystpcpy
23.1223 -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
23.1224 +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
23.1225 # define yystpcpy stpcpy
23.1226 # else
23.1227 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
23.1228 YYDEST. */
23.1229 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1230 + || defined __cplusplus || defined _MSC_VER)
23.1231 static char *
23.1232 -# if defined (__STDC__) || defined (__cplusplus)
23.1233 yystpcpy (char *yydest, const char *yysrc)
23.1234 -# else
23.1235 +#else
23.1236 +static char *
23.1237 yystpcpy (yydest, yysrc)
23.1238 - char *yydest;
23.1239 - const char *yysrc;
23.1240 -# endif
23.1241 + char *yydest;
23.1242 + const char *yysrc;
23.1243 +#endif
23.1244 {
23.1245 char *yyd = yydest;
23.1246 const char *yys = yysrc;
23.1247 @@ -1001,7 +1138,7 @@
23.1248 {
23.1249 if (*yystr == '"')
23.1250 {
23.1251 - size_t yyn = 0;
23.1252 + YYSIZE_T yyn = 0;
23.1253 char const *yyp = yystr;
23.1254
23.1255 for (;;)
23.1256 @@ -1036,53 +1173,123 @@
23.1257 }
23.1258 # endif
23.1259
23.1260 +/* Copy into YYRESULT an error message about the unexpected token
23.1261 + YYCHAR while in state YYSTATE. Return the number of bytes copied,
23.1262 + including the terminating null byte. If YYRESULT is null, do not
23.1263 + copy anything; just return the number of bytes that would be
23.1264 + copied. As a special case, return 0 if an ordinary "syntax error"
23.1265 + message will do. Return YYSIZE_MAXIMUM if overflow occurs during
23.1266 + size calculation. */
23.1267 +static YYSIZE_T
23.1268 +yysyntax_error (char *yyresult, int yystate, int yychar)
23.1269 +{
23.1270 + int yyn = yypact[yystate];
23.1271 +
23.1272 + if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
23.1273 + return 0;
23.1274 + else
23.1275 + {
23.1276 + int yytype = YYTRANSLATE (yychar);
23.1277 + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
23.1278 + YYSIZE_T yysize = yysize0;
23.1279 + YYSIZE_T yysize1;
23.1280 + int yysize_overflow = 0;
23.1281 + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
23.1282 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
23.1283 + int yyx;
23.1284 +
23.1285 +# if 0
23.1286 + /* This is so xgettext sees the translatable formats that are
23.1287 + constructed on the fly. */
23.1288 + YY_("syntax error, unexpected %s");
23.1289 + YY_("syntax error, unexpected %s, expecting %s");
23.1290 + YY_("syntax error, unexpected %s, expecting %s or %s");
23.1291 + YY_("syntax error, unexpected %s, expecting %s or %s or %s");
23.1292 + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
23.1293 +# endif
23.1294 + char *yyfmt;
23.1295 + char const *yyf;
23.1296 + static char const yyunexpected[] = "syntax error, unexpected %s";
23.1297 + static char const yyexpecting[] = ", expecting %s";
23.1298 + static char const yyor[] = " or %s";
23.1299 + char yyformat[sizeof yyunexpected
23.1300 + + sizeof yyexpecting - 1
23.1301 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
23.1302 + * (sizeof yyor - 1))];
23.1303 + char const *yyprefix = yyexpecting;
23.1304 +
23.1305 + /* Start YYX at -YYN if negative to avoid negative indexes in
23.1306 + YYCHECK. */
23.1307 + int yyxbegin = yyn < 0 ? -yyn : 0;
23.1308 +
23.1309 + /* Stay within bounds of both yycheck and yytname. */
23.1310 + int yychecklim = YYLAST - yyn + 1;
23.1311 + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
23.1312 + int yycount = 1;
23.1313 +
23.1314 + yyarg[0] = yytname[yytype];
23.1315 + yyfmt = yystpcpy (yyformat, yyunexpected);
23.1316 +
23.1317 + for (yyx = yyxbegin; yyx < yyxend; ++yyx)
23.1318 + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
23.1319 + {
23.1320 + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
23.1321 + {
23.1322 + yycount = 1;
23.1323 + yysize = yysize0;
23.1324 + yyformat[sizeof yyunexpected - 1] = '\0';
23.1325 + break;
23.1326 + }
23.1327 + yyarg[yycount++] = yytname[yyx];
23.1328 + yysize1 = yysize + yytnamerr (0, yytname[yyx]);
23.1329 + yysize_overflow |= (yysize1 < yysize);
23.1330 + yysize = yysize1;
23.1331 + yyfmt = yystpcpy (yyfmt, yyprefix);
23.1332 + yyprefix = yyor;
23.1333 + }
23.1334 +
23.1335 + yyf = YY_(yyformat);
23.1336 + yysize1 = yysize + yystrlen (yyf);
23.1337 + yysize_overflow |= (yysize1 < yysize);
23.1338 + yysize = yysize1;
23.1339 +
23.1340 + if (yysize_overflow)
23.1341 + return YYSIZE_MAXIMUM;
23.1342 +
23.1343 + if (yyresult)
23.1344 + {
23.1345 + /* Avoid sprintf, as that infringes on the user's name space.
23.1346 + Don't have undefined behavior even if the translation
23.1347 + produced a string with the wrong number of "%s"s. */
23.1348 + char *yyp = yyresult;
23.1349 + int yyi = 0;
23.1350 + while ((*yyp = *yyf) != '\0')
23.1351 + {
23.1352 + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
23.1353 + {
23.1354 + yyp += yytnamerr (yyp, yyarg[yyi++]);
23.1355 + yyf += 2;
23.1356 + }
23.1357 + else
23.1358 + {
23.1359 + yyp++;
23.1360 + yyf++;
23.1361 + }
23.1362 + }
23.1363 + }
23.1364 + return yysize;
23.1365 + }
23.1366 +}
23.1367 #endif /* YYERROR_VERBOSE */
23.1368 -
23.1369
23.1370
23.1371 -#if YYDEBUG
23.1372 -/*--------------------------------.
23.1373 -| Print this symbol on YYOUTPUT. |
23.1374 -`--------------------------------*/
23.1375 -
23.1376 -#if defined (__STDC__) || defined (__cplusplus)
23.1377 -static void
23.1378 -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
23.1379 -#else
23.1380 -static void
23.1381 -yysymprint (yyoutput, yytype, yyvaluep)
23.1382 - FILE *yyoutput;
23.1383 - int yytype;
23.1384 - YYSTYPE *yyvaluep;
23.1385 -#endif
23.1386 -{
23.1387 - /* Pacify ``unused variable'' warnings. */
23.1388 - (void) yyvaluep;
23.1389 -
23.1390 - if (yytype < YYNTOKENS)
23.1391 - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
23.1392 - else
23.1393 - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
23.1394 -
23.1395 -
23.1396 -# ifdef YYPRINT
23.1397 - if (yytype < YYNTOKENS)
23.1398 - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
23.1399 -# endif
23.1400 - switch (yytype)
23.1401 - {
23.1402 - default:
23.1403 - break;
23.1404 - }
23.1405 - YYFPRINTF (yyoutput, ")");
23.1406 -}
23.1407 -
23.1408 -#endif /* ! YYDEBUG */
23.1409 /*-----------------------------------------------.
23.1410 | Release the memory associated to this symbol. |
23.1411 `-----------------------------------------------*/
23.1412
23.1413 -#if defined (__STDC__) || defined (__cplusplus)
23.1414 +/*ARGSUSED*/
23.1415 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1416 + || defined __cplusplus || defined _MSC_VER)
23.1417 static void
23.1418 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
23.1419 #else
23.1420 @@ -1093,8 +1300,7 @@
23.1421 YYSTYPE *yyvaluep;
23.1422 #endif
23.1423 {
23.1424 - /* Pacify ``unused variable'' warnings. */
23.1425 - (void) yyvaluep;
23.1426 + YYUSE (yyvaluep);
23.1427
23.1428 if (!yymsg)
23.1429 yymsg = "Deleting";
23.1430 @@ -1102,39 +1308,39 @@
23.1431
23.1432 switch (yytype)
23.1433 {
23.1434 - case 52: /* "choice_entry" */
23.1435 + case 51: /* "choice_entry" */
23.1436
23.1437 - {
23.1438 + {
23.1439 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
23.1440 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
23.1441 if (current_menu == (yyvaluep->menu))
23.1442 menu_end_menu();
23.1443 };
23.1444
23.1445 - break;
23.1446 - case 58: /* "if_entry" */
23.1447 + break;
23.1448 + case 57: /* "if_entry" */
23.1449
23.1450 - {
23.1451 + {
23.1452 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
23.1453 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
23.1454 if (current_menu == (yyvaluep->menu))
23.1455 menu_end_menu();
23.1456 };
23.1457
23.1458 - break;
23.1459 - case 63: /* "menu_entry" */
23.1460 + break;
23.1461 + case 62: /* "menu_entry" */
23.1462
23.1463 - {
23.1464 + {
23.1465 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
23.1466 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
23.1467 if (current_menu == (yyvaluep->menu))
23.1468 menu_end_menu();
23.1469 };
23.1470
23.1471 - break;
23.1472 + break;
23.1473
23.1474 default:
23.1475 - break;
23.1476 + break;
23.1477 }
23.1478 }
23.1479
23.1480 @@ -1142,13 +1348,13 @@
23.1481 /* Prevent warnings from -Wmissing-prototypes. */
23.1482
23.1483 #ifdef YYPARSE_PARAM
23.1484 -# if defined (__STDC__) || defined (__cplusplus)
23.1485 +#if defined __STDC__ || defined __cplusplus
23.1486 int yyparse (void *YYPARSE_PARAM);
23.1487 -# else
23.1488 +#else
23.1489 int yyparse ();
23.1490 -# endif
23.1491 +#endif
23.1492 #else /* ! YYPARSE_PARAM */
23.1493 -#if defined (__STDC__) || defined (__cplusplus)
23.1494 +#if defined __STDC__ || defined __cplusplus
23.1495 int yyparse (void);
23.1496 #else
23.1497 int yyparse ();
23.1498 @@ -1173,20 +1379,24 @@
23.1499 `----------*/
23.1500
23.1501 #ifdef YYPARSE_PARAM
23.1502 -# if defined (__STDC__) || defined (__cplusplus)
23.1503 -int yyparse (void *YYPARSE_PARAM)
23.1504 -# else
23.1505 -int yyparse (YYPARSE_PARAM)
23.1506 - void *YYPARSE_PARAM;
23.1507 -# endif
23.1508 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1509 + || defined __cplusplus || defined _MSC_VER)
23.1510 +int
23.1511 +yyparse (void *YYPARSE_PARAM)
23.1512 +#else
23.1513 +int
23.1514 +yyparse (YYPARSE_PARAM)
23.1515 + void *YYPARSE_PARAM;
23.1516 +#endif
23.1517 #else /* ! YYPARSE_PARAM */
23.1518 -#if defined (__STDC__) || defined (__cplusplus)
23.1519 +#if (defined __STDC__ || defined __C99__FUNC__ \
23.1520 + || defined __cplusplus || defined _MSC_VER)
23.1521 int
23.1522 yyparse (void)
23.1523 #else
23.1524 int
23.1525 yyparse ()
23.1526 - ;
23.1527 +
23.1528 #endif
23.1529 #endif
23.1530 {
23.1531 @@ -1198,6 +1408,12 @@
23.1532 int yyerrstatus;
23.1533 /* Look-ahead token as an internal (translated) token number. */
23.1534 int yytoken = 0;
23.1535 +#if YYERROR_VERBOSE
23.1536 + /* Buffer for error messages, and its allocated size. */
23.1537 + char yymsgbuf[128];
23.1538 + char *yymsg = yymsgbuf;
23.1539 + YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
23.1540 +#endif
23.1541
23.1542 /* Three stacks and their tools:
23.1543 `yyss': related to states,
23.1544 @@ -1208,9 +1424,9 @@
23.1545 to reallocate them elsewhere. */
23.1546
23.1547 /* The state stack. */
23.1548 - short int yyssa[YYINITDEPTH];
23.1549 - short int *yyss = yyssa;
23.1550 - short int *yyssp;
23.1551 + yytype_int16 yyssa[YYINITDEPTH];
23.1552 + yytype_int16 *yyss = yyssa;
23.1553 + yytype_int16 *yyssp;
23.1554
23.1555 /* The semantic value stack. */
23.1556 YYSTYPE yyvsa[YYINITDEPTH];
23.1557 @@ -1219,7 +1435,7 @@
23.1558
23.1559
23.1560
23.1561 -#define YYPOPSTACK (yyvsp--, yyssp--)
23.1562 +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
23.1563
23.1564 YYSIZE_T yystacksize = YYINITDEPTH;
23.1565
23.1566 @@ -1228,9 +1444,9 @@
23.1567 YYSTYPE yyval;
23.1568
23.1569
23.1570 - /* When reducing, the number of symbols on the RHS of the reduced
23.1571 - rule. */
23.1572 - int yylen;
23.1573 + /* The number of symbols on the RHS of the reduced rule.
23.1574 + Keep to zero when no symbol should be popped. */
23.1575 + int yylen = 0;
23.1576
23.1577 YYDPRINTF ((stderr, "Starting parse\n"));
23.1578
23.1579 @@ -1254,8 +1470,7 @@
23.1580 `------------------------------------------------------------*/
23.1581 yynewstate:
23.1582 /* In all cases, when you get here, the value and location stacks
23.1583 - have just been pushed. so pushing a state here evens the stacks.
23.1584 - */
23.1585 + have just been pushed. So pushing a state here evens the stacks. */
23.1586 yyssp++;
23.1587
23.1588 yysetstate:
23.1589 @@ -1268,11 +1483,11 @@
23.1590
23.1591 #ifdef yyoverflow
23.1592 {
23.1593 - /* Give user a chance to reallocate the stack. Use copies of
23.1594 + /* Give user a chance to reallocate the stack. Use copies of
23.1595 these so that the &'s don't force the real ones into
23.1596 memory. */
23.1597 YYSTYPE *yyvs1 = yyvs;
23.1598 - short int *yyss1 = yyss;
23.1599 + yytype_int16 *yyss1 = yyss;
23.1600
23.1601
23.1602 /* Each stack pointer address is followed by the size of the
23.1603 @@ -1300,7 +1515,7 @@
23.1604 yystacksize = YYMAXDEPTH;
23.1605
23.1606 {
23.1607 - short int *yyss1 = yyss;
23.1608 + yytype_int16 *yyss1 = yyss;
23.1609 union yyalloc *yyptr =
23.1610 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
23.1611 if (! yyptr)
23.1612 @@ -1335,12 +1550,10 @@
23.1613 `-----------*/
23.1614 yybackup:
23.1615
23.1616 -/* Do appropriate processing given the current state. */
23.1617 -/* Read a look-ahead token if we need one and don't already have one. */
23.1618 -/* yyresume: */
23.1619 + /* Do appropriate processing given the current state. Read a
23.1620 + look-ahead token if we need one and don't already have one. */
23.1621
23.1622 /* First try to decide what to do without reference to look-ahead token. */
23.1623 -
23.1624 yyn = yypact[yystate];
23.1625 if (yyn == YYPACT_NINF)
23.1626 goto yydefault;
23.1627 @@ -1382,22 +1595,21 @@
23.1628 if (yyn == YYFINAL)
23.1629 YYACCEPT;
23.1630
23.1631 - /* Shift the look-ahead token. */
23.1632 - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
23.1633 -
23.1634 - /* Discard the token being shifted unless it is eof. */
23.1635 - if (yychar != YYEOF)
23.1636 - yychar = YYEMPTY;
23.1637 -
23.1638 - *++yyvsp = yylval;
23.1639 -
23.1640 -
23.1641 /* Count tokens shifted since error; after three, turn off error
23.1642 status. */
23.1643 if (yyerrstatus)
23.1644 yyerrstatus--;
23.1645
23.1646 + /* Shift the look-ahead token. */
23.1647 + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
23.1648 +
23.1649 + /* Discard the shifted token unless it is eof. */
23.1650 + if (yychar != YYEOF)
23.1651 + yychar = YYEMPTY;
23.1652 +
23.1653 yystate = yyn;
23.1654 + *++yyvsp = yylval;
23.1655 +
23.1656 goto yynewstate;
23.1657
23.1658
23.1659 @@ -1439,13 +1651,13 @@
23.1660
23.1661 case 9:
23.1662
23.1663 - { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); ;}
23.1664 + { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
23.1665 break;
23.1666
23.1667 case 10:
23.1668
23.1669 {
23.1670 - zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name);
23.1671 + zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
23.1672 ;}
23.1673 break;
23.1674
23.1675 @@ -1456,7 +1668,7 @@
23.1676
23.1677 case 25:
23.1678
23.1679 - { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); ;}
23.1680 + { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
23.1681 break;
23.1682
23.1683 case 26:
23.1684 @@ -1467,10 +1679,10 @@
23.1685 case 27:
23.1686
23.1687 {
23.1688 - struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
23.1689 + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
23.1690 sym->flags |= SYMBOL_OPTIONAL;
23.1691 menu_add_entry(sym);
23.1692 - printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
23.1693 + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
23.1694 ;}
23.1695 break;
23.1696
23.1697 @@ -1485,10 +1697,10 @@
23.1698 case 29:
23.1699
23.1700 {
23.1701 - struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
23.1702 + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
23.1703 sym->flags |= SYMBOL_OPTIONAL;
23.1704 menu_add_entry(sym);
23.1705 - printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
23.1706 + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
23.1707 ;}
23.1708 break;
23.1709
23.1710 @@ -1507,17 +1719,17 @@
23.1711 case 38:
23.1712
23.1713 {
23.1714 - menu_set_type((yyvsp[-2].id)->stype);
23.1715 + menu_set_type((yyvsp[(1) - (3)].id)->stype);
23.1716 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
23.1717 zconf_curname(), zconf_lineno(),
23.1718 - (yyvsp[-2].id)->stype);
23.1719 + (yyvsp[(1) - (3)].id)->stype);
23.1720 ;}
23.1721 break;
23.1722
23.1723 case 39:
23.1724
23.1725 {
23.1726 - menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
23.1727 + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
23.1728 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
23.1729 ;}
23.1730 break;
23.1731 @@ -1525,19 +1737,19 @@
23.1732 case 40:
23.1733
23.1734 {
23.1735 - menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
23.1736 - if ((yyvsp[-3].id)->stype != S_UNKNOWN)
23.1737 - menu_set_type((yyvsp[-3].id)->stype);
23.1738 + menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
23.1739 + if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
23.1740 + menu_set_type((yyvsp[(1) - (4)].id)->stype);
23.1741 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
23.1742 zconf_curname(), zconf_lineno(),
23.1743 - (yyvsp[-3].id)->stype);
23.1744 + (yyvsp[(1) - (4)].id)->stype);
23.1745 ;}
23.1746 break;
23.1747
23.1748 case 41:
23.1749
23.1750 {
23.1751 - menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
23.1752 + menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
23.1753 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
23.1754 ;}
23.1755 break;
23.1756 @@ -1545,7 +1757,7 @@
23.1757 case 42:
23.1758
23.1759 {
23.1760 - menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr));
23.1761 + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
23.1762 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
23.1763 ;}
23.1764 break;
23.1765 @@ -1553,12 +1765,12 @@
23.1766 case 45:
23.1767
23.1768 {
23.1769 - struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string)));
23.1770 + struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
23.1771 if (id && id->flags & TF_OPTION)
23.1772 - menu_add_option(id->token, (yyvsp[0].string));
23.1773 + menu_add_option(id->token, (yyvsp[(3) - (3)].string));
23.1774 else
23.1775 - zconfprint("warning: ignoring unknown option %s", (yyvsp[-1].string));
23.1776 - free((yyvsp[-1].string));
23.1777 + zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
23.1778 + free((yyvsp[(2) - (3)].string));
23.1779 ;}
23.1780 break;
23.1781
23.1782 @@ -1569,14 +1781,14 @@
23.1783
23.1784 case 47:
23.1785
23.1786 - { (yyval.string) = (yyvsp[0].string); ;}
23.1787 + { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
23.1788 break;
23.1789
23.1790 case 48:
23.1791
23.1792 {
23.1793 - struct symbol *sym = sym_lookup(NULL, 0);
23.1794 - sym->flags |= SYMBOL_CHOICE;
23.1795 + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
23.1796 + sym->flags |= SYMBOL_AUTO;
23.1797 menu_add_entry(sym);
23.1798 menu_add_expr(P_CHOICE, NULL, NULL);
23.1799 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
23.1800 @@ -1593,7 +1805,7 @@
23.1801 case 50:
23.1802
23.1803 {
23.1804 - if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) {
23.1805 + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
23.1806 menu_end_menu();
23.1807 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
23.1808 }
23.1809 @@ -1603,7 +1815,7 @@
23.1810 case 58:
23.1811
23.1812 {
23.1813 - menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
23.1814 + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
23.1815 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
23.1816 ;}
23.1817 break;
23.1818 @@ -1611,11 +1823,11 @@
23.1819 case 59:
23.1820
23.1821 {
23.1822 - if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) {
23.1823 - menu_set_type((yyvsp[-2].id)->stype);
23.1824 + if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
23.1825 + menu_set_type((yyvsp[(1) - (3)].id)->stype);
23.1826 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
23.1827 zconf_curname(), zconf_lineno(),
23.1828 - (yyvsp[-2].id)->stype);
23.1829 + (yyvsp[(1) - (3)].id)->stype);
23.1830 } else
23.1831 YYERROR;
23.1832 ;}
23.1833 @@ -1632,8 +1844,8 @@
23.1834 case 61:
23.1835
23.1836 {
23.1837 - if ((yyvsp[-3].id)->stype == S_UNKNOWN) {
23.1838 - menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
23.1839 + if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
23.1840 + menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
23.1841 printd(DEBUG_PARSE, "%s:%d:default\n",
23.1842 zconf_curname(), zconf_lineno());
23.1843 } else
23.1844 @@ -1646,7 +1858,7 @@
23.1845 {
23.1846 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
23.1847 menu_add_entry(NULL);
23.1848 - menu_add_dep((yyvsp[-1].expr));
23.1849 + menu_add_dep((yyvsp[(2) - (3)].expr));
23.1850 (yyval.menu) = menu_add_menu();
23.1851 ;}
23.1852 break;
23.1853 @@ -1654,7 +1866,7 @@
23.1854 case 65:
23.1855
23.1856 {
23.1857 - if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) {
23.1858 + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
23.1859 menu_end_menu();
23.1860 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
23.1861 }
23.1862 @@ -1665,7 +1877,7 @@
23.1863
23.1864 {
23.1865 menu_add_entry(NULL);
23.1866 - menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
23.1867 + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
23.1868 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
23.1869 ;}
23.1870 break;
23.1871 @@ -1680,7 +1892,7 @@
23.1872 case 73:
23.1873
23.1874 {
23.1875 - if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) {
23.1876 + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
23.1877 menu_end_menu();
23.1878 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
23.1879 }
23.1880 @@ -1690,8 +1902,8 @@
23.1881 case 79:
23.1882
23.1883 {
23.1884 - printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
23.1885 - zconf_nextfile((yyvsp[-1].string));
23.1886 + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
23.1887 + zconf_nextfile((yyvsp[(2) - (3)].string));
23.1888 ;}
23.1889 break;
23.1890
23.1891 @@ -1699,7 +1911,7 @@
23.1892
23.1893 {
23.1894 menu_add_entry(NULL);
23.1895 - menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL);
23.1896 + menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
23.1897 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
23.1898 ;}
23.1899 break;
23.1900 @@ -1722,122 +1934,109 @@
23.1901 case 83:
23.1902
23.1903 {
23.1904 - current_entry->sym->help = (yyvsp[0].string);
23.1905 + current_entry->help = (yyvsp[(2) - (2)].string);
23.1906 ;}
23.1907 break;
23.1908
23.1909 case 88:
23.1910
23.1911 {
23.1912 - menu_add_dep((yyvsp[-1].expr));
23.1913 + menu_add_dep((yyvsp[(3) - (4)].expr));
23.1914 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
23.1915 ;}
23.1916 break;
23.1917
23.1918 - case 89:
23.1919 -
23.1920 - {
23.1921 - menu_add_dep((yyvsp[-1].expr));
23.1922 - printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
23.1923 -;}
23.1924 - break;
23.1925 -
23.1926 case 90:
23.1927
23.1928 {
23.1929 - menu_add_dep((yyvsp[-1].expr));
23.1930 - printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
23.1931 + menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
23.1932 ;}
23.1933 break;
23.1934
23.1935 - case 92:
23.1936 + case 93:
23.1937
23.1938 - {
23.1939 - menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));
23.1940 -;}
23.1941 + { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
23.1942 + break;
23.1943 +
23.1944 + case 94:
23.1945 +
23.1946 + { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
23.1947 break;
23.1948
23.1949 case 95:
23.1950
23.1951 - { (yyval.id) = (yyvsp[-1].id); ;}
23.1952 + { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
23.1953 break;
23.1954
23.1955 - case 96:
23.1956 + case 98:
23.1957
23.1958 - { (yyval.id) = (yyvsp[-1].id); ;}
23.1959 + { (yyval.expr) = NULL; ;}
23.1960 break;
23.1961
23.1962 - case 97:
23.1963 + case 99:
23.1964
23.1965 - { (yyval.id) = (yyvsp[-1].id); ;}
23.1966 + { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
23.1967 break;
23.1968
23.1969 case 100:
23.1970
23.1971 - { (yyval.expr) = NULL; ;}
23.1972 + { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
23.1973 break;
23.1974
23.1975 case 101:
23.1976
23.1977 - { (yyval.expr) = (yyvsp[0].expr); ;}
23.1978 + { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
23.1979 break;
23.1980
23.1981 case 102:
23.1982
23.1983 - { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;}
23.1984 + { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
23.1985 break;
23.1986
23.1987 case 103:
23.1988
23.1989 - { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}
23.1990 + { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
23.1991 break;
23.1992
23.1993 case 104:
23.1994
23.1995 - { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}
23.1996 + { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
23.1997 break;
23.1998
23.1999 case 105:
23.2000
23.2001 - { (yyval.expr) = (yyvsp[-1].expr); ;}
23.2002 + { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
23.2003 break;
23.2004
23.2005 case 106:
23.2006
23.2007 - { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;}
23.2008 + { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
23.2009 break;
23.2010
23.2011 case 107:
23.2012
23.2013 - { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
23.2014 + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
23.2015 break;
23.2016
23.2017 case 108:
23.2018
23.2019 - { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
23.2020 + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
23.2021 break;
23.2022
23.2023 case 109:
23.2024
23.2025 - { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;}
23.2026 + { (yyval.string) = NULL; ;}
23.2027 break;
23.2028
23.2029 - case 110:
23.2030
23.2031 - { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;}
23.2032 - break;
23.2033 -
23.2034 +/* Line 1267 of yacc.c. */
23.2035
23.2036 default: break;
23.2037 }
23.2038 + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
23.2039
23.2040 -/* Line 1126 of yacc.c. */
23.2041 -
23.2042 -
23.2043 - yyvsp -= yylen;
23.2044 - yyssp -= yylen;
23.2045 -
23.2046 -
23.2047 + YYPOPSTACK (yylen);
23.2048 + yylen = 0;
23.2049 YY_STACK_PRINT (yyss, yyssp);
23.2050
23.2051 *++yyvsp = yyval;
23.2052 @@ -1866,110 +2065,41 @@
23.2053 if (!yyerrstatus)
23.2054 {
23.2055 ++yynerrs;
23.2056 -#if YYERROR_VERBOSE
23.2057 - yyn = yypact[yystate];
23.2058 +#if ! YYERROR_VERBOSE
23.2059 + yyerror (YY_("syntax error"));
23.2060 +#else
23.2061 + {
23.2062 + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
23.2063 + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
23.2064 + {
23.2065 + YYSIZE_T yyalloc = 2 * yysize;
23.2066 + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
23.2067 + yyalloc = YYSTACK_ALLOC_MAXIMUM;
23.2068 + if (yymsg != yymsgbuf)
23.2069 + YYSTACK_FREE (yymsg);
23.2070 + yymsg = (char *) YYSTACK_ALLOC (yyalloc);
23.2071 + if (yymsg)
23.2072 + yymsg_alloc = yyalloc;
23.2073 + else
23.2074 + {
23.2075 + yymsg = yymsgbuf;
23.2076 + yymsg_alloc = sizeof yymsgbuf;
23.2077 + }
23.2078 + }
23.2079
23.2080 - if (YYPACT_NINF < yyn && yyn < YYLAST)
23.2081 - {
23.2082 - int yytype = YYTRANSLATE (yychar);
23.2083 - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
23.2084 - YYSIZE_T yysize = yysize0;
23.2085 - YYSIZE_T yysize1;
23.2086 - int yysize_overflow = 0;
23.2087 - char *yymsg = 0;
23.2088 -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
23.2089 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
23.2090 - int yyx;
23.2091 -
23.2092 -#if 0
23.2093 - /* This is so xgettext sees the translatable formats that are
23.2094 - constructed on the fly. */
23.2095 - YY_("syntax error, unexpected %s");
23.2096 - YY_("syntax error, unexpected %s, expecting %s");
23.2097 - YY_("syntax error, unexpected %s, expecting %s or %s");
23.2098 - YY_("syntax error, unexpected %s, expecting %s or %s or %s");
23.2099 - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
23.2100 + if (0 < yysize && yysize <= yymsg_alloc)
23.2101 + {
23.2102 + (void) yysyntax_error (yymsg, yystate, yychar);
23.2103 + yyerror (yymsg);
23.2104 + }
23.2105 + else
23.2106 + {
23.2107 + yyerror (YY_("syntax error"));
23.2108 + if (yysize != 0)
23.2109 + goto yyexhaustedlab;
23.2110 + }
23.2111 + }
23.2112 #endif
23.2113 - char *yyfmt;
23.2114 - char const *yyf;
23.2115 - static char const yyunexpected[] = "syntax error, unexpected %s";
23.2116 - static char const yyexpecting[] = ", expecting %s";
23.2117 - static char const yyor[] = " or %s";
23.2118 - char yyformat[sizeof yyunexpected
23.2119 - + sizeof yyexpecting - 1
23.2120 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
23.2121 - * (sizeof yyor - 1))];
23.2122 - char const *yyprefix = yyexpecting;
23.2123 -
23.2124 - /* Start YYX at -YYN if negative to avoid negative indexes in
23.2125 - YYCHECK. */
23.2126 - int yyxbegin = yyn < 0 ? -yyn : 0;
23.2127 -
23.2128 - /* Stay within bounds of both yycheck and yytname. */
23.2129 - int yychecklim = YYLAST - yyn;
23.2130 - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
23.2131 - int yycount = 1;
23.2132 -
23.2133 - yyarg[0] = yytname[yytype];
23.2134 - yyfmt = yystpcpy (yyformat, yyunexpected);
23.2135 -
23.2136 - for (yyx = yyxbegin; yyx < yyxend; ++yyx)
23.2137 - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
23.2138 - {
23.2139 - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
23.2140 - {
23.2141 - yycount = 1;
23.2142 - yysize = yysize0;
23.2143 - yyformat[sizeof yyunexpected - 1] = '\0';
23.2144 - break;
23.2145 - }
23.2146 - yyarg[yycount++] = yytname[yyx];
23.2147 - yysize1 = yysize + yytnamerr (0, yytname[yyx]);
23.2148 - yysize_overflow |= yysize1 < yysize;
23.2149 - yysize = yysize1;
23.2150 - yyfmt = yystpcpy (yyfmt, yyprefix);
23.2151 - yyprefix = yyor;
23.2152 - }
23.2153 -
23.2154 - yyf = YY_(yyformat);
23.2155 - yysize1 = yysize + yystrlen (yyf);
23.2156 - yysize_overflow |= yysize1 < yysize;
23.2157 - yysize = yysize1;
23.2158 -
23.2159 - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
23.2160 - yymsg = (char *) YYSTACK_ALLOC (yysize);
23.2161 - if (yymsg)
23.2162 - {
23.2163 - /* Avoid sprintf, as that infringes on the user's name space.
23.2164 - Don't have undefined behavior even if the translation
23.2165 - produced a string with the wrong number of "%s"s. */
23.2166 - char *yyp = yymsg;
23.2167 - int yyi = 0;
23.2168 - while ((*yyp = *yyf))
23.2169 - {
23.2170 - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
23.2171 - {
23.2172 - yyp += yytnamerr (yyp, yyarg[yyi++]);
23.2173 - yyf += 2;
23.2174 - }
23.2175 - else
23.2176 - {
23.2177 - yyp++;
23.2178 - yyf++;
23.2179 - }
23.2180 - }
23.2181 - yyerror (yymsg);
23.2182 - YYSTACK_FREE (yymsg);
23.2183 - }
23.2184 - else
23.2185 - {
23.2186 - yyerror (YY_("syntax error"));
23.2187 - goto yyexhaustedlab;
23.2188 - }
23.2189 - }
23.2190 - else
23.2191 -#endif /* YYERROR_VERBOSE */
23.2192 - yyerror (YY_("syntax error"));
23.2193 }
23.2194
23.2195
23.2196 @@ -1980,14 +2110,15 @@
23.2197 error, discard it. */
23.2198
23.2199 if (yychar <= YYEOF)
23.2200 - {
23.2201 + {
23.2202 /* Return failure if at end of input. */
23.2203 if (yychar == YYEOF)
23.2204 YYABORT;
23.2205 - }
23.2206 + }
23.2207 else
23.2208 {
23.2209 - yydestruct ("Error: discarding", yytoken, &yylval);
23.2210 + yydestruct ("Error: discarding",
23.2211 + yytoken, &yylval);
23.2212 yychar = YYEMPTY;
23.2213 }
23.2214 }
23.2215 @@ -2005,11 +2136,14 @@
23.2216 /* Pacify compilers like GCC when the user code never invokes
23.2217 YYERROR and the label yyerrorlab therefore never appears in user
23.2218 code. */
23.2219 - if (0)
23.2220 + if (/*CONSTCOND*/ 0)
23.2221 goto yyerrorlab;
23.2222
23.2223 -yyvsp -= yylen;
23.2224 - yyssp -= yylen;
23.2225 + /* Do not reclaim the symbols of the rule which action triggered
23.2226 + this YYERROR. */
23.2227 + YYPOPSTACK (yylen);
23.2228 + yylen = 0;
23.2229 + YY_STACK_PRINT (yyss, yyssp);
23.2230 yystate = *yyssp;
23.2231 goto yyerrlab1;
23.2232
23.2233 @@ -2039,8 +2173,9 @@
23.2234 YYABORT;
23.2235
23.2236
23.2237 - yydestruct ("Error: popping", yystos[yystate], yyvsp);
23.2238 - YYPOPSTACK;
23.2239 + yydestruct ("Error: popping",
23.2240 + yystos[yystate], yyvsp);
23.2241 + YYPOPSTACK (1);
23.2242 yystate = *yyssp;
23.2243 YY_STACK_PRINT (yyss, yyssp);
23.2244 }
23.2245 @@ -2051,7 +2186,7 @@
23.2246 *++yyvsp = yylval;
23.2247
23.2248
23.2249 - /* Shift the error token. */
23.2250 + /* Shift the error token. */
23.2251 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
23.2252
23.2253 yystate = yyn;
23.2254 @@ -2086,17 +2221,26 @@
23.2255 if (yychar != YYEOF && yychar != YYEMPTY)
23.2256 yydestruct ("Cleanup: discarding lookahead",
23.2257 yytoken, &yylval);
23.2258 + /* Do not reclaim the symbols of the rule which action triggered
23.2259 + this YYABORT or YYACCEPT. */
23.2260 + YYPOPSTACK (yylen);
23.2261 + YY_STACK_PRINT (yyss, yyssp);
23.2262 while (yyssp != yyss)
23.2263 {
23.2264 yydestruct ("Cleanup: popping",
23.2265 yystos[*yyssp], yyvsp);
23.2266 - YYPOPSTACK;
23.2267 + YYPOPSTACK (1);
23.2268 }
23.2269 #ifndef yyoverflow
23.2270 if (yyss != yyssa)
23.2271 YYSTACK_FREE (yyss);
23.2272 #endif
23.2273 - return yyresult;
23.2274 +#if YYERROR_VERBOSE
23.2275 + if (yymsg != yymsgbuf)
23.2276 + YYSTACK_FREE (yymsg);
23.2277 +#endif
23.2278 + /* Make sure YYID is used. */
23.2279 + return YYID (yyresult);
23.2280 }
23.2281
23.2282
23.2283 @@ -2115,7 +2259,7 @@
23.2284 modules_sym = sym_lookup(NULL, 0);
23.2285 modules_sym->type = S_BOOLEAN;
23.2286 modules_sym->flags |= SYMBOL_AUTO;
23.2287 - rootmenu.prompt = menu_add_prompt(P_MENU, PROJECT_NAME" Configuration", NULL);
23.2288 + rootmenu.prompt = menu_add_prompt(P_MENU, PACKAGE, NULL);
23.2289
23.2290 #if YYDEBUG
23.2291 if (getenv("ZCONF_DEBUG"))
23.2292 @@ -2132,9 +2276,11 @@
23.2293 }
23.2294 menu_finalize(&rootmenu);
23.2295 for_all_symbols(i, sym) {
23.2296 - sym_check_deps(sym);
23.2297 + if (sym_check_deps(sym))
23.2298 + zconfnerrs++;
23.2299 }
23.2300 -
23.2301 + if (zconfnerrs)
23.2302 + exit(1);
23.2303 sym_set_change_count(1);
23.2304 }
23.2305
23.2306 @@ -2278,11 +2424,11 @@
23.2307 break;
23.2308 }
23.2309 }
23.2310 - if (sym->help) {
23.2311 - int len = strlen(sym->help);
23.2312 - while (sym->help[--len] == '\n')
23.2313 - sym->help[len] = 0;
23.2314 - fprintf(out, " help\n%s\n", sym->help);
23.2315 + if (menu->help) {
23.2316 + int len = strlen(menu->help);
23.2317 + while (menu->help[--len] == '\n')
23.2318 + menu->help[len] = 0;
23.2319 + fprintf(out, " help\n%s\n", menu->help);
23.2320 }
23.2321 fputc('\n', out);
23.2322 }
23.2323 @@ -2342,4 +2488,3 @@
23.2324 #include "symbol.c"
23.2325 #include "menu.c"
23.2326
23.2327 -