|
Packit Service |
102278 |
/* Author: Joshua Brindle <jbrindle@tresys.com>
|
|
Packit Service |
102278 |
* Jason Tang <jtang@tresys.com>
|
|
Packit Service |
102278 |
* Ivan Gyurdiev <ivg2@cornell.edu>
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* Copyright (C) 2005 Tresys Technology, LLC
|
|
Packit Service |
102278 |
* Copyright (C) 2005 Red Hat Inc.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
102278 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
102278 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
102278 |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
102278 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
102278 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
102278 |
* Lesser General Public License for more details.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
102278 |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
102278 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
102278 |
*/
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#ifndef _SEMANAGE_INTERNAL_DEBUG_H_
|
|
Packit Service |
102278 |
#define _SEMANAGE_INTERNAL_DEBUG_H_
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#include <stdio.h>
|
|
Packit Service |
102278 |
#include <semanage/debug.h>
|
|
Packit Service |
102278 |
#include <sepol/debug.h>
|
|
Packit Service |
102278 |
#include "handle.h"
|
|
Packit Service |
102278 |
#include "dso.h"
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#define STATUS_SUCCESS 0
|
|
Packit Service |
102278 |
#define STATUS_ERR -1
|
|
Packit Service |
102278 |
#define STATUS_NODATA 1
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#define msg_write(handle_arg, level_arg, \
|
|
Packit Service |
102278 |
channel_arg, func_arg, ...) do { \
|
|
Packit Service |
102278 |
\
|
|
Packit Service |
102278 |
if ((handle_arg)->msg_callback) { \
|
|
Packit Service |
102278 |
(handle_arg)->msg_fname = func_arg; \
|
|
Packit Service |
102278 |
(handle_arg)->msg_channel = channel_arg; \
|
|
Packit Service |
102278 |
(handle_arg)->msg_level = level_arg; \
|
|
Packit Service |
102278 |
\
|
|
Packit Service |
102278 |
(handle_arg)->msg_callback( \
|
|
Packit Service |
102278 |
(handle_arg)->msg_callback_arg, \
|
|
Packit Service |
102278 |
handle_arg, __VA_ARGS__); \
|
|
Packit Service |
102278 |
} \
|
|
Packit Service |
102278 |
} while(0)
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#define ERR(handle, ...) \
|
|
Packit Service |
102278 |
msg_write(handle, SEMANAGE_MSG_ERR, "libsemanage", \
|
|
Packit Service |
102278 |
__FUNCTION__, __VA_ARGS__)
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#define INFO(handle, ...) \
|
|
Packit Service |
102278 |
msg_write(handle, SEMANAGE_MSG_INFO, "libsemanage", \
|
|
Packit Service |
102278 |
__FUNCTION__, __VA_ARGS__)
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#define WARN(handle, ...) \
|
|
Packit Service |
102278 |
msg_write(handle, SEMANAGE_MSG_WARN, "libsemanage", \
|
|
Packit Service |
102278 |
__FUNCTION__, __VA_ARGS__)
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#ifdef __GNUC__
|
|
Packit Service |
102278 |
__attribute__ ((format(printf, 3, 4)))
|
|
Packit Service |
102278 |
#endif
|
|
Packit Service |
102278 |
extern void hidden semanage_msg_default_handler(void *varg,
|
|
Packit Service |
102278 |
semanage_handle_t * handle,
|
|
Packit Service |
102278 |
const char *fmt, ...);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#ifdef __GNUC__
|
|
Packit Service |
102278 |
__attribute__ ((format(printf, 3, 4)))
|
|
Packit Service |
102278 |
#endif
|
|
Packit Service |
102278 |
extern void hidden semanage_msg_relay_handler(void *varg,
|
|
Packit Service |
102278 |
sepol_handle_t * handle,
|
|
Packit Service |
102278 |
const char *fmt, ...);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
hidden_proto(semanage_msg_get_channel)
|
|
Packit Service |
102278 |
hidden_proto(semanage_msg_get_fname)
|
|
Packit Service |
102278 |
hidden_proto(semanage_msg_get_level)
|
|
Packit Service |
102278 |
#endif
|