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