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