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