debug.h 905 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _SEPOL_DEBUG_H_
  2. #define _SEPOL_DEBUG_H_
  3. #include <sepol/handle.h>
  4. /* Deprecated */
  5. extern void sepol_debug(int on);
  6. /* End deprecated */
  7. #define SEPOL_MSG_ERR 1
  8. #define SEPOL_MSG_WARN 2
  9. #define SEPOL_MSG_INFO 3
  10. extern int sepol_msg_get_level(sepol_handle_t * handle);
  11. extern const char *sepol_msg_get_channel(sepol_handle_t * handle);
  12. extern const char *sepol_msg_get_fname(sepol_handle_t * handle);
  13. /* Set the messaging callback.
  14. * By the default, the callback will print
  15. * the message on standard output, in a
  16. * particular format. Passing NULL here
  17. * indicates that messaging should be suppressed */
  18. extern void sepol_msg_set_callback(sepol_handle_t * handle,
  19. #ifdef __GNUC__
  20. __attribute__ ((format(printf, 3, 4)))
  21. #endif
  22. void (*msg_callback) (void *varg,
  23. sepol_handle_t *
  24. handle,
  25. const char *fmt, ...),
  26. void *msg_callback_arg);
  27. #endif