• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2005 Red Hat, Inc. */
2 
3 struct semanage_iface;
4 struct semanage_iface_key;
5 typedef struct semanage_iface_key record_key_t;
6 typedef struct semanage_iface record_t;
7 #define DBASE_RECORD_DEFINED
8 
9 #include "iface_internal.h"
10 #include "handle.h"
11 #include "database.h"
12 
semanage_iface_modify_local(semanage_handle_t * handle,const semanage_iface_key_t * key,const semanage_iface_t * data)13 int semanage_iface_modify_local(semanage_handle_t * handle,
14 				const semanage_iface_key_t * key,
15 				const semanage_iface_t * data)
16 {
17 
18 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
19 	return dbase_modify(handle, dconfig, key, data);
20 }
21 
semanage_iface_del_local(semanage_handle_t * handle,const semanage_iface_key_t * key)22 int semanage_iface_del_local(semanage_handle_t * handle,
23 			     const semanage_iface_key_t * key)
24 {
25 
26 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
27 	return dbase_del(handle, dconfig, key);
28 }
29 
semanage_iface_query_local(semanage_handle_t * handle,const semanage_iface_key_t * key,semanage_iface_t ** response)30 int semanage_iface_query_local(semanage_handle_t * handle,
31 			       const semanage_iface_key_t * key,
32 			       semanage_iface_t ** response)
33 {
34 
35 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
36 	return dbase_query(handle, dconfig, key, response);
37 }
38 
semanage_iface_exists_local(semanage_handle_t * handle,const semanage_iface_key_t * key,int * response)39 int semanage_iface_exists_local(semanage_handle_t * handle,
40 				const semanage_iface_key_t * key, int *response)
41 {
42 
43 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
44 	return dbase_exists(handle, dconfig, key, response);
45 }
46 
semanage_iface_count_local(semanage_handle_t * handle,unsigned int * response)47 int semanage_iface_count_local(semanage_handle_t * handle,
48 			       unsigned int *response)
49 {
50 
51 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
52 	return dbase_count(handle, dconfig, response);
53 }
54 
semanage_iface_iterate_local(semanage_handle_t * handle,int (* handler)(const semanage_iface_t * record,void * varg),void * handler_arg)55 int semanage_iface_iterate_local(semanage_handle_t * handle,
56 				 int (*handler) (const semanage_iface_t *
57 						 record, void *varg),
58 				 void *handler_arg)
59 {
60 
61 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
62 	return dbase_iterate(handle, dconfig, handler, handler_arg);
63 }
64 
semanage_iface_list_local(semanage_handle_t * handle,semanage_iface_t *** records,unsigned int * count)65 int semanage_iface_list_local(semanage_handle_t * handle,
66 			      semanage_iface_t *** records, unsigned int *count)
67 {
68 
69 	dbase_config_t *dconfig = semanage_iface_dbase_local(handle);
70 	return dbase_list(handle, dconfig, records, count);
71 }
72