1 /* Copyright (C) 2005 Red Hat, Inc. */
2 
3 struct semanage_fcontext;
4 struct semanage_fcontext_key;
5 typedef struct semanage_fcontext_key record_key_t;
6 typedef struct semanage_fcontext record_t;
7 #define DBASE_RECORD_DEFINED
8 
9 #include "fcontext_internal.h"
10 #include "handle.h"
11 #include "database.h"
12 
semanage_fcontext_query(semanage_handle_t * handle,const semanage_fcontext_key_t * key,semanage_fcontext_t ** response)13 int semanage_fcontext_query(semanage_handle_t * handle,
14 			    const semanage_fcontext_key_t * key,
15 			    semanage_fcontext_t ** response)
16 {
17 
18 	dbase_config_t *dconfig = semanage_fcontext_dbase_policy(handle);
19 	return dbase_query(handle, dconfig, key, response);
20 }
21 
semanage_fcontext_exists(semanage_handle_t * handle,const semanage_fcontext_key_t * key,int * response)22 int semanage_fcontext_exists(semanage_handle_t * handle,
23 			     const semanage_fcontext_key_t * key, int *response)
24 {
25 
26 	dbase_config_t *dconfig = semanage_fcontext_dbase_policy(handle);
27 	return dbase_exists(handle, dconfig, key, response);
28 }
29 
semanage_fcontext_count(semanage_handle_t * handle,unsigned int * response)30 int semanage_fcontext_count(semanage_handle_t * handle, unsigned int *response)
31 {
32 
33 	dbase_config_t *dconfig = semanage_fcontext_dbase_policy(handle);
34 	return dbase_count(handle, dconfig, response);
35 }
36 
semanage_fcontext_iterate(semanage_handle_t * handle,int (* handler)(const semanage_fcontext_t * record,void * varg),void * handler_arg)37 int semanage_fcontext_iterate(semanage_handle_t * handle,
38 			      int (*handler) (const semanage_fcontext_t *
39 					      record, void *varg),
40 			      void *handler_arg)
41 {
42 
43 	dbase_config_t *dconfig = semanage_fcontext_dbase_policy(handle);
44 	return dbase_iterate(handle, dconfig, handler, handler_arg);
45 }
46 
semanage_fcontext_list(semanage_handle_t * handle,semanage_fcontext_t *** records,unsigned int * count)47 int semanage_fcontext_list(semanage_handle_t * handle,
48 			   semanage_fcontext_t *** records, unsigned int *count)
49 {
50 
51 	dbase_config_t *dconfig = semanage_fcontext_dbase_policy(handle);
52 	return dbase_list(handle, dconfig, records, count);
53 }
54