16cd6a6acSopenharmony_ci#ifndef _SEPOL_DEBUG_H_
26cd6a6acSopenharmony_ci#define _SEPOL_DEBUG_H_
36cd6a6acSopenharmony_ci
46cd6a6acSopenharmony_ci#include <sepol/handle.h>
56cd6a6acSopenharmony_ci
66cd6a6acSopenharmony_ci#ifdef __cplusplus
76cd6a6acSopenharmony_ciextern "C" {
86cd6a6acSopenharmony_ci#endif
96cd6a6acSopenharmony_ci
106cd6a6acSopenharmony_ci/* Deprecated */
116cd6a6acSopenharmony_ciextern void sepol_debug(int on);
126cd6a6acSopenharmony_ci/* End deprecated */
136cd6a6acSopenharmony_ci
146cd6a6acSopenharmony_ci#define SEPOL_MSG_ERR  1
156cd6a6acSopenharmony_ci#define SEPOL_MSG_WARN 2
166cd6a6acSopenharmony_ci#define SEPOL_MSG_INFO 3
176cd6a6acSopenharmony_ci
186cd6a6acSopenharmony_ciextern int sepol_msg_get_level(sepol_handle_t * handle);
196cd6a6acSopenharmony_ci
206cd6a6acSopenharmony_ciextern const char *sepol_msg_get_channel(sepol_handle_t * handle);
216cd6a6acSopenharmony_ci
226cd6a6acSopenharmony_ciextern const char *sepol_msg_get_fname(sepol_handle_t * handle);
236cd6a6acSopenharmony_ci
246cd6a6acSopenharmony_ci/* Set the messaging callback.
256cd6a6acSopenharmony_ci * By the default, the callback will print
266cd6a6acSopenharmony_ci * the message on standard output, in a
276cd6a6acSopenharmony_ci * particular format. Passing NULL here
286cd6a6acSopenharmony_ci * indicates that messaging should be suppressed */
296cd6a6acSopenharmony_ciextern void sepol_msg_set_callback(sepol_handle_t * handle,
306cd6a6acSopenharmony_ci#ifdef __GNUC__
316cd6a6acSopenharmony_ci				   __attribute__ ((format(printf, 3, 4)))
326cd6a6acSopenharmony_ci#endif
336cd6a6acSopenharmony_ci				   void (*msg_callback) (void *varg,
346cd6a6acSopenharmony_ci							 sepol_handle_t *
356cd6a6acSopenharmony_ci							 handle,
366cd6a6acSopenharmony_ci							 const char *fmt, ...),
376cd6a6acSopenharmony_ci				   void *msg_callback_arg);
386cd6a6acSopenharmony_ci
396cd6a6acSopenharmony_ci#ifdef __cplusplus
406cd6a6acSopenharmony_ci}
416cd6a6acSopenharmony_ci#endif
426cd6a6acSopenharmony_ci
436cd6a6acSopenharmony_ci#endif
44