5c3f338b721d2e4527f2c7928f6b9d00c71e1ded
[silc.git] / includes / silc.h.in
1 /*
2
3   silc.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2007 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19 /*
20   This file includes common definitions for SILC. This file MUST be included
21   by all files in SILC (directly or through other global include file).
22 */
23
24 #ifndef SILCINCLUDES_H
25 #define SILCINCLUDES_H
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define SILC_UNIX
32
33 #ifdef WIN32
34 #ifndef SILC_WIN32
35 #define SILC_WIN32
36 #undef SILC_UNIX
37 #endif
38 #endif
39
40 #if defined(__EPOC32__) || defined(__SYMBIAN32__)
41 #ifndef SILC_SYMBIAN
42 #define SILC_SYMBIAN
43 #undef SILC_UNIX
44 #undef SILC_WIN32
45 #endif
46 #endif
47
48 #if defined(__MACH__) && defined(__APPLE__)
49 #ifndef SILC_MACOSX
50 #define SILC_MACOSX
51 #undef SILC_WIN32
52 #undef SILC_SYMBIAN
53 #endif
54 #endif
55
56 /* Types */
57 #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
58 #define SILC_SIZEOF_LONG @SILC_SIZEOF_LONG@
59 #define SILC_SIZEOF_INT @SILC_SIZEOF_INT@
60 #define SILC_SIZEOF_SHORT @SILC_SIZEOF_SHORT@
61 #define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
62 #define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
63
64 /* Compilation time defines, for third-party software */
65 @__SILC_HAVE_PTHREAD@
66 @__SILC_HAVE_SIM@
67 @__SILC_ENABLE_DEBUG@
68
69 #if defined(HAVE_SILCDEFS_H)
70 /* Automatically generated configuration header */
71 #ifndef SILC_SYMBIAN
72 #include "silcdefs.h"
73 #else
74 #include "../symbian/silcdefs.h"
75 #endif /* SILC_SYMBIAN */
76 #include "silcdistdefs.h"
77 #endif /* HAVE_SILCDEFS_H */
78
79 /* Platform specific includes */
80
81 #if defined(SILC_WIN32)
82 #include "silcwin32.h"
83 #endif
84
85 #if defined(SILC_SYMBIAN)
86 #include "silcsymbian.h"
87 #endif
88
89 #ifndef DLLAPI
90 #define DLLAPI
91 #endif
92
93 #ifdef SILC_HAVE_PTHREAD
94 /* For pthreads rwlock support */
95 #ifndef _XOPEN_SOURCE
96 #define _XOPEN_SOURCE 600
97 #else
98 #ifdef _XOPEN_SOURCE < 600
99 #define _XOPEN_SOURCE_SAVE _XOPEN_SOURCE
100 #undef _XOPEN_SOURCE
101 #define _XOPEN_SOURCE 600
102 #endif /* _XOPEN_SOURCE < 600 */
103 #endif /* _XOPEN_SOURCE */
104 #endif /* SILC_HAVE_PTHREAD */
105
106 #include <stdio.h>
107 #include <stdlib.h>
108 #include <string.h>
109 #include <stdarg.h>
110 #include <ctype.h>
111 #include <sys/types.h>
112 #include <sys/stat.h>
113 #include <time.h>
114
115 #ifdef HAVE_SIGNAL_H
116 #include <signal.h>
117 #endif
118
119 #ifdef HAVE_FCNTL_H
120 #include <fcntl.h>
121 #endif
122
123 #ifdef HAVE_ERRNO_H
124 #include <errno.h>
125 #endif
126
127 #ifdef HAVE_ASSERT_H
128 #include <assert.h>
129 #endif
130
131 #if !defined(SILC_WIN32)
132
133 #include <unistd.h>
134 #include <sys/time.h>
135 #include <pwd.h>
136 #include <sys/times.h>
137
138 #ifdef HAVE_GRP_H
139 #include <grp.h>
140 #endif
141
142 #if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT)
143 #include <getopt.h>
144 #else
145 #if defined(HAVE_SILCDEFS_H)
146 #include "getopti.h"
147 #endif /* HAVE_SILCDEFS_H */
148 #endif
149
150 #ifdef SOCKS5
151 #include "socks.h"
152 #endif
153
154 #include <sys/socket.h>
155 #ifdef HAVE_NETINET_IN_H
156 #include <netinet/in.h>
157 #endif
158
159 #ifdef HAVE_XTI_H
160 #include <xti.h>
161 #else
162 #ifdef HAVE_NETINET_TCP_H
163 #include <netinet/tcp.h>
164 #endif
165 #endif
166
167 #ifdef HAVE_NETDB_H
168 #include <netdb.h>
169 #endif
170
171 #ifdef HAVE_ARPA_INET_H
172 #include <arpa/inet.h>
173 #endif
174
175 #ifdef HAVE_SYS_MMAN_H
176 #include <sys/mman.h>
177 #endif
178
179 #ifdef HAVE_DLFCN_H
180 #include <dlfcn.h>
181 #endif
182
183 #ifdef HAVE_LIMITS_H
184 #include <limits.h>
185 #endif
186
187 #ifndef HAVE_REGEX_H
188 #if defined(HAVE_SILCDEFS_H)
189 #include "regexpr.h"
190 #endif /* HAVE_SILCDEFS_H */
191 #else
192 #include <regex.h>
193 #endif
194
195 #ifdef SILC_HAVE_PTHREAD
196 #include <pthread.h>
197 #ifdef _XOPEN_SOURCE_SAVE
198 #undef _XOPEN_SOURCE
199 #define _XOPEN_SOURCE _XOPEN_SOURCE_SAVE
200 #undef _XOPEN_SOURCE_SAVE
201 #endif /* _XOPEN_SOURCE_SAVE */
202 #endif
203
204 #ifdef HAVE_STDDEF_H
205 #include <stddef.h>
206 #endif
207
208 #ifdef HAVE_TERMIOS_H
209 #include <termios.h>
210 #endif
211
212 #ifdef HAVE_UTIME_H
213 #include <utime.h>
214 #endif
215
216 #ifdef HAVE_ICONV_H
217 #include <iconv.h>
218 #endif
219
220 #ifdef HAVE_LOCALE_H
221 #include <locale.h>
222 #endif
223
224 #ifdef HAVE_LANGINFO_H
225 #include <langinfo.h>
226 #endif
227
228 #ifdef HAVE_SYS_RESOURCE_H
229 #include <sys/resource.h>
230 #endif
231
232 #endif                          /* !SILC_WIN32 */
233
234 /* Include generic SILC type definitions */
235 #include "silctypes.h"
236 #include "silcmutex.h"
237 #include "silcatomic.h"
238 #include "silcversion.h"
239
240 /* SILC util library includes */
241 #include "silcstack.h"
242 #include "silcmemory.h"
243 #include "silcsnprintf.h"
244
245 /* Math library includes */
246 #include "silcmp.h"
247 #include "silcmath.h"
248
249 /* More SILC util library includes */
250 #include "silctime.h"
251 #include "silccond.h"
252 #include "silcthread.h"
253 #include "silcschedule.h"
254 #include "silclog.h"
255 #include "silcbuffer.h"
256 #include "silcbuffmt.h"
257
258 /* Crypto library includes */
259 #include "silccipher.h"
260 #include "silchash.h"
261 #include "silchmac.h"
262 #include "silcrng.h"
263 #include "silcpkcs.h"
264 #include "silcpk.h"
265 #include "silcpkcs1.h"
266
267 /* More SILC util library includes */
268 #include "silchashtable.h"
269 #include "silclist.h"
270 #include "silcdlist.h"
271 #include "silcasync.h"
272 #include "silcstream.h"
273 #include "silcnet.h"
274 #include "silcfileutil.h"
275 #include "silcstrutil.h"
276 #include "silcutf8.h"
277 #include "silcstringprep.h"
278 #include "silcutil.h"
279 #include "silcconfig.h"
280 #include "silcfsm.h"
281 #include "silcsocketstream.h"
282 #include "silcfdstream.h"
283 #include "silcvcard.h"
284 #include "silcmime.h"
285
286 #ifdef SILC_DIST_ASN1
287 #include "silcasn1.h"
288 #include "silcber.h"
289 #endif /* SILC_DIST_ASN1 */
290
291 /* SILC core library includes */
292 #include "silcargument.h"
293 #include "silcstatus.h"
294 #include "silcid.h"
295 #include "silccommand.h"
296 #include "silcauth.h"
297 #include "silcmessage.h"
298 #include "silcchannel.h"
299 #include "silcpacket.h"
300 #include "silcnotify.h"
301 #include "silcmode.h"
302 #include "silcattrs.h"
303 #include "silcpubkey.h"
304
305 /* Application utility includes */
306 #include "silcapputil.h"
307 #ifdef SILC_DIST_IDCACHE
308 #include "silcidcache.h"
309 #endif /* SILC_DIST_IDCACHE */
310
311 #ifdef SILC_DIST_SKR
312 #include "silcskr.h"
313 #endif /* SILC_DIST_SKR */
314
315 #if defined(SILC_SIM)
316 /* SILC Module library includes */
317 #include "silcsim.h"
318 #include "silcsimutil.h"
319 #endif
320
321 /* SILC Key Exchange library includes */
322 #include "silcske.h"
323 #include "silcske_payload.h"
324 #include "silcske_groups.h"
325 #include "silcconnauth.h"
326
327 #ifdef SILC_DIST_SFTP
328 /* SILC SFTP library */
329 #include "silcsftp.h"
330 #include "silcsftp_fs.h"
331 #endif /* SILC_DIST_SFTP */
332
333 #ifdef SILC_DIST_HTTP
334 /* SILC HTTP library */
335 #include "silchttpserver.h"
336 #include "silchttpphp.h"
337 #endif /* SILC_DIST_HTTP */
338
339 #ifdef __cplusplus
340 }
341 #endif
342
343 #endif /* SILCINCLUDES_H */