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