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