Added.
[silc.git] / includes / silc.h.in
1 /*
2
3   silc.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2005 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__)
41 #ifndef SILC_EPOC
42 #define SILC_EPOC
43 #undef SILC_UNIX
44 #endif
45 #endif
46
47 #ifdef BEOS
48 #ifndef SILC_BEOS
49 #define SILC_BEOS
50 #undef SILC_UNIX
51 #endif
52 #elif defined(__BEOS__)
53 #ifndef SILC_BEOS
54 #define SILC_BEOS
55 #undef SILC_UNIX
56 #endif
57 #endif
58
59 #if defined(OS2)
60 #ifndef SILC_OS2
61 #define SILC_OS2
62 #undef SILC_UNIX
63 #endif
64 #endif
65
66 #if defined(__MACH__) && defined(__APPLE__)
67 #ifndef SILC_MACOSX
68 #define SILC_MACOSX
69 #endif
70 #endif
71
72 /* Types */
73 #define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
74 #define SILC_SIZEOF_LONG @SILC_SIZEOF_LONG@
75 #define SILC_SIZEOF_INT @SILC_SIZEOF_INT@
76 #define SILC_SIZEOF_SHORT @SILC_SIZEOF_SHORT@
77 #define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
78 #define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
79
80 /* Compilation time defines, for third-party software */
81 @__SILC_HAVE_PTHREAD@
82 @__SILC_HAVE_SIM@
83 @__SILC_ENABLE_DEBUG@
84
85 #if defined(HAVE_SILCDEFS_H)
86 /* Automatically generated configuration header */
87 #include "silcdefs.h"
88 #include "silcdistdefs.h"
89 #endif /* HAVE_SILCDEFS_H */
90
91 /* Platform specific includes */
92
93 #if defined(SILC_WIN32)
94 #include "silcwin32.h"
95 #endif
96
97 #if defined(SILC_EPOC)
98 #include "silcepoc.h"
99 #endif
100
101 #if defined(SILC_BEOS)
102 #include "silcbeos.h"
103 #endif
104
105 #if defined(SILC_OS2)
106 #include "silcos2.h"
107 #endif
108
109 #ifndef DLLAPI
110 #define DLLAPI
111 #endif
112
113 #include <stdio.h>
114 #include <stdlib.h>
115 #include <string.h>
116 #include <stdarg.h>
117 #include <ctype.h>
118 #include <sys/types.h>
119 #include <sys/stat.h>
120 #include <time.h>
121
122 #ifdef HAVE_SIGNAL_H
123 #include <signal.h>
124 #endif
125
126 #ifdef HAVE_FCNTL_H
127 #include <fcntl.h>
128 #endif
129
130 #ifdef HAVE_ERRNO_H
131 #include <errno.h>
132 #endif
133
134 #ifdef HAVE_ASSERT_H
135 #include <assert.h>
136 #endif
137
138 #if !defined(SILC_WIN32)
139
140 #include <unistd.h>
141 #include <sys/time.h>
142 #include <pwd.h>
143 #include <grp.h>
144 #include <sys/times.h>
145
146 #if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT)
147 #include <getopt.h>
148 #else
149 #if defined(HAVE_SILCDEFS_H)
150 #include "getopti.h"
151 #endif /* HAVE_SILCDEFS_H */
152 #endif
153
154 #ifdef SOCKS5
155 #include "socks.h"
156 #endif
157
158 #include <sys/socket.h>
159 #ifdef HAVE_NETINET_IN_H
160 #include <netinet/in.h>
161 #endif
162
163 #ifdef HAVE_XTI_H
164 #include <xti.h>
165 #else
166 #ifdef HAVE_NETINET_TCP_H
167 #include <netinet/tcp.h>
168 #endif
169 #endif
170
171 #ifdef HAVE_NETDB_H
172 #include <netdb.h>
173 #endif
174
175 #ifdef HAVE_ARPA_INET_H
176 #include <arpa/inet.h>
177 #endif
178
179 #ifdef HAVE_SYS_MMAN_H
180 #include <sys/mman.h>
181 #endif
182
183 #ifdef HAVE_DLFCN_H
184 #include <dlfcn.h>
185 #endif
186
187 #ifdef HAVE_LIMITS_H
188 #include <limits.h>
189 #endif
190
191 #ifndef HAVE_REGEX_H
192 #if defined(HAVE_SILCDEFS_H)
193 #include "regexpr.h"
194 #endif /* HAVE_SILCDEFS_H */
195 #else
196 #include <regex.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 "silctypes.h"
235 #include "silcversion.h"
236
237 /* SILC util library includes */
238 #include "silcstack.h"
239 #include "silcmemory.h"
240
241 /* Math library includes */
242 #include "silcmp.h"
243 #include "silcmath.h"
244
245 /* More SILC util library includes */
246 #include "silcbuffer.h"
247 #include "silcbuffmt.h"
248
249 /* Crypto library includes */
250 #include "silccipher.h"
251 #include "silchash.h"
252 #include "silchmac.h"
253 #include "silcrng.h"
254 #include "silcpkcs.h"
255 #include "silcpkcs1.h"
256
257 /* More SILC util library includes */
258 #include "silctime.h"
259 #include "silcmutex.h"
260 #include "silcthread.h"
261 #include "silcschedule.h"
262 #include "silchashtable.h"
263 #include "silclog.h"
264 #include "silclist.h"
265 #include "silcdlist.h"
266 #include "silcasync.h"
267 #include "silcstream.h"
268 #include "silcnet.h"
269 #include "silcfileutil.h"
270 #include "silcstrutil.h"
271 #include "silcutf8.h"
272 #include "silcstringprep.h"
273 #include "silcutil.h"
274 #include "silcconfig.h"
275 #include "silcfsm.h"
276 #include "silcsocketstream.h"
277 #include "silcfdstream.h"
278 #include "silcvcard.h"
279 #include "silcapputil.h"
280 #include "silcmime.h"
281
282 #ifdef SILC_DIST_ASN1
283 #include "silcasn1.h"
284 #include "silcber.h"
285 #endif /* SILC_DIST_ASN1 */
286
287 /* SILC core library includes */
288 #include "silcargument.h"
289 #include "silcstatus.h"
290 #include "silcid.h"
291 #include "silcidcache.h"
292 #include "silccommand.h"
293 #include "silcmessage.h"
294 #include "silcchannel.h"
295 #include "silcpacket.h"
296 #include "silcnotify.h"
297 #include "silcmode.h"
298 #include "silcauth.h"
299 #include "silcattrs.h"
300
301 #ifdef SILC_DIST_SKR
302 #include "silcskr.h"
303 #endif /* SILC_DIST_SKR */
304
305 #if defined(SILC_SIM)
306 /* SILC Module library includes */
307 #include "silcsim.h"
308 #include "silcsimutil.h"
309 #endif
310
311 /* SILC Key Exchange library includes */
312 #include "silcske.h"
313 #include "silcske_payload.h"
314 #include "silcske_groups.h"
315 #include "silcconnauth.h"
316
317 #ifdef SILC_DIST_SFTP
318 /* SILC SFTP library */
319 #include "silcsftp.h"
320 #include "silcsftp_fs.h"
321 #endif /* SILC_DIST_SFTP */
322
323 #ifdef __cplusplus
324 }
325 #endif
326
327 #endif /* SILCINCLUDES_H */