]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/lib/message.h
DB changes for Retention Periods
[bacula/bacula] / bacula / src / lib / message.h
1 /*
2  * Define Message Types for Bacula
3  *    Kern Sibbald, 2000
4  */
5 /*
6    Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2 of
11    the License, or (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public
19    License along with this program; if not, write to the Free
20    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21    MA 02111-1307, USA.
22
23  */
24
25 #include "bits.h"
26
27 #undef  M_DEBUG
28 #undef  M_ABORT
29 #undef  M_FATAL
30 #undef  M_ERROR
31 #undef  M_WARNING
32 #undef  M_INFO
33 #undef  M_MOUNT
34 #undef  M_TERM
35
36 #define M_DEBUG     1                 /* debug message */
37 #define M_ABORT     2                 /* MUST abort immediately */
38 #define M_FATAL     3                 /* Fatal error, stopping job */
39 #define M_ERROR     4                 /* Error, but recoverable */
40 #define M_WARNING   5                 /* Warning message */
41 #define M_INFO      6                 /* Informational message */
42 #define M_SAVED     7                 /* Info on saved file */
43 #define M_NOTSAVED  8                 /* Info on notsaved file */
44 #define M_SKIPPED   9                 /* File skipped by option setting */
45 #define M_MOUNT    10                 /* Mount requests */
46 #define M_TERM     11                 /* Termination request */
47
48 #define M_MAX      M_TERM             /* keep this updated ! */
49
50 /* Define message destination structure */
51 /* *** FIXME **** where should be extended to handle multiple values */
52 typedef struct s_dest {
53    struct s_dest *next;
54    int dest_code;                     /* destination (one of the MD_ codes) */
55    int max_len;                       /* max mail line length */
56    FILE *fd;                          /* file descriptor */
57    char msg_types[nbytes_for_bits(M_MAX+1)]; /* message type mask */
58    char *where;                       /* filename/program name */
59    char *mail_cmd;                    /* mail command */
60    char *mail_filename;               /* unique mail filename */
61 } DEST;
62
63 /* Message Destination values for dest field of DEST */
64 #define MD_SYSLOG    1                /* send msg to syslog */
65 #define MD_MAIL      2                /* email group of messages */
66 #define MD_FILE      3                /* write messages to a file */
67 #define MD_APPEND    4                /* append messages to a file */
68 #define MD_STDOUT    5                /* print messages */
69 #define MD_STDERR    6                /* print messages to stderr */
70 #define MD_DIRECTOR  7                /* send message to the Director */
71 #define MD_OPERATOR  8                /* email a single message to the operator */
72 #define MD_CONSOLE   9                /* send msg to UserAgent or console */
73 #define MD_MAIL_ON_ERROR 10           /* email messages if job errors */
74
75
76 void d_msg(char *file, int line, int level, char *fmt,...);
77 void e_msg(char *file, int line, int type, int level, char *fmt,...);
78 void Jmsg(void *vjcr, int type, int level, char *fmt,...);
79
80 extern int debug_level;
81 extern char my_name[];
82 extern char *working_directory;
83 extern time_t daemon_start_time;