aboutsummaryrefslogtreecommitdiff
path: root/programs/src/kconfig_parser/output.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-03-22 22:05:56 +0100
committerKarel Kočí <cynerd@email.cz>2015-03-22 22:05:56 +0100
commit3b4fbaa22233e764f6b94effd1b21c494061d32c (patch)
treea7da885e905077137f61f9c5898ade4cbc9da5e5 /programs/src/kconfig_parser/output.c
parentf0ade98600d1fdcaeb4476ee80fb12b834f61f84 (diff)
downloadlinux-conf-perf-3b4fbaa22233e764f6b94effd1b21c494061d32c.tar.gz
linux-conf-perf-3b4fbaa22233e764f6b94effd1b21c494061d32c.tar.bz2
linux-conf-perf-3b4fbaa22233e764f6b94effd1b21c494061d32c.zip
kconfig_parser: Fix rev_dep and implement verbose level output
After this fix, generated dependency should be all right. Verbose output implementation is only temporally. It needs better implementation. And command line arguments should be parsed with argp.
Diffstat (limited to 'programs/src/kconfig_parser/output.c')
-rw-r--r--programs/src/kconfig_parser/output.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/programs/src/kconfig_parser/output.c b/programs/src/kconfig_parser/output.c
index 942693b..149a7b6 100644
--- a/programs/src/kconfig_parser/output.c
+++ b/programs/src/kconfig_parser/output.c
@@ -1,18 +1,23 @@
#include "output.h"
-void fprint_rules_cnf(FILE * f, unsigned id, struct cnfexpr *cnf) {
+void fprint_rules_cnf(FILE * f, unsigned id, struct cnfexpr *cnf, bool nt) {
unsigned i, y;
switch (cnf->type) {
case CT_FALSE:
// Never satisfiable
- fprintf(f, "-%d\n", id);
+ if (!nt)
+ fprintf(f, "-%d\n", id);
break;
case CT_TRUE:
// Always satisfiable
+ if (nt)
+ fprintf(f, "%d\n", id);
break;
case CT_EXPR:
for (i = 0; i < cnf->size; i++) {
- fprintf(f, "-%d ", id);
+ if (!nt)
+ fprintf(f, "-");
+ fprintf(f, "%d ", id);
for (y = 0; y < cnf->sizes[i] - 1; y++) {
fprintf(f, "%d ", cnf->exprs[i][y]);
}
@@ -36,10 +41,10 @@ void fprint_rules(struct symlist *sl, char *output) {
if (sl->array[i].be != NULL) {
el = sl->array + i;
if (el->be != NULL) {
- fprint_rules_cnf(f, el->id, el->be);
+ fprint_rules_cnf(f, el->id, el->be, false);
}
if (el->re_be != NULL) {
- fprint_rules_cnf(f, el->id, el->be);
+ fprint_rules_cnf(f, el->id, el->re_be, true);
}
}
}