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"
46 #include <sys/types.h>
53 #error signal.h not found in the system
59 #error fcntl.h not found in the system
65 #error errno.h not found in the system
71 #error assert.h not found in the system
80 #include <sys/times.h>
90 #include <sys/socket.h>
91 #ifdef HAVE_NETINET_IN_H
92 #include <netinet/in.h>
94 #error netinet/in.h not found in the system
100 #ifdef HAVE_NETINET_TCP_H
101 #include <netinet/tcp.h>
103 #error xti.h nor even netinet/tcp.h found in the system
110 #error netdb.h not found in the system
113 #ifdef HAVE_ARPA_INET_H
114 #include <arpa/inet.h>
116 #error arpa/inet.h not found in the system
119 #ifdef HAVE_SYS_MMAN_H
120 #include <sys/mman.h>
132 #include "../lib/contrib/regex.h"
137 #ifdef SILC_HAVE_PTHREAD
145 #endif /* !SILC_WIN32 */
147 #ifndef HAVE_GETOPT_LONG
148 #include "../lib/contrib/getopt.h"
158 /* Define offsetof */
160 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
163 /* Define types. The types must be at least of the specified size */
173 typedef unsigned char uint8;
174 typedef signed char int8;
176 #if SILC_SIZEOF_SHORT > 2
177 #error "size of the short must be 2 bytes"
180 typedef unsigned short uint16;
181 typedef signed short int16;
183 #if SILC_SIZEOF_LONG == 4
184 typedef unsigned long uint32;
185 typedef signed long int32;
187 #if SILC_SIZEOF_INT == 4
188 typedef unsigned long uint32;
189 typedef signed long int32;
191 #if SILC_SIZEOF_LONG_LONG >= 4
193 typedef unsigned long long uint32;
194 typedef signed long long int32;
200 #if SILC_SIZEOF_LONG >= 8
201 typedef unsigned long uint64;
202 typedef signed long int64;
204 #if SILC_SIZEOF_LONG_LONG >= 8
206 typedef unsigned long long uint64;
207 typedef signed long long int64;
209 typedef uint32 uint64; /* XXX Use Windows's own 64 bit types */
213 typedef uint32 uint64;
218 #if SILC_SIZEOF_VOID_P < 4
219 typedef uint32 * void *;
224 #define bool unsigned char
228 /* Generic global SILC includes */
231 /* Math library includes */
233 #include "silcmath.h"
235 /* Crypto library includes */
236 #include "silccipher.h"
237 #include "silchash.h"
238 #include "silchmac.h"
240 #include "silcpkcs.h"
242 /* SILC util library includes */
243 #include "silcmutex.h"
244 #include "silcthread.h"
245 #include "silcschedule.h"
246 #include "silchashtable.h"
248 #include "silcmemory.h"
249 #include "silclist.h"
250 #include "silcdlist.h"
251 #include "silcbuffer.h"
252 #include "silcbufutil.h"
253 #include "silcbuffmt.h"
255 #include "silcutil.h"
256 #include "silcconfig.h"
257 #include "silcprotocol.h"
258 #include "silcsockconn.h"
260 /* SILC core library includes */
262 #include "silcidcache.h"
263 #include "silcargument.h"
264 #include "silccommand.h"
265 #include "silcchannel.h"
266 #include "silcpacket.h"
267 #include "silcnotify.h"
268 #include "silcmode.h"
269 #include "silcauth.h"
270 #include "silcprivate.h"
273 /* SILC Module library includes */
275 #include "silcsimutil.h"
278 /* SILC Key Exchange library includes */
283 /* SILC SFTP library */
284 #include "silcsftp.h"
285 #include "silcsftp_fs.h"