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