]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/bacula.h
kes wx-console crashes because of differences between Bacula and wxWidgets
[bacula/bacula] / bacula / src / bacula.h
1 /*
2  * bacula.h -- main header file to include in all Bacula source
3  *
4  *   Version $Id$
5  */
6 /*
7    Copyright (C) 2000-2006 Kern Sibbald
8
9    This program is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    version 2 as amended with additional clauses defined in the
12    file LICENSE in the main source directory.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
17    the file LICENSE for additional details.
18
19  */
20
21 #ifndef _BACULA_H
22 #define _BACULA_H 1
23
24 #ifdef __cplusplus
25 /* Workaround for SGI IRIX 6.5 */
26 #define _LANGUAGE_C_PLUS_PLUS 1
27 #endif
28
29 #if defined(HAVE_WIN32)
30 #if defined(HAVE_MINGW)
31 #include "mingwconfig.h"
32 #else
33 #include "winconfig.h"
34 #endif
35 #include "winhost.h"
36 #else
37 #include "config.h"
38 #include "host.h"
39 #endif
40
41
42 #define _REENTRANT    1
43 #define _THREAD_SAFE  1
44 #define _POSIX_PTHREAD_SEMANTICS 1
45
46
47 /* System includes */
48 #if HAVE_STDINT_H
49 #include <stdint.h>
50 #endif
51 #if HAVE_STDARG_H
52 #include <stdarg.h>
53 #endif
54 #include <stdio.h>
55 #if HAVE_STDLIB_H
56 #include <stdlib.h>
57 #endif
58 #if HAVE_UNISTD_H
59 #  ifdef HAVE_HPUX_OS
60 #  undef _INCLUDE_POSIX1C_SOURCE
61 #  endif
62 #include <unistd.h>
63 #endif
64 #if HAVE_ALLOCA_H
65 #include <alloca.h>
66 #endif
67
68 #include <errno.h>
69 #include <fcntl.h>
70
71 /* O_NOATIME is defined at fcntl.h when supported */
72 #ifndef O_NOATIME
73 #define O_NOATIME 0
74 #endif
75
76 #ifdef xxxxx
77 #ifdef HAVE_GETOPT_LONG
78 #include <getopt.h>
79 #else
80 #include "lib/getopt.h"
81 #endif
82 #endif
83
84 #include <string.h>
85 #include <strings.h>
86 #include <signal.h>
87 #include <ctype.h>
88 #ifndef _SPLINT_
89 #include <syslog.h>
90 #endif
91 #if HAVE_LIMITS_H
92 #include <limits.h>
93 #endif
94 #include <pwd.h>
95 #include <grp.h>
96 #include <time.h>
97 #include <netdb.h>
98 #include <sys/types.h>
99 #ifdef HAVE_SYS_BITYPES_H
100 #include <sys/bitypes.h>
101 #endif
102 #include <sys/ioctl.h>
103 #ifdef HAVE_SYS_SOCKET_H
104 #include <sys/socket.h>
105 #endif
106 #if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
107 #include <winsock2.h>
108 #endif 
109 #if !defined(HAVE_WIN32) & !defined(HAVE_MINGW)
110 #include <sys/stat.h>
111 #endif 
112 #include <sys/time.h>
113 #if HAVE_SYS_WAIT_H
114 #include <sys/wait.h>
115 #endif
116 #include <netinet/in.h>
117 #include <arpa/inet.h>
118 #include <pthread.h>
119
120 #ifdef HAVE_OPENSSL
121 /* fight OpenSSL namespace pollution */
122 #define STORE OSSL_STORE
123 #include <openssl/ssl.h>
124 #include <openssl/x509v3.h>
125 #include <openssl/rand.h>
126 #include <openssl/err.h>
127 #include <openssl/asn1.h>
128 #include <openssl/asn1t.h>
129 #undef STORE
130 #endif
131
132 /* Local Bacula includes. Be sure to put all the system
133  *  includes before these.
134  */
135 #if defined(HAVE_WIN32)
136 #include <windows.h>
137 #include "win32/compat/compat.h"
138 #endif
139
140 #include "version.h"
141 #include "bc_types.h"
142 #include "baconfig.h"
143 #include "lib/lib.h"
144
145 /*
146  * For wx-console compiles, we undo some Bacula defines.
147  *  This prevents conflicts between wx-Widgets and Bacula.
148  *  In wx-console files that malloc or free() Bacula structures
149  *  config/resources and interface to the Bacula libraries,
150  *  you must use bmalloc() and bfree().
151  */
152 #ifdef HAVE_WXCONSOLE
153 #undef New
154 #undef _
155 #undef free
156 #undef malloc
157 #endif
158
159 #if defined(HAVE_WIN32)
160 #include "win32/winapi.h"
161 #endif
162
163 #ifndef HAVE_ZLIB_H
164 #undef HAVE_LIBZ                      /* no good without headers */
165 #endif
166
167 #endif