]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/baconfig.h
23931a3127ab1b85ff4df1a76d77432273940254
[bacula/bacula] / bacula / src / baconfig.h
1 /*
2  * General header file configurations that apply to
3  * all daemons.  System dependent stuff goes here.
4  *
5  *   Version $Id$
6  */
7 /*
8    Copyright (C) 2000-2004 Kern Sibbald and John Walker
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2 of
13    the License, or (at your option) any later version.
14
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public
21    License along with this program; if not, write to the Free
22    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23    MA 02111-1307, USA.
24
25  */
26
27
28 #ifndef _BACONFIG_H
29 #define _BACONFIG_H 1
30
31 /* Bacula common configuration defines */
32
33 #undef  TRUE
34 #undef  FALSE
35 #define TRUE  1
36 #define FALSE 0
37
38 #ifndef ETIME
39 #define ETIME ETIMEDOUT
40 #endif
41
42 #ifdef PROTOTYPES
43 # define __PROTO(p)     p
44 #else
45 # define __PROTO(p)     ()
46 #endif
47
48 #ifdef DEBUG
49 #define ASSERT(x) if (!(x)) { \
50    char *jcr = NULL; \
51    Emsg1(M_ERROR, 0, "Failed ASSERT: %s\n", #x); \
52    jcr[0] = 0; }
53 #else
54 #define ASSERT(x)
55 #endif
56
57 /* Allow printing of NULL pointers */
58 #define NPRT(x) (x)?(x):"*None*" 
59
60 #ifdef ENABLE_NLS
61 #include <libintl.h>
62 #define _(s) gettext((s))
63 #define N_(s) (s)
64 #else
65 #undef _
66 #define _(s) (s)
67 #undef N_
68 #define N_(s) (s)
69 #undef textdomain
70 #define textdomain(d)
71 /* #define bindtextdomain(p, d) */
72 #endif
73
74
75 /* This should go away! ****FIXME***** */
76 #define MAXSTRING 500
77
78 /* Maximum length to edit time/date */
79 #define MAX_TIME_LENGTH 50  
80
81 /* Maximum Name length including EOS */
82 #define MAX_NAME_LENGTH 128
83
84 /* Maximume number of user entered command args */
85 #define MAX_CMD_ARGS 30
86
87 /* All tape operations MUST be a multiple of this */
88 #define TAPE_BSIZE 1024
89 #if !defined(DEV_BSIZE) && defined(BSIZE)
90 #define DEV_BSIZE BSIZE
91 #endif
92
93 #ifndef DEV_BSIZE
94 #define DEV_BSIZE 512
95 #endif
96
97 /*
98  * Default network buffer size
99  */
100 #define DEFAULT_NETWORK_BUFFER_SIZE (32 * 1024)
101
102 /*
103  * Stream definitions.  Once defined these must NEVER
104  *   change as they go on the storage media.
105  * Note, the following streams are passed from the SD to the DIR
106  *   so that they may be put into the catalog (actually only the
107  *   stat packet part of the attr record is put in the catalog.
108  *
109  *   STREAM_UNIX_ATTRIBUTES
110  *   STREAM_UNIX_ATTRIBUTES_EX
111  *   STREAM_MD5_SIGNATURE
112  *   STREAM_SHA1_SIGNATURE
113  */
114 #define STREAM_UNIX_ATTRIBUTES    1    /* Generic Unix attributes */
115 #define STREAM_FILE_DATA          2    /* Standard uncompressed data */
116 #define STREAM_MD5_SIGNATURE      3    /* MD5 signature for the file */
117 #define STREAM_GZIP_DATA          4    /* GZip compressed file data */
118 /* Extended Unix attributes with Win32 Extended data.  Deprecated. */
119 #define STREAM_UNIX_ATTRIBUTES_EX 5    /* Extended Unix attr for Win32 EX */
120 #define STREAM_SPARSE_DATA        6    /* Sparse data stream */
121 #define STREAM_SPARSE_GZIP_DATA   7
122 #define STREAM_PROGRAM_NAMES      8    /* program names for program data */
123 #define STREAM_PROGRAM_DATA       9    /* Data needing program */
124 #define STREAM_SHA1_SIGNATURE    10    /* SHA1 signature for the file */
125 #define STREAM_WIN32_DATA        11    /* Win32 BackupRead data */
126 #define STREAM_WIN32_GZIP_DATA   12    /* Gzipped Win32 BackupRead data */
127
128 /* 
129  *  File type (Bacula defined).           
130  *  NOTE!!! These are saved in the Attributes record on the tape, so
131  *          do not change them. If need be, add to them.
132  *
133  *  This is stored as 32 bits on tape, but only FT_MASK bits are
134  *    used for the file type. The upper bits are used to indicate
135  *    additional optional fields in the attribute record.
136  */
137 #define FT_MASK       0xFFFF          /* Bits used by FT (type) */
138 #define FT_LNKSAVED   1               /* hard link to file already saved */  
139 #define FT_REGE       2               /* Regular file but empty */
140 #define FT_REG        3               /* Regular file */
141 #define FT_LNK        4               /* Soft Link */
142 #define FT_DIR        5               /* Directory */
143 #define FT_SPEC       6               /* Special file -- chr, blk, fifo, sock */
144 #define FT_NOACCESS   7               /* Not able to access */
145 #define FT_NOFOLLOW   8               /* Could not follow link */
146 #define FT_NOSTAT     9               /* Could not stat file */
147 #define FT_NOCHG     10               /* Incremental option, file not changed */
148 #define FT_DIRNOCHG  11               /* Incremental option, directory not changed */
149 #define FT_ISARCH    12               /* Trying to save archive file */
150 #define FT_NORECURSE 13               /* No recursion into directory */
151 #define FT_NOFSCHG   14               /* Different file system, prohibited */
152 #define FT_NOOPEN    15               /* Could not open directory */
153 #define FT_RAW       16               /* Raw block device */
154 #define FT_FIFO      17               /* Raw fifo device */
155
156 /* Definitions for upper part of type word (see above). */
157 #define AR_DATA_STREAM (1<<16)        /* Data stream id present */
158
159 /*
160  * Internal code for Signature types
161  */
162 #define NO_SIG   0
163 #define MD5_SIG  1
164 #define SHA1_SIG 2
165
166 /* Size of File Address stored in STREAM_SPARSE_DATA. Do NOT change! */
167 #define SPARSE_FADDR_SIZE (sizeof(uint64_t))
168
169
170 /* This is for dumb compilers/libraries like Solaris. Linux GCC
171  * does it correctly, so it might be worthwhile
172  * to remove the isascii(c) with ifdefs on such
173  * "smart" systems.
174  */
175 #define B_ISSPACE(c) (isascii((int)(c)) && isspace((int)(c)))
176 #define B_ISALPHA(c) (isascii((int)(c)) && isalpha((int)(c)))
177 #define B_ISUPPER(c) (isascii((int)(c)) && isupper((int)(c)))
178 #define B_ISDIGIT(c) (isascii((int)(c)) && isdigit((int)(c)))
179
180
181 typedef void (HANDLER)();
182 typedef int (INTHANDLER)();
183
184 #ifdef SETPGRP_VOID
185 # define SETPGRP_ARGS(x, y) /* No arguments */
186 #else
187 # define SETPGRP_ARGS(x, y) (x, y)
188 #endif
189
190 #ifndef S_ISLNK
191 #define S_ISLNK(m) (((m) & S_IFM) == S_IFLNK)
192 #endif
193
194 /* Added by KES to deal with Win32 systems */
195 #ifndef S_ISWIN32
196 #define S_ISWIN32 020000
197 #endif
198
199 #ifndef INADDR_NONE
200 #define INADDR_NONE ((unsigned long) -1)
201 #endif
202
203 #ifdef TIME_WITH_SYS_TIME
204 # include <sys/time.h>
205 # include <time.h>
206 #else
207 # ifdef HAVE_SYS_TIME_H
208 #  include <sys/time.h>
209 # else
210 #  include <time.h>
211 # endif
212 #endif
213
214 #ifndef O_BINARY
215 #define O_BINARY 0
216 #endif
217
218 #ifndef O_NOFOLLOW
219 #define O_NOFOLLOW 0
220 #endif
221
222 #ifndef MODE_RW
223 #define MODE_RW 0666
224 #endif
225
226 #ifdef DEBUG_MUTEX
227 extern void _p(char *file, int line, pthread_mutex_t *m);
228 extern void _v(char *file, int line, pthread_mutex_t *m);
229
230 #define P(x) _p(__FILE__, __LINE__, &(x))
231 #define V(x) _v(__FILE__, __LINE__, &(x))
232
233 #else
234
235 /* These probably should be subroutines */
236 #define P(x) \
237    do { int errstat; if ((errstat=pthread_mutex_lock(&(x)))) \
238       e_msg(__FILE__, __LINE__, M_ABORT, 0, "Mutex lock failure. ERR=%s\n",\
239            strerror(errstat)); \
240    } while(0)
241
242 #define V(x) \
243    do { int errstat; if ((errstat=pthread_mutex_unlock(&(x)))) \
244          e_msg(__FILE__, __LINE__, M_ABORT, 0, "Mutex unlock failure. ERR=%s\n",\
245            strerror(errstat)); \
246    } while(0)
247
248 #endif /* DEBUG_MUTEX */
249
250 /* These probably should be subroutines */
251 #define Pw(x) \
252    do { int errstat; if ((errstat=rwl_writelock(&(x)))) \
253       e_msg(__FILE__, __LINE__, M_ABORT, 0, "Write lock lock failure. ERR=%s\n",\
254            strerror(errstat)); \
255    } while(0)
256
257 #define Vw(x) \
258    do { int errstat; if ((errstat=rwl_writeunlock(&(x)))) \
259          e_msg(__FILE__, __LINE__, M_ABORT, 0, "Write lock unlock failure. ERR=%s\n",\
260            strerror(errstat)); \
261    } while(0)
262
263
264 /*
265  * The digit following Dmsg and Emsg indicates the number of substitutions in
266  * the message string. We need to do this kludge because non-GNU compilers
267  * do not handle varargs #defines.
268  */
269 /* Debug Messages that are printed */
270 #ifdef DEBUG
271 #define Dmsg0(lvl, msg)             d_msg(__FILE__, __LINE__, lvl, msg)
272 #define Dmsg1(lvl, msg, a1)         d_msg(__FILE__, __LINE__, lvl, msg, a1)
273 #define Dmsg2(lvl, msg, a1, a2)     d_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
274 #define Dmsg3(lvl, msg, a1, a2, a3) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
275 #define Dmsg4(lvl, msg, arg1, arg2, arg3, arg4) d_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
276 #define Dmsg5(lvl, msg, a1, a2, a3, a4, a5) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
277 #define Dmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
278 #define Dmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
279 #define Dmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
280 #define Dmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
281 #define Dmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
282 #define Dmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
283 #define Dmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
284 #define Dmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
285 #else
286 #define Dmsg0(lvl, msg)
287 #define Dmsg1(lvl, msg, a1)
288 #define Dmsg2(lvl, msg, a1, a2)
289 #define Dmsg3(lvl, msg, a1, a2, a3)
290 #define Dmsg4(lvl, msg, arg1, arg2, arg3, arg4)
291 #define Dmsg5(lvl, msg, a1, a2, a3, a4, a5)
292 #define Dmsg6(lvl, msg, a1, a2, a3, a4, a5, a6)
293 #define Dmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7)
294 #define Dmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
295 #define Dmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
296 #define Dmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
297 #define Dmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
298 #endif /* DEBUG */
299
300 #ifdef TRACE_FILE
301 #define Tmsg0(lvl, msg)             t_msg(__FILE__, __LINE__, lvl, msg)
302 #define Tmsg1(lvl, msg, a1)         t_msg(__FILE__, __LINE__, lvl, msg, a1)
303 #define Tmsg2(lvl, msg, a1, a2)     t_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
304 #define Tmsg3(lvl, msg, a1, a2, a3) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
305 #define Tmsg4(lvl, msg, arg1, arg2, arg3, arg4) t_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
306 #define Tmsg5(lvl, msg, a1, a2, a3, a4, a5) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
307 #define Tmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
308 #define Tmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
309 #define Tmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
310 #define Tmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
311 #define Tmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
312 #define Tmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
313 #define Tmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
314 #define Tmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
315 #else
316 #define Tmsg0(lvl, msg)
317 #define Tmsg1(lvl, msg, a1)
318 #define Tmsg2(lvl, msg, a1, a2)
319 #define Tmsg3(lvl, msg, a1, a2, a3)
320 #define Tmsg4(lvl, msg, arg1, arg2, arg3, arg4)
321 #define Tmsg5(lvl, msg, a1, a2, a3, a4, a5)
322 #define Tmsg6(lvl, msg, a1, a2, a3, a4, a5, a6)
323 #define Tmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7)
324 #define Tmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
325 #define Tmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
326 #define Tmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
327 #define Tmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
328 #endif /* TRACE_FILE */
329
330
331
332 /* Messages that are printed (uses d_msg) */
333 #define Pmsg0(lvl, msg)             p_msg(__FILE__, __LINE__, lvl, msg)
334 #define Pmsg1(lvl, msg, a1)         p_msg(__FILE__, __LINE__, lvl, msg, a1)
335 #define Pmsg2(lvl, msg, a1, a2)     p_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
336 #define Pmsg3(lvl, msg, a1, a2, a3) p_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
337 #define Pmsg4(lvl, msg, arg1, arg2, arg3, arg4) p_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
338 #define Pmsg5(lvl, msg, a1, a2, a3, a4, a5) p_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
339 #define Pmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) p_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
340 #define Pmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) p_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
341 #define Pmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) p_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
342 #define Pmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
343 #define Pmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
344 #define Pmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
345 #define Pmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
346 #define Pmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
347 #define Pmsg14(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)
348
349        
350 /* Daemon Error Messages that are delivered according to the message resource */
351 #define Emsg0(typ, lvl, msg)             e_msg(__FILE__, __LINE__, typ, lvl, msg)
352 #define Emsg1(typ, lvl, msg, a1)         e_msg(__FILE__, __LINE__, typ, lvl, msg, a1)
353 #define Emsg2(typ, lvl, msg, a1, a2)     e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2)
354 #define Emsg3(typ, lvl, msg, a1, a2, a3) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3)
355 #define Emsg4(typ, lvl, msg, a1, a2, a3, a4) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4)
356 #define Emsg5(typ, lvl, msg, a1, a2, a3, a4, a5) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4, a5)
357 #define Emsg6(typ, lvl, msg, a1, a2, a3, a4, a5, a6) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4, a5, a6)
358
359 /* Job Error Messages that are delivered according to the message resource */
360 #define Jmsg0(jcr, typ, lvl, msg)             j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg)
361 #define Jmsg1(jcr, typ, lvl, msg, a1)         j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1)
362 #define Jmsg2(jcr, typ, lvl, msg, a1, a2)     j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2)
363 #define Jmsg3(jcr, typ, lvl, msg, a1, a2, a3) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3)
364 #define Jmsg4(jcr, typ, lvl, msg, a1, a2, a3, a4) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4)
365 #define Jmsg5(jcr, typ, lvl, msg, a1, a2, a3, a4, a5) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5)
366 #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)
367
368 /* Queued Job Error Messages that are delivered according to the message resource */
369 #define Qmsg0(jcr, typ, lvl, msg)             q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg)
370 #define Qmsg1(jcr, typ, lvl, msg, a1)         q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1)
371 #define Qmsg2(jcr, typ, lvl, msg, a1, a2)     q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2)
372 #define Qmsg3(jcr, typ, lvl, msg, a1, a2, a3) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3)
373 #define Qmsg4(jcr, typ, lvl, msg, a1, a2, a3, a4) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4)
374 #define Qmsg5(jcr, typ, lvl, msg, a1, a2, a3, a4, a5) q_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5)
375 #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)
376
377
378 /* Memory Messages that are edited into a Pool Memory buffer */
379 #define Mmsg0(buf, msg)             m_msg(__FILE__, __LINE__, buf, msg)
380 #define Mmsg1(buf, msg, a1)         m_msg(__FILE__, __LINE__, buf, msg, a1)
381 #define Mmsg2(buf, msg, a1, a2)     m_msg(__FILE__, __LINE__, buf, msg, a1, a2)
382 #define Mmsg3(buf, msg, a1, a2, a3) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3)
383 #define Mmsg4(buf, msg, a1, a2, a3, a4) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4)
384 #define Mmsg5(buf, msg, a1, a2, a3, a4, a5) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5)
385 #define Mmsg6(buf, msg, a1, a2, a3, a4, a5, a6) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5, a6)
386 #define Mmsg7(buf, msg, a1, a2, a3, a4, a5, a6, a7) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5, a6)
387 #define Mmsg8(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6)
388 #define Mmsg11(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
389 #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)
390
391 /* Edit message into Pool Memory buffer -- no __FILE__ and __LINE__ */
392 int  Mmsg(POOLMEM **msgbuf, char *fmt,...);
393
394
395 struct JCR;
396 void d_msg(char *file, int line, int level, char *fmt,...);
397 void p_msg(char *file, int line, int level, char *fmt,...);
398 void e_msg(char *file, int line, int type, int level, char *fmt,...);
399 void j_msg(char *file, int line, JCR *jcr, int type, int level, char *fmt,...);
400 void q_msg(char *file, int line, JCR *jcr, int type, int level, char *fmt,...);
401 int  m_msg(char *file, int line, POOLMEM **msgbuf, char *fmt,...);
402
403
404 /* Use our strdup with smartalloc */
405 #undef strdup
406 #define strdup(buf) bad_call_on_strdup_use_bstrdup(buf)
407
408 /* Use our fgets which handles interrupts */
409 #undef fgets
410 #define fgets(x,y,z) bfgets((x), (y), (z))
411
412 #ifdef DEBUG
413 #define bstrdup(str) strcpy((char *) b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
414 #else
415 #define bstrdup(str) strcpy((char *) bmalloc(strlen((str))+1),(str))
416 #endif
417
418 #ifdef DEBUG
419 #define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
420 #endif
421
422 #ifdef __alpha__
423 #define OSF 1
424 #endif
425
426 #ifdef HAVE_SUN_OS
427    /* 
428     * On Solaris 2.5, threads are not timesliced by default, so we need to
429     * explictly increase the conncurrency level.
430     */
431 #include <thread.h>
432 #define set_thread_concurrency(x)  thr_setconcurrency(x)
433 extern int thr_setconcurrency(int);
434 #define SunOS 1
435
436 #else
437
438
439 /* Not needed on most systems */
440 #define set_thread_concurrency(x)
441
442 #endif
443
444 #ifdef HAVE_DARWIN_OS
445 /* Apparently someone forgot to wrap getdomainname as a C function */
446 extern "C" int getdomainname(char *name, int len);
447
448 /* Darwin lib fnmatch() doesn't work, so use our own */
449 #undef HAVE_FNMATCH
450 #endif
451
452 #ifdef HAVE_CYGWIN
453 /* They don't really have it */
454 #undef HAVE_GETDOMAINNAME
455 #endif
456
457 #ifdef HAVE_AIX_OS
458 #endif
459  
460 /* This probably should be done on a machine by machine basic, but it works */
461 #define ALIGN_SIZE (sizeof(double))
462 #define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
463
464
465 /* Added by KES to deal with Win32 systems */
466 #ifndef S_ISWIN32
467 #define S_ISWIN32 020000
468 #endif
469
470 /*
471  * Replace codes needed in both file routines and non-file routines
472  * Job replace codes -- in "replace"   
473  */
474 #define REPLACE_ALWAYS   'a'
475 #define REPLACE_IFNEWER  'w'
476 #define REPLACE_NEVER    'n'
477 #define REPLACE_IFOLDER  'o'
478
479 #endif /* _BACONFIG_H */