]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/bacula.h
Complete port to Windows
[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    Copyright (C) 2000-2006 Kern Sibbald
8
9    This program is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    version 2 as amended with additional clauses defined in the
12    file LICENSE in the main source directory.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
17    the file LICENSE for additional details.
18
19  */
20
21 #ifndef _BACULA_H
22 #define _BACULA_H 1
23
24 #ifdef __cplusplus
25 /* Workaround for SGI IRIX 6.5 */
26 #define _LANGUAGE_C_PLUS_PLUS 1
27 #endif
28
29 #if defined(HAVE_WIN32)
30 #if defined(HAVE_MINGW)
31 #include "mingwconfig.h"
32 #else
33 #include "winconfig.h"
34 #endif
35 #include "winhost.h"
36 #else
37 #include "config.h"
38 #include "host.h"
39 #endif
40
41
42 #define _REENTRANT    1
43 #define _THREAD_SAFE  1
44 #define _POSIX_PTHREAD_SEMANTICS 1
45
46
47 /* System includes */
48 #if HAVE_STDINT_H
49 #include <stdint.h>
50 #endif
51 #if HAVE_STDARG_H
52 #include <stdarg.h>
53 #endif
54 #include <stdio.h>
55 #if HAVE_STDLIB_H
56 #include <stdlib.h>
57 #endif
58 #if HAVE_UNISTD_H
59 #  ifdef HAVE_HPUX_OS
60 #  undef _INCLUDE_POSIX1C_SOURCE
61 #  endif
62 #include <unistd.h>
63 #endif
64 #if HAVE_ALLOCA_H
65 #include <alloca.h>
66 #endif
67
68 #include <errno.h>
69 #include <fcntl.h>
70
71 /* O_NOATIME is defined at fcntl.h when supported */
72 #ifndef O_NOATIME
73 #define O_NOATIME 0
74 #endif
75
76 #ifdef xxxxx
77 #ifdef HAVE_GETOPT_LONG
78 #include <getopt.h>
79 #else
80 #include "lib/getopt.h"
81 #endif
82 #endif
83
84 #include <string.h>
85 #include <strings.h>
86 #include <signal.h>
87 #include <ctype.h>
88 #ifndef _SPLINT_
89 #include <syslog.h>
90 #endif
91 #if HAVE_LIMITS_H
92 #include <limits.h>
93 #endif
94 #include <pwd.h>
95 #include <grp.h>
96 #include <time.h>
97 #include <netdb.h>
98 #include <sys/types.h>
99 #ifdef HAVE_SYS_BITYPES_H
100 #include <sys/bitypes.h>
101 #endif
102 #include <sys/ioctl.h>
103 #ifdef HAVE_SYS_SOCKET_H
104 #include <sys/socket.h>
105 #endif
106 #if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
107 #include <winsock2.h>
108 #else
109 //#include <sys/stat.h>
110 #endif
111 #include <sys/time.h>
112 #if HAVE_SYS_WAIT_H
113 #include <sys/wait.h>
114 #endif
115 #include <netinet/in.h>
116 #include <arpa/inet.h>
117 #include <pthread.h>
118
119 #ifdef HAVE_OPENSSL
120 /* fight OpenSSL namespace pollution */
121 #define STORE OSSL_STORE
122 #include <openssl/ssl.h>
123 #include <openssl/x509v3.h>
124 #include <openssl/rand.h>
125 #include <openssl/err.h>
126 #include <openssl/asn1.h>
127 #include <openssl/asn1t.h>
128 #undef STORE
129 #endif
130
131 /* Local Bacula includes. Be sure to put all the system
132  *  includes before these.
133  */
134 #if defined(HAVE_WIN32)
135 #include <windows.h>
136 #include "win32/compat/compat.h"
137 #endif
138
139 #include "version.h"
140 #include "bc_types.h"
141 #include "baconfig.h"
142 #include "lib/lib.h"
143
144 #ifdef HAVE_WXCONSOLE
145 #undef New
146 #undef _
147 #endif
148
149 #if defined(HAVE_WIN32)
150 #include "win32/winapi.h"
151 #endif
152
153 #ifndef HAVE_ZLIB_H
154 #undef HAVE_LIBZ                      /* no good without headers */
155 #endif
156
157 #endif