Imported Upstream version 1.6.6
[debian/sudo] / logging.h
1 /*
2  * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * 3. The name of the author may not be used to endorse or promote products
17  *    derived from this software without specific prior written permission.
18  *
19  * 4. Products derived from this software may not be called "Sudo" nor
20  *    may "Sudo" appear in their names without specific prior written
21  *    permission from the author.
22  *
23  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
26  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34
35 #ifndef _LOGGING_H
36 #define _LOGGING_H
37
38 #include <syslog.h>
39 #ifdef __STDC__
40 # include <stdarg.h>
41 #else
42 # include <varargs.h>
43 #endif
44
45 /* Logging types */
46 #define SLOG_SYSLOG             0x01
47 #define SLOG_FILE               0x02
48 #define SLOG_BOTH               0x03
49
50 /* Flags for log_error() */
51 #define MSG_ONLY                0x01
52 #define USE_ERRNO               0x02
53 #define NO_MAIL                 0x04
54 #define NO_EXIT                 0x08
55
56 /*
57  * Maximum number of characters to log per entry.  The syslogger
58  * will log this much, after that, it truncates the log line.
59  * We need this here to make sure that we continue with another   
60  * syslog(3) call if the internal buffer is more than 1023 characters.
61  */
62 #ifndef MAXSYSLOGLEN
63 # define MAXSYSLOGLEN           960
64 #endif
65       
66 void log_auth                   __P((int, int));
67 void log_error                  __P((int flags, const char *fmt, ...));
68 RETSIGTYPE reapchild            __P((int));
69
70 #endif /* _LOGGING_H */