Added SILC_STR_STRING and SILC_STR_STRING_APPEND and support for
[crypto.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 #ifdef SOCKS5
162 #include "socks.h"
163 #endif
164
165 #include <sys/socket.h>
166 #ifdef HAVE_NETINET_IN_H
167 #include <netinet/in.h>
168 #endif
169
170 #ifdef HAVE_XTI_H
171 #include <xti.h>
172 #else
173 #ifdef HAVE_NETINET_TCP_H
174 #include <netinet/tcp.h>
175 #endif
176 #endif
177
178 #ifdef HAVE_NETDB_H
179 #include <netdb.h>
180 #endif
181
182 #ifdef HAVE_ARPA_INET_H
183 #include <arpa/inet.h>
184 #endif
185
186 #ifdef HAVE_SYS_MMAN_H
187 #include <sys/mman.h>
188 #endif
189
190 #ifdef HAVE_DLFCN_H
191 #include <dlfcn.h>
192 #endif
193
194 #ifdef HAVE_LIMITS_H
195 #include <limits.h>
196 #endif
197
198 #ifdef SILC_HAVE_PTHREAD
199 #include <pthread.h>
200 #endif
201
202 #ifdef HAVE_STDDEF_H
203 #include <stddef.h>
204 #endif
205
206 #ifdef HAVE_TERMIOS_H
207 #include <termios.h>
208 #endif
209
210 #ifdef HAVE_UTIME_H
211 #include <utime.h>
212 #endif
213
214 #ifdef HAVE_ICONV_H
215 #include <iconv.h>
216 #endif
217
218 #ifdef HAVE_LOCALE_H
219 #include <locale.h>
220 #endif
221
222 #ifdef HAVE_LANGINFO_H
223 #include <langinfo.h>
224 #endif
225
226 #ifdef HAVE_SYS_RESOURCE_H
227 #include <sys/resource.h>
228 #endif
229
230 #endif                          /* !SILC_WIN32 */
231
232 /* Include generic SILC type definitions */
233 #include "silcerrno.h"
234 #include "silctypes.h"
235 #include "silcbitops.h"
236 #include "silcmutex.h"
237 #include "silcatomic.h"
238 #include "silcversion.h"
239
240 /* SILC util library includes */
241 #include "silcgetopt.h"
242 #include "silclist.h"
243 #include "silcstack.h"
244 #include "silcmemory.h"
245 #include "silcsnprintf.h"
246
247 /* Math library includes */
248 #include "silcmp.h"
249 #include "silcmath.h"
250
251 /* More SILC util library includes */
252 #include "silctime.h"
253 #include "silctimer.h"
254 #include "silccond.h"
255 #include "silcthread.h"
256 #include "silcschedule.h"
257 #include "silclog.h"
258 #include "silcfileutil.h"
259 #include "silcbuffer.h"
260 #include "silcbuffmt.h"
261 #include "silcasync.h"
262 #include "silcdlist.h"
263
264 /* Crypto library includes */
265 #include "silccrypto.h"
266 #include "silccipher.h"
267 #include "silchash.h"
268 #include "silchmac.h"
269 #include "silcrng.h"
270 #include "silcpkcs.h"
271 #include "silcpk.h"
272 #include "silcpkcs1.h"
273 #ifdef SILC_DIST_ACC
274 #include "silcacc.h"
275 #endif /* SILC_DIST_ACC */
276 #ifdef SILC_DIST_SSH
277 #include "silcssh.h"
278 #endif /* SILC_DIST_SSH */
279
280 /* More SILC util library includes */
281 #include "silcregex.h"
282 #include "silcenv.h"
283 #include "silcdll.h"
284 #include "silchashtable.h"
285 #include "silcstream.h"
286 #include "silcnet.h"
287 #include "silcbase64.h"
288 #include "silcstrutil.h"
289 #include "silcutf8.h"
290 #include "silcstringprep.h"
291 #include "silcutil.h"
292 #include "silcconfig.h"
293 #include "silcfsm.h"
294 #include "silcsocketstream.h"
295 #include "silcfdstream.h"
296 #include "silcmime.h"
297
298 #ifdef SILC_DIST_VCARD
299 #include "silcvcard.h"
300 #endif /* SILC_DIST_VCARD */
301
302 #ifdef SILC_DIST_ASN1
303 #include "silcasn1.h"
304 #include "silcber.h"
305 #endif /* SILC_DIST_ASN1 */
306
307 /* SILC core library includes */
308 #include "silcargument.h"
309 #include "silcstatus.h"
310 #include "silcid.h"
311 #include "silccommand.h"
312 #include "silcauth.h"
313 #include "silcmessage.h"
314 #include "silcchannel.h"
315 #include "silcpacket.h"
316 #include "silcnotify.h"
317 #include "silcmode.h"
318 #include "silcattrs.h"
319 #include "silcpubkey.h"
320
321 /* Application utility includes */
322 #include "silcapputil.h"
323 #ifdef SILC_DIST_IDCACHE
324 #include "silcidcache.h"
325 #endif /* SILC_DIST_IDCACHE */
326
327 #ifdef SILC_DIST_SKR
328 #include "silcskr.h"
329 #endif /* SILC_DIST_SKR */
330
331 #if defined(SILC_SIM)
332 /* SILC Module library includes */
333 #include "silcsim.h"
334 #include "silcsimutil.h"
335 #endif
336
337 /* SILC Key Exchange library includes */
338 #include "silcske.h"
339 #include "silcske_payload.h"
340 #include "silcske_groups.h"
341 #include "silcconnauth.h"
342
343 #ifdef SILC_DIST_SFTP
344 /* SILC SFTP library */
345 #include "silcsftp.h"
346 #include "silcsftp_fs.h"
347 #endif /* SILC_DIST_SFTP */
348
349 #ifdef SILC_DIST_HTTP
350 /* SILC HTTP library */
351 #include "silchttpserver.h"
352 #include "silchttpphp.h"
353 #endif /* SILC_DIST_HTTP */
354
355 #ifdef __cplusplus
356 }
357 #endif
358
359 #endif /* SILCINCLUDES_H */