• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2005 Red Hat, Inc. */
2 
3 struct semanage_bool;
4 struct semanage_bool_key;
5 typedef struct semanage_bool_key record_key_t;
6 typedef struct semanage_bool record_t;
7 #define DBASE_RECORD_DEFINED
8 
9 #include "boolean_internal.h"
10 #include "handle.h"
11 #include "database.h"
12 
semanage_bool_set_active(semanage_handle_t * handle,const semanage_bool_key_t * key,const semanage_bool_t * data)13 int semanage_bool_set_active(semanage_handle_t * handle,
14 			     const semanage_bool_key_t * key,
15 			     const semanage_bool_t * data)
16 {
17 
18 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
19 	return dbase_set(handle, dconfig, key, data);
20 }
21 
semanage_bool_query_active(semanage_handle_t * handle,const semanage_bool_key_t * key,semanage_bool_t ** response)22 int semanage_bool_query_active(semanage_handle_t * handle,
23 			       const semanage_bool_key_t * key,
24 			       semanage_bool_t ** response)
25 {
26 
27 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
28 	return dbase_query(handle, dconfig, key, response);
29 }
30 
semanage_bool_exists_active(semanage_handle_t * handle,const semanage_bool_key_t * key,int * response)31 int semanage_bool_exists_active(semanage_handle_t * handle,
32 				const semanage_bool_key_t * key, int *response)
33 {
34 
35 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
36 	return dbase_exists(handle, dconfig, key, response);
37 }
38 
semanage_bool_count_active(semanage_handle_t * handle,unsigned int * response)39 int semanage_bool_count_active(semanage_handle_t * handle,
40 			       unsigned int *response)
41 {
42 
43 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
44 	return dbase_count(handle, dconfig, response);
45 }
46 
semanage_bool_iterate_active(semanage_handle_t * handle,int (* handler)(const semanage_bool_t * record,void * varg),void * handler_arg)47 int semanage_bool_iterate_active(semanage_handle_t * handle,
48 				 int (*handler) (const semanage_bool_t * record,
49 						 void *varg), void *handler_arg)
50 {
51 
52 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
53 	return dbase_iterate(handle, dconfig, handler, handler_arg);
54 }
55 
semanage_bool_list_active(semanage_handle_t * handle,semanage_bool_t *** records,unsigned int * count)56 int semanage_bool_list_active(semanage_handle_t * handle,
57 			      semanage_bool_t *** records, unsigned int *count)
58 {
59 
60 	dbase_config_t *dconfig = semanage_bool_dbase_active(handle);
61 	return dbase_list(handle, dconfig, records, count);
62 }
63