+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version three of the GNU Affero General Public
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of Kern Sibbald.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
/*
* Define Message Types for Bacula
* Kern Sibbald, 2000
*
- * Version $Id$
*/
-/*
- Copyright (C) 2000-2006 Kern Sibbald
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as amended with additional clauses defined in the
- file LICENSE in the main source directory.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- the file LICENSE for additional details.
-
- */
#include "bits.h"
#undef M_RESTORED
#undef M_SECURITY
#undef M_ALERT
+#undef M_VOLMGMT
/*
* Most of these message levels are more or less obvious.
*
* M_ALERT For Tape Alert messages.
*
+ * M_VOLMGMT Volume Management message
*/
enum {
M_TERM, /* Terminating daemon normally */
M_RESTORED, /* ls -l of restored files */
M_SECURITY, /* security violation */
- M_ALERT /* tape alert messages */
+ M_ALERT, /* tape alert messages */
+ M_VOLMGMT /* Volume management messages */
};
-#define M_MAX M_ALERT /* keep this updated ! */
+#define M_MAX M_VOLMGMT /* keep this updated ! */
/* Define message destination structure */
/* *** FIXME **** where should be extended to handle multiple values */
MD_DIRECTOR, /* send message to the Director */
MD_OPERATOR, /* email a single message to the operator */
MD_CONSOLE, /* send msg to UserAgent or console */
- MD_MAIL_ON_ERROR /* email messages if job errors */
+ MD_MAIL_ON_ERROR, /* email messages if job errors */
+ MD_MAIL_ON_SUCCESS, /* email messages if job succeeds */
+ MD_CATALOG /* sent to catalog Log table */
};
/* Queued message item */
struct MQUEUE_ITEM {
dlink link;
int type;
- time_t mtime;
+ utime_t mtime;
char msg[1];
};
-
+
void d_msg(const char *file, int line, int level, const char *fmt,...);
void e_msg(const char *file, int line, int type, int level, const char *fmt,...);
-void Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...);
-void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...);
+void Jmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...);
+void Qmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...);
bool get_trace(void);
-
-
-extern int DLL_IMP_EXP debug_level;
-extern int DLL_IMP_EXP verbose;
-extern char DLL_IMP_EXP my_name[];
-extern const char * DLL_IMP_EXP working_directory;
-extern time_t DLL_IMP_EXP daemon_start_time;
-extern char catalog_db[];
-
-extern int DLL_IMP_EXP console_msg_pending;
-extern FILE * DLL_IMP_EXP con_fd; /* Console file descriptor */
-extern brwlock_t DLL_IMP_EXP con_lock; /* Console lock structure */
+const char *get_basename(const char *pathname);
+
+class B_DB;
+typedef void (*sql_query_func)(JCR *jcr, const char *cmd);
+typedef void (*sql_escape_func)(JCR *jcr, B_DB* db, char *snew, char *old, int len);
+
+extern DLL_IMP_EXP sql_query_func p_sql_query;
+extern DLL_IMP_EXP sql_escape_func p_sql_escape;
+
+extern DLL_IMP_EXP int debug_level;
+extern DLL_IMP_EXP bool dbg_timestamp; /* print timestamp in debug output */
+extern DLL_IMP_EXP bool prt_kaboom; /* Print kaboom output */
+extern DLL_IMP_EXP int verbose;
+extern DLL_IMP_EXP char my_name[];
+extern DLL_IMP_EXP const char * working_directory;
+extern DLL_IMP_EXP utime_t daemon_start_time;
+
+extern DLL_IMP_EXP int console_msg_pending;
+extern DLL_IMP_EXP FILE * con_fd; /* Console file descriptor */
+extern DLL_IMP_EXP brwlock_t con_lock; /* Console lock structure */