1/* Copyright (C) 2005 Red Hat, Inc. */
2
3#ifndef _SEMANAGE_BOOLEAN_RECORD_H_
4#define _SEMANAGE_BOOLEAN_RECORD_H_
5
6#include <semanage/handle.h>
7
8#ifndef _SEMANAGE_BOOL_DEFINED_
9struct semanage_bool;
10struct semanage_bool_key;
11typedef struct semanage_bool semanage_bool_t;
12typedef struct semanage_bool_key semanage_bool_key_t;
13#define _SEMANAGE_BOOL_DEFINED_
14#endif
15
16/* Key */
17extern int semanage_bool_key_create(semanage_handle_t * handle,
18				    const char *name,
19				    semanage_bool_key_t ** key);
20
21extern int semanage_bool_key_extract(semanage_handle_t * handle,
22				     const semanage_bool_t * boolean,
23				     semanage_bool_key_t ** key);
24
25extern void semanage_bool_key_free(semanage_bool_key_t * key);
26
27extern int semanage_bool_compare(const semanage_bool_t * boolean,
28				 const semanage_bool_key_t * key);
29
30extern int semanage_bool_compare2(const semanage_bool_t * boolean,
31				  const semanage_bool_t * boolean2);
32
33/* Name */
34extern const char *semanage_bool_get_name(const semanage_bool_t * boolean);
35
36extern int semanage_bool_set_name(semanage_handle_t * handle,
37				  semanage_bool_t * boolean, const char *name);
38
39/* Value */
40extern int semanage_bool_get_value(const semanage_bool_t * boolean);
41
42extern void semanage_bool_set_value(semanage_bool_t * boolean, int value);
43
44/* Create/Clone/Destroy */
45extern int semanage_bool_create(semanage_handle_t * handle,
46				semanage_bool_t ** bool_ptr);
47
48extern int semanage_bool_clone(semanage_handle_t * handle,
49			       const semanage_bool_t * boolean,
50			       semanage_bool_t ** bool_ptr);
51
52extern void semanage_bool_free(semanage_bool_t * boolean);
53
54#endif
55