~drizzle-trunk/drizzle/development

1637.3.1 by Mark Atwood
new syslog module, with plugins for query log, error message, and SYSLOG() function
1
/*
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
2
 * Copyright (C) 1982, 1986, 1988, 1993
1637.3.1 by Mark Atwood
new syslog module, with plugins for query log, error message, and SYSLOG() function
3
 *      The Regents of the University of California.  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
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 * 4. Neither the name of the University nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
 * SUCH DAMAGE.
28
 *
29
 *      @(#)syslog.h    8.1 (Berkeley) 6/2/93
30
 */
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
31
#pragma once
1637.3.1 by Mark Atwood
new syslog module, with plugins for query log, error message, and SYSLOG() function
32
33
/* Solaris doesn't define these, so we copy them in. So Sad. */
34
35
#ifndef LOG_FTP
36
# define        LOG_FTP         (11<<3)
37
#endif
38
#ifndef LOG_AUTHPRIV
39
# define        LOG_AUTHPRIV    (10<<3)
40
#endif
41
42
#define LOG_PRI(p)      ((p) & LOG_PRIMASK)
43
#define LOG_MAKEPRI(fac, pri)   (((fac) << 3) | (pri))
44
45
#define INTERNAL_NOPRI  0x10    /* the "no priority" priority */
46
                                /* mark "facility" */
47
#define INTERNAL_MARK   LOG_MAKEPRI(LOG_NFACILITIES, 0)
48
typedef struct _code {
49
        const char    *c_name;
50
        int     c_val;
51
} CODE;
52
53
CODE prioritynames[] =
54
  {
55
    { "alert", LOG_ALERT },
56
    { "crit", LOG_CRIT },
57
    { "debug", LOG_DEBUG },
58
    { "emerg", LOG_EMERG },
59
    { "err", LOG_ERR },
60
    { "error", LOG_ERR },               /* DEPRECATED */
61
    { "info", LOG_INFO },
62
    { "none", INTERNAL_NOPRI },         /* INTERNAL */
63
    { "notice", LOG_NOTICE },
64
    { "panic", LOG_EMERG },             /* DEPRECATED */
65
    { "warn", LOG_WARNING },            /* DEPRECATED */
66
    { "warning", LOG_WARNING },
67
    { NULL, -1 }
68
  };
69
70
71
CODE facilitynames[] =
72
  {
73
    { "auth", LOG_AUTH },
74
    { "authpriv", LOG_AUTHPRIV },
75
    { "cron", LOG_CRON },
76
    { "daemon", LOG_DAEMON },
77
    { "ftp", LOG_FTP },
78
    { "kern", LOG_KERN },
79
    { "lpr", LOG_LPR },
80
    { "mail", LOG_MAIL },
81
    { "mark", INTERNAL_MARK },          /* INTERNAL */
82
    { "news", LOG_NEWS },
83
    { "security", LOG_AUTH },           /* DEPRECATED */
84
    { "syslog", LOG_SYSLOG },
85
    { "user", LOG_USER },
86
    { "uucp", LOG_UUCP },
87
    { "local0", LOG_LOCAL0 },
88
    { "local1", LOG_LOCAL1 },
89
    { "local2", LOG_LOCAL2 },
90
    { "local3", LOG_LOCAL3 },
91
    { "local4", LOG_LOCAL4 },
92
    { "local5", LOG_LOCAL5 },
93
    { "local6", LOG_LOCAL6 },
94
    { "local7", LOG_LOCAL7 },
95
    { NULL, -1 }
96
  };
97
98