aboutsummaryrefslogtreecommitdiff
path: root/scripts/parse_kconfig/boolexpr.h
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/parse_kconfig/boolexpr.h')
-rw-r--r--scripts/parse_kconfig/boolexpr.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/parse_kconfig/boolexpr.h b/scripts/parse_kconfig/boolexpr.h
new file mode 100644
index 0000000..52cd4a6
--- /dev/null
+++ b/scripts/parse_kconfig/boolexpr.h
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include <kconfig/lkc.h>
+
+#ifndef _BOOLEXPR_H_
+#define _BOOLEXPR_H_
+
+#include "symlist.h"
+
+enum boolexpr_type {
+ BT_SYM, BT_TRUE, BT_FALSE, BT_OR, BT_AND, BT_NOT
+};
+
+struct boolexpr {
+ enum boolexpr_type type;
+ unsigned id;
+ struct boolexpr *left, *right;
+
+ unsigned overusage;
+};
+
+struct boolexpr *boolexpr_kconfig(struct symlist *sl, struct expr *expr);
+
+struct boolexpr *boolexpr_true();
+struct boolexpr *boolexpr_false();
+struct boolexpr *boolexpr_sym(struct symlist *sl, struct symbol *sym);
+struct boolexpr *boolexpr_or(struct boolexpr *e1, struct boolexpr *e2);
+struct boolexpr *boolexpr_and(struct boolexpr *e1, struct boolexpr *e2);
+struct boolexpr *boolexpr_not(struct boolexpr *e);
+struct boolexpr *boolexpr_copy(struct boolexpr *e);
+void boolexpr_free(struct boolexpr *e);
+
+#endif /* _BOOLEXPR_H_ */