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