* Version $Id$
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* Bacula common configuration defines */
+#undef TRUE
+#undef FALSE
#define TRUE 1
#define FALSE 0
#define _(s) gettext((s))
#define N_(s) (s)
#else
+#undef _
#define _(s) (s)
+#undef N_
#define N_(s) (s)
+#undef textdomain
#define textdomain(d)
-#define bindtextdomain(p, d)
+/* #define bindtextdomain(p, d) */
#endif
#endif
/*
- * Maximum number of bytes that you can push into a
- * socket.
+ * Default network buffer size
*/
-#define MAX_NETWORK_BUFFER_SIZE (32 * 1024)
+#define DEFAULT_NETWORK_BUFFER_SIZE (32 * 1024)
/*
* Stream definitions. Once defined these must NEVER
strerror(errstat)); \
} while(0)
+#define LockRes() b_LockRes(__FILE__, __LINE__)
+#define UnlockRes() b_UnlockRes(__FILE__, __LINE__)
+
/*
* The digit following Dmsg and Emsg indicates the number of substitutions in
#define Jmsg5(jcr, typ, lvl, msg, a1, a2, a3, a4, a5) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5)
#define Jmsg6(jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6)
+/* Queued Job Error Messages that are delivered according to the message resource */
+#define Qmsg0(jcr, typ, lvl, msg) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg)
+#define Qmsg1(jcr, typ, lvl, msg, a1) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1)
+#define Qmsg2(jcr, typ, lvl, msg, a1, a2) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2)
+#define Qmsg3(jcr, typ, lvl, msg, a1, a2, a3) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3)
+#define Qmsg4(jcr, typ, lvl, msg, a1, a2, a3, a4) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4)
+#define Qmsg5(jcr, typ, lvl, msg, a1, a2, a3, a4, a5) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5)
+#define Qmsg6(jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6)
+
/* Memory Messages that are edited into a Pool Memory buffer */
#define Mmsg0(buf, msg) m_msg(__FILE__, __LINE__, buf, msg)
#define Mmsg15(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)
/* Edit message into Pool Memory buffer -- no __FILE__ and __LINE__ */
-int Mmsg(POOLMEM **msgbuf, char *fmt,...);
+int Mmsg(POOLMEM **msgbuf, const char *fmt,...);
struct JCR;
-void d_msg(char *file, int line, int level, char *fmt,...);
-void p_msg(char *file, int line, int level, char *fmt,...);
-void e_msg(char *file, int line, int type, int level, char *fmt,...);
-void j_msg(char *file, int line, JCR *jcr, int type, int level, char *fmt,...);
-int m_msg(char *file, int line, POOLMEM **msgbuf, char *fmt,...);
+void d_msg(const char *file, int line, int level, const char *fmt,...);
+void p_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 j_msg(const char *file, int line, JCR *jcr, int type, int level, const char *fmt,...);
+void q_msg(const char *file, int line, JCR *jcr, int type, int level, const char *fmt,...);
+int m_msg(const char *file, int line, POOLMEM **msgbuf, const char *fmt,...);
/* Use our strdup with smartalloc */
#define fgets(x,y,z) bfgets((x), (y), (z))
#ifdef DEBUG
-#define bstrdup(str) strcpy((char *) b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
+#define bstrdup(str) strcpy((char *)b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
#else
-#define bstrdup(str) strcpy((char *) bmalloc(strlen((str))+1),(str))
+#define bstrdup(str) strcpy((char *)bmalloc(strlen((str))+1),(str))
#endif
#ifdef DEBUG
#ifdef HAVE_DARWIN_OS
/* Apparently someone forgot to wrap getdomainname as a C function */
-extern "C" int getdomainname(char *name, size_t len);
+extern "C" int getdomainname(char *name, int len);
/* Darwin lib fnmatch() doesn't work, so use our own */
#undef HAVE_FNMATCH