History

Merge branch 'master' into for-next

Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.

Jiri Kosina committed 15 years ago

Commit e060c382 parents 10e4ac5 cc39c6a3980 files · +199073 −61456Browse files

Showing the changes to scripts (23 of 3980 files). Show all

Unified · Split

23 files
  1. scripts/checkpatch.pl +2 −1
  2. scripts/get_maintainer.pl +1 −1
  3. scripts/kconfig/Makefile +8 −15
  4. scripts/kconfig/conf.c +39 −9
  5. scripts/kconfig/confdata.c +194 −101
  6. scripts/kconfig/expr.c +4 −9
  7. scripts/kconfig/expr.h +0 −3
  8. scripts/kconfig/gconf.c +1 −37
  9. scripts/kconfig/kconfig_load.c +0 −35
  10. scripts/kconfig/kxgettext.c +0 −1
  11. scripts/kconfig/lkc.h +5 −11
  12. scripts/kconfig/lkc_proto.h +1 −0
  13. scripts/kconfig/mconf.c +1 −1
  14. scripts/kconfig/menu.c +3 −2
  15. scripts/kconfig/nconf.c +9 −21
  16. scripts/kconfig/qconf.cc +10 −7
  17. scripts/kconfig/qconf.h +1 −1
  18. scripts/kconfig/symbol.c +45 −2
  19. scripts/kconfig/util.c +2 −0
  20. scripts/kconfig/zconf.l +0 −1
  21. scripts/kconfig/zconf.lex.c_shipped +0 −1
  22. scripts/kconfig/zconf.tab.c_shipped +0 −1
  23. scripts/kconfig/zconf.y +0 −1
