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