OSDN Git Service

Don't use safe_new but new throughout. Fix copyright dates
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygserver / bsd_log.h
1 /* bsd_log.h: Helps integrating BSD kernel code
2
3    Copyright 2003 Red Hat, Inc.
4
5 This file is part of Cygwin.
6
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
9 details. */
10 #ifndef _BSD_LOG_H
11 #define _BSD_LOG_H
12
13 #include <sys/types.h>
14 #include <sys/syslog.h>
15
16 extern long log_level;
17 extern tun_bool_t log_debug;
18 extern tun_bool_t log_syslog;
19 extern tun_bool_t log_stderr;
20
21 void loginit (tun_bool_t, tun_bool_t);
22 void _vlog (const char *, int, int, const char *, va_list);
23 void _log (const char *, int, int, const char *, ...);
24 void _vpanic (const char *, int, const char *, va_list) __attribute__ ((noreturn));
25 void _panic (const char *, int, const char *, ...) __attribute__ ((noreturn));
26 #define vlog(l,f,a) _vlog(NULL,0,(l),(f),(a))
27 #define log(l,f,...) _log(NULL,0,(l),(f),##__VA_ARGS__)
28 #define vdebug(f,a) _vlog(__FILE__,__LINE__,LOG_DEBUG,(f),(a))
29 #define debug(f,...) _log(__FILE__,__LINE__,LOG_DEBUG,(f),##__VA_ARGS__)
30 #define vpanic(f,a) _vpanic(__FILE__,__LINE__,(f),(a))
31 #define panic(f,...) _panic(__FILE__,__LINE__,(f),##__VA_ARGS__)
32
33 #endif /* _BSD_LOG_H */