Home | History | Annotate | Download | only in src
      1 /* Copyright (C) 2005 Red Hat, Inc. */
      2 
      3 struct semanage_user;
      4 struct semanage_user_key;
      5 typedef struct semanage_user_key record_key_t;
      6 typedef struct semanage_user record_t;
      7 #define DBASE_RECORD_DEFINED
      8 
      9 #include "user_internal.h"
     10 #include "handle.h"
     11 #include "database.h"
     12 
     13 int semanage_user_query(semanage_handle_t * handle,
     14 			const semanage_user_key_t * key,
     15 			semanage_user_t ** response)
     16 {
     17 
     18 	dbase_config_t *dconfig = semanage_user_dbase_policy(handle);
     19 	return dbase_query(handle, dconfig, key, response);
     20 }
     21 
     22 hidden_def(semanage_user_query)
     23 
     24 int semanage_user_exists(semanage_handle_t * handle,
     25 			 const semanage_user_key_t * key, int *response)
     26 {
     27 
     28 	dbase_config_t *dconfig = semanage_user_dbase_policy(handle);
     29 	return dbase_exists(handle, dconfig, key, response);
     30 }
     31 
     32 hidden_def(semanage_user_exists)
     33 
     34 int semanage_user_count(semanage_handle_t * handle, unsigned int *response)
     35 {
     36 
     37 	dbase_config_t *dconfig = semanage_user_dbase_policy(handle);
     38 	return dbase_count(handle, dconfig, response);
     39 }
     40 
     41 int semanage_user_iterate(semanage_handle_t * handle,
     42 			  int (*handler) (const semanage_user_t * record,
     43 					  void *varg), void *handler_arg)
     44 {
     45 
     46 	dbase_config_t *dconfig = semanage_user_dbase_policy(handle);
     47 	return dbase_iterate(handle, dconfig, handler, handler_arg);
     48 }
     49 
     50 int semanage_user_list(semanage_handle_t * handle,
     51 		       semanage_user_t *** records, unsigned int *count)
     52 {
     53 
     54 	dbase_config_t *dconfig = semanage_user_dbase_policy(handle);
     55 	return dbase_list(handle, dconfig, records, count);
     56 }
     57