aboutsummaryrefslogtreecommitdiffstats
path: root/tools/sepolicy-analyze/booleans.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sepolicy-analyze/booleans.c')
-rw-r--r--tools/sepolicy-analyze/booleans.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/sepolicy-analyze/booleans.c b/tools/sepolicy-analyze/booleans.c
new file mode 100644
index 0000000..c3b605d
--- /dev/null
+++ b/tools/sepolicy-analyze/booleans.c
@@ -0,0 +1,22 @@
+#include "booleans.h"
+
+void booleans_usage() {
+ fprintf(stderr, "\tbooleans\n");
+}
+
+static int list_booleans(hashtab_key_t k,
+ __attribute__ ((unused)) hashtab_datum_t d,
+ __attribute__ ((unused)) void *args)
+{
+ const char *name = k;
+ printf("%s\n", name);
+ return 0;
+}
+
+int booleans_func (int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) {
+ if (argc != 1) {
+ USAGE_ERROR = true;
+ return -1;
+ }
+ return hashtab_map(policydb->p_bools.table, list_booleans, NULL);
+}