scripts/checkpatch.pl+2−1
@@ -2574,7 +2574,8 @@ sub process { · 2573 unmodified lines
2574 } else {2574 } else {
2575 $cast = $cast2;2575 $cast = $cast2;
2576 }2576 }
2577 WARN("$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . $herecurr);2577 WARN("MINMAX",
2578 "$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . $herecurr);
2578 }2579 }
2579 }2580 }
2580 2581
scripts/get_maintainer.pl+1−1
@@ -1389,7 +1389,7 @@ sub vcs_exists { · 1388 unmodified lines
1389 warn("$P: No supported VCS found. Add --nogit to options?\n");1389 warn("$P: No supported VCS found. Add --nogit to options?\n");
1390 warn("Using a git repository produces better results.\n");1390 warn("Using a git repository produces better results.\n");
1391 warn("Try Linus Torvalds' latest git repository using:\n");1391 warn("Try Linus Torvalds' latest git repository using:\n");
1392 warn("git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n");1392 warn("git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n");
1393 $printed_novcs = 1;1393 $printed_novcs = 1;
1394 }1394 }
1395 return 0;1395 return 0;
scripts/kconfig/Makefile+8−15
@@ -170,8 +170,8 @@ mconf-objs := mconf.o zconf.tab.o $(lxdialog) · 169 unmodified lines
170nconf-objs := nconf.o zconf.tab.o nconf.gui.o170nconf-objs := nconf.o zconf.tab.o nconf.gui.o
171kxgettext-objs := kxgettext.o zconf.tab.o171kxgettext-objs := kxgettext.o zconf.tab.o
172qconf-cxxobjs := qconf.o172qconf-cxxobjs := qconf.o
173qconf-objs := kconfig_load.o zconf.tab.o173qconf-objs := zconf.tab.o
174gconf-objs := gconf.o kconfig_load.o zconf.tab.o174gconf-objs := gconf.o zconf.tab.o
175 175
176hostprogs-y := conf176hostprogs-y := conf
177 177
@@ -203,7 +203,7 @@ ifeq ($(gconf-target),1) · 25 unmodified lines
203 hostprogs-y += gconf203 hostprogs-y += gconf
204endif204endif
205 205
206clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck206clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
207clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h207clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
208clean-files += mconf qconf gconf nconf208clean-files += mconf qconf gconf nconf
209clean-files += config.pot linux.pot209clean-files += config.pot linux.pot
@@ -226,12 +226,12 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) · 16 unmodified lines
226LEX_PREFIX_zconf := zconf226LEX_PREFIX_zconf := zconf
227YACC_PREFIX_zconf := zconf227YACC_PREFIX_zconf := zconf
228 228
229HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl229HOSTLOADLIBES_qconf = $(KC_QT_LIBS)
230HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK230HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS)
231 231
232HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl232HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
233HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \233HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
234 -D LKC_DIRECT_LINK234 -Wno-missing-prototypes
235 235
236HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))236HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
237 237
@@ -321,18 +321,11 @@ endif · 83 unmodified lines
321 321
322$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c322$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
323 323
324$(obj)/kconfig_load.o: $(obj)/lkc_defs.h324$(obj)/qconf.o: $(obj)/qconf.moc
325
326$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
327
328$(obj)/gconf.o: $(obj)/lkc_defs.h
329 325
330$(obj)/%.moc: $(src)/%.h326$(obj)/%.moc: $(src)/%.h
331 $(KC_QT_MOC) -i $< -o $@327 $(KC_QT_MOC) -i $< -o $@
332 328
333$(obj)/lkc_defs.h: $(src)/lkc_proto.h
334 $(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
335
336# Extract gconf menu items for I18N support329# Extract gconf menu items for I18N support
337$(obj)/gconf.glade.h: $(obj)/gconf.glade330$(obj)/gconf.glade.h: $(obj)/gconf.glade
338 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \331 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
scripts/kconfig/conf.c+39−9
@@ -14,11 +14,11 @@ · 13 unmodified lines
14#include <sys/stat.h>14#include <sys/stat.h>
15#include <sys/time.h>15#include <sys/time.h>
16 16
17#define LKC_DIRECT_LINK
18#include "lkc.h"17#include "lkc.h"
19 18
20static void conf(struct menu *menu);19static void conf(struct menu *menu);
21static void check_conf(struct menu *menu);20static void check_conf(struct menu *menu);
21static void xfgets(char *str, int size, FILE *in);
22 22
23enum input_mode {23enum input_mode {
24 oldaskconfig,24 oldaskconfig,
@@ -35,8 +35,6 @@ enum input_mode { · 10 unmodified lines
35 oldnoconfig,35 oldnoconfig,
36} input_mode = oldaskconfig;36} input_mode = oldaskconfig;
37 37
38char *defconfig_file;
39
40static int indent = 1;38static int indent = 1;
41static int valid_stdin = 1;39static int valid_stdin = 1;
42static int sync_kconfig;40static int sync_kconfig;
@@ -106,6 +104,7 @@ static int conf_askvalue(struct symbol *sym, const char *def) · 63 unmodified lines
106 return 0;104 return 0;
107 }105 }
108 check_stdin();106 check_stdin();
107 /* fall through */
109 case oldaskconfig:108 case oldaskconfig:
110 fflush(stdout);109 fflush(stdout);
111 xfgets(line, 128, stdin);110 xfgets(line, 128, stdin);
@@ -150,6 +149,7 @@ static int conf_string(struct menu *menu) · 38 unmodified lines
150 def = NULL;149 def = NULL;
151 break;150 break;
152 }151 }
152 /* fall through */
153 default:153 default:
154 line[strlen(line)-1] = 0;154 line[strlen(line)-1] = 0;
155 def = line;155 def = line;
@@ -304,6 +304,7 @@ static int conf_choice(struct menu *menu) · 148 unmodified lines
304 break;304 break;
305 }305 }
306 check_stdin();306 check_stdin();
307 /* fall through */
307 case oldaskconfig:308 case oldaskconfig:
308 fflush(stdout);309 fflush(stdout);
309 xfgets(line, 128, stdin);310 xfgets(line, 128, stdin);
@@ -369,6 +370,7 @@ static void conf(struct menu *menu) · 59 unmodified lines
369 check_conf(menu);370 check_conf(menu);
370 return;371 return;
371 }372 }
373 /* fall through */
372 case P_COMMENT:374 case P_COMMENT:
373 prompt = menu_get_prompt(menu);375 prompt = menu_get_prompt(menu);
374 if (prompt)376 if (prompt)
@@ -456,10 +458,30 @@ static struct option long_opts[] = { · 81 unmodified lines
456 {NULL, 0, NULL, 0}458 {NULL, 0, NULL, 0}
457};459};
458 460
461static void conf_usage(const char *progname)
462{
463
464 printf("Usage: %s [option] <kconfig-file>\n", progname);
465 printf("[option] is _one_ of the following:\n");
466 printf(" --listnewconfig List new options\n");
467 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
468 printf(" --oldconfig Update a configuration using a provided .config as base\n");
469 printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n");
470 printf(" --oldnoconfig Same as silentoldconfig but set new symbols to no\n");
471 printf(" --defconfig <file> New config with default defined in <file>\n");
472 printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n");
473 printf(" --allnoconfig New config where all options are answered with no\n");
474 printf(" --allyesconfig New config where all options are answered with yes\n");
475 printf(" --allmodconfig New config where all options are answered with mod\n");
476 printf(" --alldefconfig New config with all symbols set to default\n");
477 printf(" --randconfig New config with random answer to all options\n");
478}
479
459int main(int ac, char **av)480int main(int ac, char **av)
460{481{
482 const char *progname = av[0];
461 int opt;483 int opt;
462 const char *name;484 const char *name, *defconfig_file = NULL /* gcc uninit */;
463 struct stat tmpstat;485 struct stat tmpstat;
464 486
465 setlocale(LC_ALL, "");487 setlocale(LC_ALL, "");
@@ -491,14 +513,24 @@ int main(int ac, char **av) · 25 unmodified lines
491 srand(seed);513 srand(seed);
492 break;514 break;
493 }515 }
516 case oldaskconfig:
517 case oldconfig:
518 case allnoconfig:
519 case allyesconfig:
520 case allmodconfig:
521 case alldefconfig:
522 case listnewconfig:
523 case oldnoconfig:
524 break;
494 case '?':525 case '?':
495 fprintf(stderr, _("See README for usage info\n"));526 conf_usage(progname);
496 exit(1);527 exit(1);
497 break;528 break;
498 }529 }
499 }530 }
500 if (ac == optind) {531 if (ac == optind) {
501 printf(_("%s: Kconfig file missing\n"), av[0]);532 printf(_("%s: Kconfig file missing\n"), av[0]);
533 conf_usage(progname);
502 exit(1);534 exit(1);
503 }535 }
504 name = av[optind];536 name = av[optind];
@@ -641,13 +673,11 @@ int main(int ac, char **av) · 136 unmodified lines
641 }673 }
642 return 0;674 return 0;
643}675}
676
644/*677/*
645 * Helper function to facilitate fgets() by Jean Sacren.678 * Helper function to facilitate fgets() by Jean Sacren.
646 */679 */
647void xfgets(str, size, in)680void xfgets(char *str, int size, FILE *in)
648 char *str;
649 int size;
650 FILE *in;
651{681{
652 if (fgets(str, size, in) == NULL)682 if (fgets(str, size, in) == NULL)
653 fprintf(stderr, "\nError in reading or end of file.\n");683 fprintf(stderr, "\nError in reading or end of file.\n");
scripts/kconfig/confdata.c+194−101
@@ -7,13 +7,13 @@ · 6 unmodified lines
7#include <ctype.h>7#include <ctype.h>
8#include <errno.h>8#include <errno.h>
9#include <fcntl.h>9#include <fcntl.h>
10#include <stdarg.h>
10#include <stdio.h>11#include <stdio.h>
11#include <stdlib.h>12#include <stdlib.h>
12#include <string.h>13#include <string.h>
13#include <time.h>14#include <time.h>
14#include <unistd.h>15#include <unistd.h>
15 16
16#define LKC_DIRECT_LINK
17#include "lkc.h"17#include "lkc.h"
18 18
19static void conf_warning(const char *fmt, ...)19static void conf_warning(const char *fmt, ...)
@@ -128,6 +128,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 108 unmodified lines
128 sym->flags |= def_flags;128 sym->flags |= def_flags;
129 break;129 break;
130 }130 }
131 /* fall through */
131 case S_BOOLEAN:132 case S_BOOLEAN:
132 if (p[0] == 'y') {133 if (p[0] == 'y') {
133 sym->def[def].tri = yes;134 sym->def[def].tri = yes;
@@ -140,7 +141,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 6 unmodified lines
140 break;141 break;
141 }142 }
142 conf_warning("symbol value '%s' invalid for %s", p, sym->name);143 conf_warning("symbol value '%s' invalid for %s", p, sym->name);
143 break;144 return 1;
144 case S_OTHER:145 case S_OTHER:
145 if (*p != '"') {146 if (*p != '"') {
146 for (p2 = p; *p2 && !isspace(*p2); p2++)147 for (p2 = p; *p2 && !isspace(*p2); p2++)
@@ -148,6 +149,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 1 unmodified line
148 sym->type = S_STRING;149 sym->type = S_STRING;
149 goto done;150 goto done;
150 }151 }
152 /* fall through */
151 case S_STRING:153 case S_STRING:
152 if (*p++ != '"')154 if (*p++ != '"')
153 break;155 break;
@@ -162,6 +164,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 8 unmodified lines
162 conf_warning("invalid string found");164 conf_warning("invalid string found");
163 return 1;165 return 1;
164 }166 }
167 /* fall through */
165 case S_INT:168 case S_INT:
166 case S_HEX:169 case S_HEX:
167 done:170 done:
@@ -237,6 +240,7 @@ load: · 69 unmodified lines
237 case S_STRING:240 case S_STRING:
238 if (sym->def[def].val)241 if (sym->def[def].val)
239 free(sym->def[def].val);242 free(sym->def[def].val);
243 /* fall through */
240 default:244 default:
241 sym->def[def].val = NULL;245 sym->def[def].val = NULL;
242 sym->def[def].tri = no;246 sym->def[def].tri = no;
@@ -363,6 +367,7 @@ int conf_read(const char *name) · 120 unmodified lines
363 break;367 break;
364 if (!sym_is_choice(sym))368 if (!sym_is_choice(sym))
365 goto sym_ok;369 goto sym_ok;
370 /* fall through */
366 default:371 default:
367 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))372 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
368 goto sym_ok;373 goto sym_ok;
@@ -417,64 +422,202 @@ int conf_read(const char *name) · 48 unmodified lines
417 return 0;422 return 0;
418}423}
419 424
420/* Write a S_STRING */425/*
421static void conf_write_string(bool headerfile, const char *name,426 * Kconfig configuration printer
422 const char *str, FILE *out)427 *
428 * This printer is used when generating the resulting configuration after
429 * kconfig invocation and `defconfig' files. Unset symbol might be omitted by
430 * passing a non-NULL argument to the printer.
431 *
432 */
433static void
434kconfig_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
423{435{
424 int l;436
425 if (headerfile)437 switch (sym->type) {
426 fprintf(out, "#define %s%s \"", CONFIG_, name);438 case S_BOOLEAN:
427 else439 case S_TRISTATE:
428 fprintf(out, "%s%s=\"", CONFIG_, name);440 if (*value == 'n') {
429 441 bool skip_unset = (arg != NULL);
430 while (1) {442
431 l = strcspn(str, "\"\\");443 if (!skip_unset)
444 fprintf(fp, "# %s%s is not set\n",
445 CONFIG_, sym->name);
446 return;
447 }
448 break;
449 default:
450 break;
451 }
452
453 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, value);
454}
455
456static void
457kconfig_print_comment(FILE *fp, const char *value, void *arg)
458{
459 const char *p = value;
460 size_t l;
461
462 for (;;) {
463 l = strcspn(p, "\n");
464 fprintf(fp, "#");
432 if (l) {465 if (l) {
433 xfwrite(str, l, 1, out);466 fprintf(fp, " ");
434 str += l;467 fwrite(p, l, 1, fp);
468 p += l;
435 }469 }
436 if (!*str)470 fprintf(fp, "\n");
471 if (*p++ == '\0')
437 break;472 break;
438 fprintf(out, "\\%c", *str++);
439 }473 }
440 fputs("\"\n", out);
441}474}
442 475
443static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no)476static struct conf_printer kconfig_printer_cb =
477{
478 .print_symbol = kconfig_print_symbol,
479 .print_comment = kconfig_print_comment,
480};
481
482/*
483 * Header printer
484 *
485 * This printer is used when generating the `include/generated/autoconf.h' file.
486 */
487static void
488header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
444{489{
445 const char *str;
446 490
447 switch (sym->type) {491 switch (sym->type) {
448 case S_BOOLEAN:492 case S_BOOLEAN:
449 case S_TRISTATE:493 case S_TRISTATE: {
450 switch (sym_get_tristate_value(sym)) {494 const char *suffix = "";
451 case no:495
452 if (write_no)496 switch (*value) {
453 fprintf(out, "# %s%s is not set\n",497 case 'n':
454 CONFIG_, sym->name);
455 break;
456 case mod:
457 fprintf(out, "%s%s=m\n", CONFIG_, sym->name);
458 break;
459 case yes:
460 fprintf(out, "%s%s=y\n", CONFIG_, sym->name);
461 break;498 break;
499 case 'm':
500 suffix = "_MODULE";
501 /* fall through */
502 default:
503 fprintf(fp, "#define %s%s%s 1\n",
504 CONFIG_, sym->name, suffix);
462 }505 }
506 /*
507 * Generate the __enabled_CONFIG_* and
508 * __enabled_CONFIG_*_MODULE macros for use by the
509 * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
510 * generated even for booleans so that the IS_ENABLED() macro
511 * works.
512 */
513 fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
514 sym->name, (*value == 'y'));
515 fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
516 sym->name, (*value == 'm'));
463 break;517 break;
464 case S_STRING:518 }
465 conf_write_string(false, sym->name, sym_get_string_value(sym), out);519 case S_HEX: {
520 const char *prefix = "";
521
522 if (value[0] != '0' || (value[1] != 'x' && value[1] != 'X'))
523 prefix = "0x";
524 fprintf(fp, "#define %s%s %s%s\n",
525 CONFIG_, sym->name, prefix, value);
466 break;526 break;
467 case S_HEX:527 }
528 case S_STRING:
468 case S_INT:529 case S_INT:
469 str = sym_get_string_value(sym);530 fprintf(fp, "#define %s%s %s\n",
470 fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str);531 CONFIG_, sym->name, value);
532 break;
533 default:
471 break;534 break;
535 }
536
537}
538
539static void
540header_print_comment(FILE *fp, const char *value, void *arg)
541{
542 const char *p = value;
543 size_t l;
544
545 fprintf(fp, "/*\n");
546 for (;;) {
547 l = strcspn(p, "\n");
548 fprintf(fp, " *");
549 if (l) {
550 fprintf(fp, " ");
551 fwrite(p, l, 1, fp);
552 p += l;
553 }
554 fprintf(fp, "\n");
555 if (*p++ == '\0')
556 break;
557 }
558 fprintf(fp, " */\n");
559}
560
561static struct conf_printer header_printer_cb =
562{
563 .print_symbol = header_print_symbol,
564 .print_comment = header_print_comment,
565};
566
567/*
568 * Tristate printer
569 *
570 * This printer is used when generating the `include/config/tristate.conf' file.
571 */
572static void
573tristate_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
574{
575
576 if (sym->type == S_TRISTATE && *value != 'n')
577 fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value));
578}
579
580static struct conf_printer tristate_printer_cb =
581{
582 .print_symbol = tristate_print_symbol,
583 .print_comment = kconfig_print_comment,
584};
585
586static void conf_write_symbol(FILE *fp, struct symbol *sym,
587 struct conf_printer *printer, void *printer_arg)
588{
589 const char *str;
590
591 switch (sym->type) {
472 case S_OTHER:592 case S_OTHER:
473 case S_UNKNOWN:593 case S_UNKNOWN:
474 break;594 break;
595 case S_STRING:
596 str = sym_get_string_value(sym);
597 str = sym_escape_string_value(str);
598 printer->print_symbol(fp, sym, str, printer_arg);
599 free((void *)str);
600 break;
601 default:
602 str = sym_get_string_value(sym);
603 printer->print_symbol(fp, sym, str, printer_arg);
475 }604 }
476}605}
477 606
607static void
608conf_write_heading(FILE *fp, struct conf_printer *printer, void *printer_arg)
609{
610 char buf[256];
611
612 snprintf(buf, sizeof(buf),
613 "\n"
614 "Automatically generated file; DO NOT EDIT.\n"
615 "%s\n",
616 rootmenu.prompt->text);
617
618 printer->print_comment(fp, buf, printer_arg);
619}
620
478/*621/*
479 * Write out a minimal config.622 * Write out a minimal config.
480 * All values that has default values are skipped as this is redundant.623 * All values that has default values are skipped as this is redundant.
@@ -531,7 +674,7 @@ int conf_write_defconfig(const char *filename) · 50 unmodified lines
531 goto next_menu;674 goto next_menu;
532 }675 }
533 }676 }
534 conf_write_symbol(sym, out, true);677 conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
535 }678 }
536next_menu:679next_menu:
537 if (menu->list != NULL) {680 if (menu->list != NULL) {
@@ -596,11 +739,7 @@ int conf_write(const char *name) · 58 unmodified lines
596 if (!out)739 if (!out)
597 return 1;740 return 1;
598 741
599 fprintf(out, _("#\n"742 conf_write_heading(out, &kconfig_printer_cb, NULL);
600 "# Automatically generated make config: don't edit\n"
601 "# %s\n"
602 "#\n"),
603 rootmenu.prompt->text);
604 743
605 if (!conf_get_changed())744 if (!conf_get_changed())
606 sym_clear_all_valid();745 sym_clear_all_valid();
@@ -621,8 +760,8 @@ int conf_write(const char *name) · 14 unmodified lines
621 if (!(sym->flags & SYMBOL_WRITE))760 if (!(sym->flags & SYMBOL_WRITE))
622 goto next;761 goto next;
623 sym->flags &= ~SYMBOL_WRITE;762 sym->flags &= ~SYMBOL_WRITE;
624 /* Write config symbol to file */763
625 conf_write_symbol(sym, out, true);764 conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
626 }765 }
627 766
628next:767next:
@@ -771,7 +910,6 @@ out: · 142 unmodified lines
771int conf_write_autoconf(void)910int conf_write_autoconf(void)
772{911{
773 struct symbol *sym;912 struct symbol *sym;
774 const char *str;
775 const char *name;913 const char *name;
776 FILE *out, *tristate, *out_h;914 FILE *out, *tristate, *out_h;
777 int i;915 int i;
@@ -800,68 +938,23 @@ int conf_write_autoconf(void) · 22 unmodified lines
800 return 1;938 return 1;
801 }939 }
802 940
803 fprintf(out, "#\n"941 conf_write_heading(out, &kconfig_printer_cb, NULL);
804 "# Automatically generated make config: don't edit\n"942
805 "# %s\n"943 conf_write_heading(tristate, &tristate_printer_cb, NULL);
806 "#\n",944
807 rootmenu.prompt->text);945 conf_write_heading(out_h, &header_printer_cb, NULL);
808 fprintf(tristate, "#\n"
809 "# Automatically generated - do not edit\n"
810 "\n");
811 fprintf(out_h, "/*\n"
812 " * Automatically generated C config: don't edit\n"
813 " * %s\n"
814 " */\n",
815 rootmenu.prompt->text);
816 946
817 for_all_symbols(i, sym) {947 for_all_symbols(i, sym) {
818 sym_calc_value(sym);948 sym_calc_value(sym);
819 if (!(sym->flags & SYMBOL_WRITE) || !sym->name)949 if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
820 continue;950 continue;
821 951
822 /* write symbol to config file */952 /* write symbol to auto.conf, tristate and header files */
823 conf_write_symbol(sym, out, false);953 conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
824 954
825 /* update autoconf and tristate files */955 conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);
826 switch (sym->type) {956
827 case S_BOOLEAN:957 conf_write_symbol(out_h, sym, &header_printer_cb, NULL);
828 case S_TRISTATE:
829 switch (sym_get_tristate_value(sym)) {
830 case no:
831 break;
832 case mod:
833 fprintf(tristate, "%s%s=M\n",
834 CONFIG_, sym->name);
835 fprintf(out_h, "#define %s%s_MODULE 1\n",
836 CONFIG_, sym->name);
837 break;
838 case yes:
839 if (sym->type == S_TRISTATE)
840 fprintf(tristate,"%s%s=Y\n",
841 CONFIG_, sym->name);
842 fprintf(out_h, "#define %s%s 1\n",
843 CONFIG_, sym->name);
844 break;
845 }
846 break;
847 case S_STRING:
848 conf_write_string(true, sym->name, sym_get_string_value(sym), out_h);
849 break;
850 case S_HEX:
851 str = sym_get_string_value(sym);
852 if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
853 fprintf(out_h, "#define %s%s 0x%s\n",
854 CONFIG_, sym->name, str);
855 break;
856 }
857 case S_INT:
858 str = sym_get_string_value(sym);
859 fprintf(out_h, "#define %s%s %s\n",
860 CONFIG_, sym->name, str);
861 break;
862 default:
863 break;
864 }
865 }958 }
866 fclose(out);959 fclose(out);
867 fclose(tristate);960 fclose(tristate);
scripts/kconfig/expr.c+4−9
@@ -7,15 +7,13 @@ · 6 unmodified lines
7#include <stdlib.h>7#include <stdlib.h>
8#include <string.h>8#include <string.h>
9 9
10#define LKC_DIRECT_LINK
11#include "lkc.h"10#include "lkc.h"
12 11
13#define DEBUG_EXPR 012#define DEBUG_EXPR 0
14 13
15struct expr *expr_alloc_symbol(struct symbol *sym)14struct expr *expr_alloc_symbol(struct symbol *sym)
16{15{
17 struct expr *e = malloc(sizeof(*e));16 struct expr *e = calloc(1, sizeof(*e));
18 memset(e, 0, sizeof(*e));
19 e->type = E_SYMBOL;17 e->type = E_SYMBOL;
20 e->left.sym = sym;18 e->left.sym = sym;
21 return e;19 return e;
@@ -23,8 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym) · 1 unmodified line
23 21
24struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)22struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
25{23{
26 struct expr *e = malloc(sizeof(*e));24 struct expr *e = calloc(1, sizeof(*e));
27 memset(e, 0, sizeof(*e));
28 e->type = type;25 e->type = type;
29 e->left.expr = ce;26 e->left.expr = ce;
30 return e;27 return e;
@@ -32,8 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) · 1 unmodified line
32 29
33struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)30struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
34{31{
35 struct expr *e = malloc(sizeof(*e));32 struct expr *e = calloc(1, sizeof(*e));
36 memset(e, 0, sizeof(*e));
37 e->type = type;33 e->type = type;
38 e->left.expr = e1;34 e->left.expr = e1;
39 e->right.expr = e2;35 e->right.expr = e2;
@@ -42,8 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e · 2 unmodified lines
42 38
43struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)39struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
44{40{
45 struct expr *e = malloc(sizeof(*e));41 struct expr *e = calloc(1, sizeof(*e));
46 memset(e, 0, sizeof(*e));
47 e->type = type;42 e->type = type;
48 e->left.sym = s1;43 e->left.sym = s1;
49 e->right.sym = s2;44 e->right.sym = s2;
scripts/kconfig/expr.h+0−3
@@ -172,8 +172,6 @@ struct menu { · 171 unmodified lines
172#define MENU_CHANGED 0x0001172#define MENU_CHANGED 0x0001
173#define MENU_ROOT 0x0002173#define MENU_ROOT 0x0002
174 174
175#ifndef SWIG
176
177extern struct file *file_list;175extern struct file *file_list;
178extern struct file *current_file;176extern struct file *current_file;
179struct file *lookup_file(const char *name);177struct file *lookup_file(const char *name);
@@ -218,7 +216,6 @@ static inline int expr_is_no(struct expr *e) · 38 unmodified lines
218{216{
219 return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);217 return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
220}218}
221#endif
222 219
223#ifdef __cplusplus220#ifdef __cplusplus
224}221}
scripts/kconfig/gconf.c+1−37
@@ -285,8 +285,6 @@ void init_left_tree(void) · 284 unmodified lines
285static void renderer_edited(GtkCellRendererText * cell,285static void renderer_edited(GtkCellRendererText * cell,
286 const gchar * path_string,286 const gchar * path_string,
287 const gchar * new_text, gpointer user_data);287 const gchar * new_text, gpointer user_data);
288static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle,
289 gchar * arg1, gpointer user_data);
290 288
291void init_right_tree(void)289void init_right_tree(void)
292{290{
@@ -320,8 +318,6 @@ void init_right_tree(void) · 27 unmodified lines
320 "inconsistent", COL_BTNINC,318 "inconsistent", COL_BTNINC,
321 "visible", COL_BTNVIS,319 "visible", COL_BTNVIS,
322 "radio", COL_BTNRAD, NULL);320 "radio", COL_BTNRAD, NULL);
323 /*g_signal_connect(G_OBJECT(renderer), "toggled",
324 G_CALLBACK(renderer_toggled), NULL); */
325 renderer = gtk_cell_renderer_text_new();321 renderer = gtk_cell_renderer_text_new();
326 gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),322 gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
327 renderer, FALSE);323 renderer, FALSE);
@@ -888,35 +884,6 @@ static void toggle_sym_value(struct menu *menu) · 560 unmodified lines
888 display_tree_part(); //fixme: keep exp/coll884 display_tree_part(); //fixme: keep exp/coll
889}885}
890 886
891static void renderer_toggled(GtkCellRendererToggle * cell,
892 gchar * path_string, gpointer user_data)
893{
894 GtkTreePath *path, *sel_path = NULL;
895 GtkTreeIter iter, sel_iter;
896 GtkTreeSelection *sel;
897 struct menu *menu;
898
899 path = gtk_tree_path_new_from_string(path_string);
900 if (!gtk_tree_model_get_iter(model2, &iter, path))
901 return;
902
903 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree2_w));
904 if (gtk_tree_selection_get_selected(sel, NULL, &sel_iter))
905 sel_path = gtk_tree_model_get_path(model2, &sel_iter);
906 if (!sel_path)
907 goto out1;
908 if (gtk_tree_path_compare(path, sel_path))
909 goto out2;
910
911 gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
912 toggle_sym_value(menu);
913
914 out2:
915 gtk_tree_path_free(sel_path);
916 out1:
917 gtk_tree_path_free(path);
918}
919
920static gint column2index(GtkTreeViewColumn * column)887static gint column2index(GtkTreeViewColumn * column)
921{888{
922 gint i;889 gint i;
@@ -1172,6 +1139,7 @@ static gchar **fill_row(struct menu *menu) · 249 unmodified lines
1172 row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);1139 row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
1173 if (sym_is_choice(sym))1140 if (sym_is_choice(sym))
1174 break;1141 break;
1142 /* fall through */
1175 case S_TRISTATE:1143 case S_TRISTATE:
1176 val = sym_get_tristate_value(sym);1144 val = sym_get_tristate_value(sym);
1177 switch (val) {1145 switch (val) {
@@ -1506,10 +1474,6 @@ int main(int ac, char *av[]) · 328 unmodified lines
1506 char *env;1474 char *env;
1507 gchar *glade_file;1475 gchar *glade_file;
1508 1476
1509#ifndef LKC_DIRECT_LINK
1510 kconfig_load();
1511#endif
1512
1513 bindtextdomain(PACKAGE, LOCALEDIR);1477 bindtextdomain(PACKAGE, LOCALEDIR);
1514 bind_textdomain_codeset(PACKAGE, "UTF-8");1478 bind_textdomain_codeset(PACKAGE, "UTF-8");
1515 textdomain(PACKAGE);1479 textdomain(PACKAGE);
scripts/kconfig/kconfig_load.c+0−35
@@ -1,35 +0,0 @@
1#include <dlfcn.h>
2#include <stdio.h>
3#include <stdlib.h>
4
5#include "lkc.h"
6
7#define P(name,type,arg) type (*name ## _p) arg
8#include "lkc_proto.h"
9#undef P
10
11void kconfig_load(void)
12{
13 void *handle;
14 char *error;
15
16 handle = dlopen("./libkconfig.so", RTLD_LAZY);
17 if (!handle) {
18 handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY);
19 if (!handle) {
20 fprintf(stderr, "%s\n", dlerror());
21 exit(1);
22 }
23 }
24
25#define P(name,type,arg) \
26{ \
27 name ## _p = dlsym(handle, #name); \
28 if ((error = dlerror())) { \
29 fprintf(stderr, "%s\n", error); \
30 exit(1); \
31 } \
32}
33#include "lkc_proto.h"
34#undef P
35}
scripts/kconfig/kxgettext.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
7#include <stdlib.h>7#include <stdlib.h>
8#include <string.h>8#include <string.h>
9 9
10#define LKC_DIRECT_LINK
11#include "lkc.h"10#include "lkc.h"
12 11
13static char *escape(const char* text, char *bf, int len)12static char *escape(const char* text, char *bf, int len)
scripts/kconfig/lkc.h+5−11
@@ -21,12 +21,7 @@ static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; · 20 unmodified lines
21extern "C" {21extern "C" {
22#endif22#endif
23 23
24#ifdef LKC_DIRECT_LINK
25#define P(name,type,arg) extern type name arg24#define P(name,type,arg) extern type name arg
26#else
27#include "lkc_defs.h"
28#define P(name,type,arg) extern type (*name ## _p) arg
29#endif
30#include "lkc_proto.h"25#include "lkc_proto.h"
31#undef P26#undef P
32 27
@@ -79,9 +74,6 @@ void zconf_nextfile(const char *name); · 46 unmodified lines
79int zconf_lineno(void);74int zconf_lineno(void);
80const char *zconf_curname(void);75const char *zconf_curname(void);
81 76
82/* conf.c */
83void xfgets(char *str, int size, FILE *in);
84
85/* confdata.c */77/* confdata.c */
86const char *conf_get_configname(void);78const char *conf_get_configname(void);
87const char *conf_get_autoconfig_name(void);79const char *conf_get_autoconfig_name(void);
@@ -90,6 +82,11 @@ void sym_set_change_count(int count); · 2 unmodified lines
90void sym_add_change_count(int count);82void sym_add_change_count(int count);
91void conf_set_all_new_symbols(enum conf_def_mode mode);83void conf_set_all_new_symbols(enum conf_def_mode mode);
92 84
85struct conf_printer {
86 void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
87 void (*print_comment)(FILE *, const char *, void *);
88};
89
93/* confdata.c and expr.c */90/* confdata.c and expr.c */
94static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)91static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
95{92{
@@ -97,9 +94,6 @@ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) · 1 unmodified line
97 fprintf(stderr, "\nError in writing or end of file.\n");94 fprintf(stderr, "\nError in writing or end of file.\n");
98}95}
99 96
100/* kconfig_load.c */
101void kconfig_load(void);
102
103/* menu.c */97/* menu.c */
104void _menu_init(void);98void _menu_init(void);
105void menu_warn(struct menu *menu, const char *fmt, ...);99void menu_warn(struct menu *menu, const char *fmt, ...);
scripts/kconfig/lkc_proto.h+1−0
@@ -31,6 +31,7 @@ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); · 30 unmodified lines
31P(sym_lookup,struct symbol *,(const char *name, int flags));31P(sym_lookup,struct symbol *,(const char *name, int flags));
32P(sym_find,struct symbol *,(const char *name));32P(sym_find,struct symbol *,(const char *name));
33P(sym_expand_string_value,const char *,(const char *in));33P(sym_expand_string_value,const char *,(const char *in));
34P(sym_escape_string_value, const char *,(const char *in));
34P(sym_re_search,struct symbol **,(const char *pattern));35P(sym_re_search,struct symbol **,(const char *pattern));
35P(sym_type_name,const char *,(enum symbol_type type));36P(sym_type_name,const char *,(enum symbol_type type));
36P(sym_calc_value,void,(struct symbol *sym));37P(sym_calc_value,void,(struct symbol *sym));
scripts/kconfig/mconf.c+1−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
18#include <unistd.h>18#include <unistd.h>
19#include <locale.h>19#include <locale.h>
20 20
21#define LKC_DIRECT_LINK
22#include "lkc.h"21#include "lkc.h"
23#include "lxdialog/dialog.h"22#include "lxdialog/dialog.h"
24 23
@@ -845,6 +844,7 @@ int main(int ac, char **av) · 820 unmodified lines
845 "\n\n"));844 "\n\n"));
846 return 1;845 return 1;
847 }846 }
847 /* fall through */
848 case -1:848 case -1:
849 printf(_("\n\n"849 printf(_("\n\n"
850 "*** End of the configuration.\n"850 "*** End of the configuration.\n"
scripts/kconfig/menu.c+3−2
@@ -3,10 +3,11 @@ · 2 unmodified lines
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 <ctype.h>
7#include <stdarg.h>
6#include <stdlib.h>8#include <stdlib.h>
7#include <string.h>9#include <string.h>
8 10
9#define LKC_DIRECT_LINK
10#include "lkc.h"11#include "lkc.h"
11 12
12static const char nohelp_text[] = N_(13static const char nohelp_text[] = N_(
@@ -350,7 +351,7 @@ void menu_finalize(struct menu *parent) · 337 unmodified lines
350 last_menu->next = NULL;351 last_menu->next = NULL;
351 }352 }
352 353
353 sym->dir_dep.expr = parent->dep;354 sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
354 }355 }
355 for (menu = parent->list; menu; menu = menu->next) {356 for (menu = parent->list; menu; menu = menu->next) {
356 if (sym && sym_is_choice(sym) &&357 if (sym && sym_is_choice(sym) &&
scripts/kconfig/nconf.c+9−21
@@ -7,7 +7,7 @@ · 6 unmodified lines
7 */7 */
8#define _GNU_SOURCE8#define _GNU_SOURCE
9#include <string.h>9#include <string.h>
10#define LKC_DIRECT_LINK10
11#include "lkc.h"11#include "lkc.h"
12#include "nconf.h"12#include "nconf.h"
13#include <ctype.h>13#include <ctype.h>
@@ -1067,7 +1067,6 @@ static void conf(struct menu *menu) · 1053 unmodified lines
1067 struct menu *submenu = 0;1067 struct menu *submenu = 0;
1068 const char *prompt = menu_get_prompt(menu);1068 const char *prompt = menu_get_prompt(menu);
1069 struct symbol *sym;1069 struct symbol *sym;
1070 struct menu *active_menu = NULL;
1071 int res;1070 int res;
1072 int current_index = 0;1071 int current_index = 0;
1073 int last_top_row = 0;1072 int last_top_row = 0;
@@ -1152,13 +1151,9 @@ static void conf(struct menu *menu) · 78 unmodified lines
1152 continue;1151 continue;
1153 1152
1154 submenu = (struct menu *) item_data();1153 submenu = (struct menu *) item_data();
1155 active_menu = (struct menu *)item_data();
1156 if (!submenu || !menu_is_visible(submenu))1154 if (!submenu || !menu_is_visible(submenu))
1157 continue;1155 continue;
1158 if (submenu)1156 sym = submenu->sym;
1159 sym = submenu->sym;
1160 else
1161 sym = NULL;
1162 1157
1163 switch (res) {1158 switch (res) {
1164 case ' ':1159 case ' ':
@@ -1222,20 +1217,13 @@ static void conf_message_callback(const char *fmt, va_list ap) · 57 unmodified lines
1222 1217
1223static void show_help(struct menu *menu)1218static void show_help(struct menu *menu)
1224{1219{
1225 struct gstr help = str_new();1220 struct gstr help;
1226 1221
1227 if (menu && menu->sym && menu_has_help(menu)) {1222 if (!menu)
1228 if (menu->sym->name) {1223 return;
1229 str_printf(&help, "%s%s:\n\n", CONFIG_, menu->sym->name);1224
1230 str_append(&help, _(menu_get_help(menu)));1225 help = str_new();
1231 str_append(&help, "\n");1226 menu_get_ext_help(menu, &help);
1232 get_symbol_str(&help, menu->sym);
1233 } else {
1234 str_append(&help, _(menu_get_help(menu)));
1235 }
1236 } else {
1237 str_append(&help, nohelp_text);
1238 }
1239 show_scroll_win(main_window, _(menu_get_prompt(menu)), str_get(&help));1227 show_scroll_win(main_window, _(menu_get_prompt(menu)), str_get(&help));
1240 str_free(&help);1228 str_free(&help);
1241}1229}
scripts/kconfig/qconf.cc+10−7
@@ -1478,10 +1478,13 @@ void ConfigMainWindow::loadConfig(void) · 1477 unmodified lines
1478 ConfigView::updateListAll();1478 ConfigView::updateListAll();
1479}1479}
1480 1480
1481void ConfigMainWindow::saveConfig(void)1481bool ConfigMainWindow::saveConfig(void)
1482{1482{
1483 if (conf_write(NULL))1483 if (conf_write(NULL)) {
1484 QMessageBox::information(this, "qconf", _("Unable to save configuration!"));1484 QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
1485 return false;
1486 }
1487 return true;
1485}1488}
1486 1489
1487void ConfigMainWindow::saveConfigAs(void)1490void ConfigMainWindow::saveConfigAs(void)
@@ -1642,7 +1645,11 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) · 154 unmodified lines
1642 mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));1645 mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
1643 switch (mb.exec()) {1646 switch (mb.exec()) {
1644 case QMessageBox::Yes:1647 case QMessageBox::Yes:
1645 saveConfig();1648 if (saveConfig())
1649 e->accept();
1650 else
1651 e->ignore();
1652 break;
1646 case QMessageBox::No:1653 case QMessageBox::No:
1647 e->accept();1654 e->accept();
1648 break;1655 break;
@@ -1745,10 +1752,6 @@ int main(int ac, char** av) · 96 unmodified lines
1745 bindtextdomain(PACKAGE, LOCALEDIR);1752 bindtextdomain(PACKAGE, LOCALEDIR);
1746 textdomain(PACKAGE);1753 textdomain(PACKAGE);
1747 1754
1748#ifndef LKC_DIRECT_LINK
1749 kconfig_load();
1750#endif
1751
1752 progname = av[0];1755 progname = av[0];
1753 configApp = new QApplication(ac, av);1756 configApp = new QApplication(ac, av);
1754 if (ac > 1 && av[1][0] == '-') {1757 if (ac > 1 && av[1][0] == '-') {
scripts/kconfig/qconf.h+1−1
@@ -311,7 +311,7 @@ public slots: · 310 unmodified lines
311 void listFocusChanged(void);311 void listFocusChanged(void);
312 void goBack(void);312 void goBack(void);
313 void loadConfig(void);313 void loadConfig(void);
314 void saveConfig(void);314 bool saveConfig(void);
315 void saveConfigAs(void);315 void saveConfigAs(void);
316 void searchConfig(void);316 void searchConfig(void);
317 void showSingleView(void);317 void showSingleView(void);
scripts/kconfig/symbol.c+45−2
@@ -9,7 +9,6 @@ · 8 unmodified lines
9#include <regex.h>9#include <regex.h>
10#include <sys/utsname.h>10#include <sys/utsname.h>
11 11
12#define LKC_DIRECT_LINK
13#include "lkc.h"12#include "lkc.h"
14 13
15struct symbol symbol_yes = {14struct symbol symbol_yes = {
@@ -751,7 +750,8 @@ const char *sym_get_string_value(struct symbol *sym) · 735 unmodified lines
751 case no:750 case no:
752 return "n";751 return "n";
753 case mod:752 case mod:
754 return "m";753 sym_calc_value(modules_sym);
754 return (modules_sym->curr.tri == no) ? "n" : "m";
755 case yes:755 case yes:
756 return "y";756 return "y";
757 }757 }
@@ -893,6 +893,49 @@ const char *sym_expand_string_value(const char *in) · 135 unmodified lines
893 return res;893 return res;
894}894}
895 895
896const char *sym_escape_string_value(const char *in)
897{
898 const char *p;
899 size_t reslen;
900 char *res;
901 size_t l;
902
903 reslen = strlen(in) + strlen("\"\"") + 1;
904
905 p = in;
906 for (;;) {
907 l = strcspn(p, "\"\\");
908 p += l;
909
910 if (p[0] == '\0')
911 break;
912
913 reslen++;
914 p++;
915 }
916
917 res = malloc(reslen);
918 res[0] = '\0';
919
920 strcat(res, "\"");
921
922 p = in;
923 for (;;) {
924 l = strcspn(p, "\"\\");
925 strncat(res, p, l);
926 p += l;
927
928 if (p[0] == '\0')
929 break;
930
931 strcat(res, "\\");
932 strncat(res, p++, 1);
933 }
934
935 strcat(res, "\"");
936 return res;
937}
938
896struct symbol **sym_re_search(const char *pattern)939struct symbol **sym_re_search(const char *pattern)
897{940{
898 struct symbol *sym, **sym_arr = NULL;941 struct symbol *sym, **sym_arr = NULL;
scripts/kconfig/util.c+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
5 * Released under the terms of the GNU GPL v2.0.5 * Released under the terms of the GNU GPL v2.0.
6 */6 */
7 7
8#include <stdarg.h>
9#include <stdlib.h>
8#include <string.h>10#include <string.h>
9#include "lkc.h"11#include "lkc.h"
10 12
scripts/kconfig/zconf.l+0−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
14#include <string.h>14#include <string.h>
15#include <unistd.h>15#include <unistd.h>
16 16
17#define LKC_DIRECT_LINK
18#include "lkc.h"17#include "lkc.h"
19 18
20#define START_STRSIZE 1619#define START_STRSIZE 16
scripts/kconfig/zconf.lex.c_shipped+0−1
@@ -776,7 +776,6 @@ char *zconftext; · 775 unmodified lines
776#include <string.h>776#include <string.h>
777#include <unistd.h>777#include <unistd.h>
778 778
779#define LKC_DIRECT_LINK
780#include "lkc.h"779#include "lkc.h"
781 780
782#define START_STRSIZE 16781#define START_STRSIZE 16
scripts/kconfig/zconf.tab.c_shipped+0−1
@@ -87,7 +87,6 @@ · 86 unmodified lines
87#include <string.h>87#include <string.h>
88#include <stdbool.h>88#include <stdbool.h>
89 89
90#define LKC_DIRECT_LINK
91#include "lkc.h"90#include "lkc.h"
92 91
93#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)92#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
scripts/kconfig/zconf.y+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
11#include <string.h>11#include <string.h>
12#include <stdbool.h>12#include <stdbool.h>
13 13
14#define LKC_DIRECT_LINK
15#include "lkc.h"14#include "lkc.h"
16 15
17#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)16#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t