Ring Daemon 16.0.0
Loading...
Searching...
No Matches
winsyslog.h
Go to the documentation of this file.
1/*
2 * This header borrowed from Cygnus GNUwin32 project
3 *
4 * Cygwin is free software. Red Hat, Inc. licenses Cygwin to you under the
5 * terms of the GNU General Public License as published by the Free Software
6 * Foundation; you can redistribute it and/or modify it under the terms of
7 * the GNU General Public License either version 3 of the license, or (at your
8 * option) any later version (GPLv3+), along with the additional permissions
9 * given below.
10 *
11 * Modified for use with functions to map syslog
12 * calls to EventLog calls on the windows platform
13 *
14 * much of this is not used, but here for the sake of
15 * error free compilation. EventLogs will most likely
16 * not behave as syslog does, but may be useful anyway.
17 * much of what syslog does can be emulated here, but
18 * that will have to be done later.
19 */
20
21#ifndef WINSYSLOG_H
22#define WINSYSLOG_H
23#ifndef WIN32_LEAN_AND_MEAN
24#define WIN32_LEAN_AND_MEAN 1
25#endif
26#include <windows.h>
27
28#define WINLOG_PRIMASK 0x07
29
30#define WINLOG_PRI(p) ((p) &WINLOG_PRIMASK)
31#define WINLOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
32
33#define WINLOG_KERN (0 << 3)
34#define WINLOG_USER (1 << 3)
35#define WINLOG_MAIL (2 << 3)
36#define WINLOG_DAEMON (3 << 3)
37#define WINLOG_AUTH (4 << 3)
38#define WINLOG_SYSLOG (5 << 3)
39#define WINLOG_LPR (6 << 3)
40#define WINLOG_NEWS (7 << 3)
41#define WINLOG_UUCP (8 << 3)
42#define WINLOG_CRON (9 << 3)
43#define WINLOG_AUTHPRIV (10 << 3)
44
45#define WINLOG_NFACILITIES 10
46#define WINLOG_FACMASK 0x03f8
47#define WINLOG_FAC(p) (((p) &WINLOG_FACMASK) >> 3)
48
49#define WINLOG_MASK(pri) (1 << (pri))
50#define WINLOG_UPTO(pri) ((1 << ((pri) + 1)) - 1)
51
52/*
53 * Option flags for openlog.
54 *
55 * WINLOG_ODELAY no longer does anything.
56 * WINLOG_NDELAY is the inverse of what it used to be.
57 */
58#define WINLOG_PID 0x01 /* log the pid with each message */
59#define WINLOG_CONS 0x02 /* log on the console if errors in sending */
60#define WINLOG_ODELAY 0x04 /* delay open until first syslog() (default) */
61#define WINLOG_NDELAY 0x08 /* don't delay open */
62#define WINLOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
63#define WINLOG_PERROR 0x20 /* log to stderr as well */
64
65#define strerror_r(errno, buf, len) strerror_s(buf, len, errno)
66
67#ifdef __cplusplus
68extern "C" {
69#endif
70
71extern void closelog(void);
72extern void openlog(const char*, int, int);
73extern void syslog(int, const char*, ...);
74
75#ifdef __cplusplus
76}
77#endif
78#endif
void syslog(int, const char *,...)
void openlog(const char *, int, int)
void closelog(void)