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