Added silc_getopt.
[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
71 /* Automatically generated configuration header */
72 #ifndef SILC_SYMBIAN
73 #include "silcdefs.h"
74 #else
75 #include "../symbian/silcdefs.h"
76 #endif /* SILC_SYMBIAN */
77 #include "silcdistdefs.h"
78
79 #else
80
81 /* Autodetect CPU so that inline assembly in headers are enabled */
82
83 #if defined(__i386__)
84 #undef SILC_I386
85 #define SILC_I386
86 #undef SILC_I486
87 #define SILC_I486
88 #endif /* __i386__ */
89
90 #if defined(__x86_64__)
91 #undef SILC_X86_64
92 #define SILC_X86_64
93 #endif /* __x86_64__ */
94
95 #if defined(__ia64__)
96 #undef SILC_IA64
97 #define SILC_IA64
98 #endif /* __ia64__ */
99
100 #if defined(__ppc__) || defined(__ppc64__)
101 #undef SILC_POWERPC
102 #define SILC_POWERPC
103 #endif /* __ppc__ || __ppc64__ */
104
105 #ifndef SILC_ALIGNMENT
106 #define SILC_ALIGNMENT SILC_SIZEOF_VOID_P
107 #endif /* SILC_ALIGNMENT */
108
109 #endif /* HAVE_SILCDEFS_H */
110
111 /* Platform specific includes */
112
113 #if defined(SILC_WIN32)
114 #include "silcwin32.h"
115 #endif
116
117 #if defined(SILC_SYMBIAN)
118 #include "silcsymbian.h"
119 #endif
120
121 #ifndef DLLAPI
122 #define DLLAPI
123 #endif
124
125 #include <stdio.h>
126 #include <stdlib.h>
127 #include <string.h>
128 #include <stdarg.h>
129 #include <ctype.h>
130 #include <sys/types.h>
131 #include <sys/stat.h>
132 #include <time.h>
133
134 #ifdef HAVE_SIGNAL_H
135 #include <signal.h>
136 #endif
137
138 #ifdef HAVE_FCNTL_H
139 #include <fcntl.h>
140 #endif
141
142 #ifdef HAVE_ERRNO_H
143 #include <errno.h>
144 #endif
145
146 #ifdef HAVE_ASSERT_H
147 #include <assert.h>
148 #endif
149
150 #if !defined(SILC_WIN32)
151
152 #include <unistd.h>
153 #include <sys/time.h>
154 #include <pwd.h>
155 #include <sys/times.h>
156
157 #ifdef HAVE_GRP_H
158 #include <grp.h>
159 #endif
160
161 #if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT)
162 #include <getopt.h>
163 #else
164 #if defined(HAVE_SILCDEFS_H)
165 #include "getopti.h"
166 #endif /* HAVE_SILCDEFS_H */
167 #endif
168
169 #ifdef SOCKS5
170 #include "socks.h"
171 #endif
172
173 #include <sys/socket.h>
174 #ifdef HAVE_NETINET_IN_H
175 #include <netinet/in.h>
176 #endif
177
178 #ifdef HAVE_XTI_H
179 #include <xti.h>
180 #else
181 #ifdef HAVE_NETINET_TCP_H
182 #include <netinet/tcp.h>
183 #endif
184 #endif
185
186 #ifdef HAVE_NETDB_H
187 #include <netdb.h>
188 #endif
189
190 #ifdef HAVE_ARPA_INET_H
191 #include <arpa/inet.h>
192 #endif
193
194 #ifdef HAVE_SYS_MMAN_H
195 #include <sys/mman.h>
196 #endif
197
198 #ifdef HAVE_DLFCN_H
199 #include <dlfcn.h>
200 #endif
201
202 #ifdef HAVE_LIMITS_H
203 #include <limits.h>
204 #endif
205
206 #ifndef HAVE_REGEX_H
207 #if defined(HAVE_SILCDEFS_H)
208 #include "regexpr.h"
209 #endif /* HAVE_SILCDEFS_H */
210 #else
211 #include <regex.h>
212 #endif
213
214 #ifdef SILC_HAVE_PTHREAD
215 #include <pthread.h>
216 #endif
217
218 #ifdef HAVE_STDDEF_H
219 #include <stddef.h>
220 #endif
221
222 #ifdef HAVE_TERMIOS_H
223 #include <termios.h>
224 #endif
225
226 #ifdef HAVE_UTIME_H
227 #include <utime.h>
228 #endif
229
230 #ifdef HAVE_ICONV_H
231 #include <iconv.h>
232 #endif
233
234 #ifdef HAVE_LOCALE_H
235 #include <locale.h>
236 #endif
237
238 #ifdef HAVE_LANGINFO_H
239 #include <langinfo.h>
240 #endif
241
242 #ifdef HAVE_SYS_RESOURCE_H
243 #include <sys/resource.h>
244 #endif
245
246 #endif                          /* !SILC_WIN32 */
247
248 /* Include generic SILC type definitions */
249 #include "silcerrno.h"
250 #include "silctypes.h"
251 #include "silcbitops.h"
252 #include "silcmutex.h"
253 #include "silcatomic.h"
254 #include "silcversion.h"
255
256 /* SILC util library includes */
257 #include "silcgetopt.h"
258 #include "silclist.h"
259 #include "silcstack.h"
260 #include "silcmemory.h"
261 #include "silcsnprintf.h"
262
263 /* Math library includes */
264 #include "silcmp.h"
265 #include "silcmath.h"
266
267 /* More SILC util library includes */
268 #include "silctime.h"
269 #include "silctimer.h"
270 #include "silccond.h"
271 #include "silcthread.h"
272 #include "silcschedule.h"
273 #include "silclog.h"
274 #include "silcbuffer.h"
275 #include "silcbuffmt.h"
276 #include "silcasync.h"
277 #include "silcdlist.h"
278
279 /* Crypto library includes */
280 #include "silccrypto.h"
281 #include "silccipher.h"
282 #include "silchash.h"
283 #include "silchmac.h"
284 #include "silcrng.h"
285 #include "silcpkcs.h"
286 #include "silcpk.h"
287 #include "silcpkcs1.h"
288 #ifdef SILC_DIST_ACC
289 #include "silcacc.h"
290 #endif /* SILC_DIST_ACC */
291 #ifdef SILC_DIST_SSH
292 #include "silcssh.h"
293 #endif /* SILC_DIST_SSH */
294
295 /* More SILC util library includes */
296 #include "silcenv.h"
297 #include "silcdll.h"
298 #include "silchashtable.h"
299 #include "silcstream.h"
300 #include "silcnet.h"
301 #include "silcfileutil.h"
302 #include "silcbase64.h"
303 #include "silcstrutil.h"
304 #include "silcutf8.h"
305 #include "silcstringprep.h"
306 #include "silcutil.h"
307 #include "silcconfig.h"
308 #include "silcfsm.h"
309 #include "silcsocketstream.h"
310 #include "silcfdstream.h"
311 #include "silcmime.h"
312
313 #ifdef SILC_DIST_VCARD
314 #include "silcvcard.h"
315 #endif /* SILC_DIST_VCARD */
316
317 #ifdef SILC_DIST_ASN1
318 #include "silcasn1.h"
319 #include "silcber.h"
320 #endif /* SILC_DIST_ASN1 */
321
322 /* SILC core library includes */
323 #include "silcargument.h"
324 #include "silcstatus.h"
325 #include "silcid.h"
326 #include "silccommand.h"
327 #include "silcauth.h"
328 #include "silcmessage.h"
329 #include "silcchannel.h"
330 #include "silcpacket.h"
331 #include "silcnotify.h"
332 #include "silcmode.h"
333 #include "silcattrs.h"
334 #include "silcpubkey.h"
335
336 /* Application utility includes */
337 #include "silcapputil.h"
338 #ifdef SILC_DIST_IDCACHE
339 #include "silcidcache.h"
340 #endif /* SILC_DIST_IDCACHE */
341
342 #ifdef SILC_DIST_SKR
343 #include "silcskr.h"
344 #endif /* SILC_DIST_SKR */
345
346 #if defined(SILC_SIM)
347 /* SILC Module library includes */
348 #include "silcsim.h"
349 #include "silcsimutil.h"
350 #endif
351
352 /* SILC Key Exchange library includes */
353 #include "silcske.h"
354 #include "silcske_payload.h"
355 #include "silcske_groups.h"
356 #include "silcconnauth.h"
357
358 #ifdef SILC_DIST_SFTP
359 /* SILC SFTP library */
360 #include "silcsftp.h"
361 #include "silcsftp_fs.h"
362 #endif /* SILC_DIST_SFTP */
363
364 #ifdef SILC_DIST_HTTP
365 /* SILC HTTP library */
366 #include "silchttpserver.h"
367 #include "silchttpphp.h"
368 #endif /* SILC_DIST_HTTP */
369
370 #ifdef __cplusplus
371 }
372 #endif
373
374 #endif /* SILCINCLUDES_H */