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