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