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_modify_local(semanage_handle_t * handle,const semanage_bool_key_t * key,const semanage_bool_t * data)13 int semanage_bool_modify_local(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_local(handle);
19 	return dbase_modify(handle, dconfig, key, data);
20 }
21 
semanage_bool_del_local(semanage_handle_t * handle,const semanage_bool_key_t * key)22 int semanage_bool_del_local(semanage_handle_t * handle,
23 			    const semanage_bool_key_t * key)
24 {
25 
26 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
27 	return dbase_del(handle, dconfig, key);
28 }
29 
semanage_bool_query_local(semanage_handle_t * handle,const semanage_bool_key_t * key,semanage_bool_t ** response)30 int semanage_bool_query_local(semanage_handle_t * handle,
31 			      const semanage_bool_key_t * key,
32 			      semanage_bool_t ** response)
33 {
34 
35 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
36 	return dbase_query(handle, dconfig, key, response);
37 }
38 
semanage_bool_exists_local(semanage_handle_t * handle,const semanage_bool_key_t * key,int * response)39 int semanage_bool_exists_local(semanage_handle_t * handle,
40 			       const semanage_bool_key_t * key, int *response)
41 {
42 
43 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
44 	return dbase_exists(handle, dconfig, key, response);
45 }
46 
semanage_bool_count_local(semanage_handle_t * handle,unsigned int * response)47 int semanage_bool_count_local(semanage_handle_t * handle,
48 			      unsigned int *response)
49 {
50 
51 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
52 	return dbase_count(handle, dconfig, response);
53 }
54 
semanage_bool_iterate_local(semanage_handle_t * handle,int (* handler)(const semanage_bool_t * record,void * varg),void * handler_arg)55 int semanage_bool_iterate_local(semanage_handle_t * handle,
56 				int (*handler) (const semanage_bool_t * record,
57 						void *varg), void *handler_arg)
58 {
59 
60 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
61 	return dbase_iterate(handle, dconfig, handler, handler_arg);
62 }
63 
semanage_bool_list_local(semanage_handle_t * handle,semanage_bool_t *** records,unsigned int * count)64 int semanage_bool_list_local(semanage_handle_t * handle,
65 			     semanage_bool_t *** records, unsigned int *count)
66 {
67 
68 	dbase_config_t *dconfig = semanage_bool_dbase_local(handle);
69 	return dbase_list(handle, dconfig, records, count);
70 }
71