5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 1997 - 2001 Pekka Riikonen
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; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
21 This file includes common definitions for SILC. This file MUST be included
22 by all files in SILC (directly or through other global include file).
25 #ifndef SILCINCLUDES_H
26 #define SILCINCLUDES_H
28 /* Automatically generated configuration header */
37 #if defined(__EPOC32__)
47 #elif defined(__BEOS__)
53 /* Platform specific includes */
56 #include "silcwin32.h"
76 #include <sys/types.h>
83 #error signal.h not found in the system
89 #error fcntl.h not found in the system
95 #error errno.h not found in the system
101 #error assert.h not found in the system
107 #include <sys/time.h>
110 #include <sys/times.h>
120 #include <sys/socket.h>
121 #ifdef HAVE_NETINET_IN_H
122 #include <netinet/in.h>
124 #error netinet/in.h not found in the system
130 #ifdef HAVE_NETINET_TCP_H
131 #include <netinet/tcp.h>
133 #error xti.h nor even netinet/tcp.h found in the system
140 #error netdb.h not found in the system
143 #ifdef HAVE_ARPA_INET_H
144 #include <arpa/inet.h>
146 #error arpa/inet.h not found in the system
149 #ifdef HAVE_SYS_MMAN_H
150 #include <sys/mman.h>
162 #include "../lib/contrib/regex.h"
167 #ifdef SILC_HAVE_PTHREAD
175 #endif /* !SILC_WIN32 */
177 #ifndef HAVE_GETOPT_LONG
178 #include "../lib/contrib/getopt.h"
188 /* Define offsetof */
190 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
193 /* Define types. The types must be at least of the specified size */
203 typedef unsigned char uint8;
204 typedef signed char int8;
206 #if SILC_SIZEOF_SHORT > 2
207 #error "size of the short must be 2 bytes"
210 typedef unsigned short uint16;
211 typedef signed short int16;
213 #if SILC_SIZEOF_LONG == 4
214 typedef unsigned long uint32;
215 typedef signed long int32;
217 #if SILC_SIZEOF_INT == 4
218 typedef unsigned long uint32;
219 typedef signed long int32;
221 #if SILC_SIZEOF_LONG_LONG >= 4
223 typedef unsigned long long uint32;
224 typedef signed long long int32;
230 #if SILC_SIZEOF_LONG >= 8
231 typedef unsigned long uint64;
232 typedef signed long int64;
234 #if SILC_SIZEOF_LONG_LONG >= 8
236 typedef unsigned long long uint64;
237 typedef signed long long int64;
239 typedef uint32 uint64; /* XXX Use Windows's own 64 bit types */
243 typedef uint32 uint64;
248 #if SILC_SIZEOF_VOID_P < 4
249 typedef uint32 * void *;
254 #define bool unsigned char
258 /* Generic global SILC includes */
261 /* Math library includes */
263 #include "silcmath.h"
265 /* Crypto library includes */
266 #include "silccipher.h"
267 #include "silchash.h"
268 #include "silchmac.h"
270 #include "silcpkcs.h"
272 /* SILC util library includes */
273 #include "silcmutex.h"
274 #include "silcthread.h"
275 #include "silcschedule.h"
276 #include "silchashtable.h"
278 #include "silcmemory.h"
279 #include "silclist.h"
280 #include "silcdlist.h"
281 #include "silcbuffer.h"
282 #include "silcbuffmt.h"
284 #include "silcfileutil.h"
285 #include "silcutil.h"
286 #include "silcconfig.h"
287 #include "silcprotocol.h"
288 #include "silcsockconn.h"
290 /* SILC core library includes */
292 #include "silcidcache.h"
293 #include "silcargument.h"
294 #include "silccommand.h"
295 #include "silcchannel.h"
296 #include "silcpacket.h"
297 #include "silcnotify.h"
298 #include "silcmode.h"
299 #include "silcauth.h"
300 #include "silcprivate.h"
303 /* SILC Module library includes */
305 #include "silcsimutil.h"
308 /* SILC Key Exchange library includes */
310 #include "silcske_payload.h"
311 #include "silcske_groups.h"
313 /* SILC SFTP library */
314 #include "silcsftp.h"
315 #include "silcsftp_fs.h"