]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/bacula.h
Backport from BEE
[bacula/bacula] / bacula / src / bacula.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from many
7    others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    Bacula® is a registered trademark of Kern Sibbald.
15 */
16 /*
17  * bacula.h -- main header file to include in all Bacula source
18  *
19  */
20
21 #ifndef _BACULA_H
22 #define _BACULA_H 1
23
24 /* Disable FORTIFY_SOURCE, because bacula uses is own memory
25  * manager
26  */
27 #ifdef _FORTIFY_SOURCE
28 #undef _FORTIFY_SOURCE
29 #endif
30
31 #ifdef __cplusplus
32 /* Workaround for SGI IRIX 6.5 */
33 #define _LANGUAGE_C_PLUS_PLUS 1
34 #endif
35
36 #if defined(HAVE_WIN32)
37 #if defined(HAVE_MINGW)
38 #include "mingwconfig.h"
39 #else
40 #include "winconfig.h"
41 #endif
42 #else
43 #include "config.h"
44 #endif
45 #define __CONFIG_H
46
47
48 #define _REENTRANT    1
49 #define _THREAD_SAFE  1
50 #define _POSIX_PTHREAD_SEMANTICS 1
51
52
53 /* System includes */
54 #if HAVE_STDINT_H
55 #ifndef __sgi
56 #include <stdint.h>
57 #endif
58 #endif
59 #if HAVE_STDARG_H
60 #include <stdarg.h>
61 #endif
62 #include <stdio.h>
63 #if HAVE_STDLIB_H
64 #include <stdlib.h>
65 #endif
66 #if HAVE_UNISTD_H
67 #  ifdef HAVE_HPUX_OS
68 #  undef _INCLUDE_POSIX1C_SOURCE
69 #  endif
70 #include <unistd.h>
71 #endif
72 #if HAVE_ALLOCA_H
73 #include <alloca.h>
74 #endif
75 #if defined(_MSC_VER)
76 #include <io.h>
77 #include <direct.h>
78 #include <process.h>
79 #endif
80 #include <errno.h>
81 #include <fcntl.h>
82
83 /* O_NOATIME is defined at fcntl.h when supported */
84 #ifndef O_NOATIME
85 #define O_NOATIME 0
86 #endif
87
88 #if defined(_MSC_VER)
89 extern "C" {
90 #include "getopt.h"
91 }
92 #endif
93
94 #ifdef xxxxx
95 #ifdef HAVE_GETOPT_LONG
96 #include <getopt.h>
97 #else
98 #include "lib/getopt.h"
99 #endif
100 #endif
101
102 #include <string.h>
103 #include <strings.h>
104 #include <signal.h>
105 #include <ctype.h>
106 #ifndef _SPLINT_
107 #include <syslog.h>
108 #endif
109 #if HAVE_LIMITS_H
110 #include <limits.h>
111 #endif
112 #include <pwd.h>
113 #include <grp.h>
114 #include <time.h>
115 #include <netdb.h>
116 #include <sys/types.h>
117 #ifdef HAVE_SYS_BITYPES_H
118 #include <sys/bitypes.h>
119 #endif
120 #include <sys/ioctl.h>
121 #ifdef HAVE_SYS_SOCKET_H
122 #include <sys/socket.h>
123 #endif
124 #if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
125 #include <winsock2.h>
126 #endif
127 #if !defined(HAVE_WIN32) & !defined(HAVE_MINGW)
128 #include <sys/stat.h>
129 #endif
130 #include <sys/time.h>
131 #if HAVE_SYS_WAIT_H
132 #include <sys/wait.h>
133 #endif
134 #include <netinet/in.h>
135 #include <arpa/inet.h>
136 #include <pthread.h>
137
138 #ifdef HAVE_OPENSSL
139 /* fight OpenSSL namespace pollution */
140 #define STORE OSSL_STORE
141 #include <openssl/ssl.h>
142 #include <openssl/x509v3.h>
143 #include <openssl/rand.h>
144 #include <openssl/err.h>
145 #include <openssl/asn1.h>
146 #include <openssl/asn1t.h>
147 #undef STORE
148 #endif
149
150 /* Local Bacula includes. Be sure to put all the system
151  *  includes before these.
152  */
153 #if defined(HAVE_WIN32)
154 #include <windows.h>
155 #include "win32/compat/compat.h"
156 #endif
157
158 #include "version.h"
159 #include "bc_types.h"
160 #include "streams.h"
161 #include "filetypes.h"
162 #include "baconfig.h"
163 #include "lib/lib.h"
164
165 /*
166  * For wx-console compiles, we undo some Bacula defines.
167  *  This prevents conflicts between wx-Widgets and Bacula.
168  *  In wx-console files that malloc or free() Bacula structures
169  *  config/resources and interface to the Bacula libraries,
170  *  you must use bmalloc() and bfree().
171  */
172 #ifdef HAVE_WXCONSOLE
173 #undef New
174 #undef _
175 #undef free
176 #undef malloc
177 #endif
178
179 #if defined(HAVE_WIN32)
180 #include "win32/winapi.h"
181 #include "winhost.h"
182 #else
183 #include "host.h"
184 #endif
185
186 #ifndef HAVE_ZLIB_H
187 #undef HAVE_LIBZ                      /* no good without headers */
188 #endif
189
190 #endif