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 */
38 #include "silcwin32.h"
50 #include <sys/types.h>
57 #error signal.h not found in the system
63 #error fcntl.h not found in the system
69 #error errno.h not found in the system
75 #error assert.h not found in the system
84 #include <sys/times.h>
94 #include <sys/socket.h>
95 #ifdef HAVE_NETINET_IN_H
96 #include <netinet/in.h>
98 #error netinet/in.h not found in the system
104 #ifdef HAVE_NETINET_TCP_H
105 #include <netinet/tcp.h>
107 #error xti.h nor even netinet/tcp.h found in the system
114 #error netdb.h not found in the system
117 #ifdef HAVE_ARPA_INET_H
118 #include <arpa/inet.h>
120 #error arpa/inet.h not found in the system
123 #ifdef HAVE_SYS_MMAN_H
124 #include <sys/mman.h>
136 #include "../lib/contrib/regex.h"
141 #ifdef SILC_HAVE_PTHREAD
149 #endif /* !SILC_WIN32 */
151 #ifndef HAVE_GETOPT_LONG
152 #include "../lib/contrib/getopt.h"
162 /* Define offsetof */
164 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
167 /* Define types. The types must be at least of the specified size */
177 typedef unsigned char uint8;
178 typedef signed char int8;
180 #if SILC_SIZEOF_SHORT > 2
181 #error "size of the short must be 2 bytes"
184 typedef unsigned short uint16;
185 typedef signed short int16;
187 #if SILC_SIZEOF_LONG == 4
188 typedef unsigned long uint32;
189 typedef signed long int32;
191 #if SILC_SIZEOF_INT == 4
192 typedef unsigned long uint32;
193 typedef signed long int32;
195 #if SILC_SIZEOF_LONG_LONG >= 4
197 typedef unsigned long long uint32;
198 typedef signed long long int32;
204 #if SILC_SIZEOF_LONG >= 8
205 typedef unsigned long uint64;
206 typedef signed long int64;
208 #if SILC_SIZEOF_LONG_LONG >= 8
210 typedef unsigned long long uint64;
211 typedef signed long long int64;
213 typedef uint32 uint64; /* XXX Use Windows's own 64 bit types */
217 typedef uint32 uint64;
222 #if SILC_SIZEOF_VOID_P < 4
223 typedef uint32 * void *;
228 #define bool unsigned char
232 /* Generic global SILC includes */
235 /* Math library includes */
237 #include "silcmath.h"
239 /* Crypto library includes */
240 #include "silccipher.h"
241 #include "silchash.h"
242 #include "silchmac.h"
244 #include "silcpkcs.h"
246 /* SILC util library includes */
247 #include "silcmutex.h"
248 #include "silcthread.h"
249 #include "silcschedule.h"
250 #include "silchashtable.h"
252 #include "silcmemory.h"
253 #include "silclist.h"
254 #include "silcdlist.h"
255 #include "silcbuffer.h"
256 #include "silcbufutil.h"
257 #include "silcbuffmt.h"
259 #include "silcutil.h"
260 #include "silcconfig.h"
261 #include "silcprotocol.h"
262 #include "silcsockconn.h"
264 /* SILC core library includes */
266 #include "silcidcache.h"
267 #include "silcargument.h"
268 #include "silccommand.h"
269 #include "silcchannel.h"
270 #include "silcpacket.h"
271 #include "silcnotify.h"
272 #include "silcmode.h"
273 #include "silcauth.h"
274 #include "silcprivate.h"
277 /* SILC Module library includes */
279 #include "silcsimutil.h"
282 /* SILC Key Exchange library includes */
287 /* SILC SFTP library */
288 #include "silcsftp.h"
289 #include "silcsftp_fs.h"