1*2d543d20SAndroid Build Coastguard Worker #ifndef _SEPOL_BOOLEANS_H_ 2*2d543d20SAndroid Build Coastguard Worker #define _SEPOL_BOOLEANS_H_ 3*2d543d20SAndroid Build Coastguard Worker 4*2d543d20SAndroid Build Coastguard Worker #include <stddef.h> 5*2d543d20SAndroid Build Coastguard Worker #include <sepol/policydb.h> 6*2d543d20SAndroid Build Coastguard Worker #include <sepol/boolean_record.h> 7*2d543d20SAndroid Build Coastguard Worker #include <sepol/handle.h> 8*2d543d20SAndroid Build Coastguard Worker 9*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus 10*2d543d20SAndroid Build Coastguard Worker extern "C" { 11*2d543d20SAndroid Build Coastguard Worker #endif 12*2d543d20SAndroid Build Coastguard Worker 13*2d543d20SAndroid Build Coastguard Worker /* Set the specified boolean */ 14*2d543d20SAndroid Build Coastguard Worker extern int sepol_bool_set(sepol_handle_t * handle, 15*2d543d20SAndroid Build Coastguard Worker sepol_policydb_t * policydb, 16*2d543d20SAndroid Build Coastguard Worker const sepol_bool_key_t * key, 17*2d543d20SAndroid Build Coastguard Worker const sepol_bool_t * data); 18*2d543d20SAndroid Build Coastguard Worker 19*2d543d20SAndroid Build Coastguard Worker /* Return the number of booleans */ 20*2d543d20SAndroid Build Coastguard Worker extern int sepol_bool_count(sepol_handle_t * handle, 21*2d543d20SAndroid Build Coastguard Worker const sepol_policydb_t * p, unsigned int *response); 22*2d543d20SAndroid Build Coastguard Worker 23*2d543d20SAndroid Build Coastguard Worker /* Check if the specified boolean exists */ 24*2d543d20SAndroid Build Coastguard Worker extern int sepol_bool_exists(sepol_handle_t * handle, 25*2d543d20SAndroid Build Coastguard Worker const sepol_policydb_t * policydb, 26*2d543d20SAndroid Build Coastguard Worker const sepol_bool_key_t * key, int *response); 27*2d543d20SAndroid Build Coastguard Worker 28*2d543d20SAndroid Build Coastguard Worker /* Query a boolean - returns the boolean, or NULL if not found */ 29*2d543d20SAndroid Build Coastguard Worker extern int sepol_bool_query(sepol_handle_t * handle, 30*2d543d20SAndroid Build Coastguard Worker const sepol_policydb_t * p, 31*2d543d20SAndroid Build Coastguard Worker const sepol_bool_key_t * key, 32*2d543d20SAndroid Build Coastguard Worker sepol_bool_t ** response); 33*2d543d20SAndroid Build Coastguard Worker 34*2d543d20SAndroid Build Coastguard Worker /* Iterate the booleans 35*2d543d20SAndroid Build Coastguard Worker * The handler may return: 36*2d543d20SAndroid Build Coastguard Worker * -1 to signal an error condition, 37*2d543d20SAndroid Build Coastguard Worker * 1 to signal successful exit 38*2d543d20SAndroid Build Coastguard Worker * 0 to signal continue */ 39*2d543d20SAndroid Build Coastguard Worker 40*2d543d20SAndroid Build Coastguard Worker extern int sepol_bool_iterate(sepol_handle_t * handle, 41*2d543d20SAndroid Build Coastguard Worker const sepol_policydb_t * policydb, 42*2d543d20SAndroid Build Coastguard Worker int (*fn) (const sepol_bool_t * boolean, 43*2d543d20SAndroid Build Coastguard Worker void *fn_arg), void *arg); 44*2d543d20SAndroid Build Coastguard Worker 45*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus 46*2d543d20SAndroid Build Coastguard Worker } 47*2d543d20SAndroid Build Coastguard Worker #endif 48*2d543d20SAndroid Build Coastguard Worker 49*2d543d20SAndroid Build Coastguard Worker #endif 50