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_
9 struct semanage_bool;
10 struct semanage_bool_key;
11 typedef struct semanage_bool semanage_bool_t;
12 typedef struct semanage_bool_key semanage_bool_key_t;
13 #define _SEMANAGE_BOOL_DEFINED_
14 #endif
15 
16 /* Key */
17 extern int semanage_bool_key_create(semanage_handle_t * handle,
18 				    const char *name,
19 				    semanage_bool_key_t ** key);
20 
21 extern int semanage_bool_key_extract(semanage_handle_t * handle,
22 				     const semanage_bool_t * boolean,
23 				     semanage_bool_key_t ** key);
24 
25 extern void semanage_bool_key_free(semanage_bool_key_t * key);
26 
27 extern int semanage_bool_compare(const semanage_bool_t * boolean,
28 				 const semanage_bool_key_t * key);
29 
30 extern int semanage_bool_compare2(const semanage_bool_t * boolean,
31 				  const semanage_bool_t * boolean2);
32 
33 /* Name */
34 extern const char *semanage_bool_get_name(const semanage_bool_t * boolean);
35 
36 extern int semanage_bool_set_name(semanage_handle_t * handle,
37 				  semanage_bool_t * boolean, const char *name);
38 
39 /* Value */
40 extern int semanage_bool_get_value(const semanage_bool_t * boolean);
41 
42 extern void semanage_bool_set_value(semanage_bool_t * boolean, int value);
43 
44 /* Create/Clone/Destroy */
45 extern int semanage_bool_create(semanage_handle_t * handle,
46 				semanage_bool_t ** bool_ptr);
47 
48 extern int semanage_bool_clone(semanage_handle_t * handle,
49 			       const semanage_bool_t * boolean,
50 			       semanage_bool_t ** bool_ptr);
51 
52 extern void semanage_bool_free(semanage_bool_t * boolean);
53 
54 #endif
55