28#ifndef __STUMPLESS_FACILITY_H
29# define __STUMPLESS_FACILITY_H
31# include <stumpless/config.h>
35# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
44# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
45# define STUMPLESS_FACILITY_KERN_VALUE LOG_KERN
47# define STUMPLESS_FACILITY_KERN_VALUE 0
55# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
56# define STUMPLESS_FACILITY_USER_VALUE LOG_USER
58# define STUMPLESS_FACILITY_USER_VALUE ( 1 << 3 )
66# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
67# define STUMPLESS_FACILITY_MAIL_VALUE LOG_MAIL
69# define STUMPLESS_FACILITY_MAIL_VALUE ( 2 << 3 )
77# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
78# define STUMPLESS_FACILITY_DAEMON_VALUE LOG_DAEMON
80# define STUMPLESS_FACILITY_DAEMON_VALUE ( 3 << 3 )
89# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
90# define STUMPLESS_FACILITY_AUTH_VALUE LOG_AUTH
92# define STUMPLESS_FACILITY_AUTH_VALUE ( 4 << 3 )
101# define STUMPLESS_FACILITY_SYSLOG_VALUE ( 5 << 3 )
108# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
109# define STUMPLESS_FACILITY_LPR_VALUE LOG_LPR
111# define STUMPLESS_FACILITY_LPR_VALUE ( 6 << 3 )
119# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
120# define STUMPLESS_FACILITY_NEWS_VALUE LOG_NEWS
122# define STUMPLESS_FACILITY_NEWS_VALUE ( 7 << 3 )
130# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
131# define STUMPLESS_FACILITY_UUCP_VALUE LOG_UUCP
133# define STUMPLESS_FACILITY_UUCP_VALUE ( 8 << 3 )
141# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
142# define STUMPLESS_FACILITY_CRON_VALUE LOG_CRON
144# define STUMPLESS_FACILITY_CRON_VALUE ( 9 << 3 )
152# define STUMPLESS_FACILITY_AUTH2_VALUE ( 10 << 3 )
159# define STUMPLESS_FACILITY_FTP_VALUE ( 11 << 3 )
166# define STUMPLESS_FACILITY_NTP_VALUE ( 12 << 3 )
173# define STUMPLESS_FACILITY_AUDIT_VALUE ( 13 << 3 )
180# define STUMPLESS_FACILITY_ALERT_VALUE ( 14 << 3 )
187# define STUMPLESS_FACILITY_CRON2_VALUE ( 15 << 3 )
194# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
195# define STUMPLESS_FACILITY_LOCAL0_VALUE LOG_LOCAL0
197# define STUMPLESS_FACILITY_LOCAL0_VALUE ( 16 << 3 )
205# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
206# define STUMPLESS_FACILITY_LOCAL1_VALUE LOG_LOCAL1
208# define STUMPLESS_FACILITY_LOCAL1_VALUE ( 17 << 3 )
216# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
217# define STUMPLESS_FACILITY_LOCAL2_VALUE LOG_LOCAL2
219# define STUMPLESS_FACILITY_LOCAL2_VALUE ( 18 << 3 )
227# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
228# define STUMPLESS_FACILITY_LOCAL3_VALUE LOG_LOCAL3
230# define STUMPLESS_FACILITY_LOCAL3_VALUE ( 19 << 3 )
238# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
239# define STUMPLESS_FACILITY_LOCAL4_VALUE LOG_LOCAL4
241# define STUMPLESS_FACILITY_LOCAL4_VALUE ( 20 << 3 )
249# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
250# define STUMPLESS_FACILITY_LOCAL5_VALUE LOG_LOCAL5
252# define STUMPLESS_FACILITY_LOCAL5_VALUE ( 21 << 3 )
260# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
261# define STUMPLESS_FACILITY_LOCAL6_VALUE LOG_LOCAL6
263# define STUMPLESS_FACILITY_LOCAL6_VALUE ( 22 << 3 )
271# ifdef STUMPLESS_SYSLOG_H_COMPATIBLE
272# define STUMPLESS_FACILITY_LOCAL7_VALUE LOG_LOCAL7
274# define STUMPLESS_FACILITY_LOCAL7_VALUE ( 23 << 3 )
285# define STUMPLESS_FOREACH_FACILITY( ACTION ) \
287ACTION( STUMPLESS_FACILITY_KERN, STUMPLESS_FACILITY_KERN_VALUE ) \
289ACTION( STUMPLESS_FACILITY_USER, STUMPLESS_FACILITY_USER_VALUE ) \
291ACTION( STUMPLESS_FACILITY_MAIL, STUMPLESS_FACILITY_MAIL_VALUE ) \
293ACTION( STUMPLESS_FACILITY_DAEMON, STUMPLESS_FACILITY_DAEMON_VALUE ) \
295ACTION( STUMPLESS_FACILITY_AUTH, STUMPLESS_FACILITY_AUTH_VALUE ) \
297ACTION( STUMPLESS_FACILITY_SYSLOG, STUMPLESS_FACILITY_SYSLOG_VALUE ) \
299ACTION( STUMPLESS_FACILITY_LPR, STUMPLESS_FACILITY_LPR_VALUE ) \
301ACTION( STUMPLESS_FACILITY_NEWS, STUMPLESS_FACILITY_NEWS_VALUE ) \
303ACTION( STUMPLESS_FACILITY_UUCP, STUMPLESS_FACILITY_UUCP_VALUE ) \
305ACTION( STUMPLESS_FACILITY_CRON, STUMPLESS_FACILITY_CRON_VALUE ) \
307ACTION( STUMPLESS_FACILITY_AUTH2, STUMPLESS_FACILITY_AUTH2_VALUE ) \
309ACTION( STUMPLESS_FACILITY_FTP, STUMPLESS_FACILITY_FTP_VALUE ) \
311ACTION( STUMPLESS_FACILITY_NTP, STUMPLESS_FACILITY_NTP_VALUE ) \
313ACTION( STUMPLESS_FACILITY_AUDIT, STUMPLESS_FACILITY_AUDIT_VALUE ) \
315ACTION( STUMPLESS_FACILITY_ALERT, STUMPLESS_FACILITY_ALERT_VALUE ) \
317ACTION( STUMPLESS_FACILITY_CRON2, STUMPLESS_FACILITY_CRON2_VALUE ) \
319ACTION( STUMPLESS_FACILITY_LOCAL0, STUMPLESS_FACILITY_LOCAL0_VALUE ) \
321ACTION( STUMPLESS_FACILITY_LOCAL1, STUMPLESS_FACILITY_LOCAL1_VALUE ) \
323ACTION( STUMPLESS_FACILITY_LOCAL2, STUMPLESS_FACILITY_LOCAL2_VALUE ) \
325ACTION( STUMPLESS_FACILITY_LOCAL3, STUMPLESS_FACILITY_LOCAL3_VALUE ) \
327ACTION( STUMPLESS_FACILITY_LOCAL4, STUMPLESS_FACILITY_LOCAL4_VALUE ) \
329ACTION( STUMPLESS_FACILITY_LOCAL5, STUMPLESS_FACILITY_LOCAL5_VALUE ) \
331ACTION( STUMPLESS_FACILITY_LOCAL6, STUMPLESS_FACILITY_LOCAL6_VALUE ) \
333ACTION( STUMPLESS_FACILITY_LOCAL7, STUMPLESS_FACILITY_LOCAL7_VALUE )
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
定义 config.h:31
#define STUMPLESS_FOREACH_FACILITY(ACTION)
A macro function that runs the provided action once for each facility, providing the symbol and value...
定义 facility.h:285
const char * stumpless_get_facility_string(enum stumpless_facility facility)
Gets the string representation of the given facility.
enum stumpless_facility stumpless_get_facility_enum(const char *facility_string)
Gets the enum value corresponding to the given facility string.
enum stumpless_facility stumpless_get_facility_enum_from_buffer(const char *facility_string, size_t facility_buffer_length)
Gets the enum value corresponding to the given facility string.
stumpless_facility
All possible facility codes available to log entries.
定义 facility.h:347
@ STUMPLESS_GENERATE_ENUM
Kernel messages.
定义 facility.h:348
Generic functionality to be used with STUMPLESS_FOREACH macros to allow for more generic definition o...