summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-11-06 03:54:26 (UTC)
committer kergoth <kergoth>2002-11-06 03:54:26 (UTC)
commit6b7d5deabe1d2da336fbe6c8409e437cbb8a1c89 (patch) (unidiff)
tree9df959827ec4e404d91d3838dde7853c32abe33f
parent2129e9cd500a7755062c93f3b9ea325b9368ea37 (diff)
downloadopie-6b7d5deabe1d2da336fbe6c8409e437cbb8a1c89.zip
opie-6b7d5deabe1d2da336fbe6c8409e437cbb8a1c89.tar.gz
opie-6b7d5deabe1d2da336fbe6c8409e437cbb8a1c89.tar.bz2
Remove kernel references
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/kconfig/mconf.c8
-rw-r--r--scripts/kconfig/zconf.y2
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 84699be..dec8603 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -1,164 +1,164 @@
1/* 1/*
2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
3 * Released under the terms of the GNU GPL v2.0. 3 * Released under the terms of the GNU GPL v2.0.
4 */ 4 */
5 5
6#include <sys/ioctl.h> 6#include <sys/ioctl.h>
7#include <sys/wait.h> 7#include <sys/wait.h>
8#include <ctype.h> 8#include <ctype.h>
9#include <errno.h> 9#include <errno.h>
10#include <fcntl.h> 10#include <fcntl.h>
11#include <signal.h> 11#include <signal.h>
12#include <stdarg.h> 12#include <stdarg.h>
13#include <stdlib.h> 13#include <stdlib.h>
14#include <string.h> 14#include <string.h>
15#include <unistd.h> 15#include <unistd.h>
16 16
17#define LKC_DIRECT_LINK 17#define LKC_DIRECT_LINK
18#include "lkc.h" 18#include "lkc.h"
19 19
20static char menu_backtitle[128]; 20static char menu_backtitle[128];
21static const char menu_instructions[] = 21static const char menu_instructions[] =
22 "Arrow keys navigate the menu. " 22 "Arrow keys navigate the menu. "
23 "<Enter> selects submenus --->. " 23 "<Enter> selects submenus --->. "
24 "Highlighted letters are hotkeys. " 24 "Highlighted letters are hotkeys. "
25 "Pressing <Y> includes, <N> excludes, <M> modularizes features. " 25 "Pressing <Y> includes, <N> excludes, <M> modularizes features. "
26 "Press <Esc><Esc> to exit, <?> for Help. " 26 "Press <Esc><Esc> to exit, <?> for Help. "
27 "Legend: [*] built-in [ ] excluded <M> module < > module capable", 27 "Legend: [*] built-in [ ] excluded <M> module < > module capable",
28radiolist_instructions[] = 28radiolist_instructions[] =
29 "Use the arrow keys to navigate this window or " 29 "Use the arrow keys to navigate this window or "
30 "press the hotkey of the item you wish to select " 30 "press the hotkey of the item you wish to select "
31 "followed by the <SPACE BAR>. " 31 "followed by the <SPACE BAR>. "
32 "Press <?> for additional information about this option.", 32 "Press <?> for additional information about this option.",
33inputbox_instructions_int[] = 33inputbox_instructions_int[] =
34 "Please enter a decimal value. " 34 "Please enter a decimal value. "
35 "Fractions will not be accepted. " 35 "Fractions will not be accepted. "
36 "Use the <TAB> key to move from the input field to the buttons below it.", 36 "Use the <TAB> key to move from the input field to the buttons below it.",
37inputbox_instructions_hex[] = 37inputbox_instructions_hex[] =
38 "Please enter a hexadecimal value. " 38 "Please enter a hexadecimal value. "
39 "Use the <TAB> key to move from the input field to the buttons below it.", 39 "Use the <TAB> key to move from the input field to the buttons below it.",
40inputbox_instructions_string[] = 40inputbox_instructions_string[] =
41 "Please enter a string value. " 41 "Please enter a string value. "
42 "Use the <TAB> key to move from the input field to the buttons below it.", 42 "Use the <TAB> key to move from the input field to the buttons below it.",
43setmod_text[] = 43setmod_text[] =
44 "This feature depends on another which has been configured as a module.\n" 44 "This feature depends on another which has been configured as a module.\n"
45 "As a result, this feature will be built as a module.", 45 "As a result, this feature will be built as a module.",
46nohelp_text[] = 46nohelp_text[] =
47 "There is no help available for this kernel option.\n", 47 "There is no help available for this option.\n",
48load_config_text[] = 48load_config_text[] =
49 "Enter the name of the configuration file you wish to load. " 49 "Enter the name of the configuration file you wish to load. "
50 "Accept the name shown to restore the configuration you " 50 "Accept the name shown to restore the configuration you "
51 "last retrieved. Leave blank to abort.", 51 "last retrieved. Leave blank to abort.",
52load_config_help[] = 52load_config_help[] =
53 "\n" 53 "\n"
54 "For various reasons, one may wish to keep several different kernel\n" 54 "For various reasons, one may wish to keep several different\n"
55 "configurations available on a single machine.\n" 55 "configurations available on a single machine.\n"
56 "\n" 56 "\n"
57 "If you have saved a previous configuration in a file other than the\n" 57 "If you have saved a previous configuration in a file other than the\n"
58 "kernel's default, entering the name of the file here will allow you\n" 58 "default, entering the name of the file here will allow you\n"
59 "to modify that configuration.\n" 59 "to modify that configuration.\n"
60 "\n" 60 "\n"
61 "If you are uncertain, then you have probably never used alternate\n" 61 "If you are uncertain, then you have probably never used alternate\n"
62 "configuration files. You should therefor leave this blank to abort.\n", 62 "configuration files. You should therefor leave this blank to abort.\n",
63save_config_text[] = 63save_config_text[] =
64 "Enter a filename to which this configuration should be saved " 64 "Enter a filename to which this configuration should be saved "
65 "as an alternate. Leave blank to abort.", 65 "as an alternate. Leave blank to abort.",
66save_config_help[] = 66save_config_help[] =
67 "\n" 67 "\n"
68 "For various reasons, one may wish to keep different kernel\n" 68 "For various reasons, one may wish to keep different\n"
69 "configurations available on a single machine.\n" 69 "configurations available on a single machine.\n"
70 "\n" 70 "\n"
71 "Entering a file name here will allow you to later retrieve, modify\n" 71 "Entering a file name here will allow you to later retrieve, modify\n"
72 "and use the current configuration as an alternate to whatever\n" 72 "and use the current configuration as an alternate to whatever\n"
73 "configuration options you have selected at that time.\n" 73 "configuration options you have selected at that time.\n"
74 "\n" 74 "\n"
75 "If you are uncertain what all this means then you should probably\n" 75 "If you are uncertain what all this means then you should probably\n"
76 "leave this blank.\n" 76 "leave this blank.\n"
77; 77;
78 78
79static char buf[4096], *bufptr = buf; 79static char buf[4096], *bufptr = buf;
80static char input_buf[4096]; 80static char input_buf[4096];
81static char *args[1024], **argptr = args; 81static char *args[1024], **argptr = args;
82static int indent = 0; 82static int indent = 0;
83static int rows, cols; 83static int rows, cols;
84static struct menu *current_menu; 84static struct menu *current_menu;
85static int child_count; 85static int child_count;
86static int do_resize; 86static int do_resize;
87 87
88static void conf(struct menu *menu); 88static void conf(struct menu *menu);
89static void conf_choice(struct menu *menu); 89static void conf_choice(struct menu *menu);
90static void conf_string(struct menu *menu); 90static void conf_string(struct menu *menu);
91static void conf_load(void); 91static void conf_load(void);
92static void conf_save(void); 92static void conf_save(void);
93static void show_textbox(const char *title, const char *text, int r, int c); 93static void show_textbox(const char *title, const char *text, int r, int c);
94static void show_helptext(const char *title, const char *text); 94static void show_helptext(const char *title, const char *text);
95static void show_help(struct menu *menu); 95static void show_help(struct menu *menu);
96static void show_readme(void); 96static void show_readme(void);
97 97
98static void cprint_init(void); 98static void cprint_init(void);
99static int cprint1(const char *fmt, ...); 99static int cprint1(const char *fmt, ...);
100static void cprint_done(void); 100static void cprint_done(void);
101static int cprint(const char *fmt, ...); 101static int cprint(const char *fmt, ...);
102 102
103static void init_wsize(void) 103static void init_wsize(void)
104{ 104{
105 struct winsize ws; 105 struct winsize ws;
106 106
107 if (ioctl(1, TIOCGWINSZ, &ws) == -1) { 107 if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
108 rows = 24; 108 rows = 24;
109 cols = 80; 109 cols = 80;
110 } else { 110 } else {
111 rows = ws.ws_row; 111 rows = ws.ws_row;
112 cols = ws.ws_col; 112 cols = ws.ws_col;
113 } 113 }
114 114
115 if (rows < 19 || cols < 80) { 115 if (rows < 19 || cols < 80) {
116 fprintf(stderr, "Your display is too small to run Menuconfig!\n"); 116 fprintf(stderr, "Your display is too small to run Menuconfig!\n");
117 fprintf(stderr, "It must be at least 19 lines by 80 columns.\n"); 117 fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
118 exit(1); 118 exit(1);
119 } 119 }
120 120
121 rows -= 4; 121 rows -= 4;
122 cols -= 5; 122 cols -= 5;
123} 123}
124 124
125static void cprint_init(void) 125static void cprint_init(void)
126{ 126{
127 bufptr = buf; 127 bufptr = buf;
128 argptr = args; 128 argptr = args;
129 memset(args, 0, sizeof(args)); 129 memset(args, 0, sizeof(args));
130 indent = 0; 130 indent = 0;
131 child_count = 0; 131 child_count = 0;
132 cprint("./scripts/lxdialog/lxdialog"); 132 cprint("./scripts/lxdialog/lxdialog");
133 cprint("--backtitle"); 133 cprint("--backtitle");
134 cprint(menu_backtitle); 134 cprint(menu_backtitle);
135} 135}
136 136
137static int cprint1(const char *fmt, ...) 137static int cprint1(const char *fmt, ...)
138{ 138{
139 va_list ap; 139 va_list ap;
140 int res; 140 int res;
141 141
142 if (!*argptr) 142 if (!*argptr)
143 *argptr = bufptr; 143 *argptr = bufptr;
144 va_start(ap, fmt); 144 va_start(ap, fmt);
145 res = vsprintf(bufptr, fmt, ap); 145 res = vsprintf(bufptr, fmt, ap);
146 va_end(ap); 146 va_end(ap);
147 bufptr += res; 147 bufptr += res;
148 148
149 return res; 149 return res;
150} 150}
151 151
152static void cprint_done(void) 152static void cprint_done(void)
153{ 153{
154 *bufptr++ = 0; 154 *bufptr++ = 0;
155 argptr++; 155 argptr++;
156} 156}
157 157
158static int cprint(const char *fmt, ...) 158static int cprint(const char *fmt, ...)
159{ 159{
160 va_list ap; 160 va_list ap;
161 int res; 161 int res;
162 162
163 *argptr++ = bufptr; 163 *argptr++ = bufptr;
164 va_start(ap, fmt); 164 va_start(ap, fmt);
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 79cb983..c3f1bd0 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -331,193 +331,193 @@ comment: T_COMMENT prompt
331 menu_add_entry(NULL); 331 menu_add_entry(NULL);
332 menu_add_prop(P_COMMENT, $2, NULL, NULL); 332 menu_add_prop(P_COMMENT, $2, NULL, NULL);
333 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); 333 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
334}; 334};
335 335
336comment_stmt: comment T_EOL depends_list 336comment_stmt: comment T_EOL depends_list
337{ 337{
338 menu_end_entry(); 338 menu_end_entry();
339}; 339};
340 340
341/* help option */ 341/* help option */
342 342
343help_start: T_HELP T_EOL 343help_start: T_HELP T_EOL
344{ 344{
345 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); 345 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
346 zconf_starthelp(); 346 zconf_starthelp();
347}; 347};
348 348
349help: help_start T_HELPTEXT 349help: help_start T_HELPTEXT
350{ 350{
351 current_entry->sym->help = $2; 351 current_entry->sym->help = $2;
352}; 352};
353 353
354/* depends option */ 354/* depends option */
355 355
356 depends_list: /* empty */ 356 depends_list: /* empty */
357 | depends_list depends T_EOL 357 | depends_list depends T_EOL
358 | depends_list T_EOL 358 | depends_list T_EOL
359{ }; 359{ };
360 360
361depends: T_DEPENDS T_ON expr 361depends: T_DEPENDS T_ON expr
362{ 362{
363 menu_add_dep($3); 363 menu_add_dep($3);
364 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); 364 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
365} 365}
366 | T_DEPENDS expr 366 | T_DEPENDS expr
367{ 367{
368 menu_add_dep($2); 368 menu_add_dep($2);
369 printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); 369 printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
370} 370}
371 | T_REQUIRES expr 371 | T_REQUIRES expr
372{ 372{
373 menu_add_dep($2); 373 menu_add_dep($2);
374 printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); 374 printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
375}; 375};
376 376
377/* prompt statement */ 377/* prompt statement */
378 378
379prompt_stmt_opt: 379prompt_stmt_opt:
380 /* empty */ 380 /* empty */
381 | prompt 381 | prompt
382{ 382{
383 menu_add_prop(P_PROMPT, $1, NULL, NULL); 383 menu_add_prop(P_PROMPT, $1, NULL, NULL);
384} 384}
385 | prompt T_IF expr 385 | prompt T_IF expr
386{ 386{
387 menu_add_prop(P_PROMPT, $1, NULL, $3); 387 menu_add_prop(P_PROMPT, $1, NULL, $3);
388}; 388};
389 389
390 prompt: T_WORD 390 prompt: T_WORD
391 | T_STRING 391 | T_STRING
392; 392;
393 393
394 end: T_ENDMENU { $$ = T_ENDMENU; } 394 end: T_ENDMENU { $$ = T_ENDMENU; }
395 | T_ENDCHOICE { $$ = T_ENDCHOICE; } 395 | T_ENDCHOICE { $$ = T_ENDCHOICE; }
396 | T_ENDIF { $$ = T_ENDIF; } 396 | T_ENDIF { $$ = T_ENDIF; }
397; 397;
398 398
399nl_or_eof: 399nl_or_eof:
400 T_EOL | T_EOF; 400 T_EOL | T_EOF;
401 401
402 if_expr: /* empty */ { $$ = NULL; } 402 if_expr: /* empty */ { $$ = NULL; }
403 | T_IF expr { $$ = $2; } 403 | T_IF expr { $$ = $2; }
404; 404;
405 405
406 expr: symbol { $$ = expr_alloc_symbol($1); } 406 expr: symbol { $$ = expr_alloc_symbol($1); }
407 | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); } 407 | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); }
408 | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); } 408 | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); }
409 | T_OPEN_PAREN expr T_CLOSE_PAREN{ $$ = $2; } 409 | T_OPEN_PAREN expr T_CLOSE_PAREN{ $$ = $2; }
410 | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); } 410 | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); }
411 | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); } 411 | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); }
412 | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); } 412 | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); }
413; 413;
414 414
415 symbol: T_WORD{ $$ = sym_lookup($1, 0); free($1); } 415 symbol: T_WORD{ $$ = sym_lookup($1, 0); free($1); }
416 | T_STRING{ $$ = sym_lookup($1, 1); free($1); } 416 | T_STRING{ $$ = sym_lookup($1, 1); free($1); }
417; 417;
418 418
419%% 419%%
420 420
421void conf_parse(const char *name) 421void conf_parse(const char *name)
422{ 422{
423 zconf_initscan(name); 423 zconf_initscan(name);
424 424
425 sym_init(); 425 sym_init();
426 menu_init(); 426 menu_init();
427 rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); 427 rootmenu.prompt = menu_add_prop(P_MENU, "Configuration", NULL, NULL);
428 428
429 //zconfdebug = 1; 429 //zconfdebug = 1;
430 zconfparse(); 430 zconfparse();
431 if (zconfnerrs) 431 if (zconfnerrs)
432 exit(1); 432 exit(1);
433 menu_finalize(&rootmenu); 433 menu_finalize(&rootmenu);
434 434
435 modules_sym = sym_lookup("MODULES", 0); 435 modules_sym = sym_lookup("MODULES", 0);
436 436
437 sym_change_count = 1; 437 sym_change_count = 1;
438} 438}
439 439
440const char *zconf_tokenname(int token) 440const char *zconf_tokenname(int token)
441{ 441{
442 switch (token) { 442 switch (token) {
443 case T_MENU: return "menu"; 443 case T_MENU: return "menu";
444 case T_ENDMENU: return "endmenu"; 444 case T_ENDMENU: return "endmenu";
445 case T_CHOICE: return "choice"; 445 case T_CHOICE: return "choice";
446 case T_ENDCHOICE:return "endchoice"; 446 case T_ENDCHOICE:return "endchoice";
447 case T_IF: return "if"; 447 case T_IF: return "if";
448 case T_ENDIF: return "endif"; 448 case T_ENDIF: return "endif";
449 } 449 }
450 return "<token>"; 450 return "<token>";
451} 451}
452 452
453static bool zconf_endtoken(int token, int starttoken, int endtoken) 453static bool zconf_endtoken(int token, int starttoken, int endtoken)
454{ 454{
455 if (token != endtoken) { 455 if (token != endtoken) {
456 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken)); 456 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
457 zconfnerrs++; 457 zconfnerrs++;
458 return false; 458 return false;
459 } 459 }
460 if (current_menu->file != current_file) { 460 if (current_menu->file != current_file) {
461 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken)); 461 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
462 zconfprint("location of the '%s'", zconf_tokenname(starttoken)); 462 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
463 zconfnerrs++; 463 zconfnerrs++;
464 return false; 464 return false;
465 } 465 }
466 return true; 466 return true;
467} 467}
468 468
469static void zconfprint(const char *err, ...) 469static void zconfprint(const char *err, ...)
470{ 470{
471 va_list ap; 471 va_list ap;
472 472
473 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); 473 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
474 va_start(ap, err); 474 va_start(ap, err);
475 vfprintf(stderr, err, ap); 475 vfprintf(stderr, err, ap);
476 va_end(ap); 476 va_end(ap);
477 fprintf(stderr, "\n"); 477 fprintf(stderr, "\n");
478} 478}
479 479
480static void zconferror(const char *err) 480static void zconferror(const char *err)
481{ 481{
482 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno(), err); 482 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno(), err);
483} 483}
484 484
485void print_quoted_string(FILE *out, const char *str) 485void print_quoted_string(FILE *out, const char *str)
486{ 486{
487 const char *p; 487 const char *p;
488 int len; 488 int len;
489 489
490 putc('"', out); 490 putc('"', out);
491 while ((p = strchr(str, '"'))) { 491 while ((p = strchr(str, '"'))) {
492 len = p - str; 492 len = p - str;
493 if (len) 493 if (len)
494 fprintf(out, "%.*s", len, str); 494 fprintf(out, "%.*s", len, str);
495 fputs("\\\"", out); 495 fputs("\\\"", out);
496 str = p + 1; 496 str = p + 1;
497 } 497 }
498 fputs(str, out); 498 fputs(str, out);
499 putc('"', out); 499 putc('"', out);
500} 500}
501 501
502void print_symbol(FILE *out, struct menu *menu) 502void print_symbol(FILE *out, struct menu *menu)
503{ 503{
504 struct symbol *sym = menu->sym; 504 struct symbol *sym = menu->sym;
505 struct property *prop; 505 struct property *prop;
506 506
507 //sym->flags |= SYMBOL_PRINTED; 507 //sym->flags |= SYMBOL_PRINTED;
508 508
509 if (sym_is_choice(sym)) 509 if (sym_is_choice(sym))
510 fprintf(out, "choice\n"); 510 fprintf(out, "choice\n");
511 else 511 else
512 fprintf(out, "config %s\n", sym->name); 512 fprintf(out, "config %s\n", sym->name);
513 switch (sym->type) { 513 switch (sym->type) {
514 case S_BOOLEAN: 514 case S_BOOLEAN:
515 fputs(" boolean\n", out); 515 fputs(" boolean\n", out);
516 break; 516 break;
517 case S_TRISTATE: 517 case S_TRISTATE:
518 fputs(" tristate\n", out); 518 fputs(" tristate\n", out);
519 break; 519 break;
520 case S_STRING: 520 case S_STRING:
521 fputs(" string\n", out); 521 fputs(" string\n", out);
522 break; 522 break;
523 case S_INT: 523 case S_INT: