From 9a1f3ff8fbff9dd418242eefa7aa69dfd38609c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 4 May 2015 22:47:00 +0200 Subject: Add some configuration options and clean write_conf --- scripts/write_config/solution.c | 11 ++++------- scripts/write_config/write.c | 6 +++++- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'scripts/write_config') diff --git a/scripts/write_config/solution.c b/scripts/write_config/solution.c index a8d9fc7..f575864 100644 --- a/scripts/write_config/solution.c +++ b/scripts/write_config/solution.c @@ -1,5 +1,6 @@ #include "solution.h" +extern int exit_status; void solution_check(struct symlist *sl, FILE * f) { int c; // skip first line @@ -28,20 +29,16 @@ void solution_check(struct symlist *sl, FILE * f) { continue; if (sl->array[id - 1].sym == NULL) continue; - //tristate val = sym_get_tristate_value(sl->array[id - 1].sym); - //sym_set_tristate_value(sl->array[id - 1].sym, neg ? no : yes); - //sym_calc_value(sl->array[id - 1].sym); if (neg == (sym_get_tristate_value(sl->array[id - 1].sym) == no ? true : false)) - //printf("Ok\n"); { - } else + } else { printf("Problem %s=%d/%d\n", sl->array[id - 1].sym->name, !neg, sym_get_tristate_value(sl->array[id - 1].sym)); - //if (sym_get_tristate_value(sl->array[id - 1].sym) != val) - //printf("Change: %s\n", sl->array[id - 1].sym->name); + exit_status++; + } } else { if (w_pos >= w_size) { w_size *= 2; diff --git a/scripts/write_config/write.c b/scripts/write_config/write.c index 86895b6..29fcd60 100644 --- a/scripts/write_config/write.c +++ b/scripts/write_config/write.c @@ -11,7 +11,10 @@ int verbose_level; char *file, *folder; +int exit_status; + int main(int argc, char **argv) { + exit_status = 0; verbose_level = 1; int i; for (i = 1; i < argc; i++) { @@ -47,6 +50,7 @@ int main(int argc, char **argv) { textdomain(PACKAGE); conf_parse(file); + struct symbol *sym; //conf_read(def_config_file); conf_read(".config"); @@ -68,5 +72,5 @@ int main(int argc, char **argv) { conf_write(".config"); - return 0; + return exit_status; } -- cgit v1.2.3