]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/bacula.h
Separate definitions of streams, filetypes, and fileoptions to separate files
[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 #endif
71 #if HAVE_STDARG_H
72 #include <stdarg.h>
73 #endif
74 #include <stdio.h>
75 #if HAVE_STDLIB_H
76 #include <stdlib.h>
77 #endif
78 #if HAVE_UNISTD_H
79 #  ifdef HAVE_HPUX_OS
80 #  undef _INCLUDE_POSIX1C_SOURCE
81 #  endif
82 #include <unistd.h>
83 #endif
84 #if HAVE_ALLOCA_H
85 #include <alloca.h>
86 #endif
87 #if defined(_MSC_VER)
88 #include <io.h>
89 #include <direct.h>
90 #include <process.h>
91 #endif
92 #include <errno.h>
93 #include <fcntl.h>
94
95 /* O_NOATIME is defined at fcntl.h when supported */
96 #ifndef O_NOATIME
97 #define O_NOATIME 0
98 #endif
99
100 #if defined(_MSC_VER)
101 extern "C" {
102 #include "getopt.h"
103 }
104 #endif
105
106 #ifdef xxxxx
107 #ifdef HAVE_GETOPT_LONG
108 #include <getopt.h>
109 #else
110 #include "lib/getopt.h"
111 #endif
112 #endif
113
114 #include <string.h>
115 #include <strings.h>
116 #include <signal.h>
117 #include <ctype.h>
118 #ifndef _SPLINT_
119 #include <syslog.h>
120 #endif
121 #if HAVE_LIMITS_H
122 #include <limits.h>
123 #endif
124 #include <pwd.h>
125 #include <grp.h>
126 #include <time.h>
127 #include <netdb.h>
128 #include <sys/types.h>
129 #ifdef HAVE_SYS_BITYPES_H
130 #include <sys/bitypes.h>
131 #endif
132 #include <sys/ioctl.h>
133 #ifdef HAVE_SYS_SOCKET_H
134 #include <sys/socket.h>
135 #endif
136 #if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
137 #include <winsock2.h>
138 #endif 
139 #if !defined(HAVE_WIN32) & !defined(HAVE_MINGW)
140 #include <sys/stat.h>
141 #endif 
142 #include <sys/time.h>
143 #if HAVE_SYS_WAIT_H
144 #include <sys/wait.h>
145 #endif
146 #include <netinet/in.h>
147 #include <arpa/inet.h>
148 #include <pthread.h>
149
150 #ifdef HAVE_OPENSSL
151 /* fight OpenSSL namespace pollution */
152 #define STORE OSSL_STORE
153 #include <openssl/ssl.h>
154 #include <openssl/x509v3.h>
155 #include <openssl/rand.h>
156 #include <openssl/err.h>
157 #include <openssl/asn1.h>
158 #include <openssl/asn1t.h>
159 #undef STORE
160 #endif
161
162 /* Local Bacula includes. Be sure to put all the system
163  *  includes before these.
164  */
165 #if defined(HAVE_WIN32)
166 #include <windows.h>
167 #include "win32/compat/compat.h"
168 #endif
169
170 #include "version.h"
171 #include "bc_types.h"
172 #include "streams.h"
173 #include "filetypes.h"
174 #include "baconfig.h"
175 #include "lib/lib.h"
176
177 /*
178  * For wx-console compiles, we undo some Bacula defines.
179  *  This prevents conflicts between wx-Widgets and Bacula.
180  *  In wx-console files that malloc or free() Bacula structures
181  *  config/resources and interface to the Bacula libraries,
182  *  you must use bmalloc() and bfree().
183  */
184 #ifdef HAVE_WXCONSOLE
185 #undef New
186 #undef _
187 #undef free
188 #undef malloc
189 #endif
190
191 #if defined(HAVE_WIN32)
192 #include "win32/winapi.h"
193 #include "winhost.h"
194 #else
195 #include "host.h"
196 #endif
197
198 #ifndef HAVE_ZLIB_H
199 #undef HAVE_LIBZ                      /* no good without headers */
200 #endif
201
202 #endif