aboutsummaryrefslogtreecommitdiff
path: root/tools/sepolicy-analyze/booleans.c
blob: c3b605d0ab40a7ce5cc193cdf9b97af7e6c94d71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}