Open SCAP Library
reporter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors:
20  * Lukas Kuklinek <lkuklinek@redhat.com>
21  */
22 
28 #ifndef OSCAP_REPORTER_H_
29 #define OSCAP_REPORTER_H_
30 
31 #include <stdbool.h>
32 #include <stdarg.h>
33 
73 
74 typedef enum oscap_reporter_family {
78  OSCAP_REPORTER_FAMILY_USER_START = 1024
80 
82 typedef unsigned int oscap_reporter_code_t;
83 
86 
92 
96 typedef int (*oscap_reporter)(const struct oscap_reporter_message *msg, void *arg);
97 
98 
112 const char *oscap_reporter_message_get_string(const struct oscap_reporter_message *item);
113 
115 const char *oscap_reporter_message_get_user1str(const struct oscap_reporter_message *msg);
121 const char *oscap_reporter_message_get_user2str(const struct oscap_reporter_message *msg);
127 const char *oscap_reporter_message_get_user3str(const struct oscap_reporter_message *msg);
132 
133 
139 int oscap_reporter_dispatch(oscap_reporter reporter, const struct oscap_reporter_message *msg, void *arg);
140 
148 int oscap_reporter_report(oscap_reporter reporter, struct oscap_reporter_message *msg, void *arg);
149 
156 int oscap_reporter_report_fmt(oscap_reporter reporter, void *arg, oscap_reporter_family_t family, oscap_reporter_code_t code, const char *fmt, ...);
157 
159 int oscap_reporter_fd(const struct oscap_reporter_message *msg, void *arg);
160 
181 int oscap_reporter_switch(const struct oscap_reporter_message *msg, void *arg);
182 
183 #endif // OSCAP_REPORTER_H_