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