From 3fb6326fc36c69aa0b66de4823b116d7c0a9486c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 1 May 2015 20:55:43 +0200 Subject: parse_kconfig rewriten parse_kconfig should now generate full dependency. It is not transforming whole expression to CNF, but only pairs. --- scripts/parse_kconfig/symlist.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'scripts/parse_kconfig/symlist.c') diff --git a/scripts/parse_kconfig/symlist.c b/scripts/parse_kconfig/symlist.c index f5f42ab..042a950 100644 --- a/scripts/parse_kconfig/symlist.c +++ b/scripts/parse_kconfig/symlist.c @@ -22,6 +22,7 @@ void symlist_add(struct symlist *sl, char *name) { sl->array[sl->pos].def_size = 0; sl->array[sl->pos].dep = NULL; sl->array[sl->pos].rev_dep = NULL; + output_push_symbol((unsigned) sl->pos, name); sl->pos++; } @@ -46,6 +47,10 @@ struct symlist_el *symlist_find(struct symlist *sl, char *name) { // TODO faster implementation? Maybe binary search tree? size_t symlist_id(struct symlist * sl, char *name) { + if (name == NULL) { + printf("Aha\n"); + return 0; + } size_t i = 0; while (i < sl->pos) { if (!strcmp(name, sl->array[i].name)) @@ -55,20 +60,6 @@ size_t symlist_id(struct symlist * sl, char *name) { return 0; } -void symlist_print(struct symlist *sl) { - /* - size_t i; - for (i = 0; i < sl->pos; i++) { - printf("%d:%s\n", sl->array[i].id, sl->array[i].name); - if (sl->array[i].be != NULL) { - printf(" "); - cnf_printf(sl->array[i].be); - printf("\n"); - } - } - */ -} - void symlist_free(struct symlist *sl) { free(sl->array); free(sl); -- cgit v1.2.3