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