X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fbaconfig.h;h=35698e8c1d10f389ab7f6e5e2e038fa3499324d3;hb=4123610ef607a764883b77af3ec7f09b6bb6d627;hp=4a7dc15d97ee459f3d2ef1255936e10a0a04d9a0;hpb=3c4aa7c0dd0b6831656bdcc7703849f62471b689;p=bacula%2Fbacula diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 4a7dc15d97..35698e8c1d 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -5,7 +5,7 @@ * 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 @@ -30,6 +30,8 @@ /* Bacula common configuration defines */ +#undef TRUE +#undef FALSE #define TRUE 1 #define FALSE 0 @@ -60,10 +62,13 @@ #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 @@ -71,7 +76,7 @@ #define MAXSTRING 500 /* Maximum length to edit time/date */ -#define MAX_TIME_LENGTH 30 +#define MAX_TIME_LENGTH 50 /* Maximum Name length including EOS */ #define MAX_NAME_LENGTH 128 @@ -90,10 +95,9 @@ #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 @@ -120,7 +124,6 @@ #define STREAM_SHA1_SIGNATURE 10 /* SHA1 signature for the file */ #define STREAM_WIN32_DATA 11 /* Win32 BackupRead data */ #define STREAM_WIN32_GZIP_DATA 12 /* Gzipped Win32 BackupRead data */ -#define STREAM_WIN32_ATTRIBUTES 13 /* Unix attribs, but WIN32_DATA follows */ /* * File type (Bacula defined). @@ -257,6 +260,9 @@ extern void _v(char *file, int line, pthread_mutex_t *m); 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 @@ -362,6 +368,15 @@ extern void _v(char *file, int line, pthread_mutex_t *m); #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) @@ -377,25 +392,30 @@ extern void _v(char *file, int line, pthread_mutex_t *m); #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(char **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, char **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 */ #undef strdup #define strdup(buf) bad_call_on_strdup_use_bstrdup(buf) +/* Use our fgets which handles interrupts */ +#undef fgets +#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 @@ -426,7 +446,7 @@ extern int thr_setconcurrency(int); #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