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__)
44 #include "silcwin32.h"
60 #include <sys/types.h>
67 #error signal.h not found in the system
73 #error fcntl.h not found in the system
79 #error errno.h not found in the system
85 #error assert.h not found in the system
94 #include <sys/times.h>
104 #include <sys/socket.h>
105 #ifdef HAVE_NETINET_IN_H
106 #include <netinet/in.h>
108 #error netinet/in.h not found in the system
114 #ifdef HAVE_NETINET_TCP_H
115 #include <netinet/tcp.h>
117 #error xti.h nor even netinet/tcp.h found in the system
124 #error netdb.h not found in the system
127 #ifdef HAVE_ARPA_INET_H
128 #include <arpa/inet.h>
130 #error arpa/inet.h not found in the system
133 #ifdef HAVE_SYS_MMAN_H
134 #include <sys/mman.h>
146 #include "../lib/contrib/regex.h"
151 #ifdef SILC_HAVE_PTHREAD
159 #endif /* !SILC_WIN32 */
161 #ifndef HAVE_GETOPT_LONG
162 #include "../lib/contrib/getopt.h"
172 /* Define offsetof */
174 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
177 /* Define types. The types must be at least of the specified size */
187 typedef unsigned char uint8;
188 typedef signed char int8;
190 #if SILC_SIZEOF_SHORT > 2
191 #error "size of the short must be 2 bytes"
194 typedef unsigned short uint16;
195 typedef signed short int16;
197 #if SILC_SIZEOF_LONG == 4
198 typedef unsigned long uint32;
199 typedef signed long int32;
201 #if SILC_SIZEOF_INT == 4
202 typedef unsigned long uint32;
203 typedef signed long int32;
205 #if SILC_SIZEOF_LONG_LONG >= 4
207 typedef unsigned long long uint32;
208 typedef signed long long int32;
214 #if SILC_SIZEOF_LONG >= 8
215 typedef unsigned long uint64;
216 typedef signed long int64;
218 #if SILC_SIZEOF_LONG_LONG >= 8
220 typedef unsigned long long uint64;
221 typedef signed long long int64;
223 typedef uint32 uint64; /* XXX Use Windows's own 64 bit types */
227 typedef uint32 uint64;
232 #if SILC_SIZEOF_VOID_P < 4
233 typedef uint32 * void *;
238 #define bool unsigned char
242 /* Generic global SILC includes */
245 /* Math library includes */
247 #include "silcmath.h"
249 /* Crypto library includes */
250 #include "silccipher.h"
251 #include "silchash.h"
252 #include "silchmac.h"
254 #include "silcpkcs.h"
256 /* SILC util library includes */
257 #include "silcmutex.h"
258 #include "silcthread.h"
259 #include "silcschedule.h"
260 #include "silchashtable.h"
262 #include "silcmemory.h"
263 #include "silclist.h"
264 #include "silcdlist.h"
265 #include "silcbuffer.h"
266 #include "silcbufutil.h"
267 #include "silcbuffmt.h"
269 #include "silcfileutil.h"
270 #include "silcutil.h"
271 #include "silcconfig.h"
272 #include "silcprotocol.h"
273 #include "silcsockconn.h"
275 /* SILC core library includes */
277 #include "silcidcache.h"
278 #include "silcargument.h"
279 #include "silccommand.h"
280 #include "silcchannel.h"
281 #include "silcpacket.h"
282 #include "silcnotify.h"
283 #include "silcmode.h"
284 #include "silcauth.h"
285 #include "silcprivate.h"
288 /* SILC Module library includes */
290 #include "silcsimutil.h"
293 /* SILC Key Exchange library includes */
295 #include "silcske_payload.h"
296 #include "silcske_groups.h"
298 /* SILC SFTP library */
299 #include "silcsftp.h"
300 #include "silcsftp_fs.h"