updates.
[silc.git] / includes / silcincludes.h
1 /*
2
3   silcincludes.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2001 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; either version 2 of the License, or
12   (at your option) any later version.
13   
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.
18
19 */
20 /*
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).
23 */
24
25 #ifndef SILCINCLUDES_H
26 #define SILCINCLUDES_H
27
28 /* Automatically generated configuration header */
29 #include "silcdefs.h"
30
31 #ifdef SILC_WIN32
32 #include "silcwin32.h"
33 #endif
34
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <unistd.h>
38 #include <string.h>
39 #include <stdarg.h>
40 #include <ctype.h>
41 #include <sys/types.h>
42 #include <sys/stat.h>
43 #include <sys/time.h>
44 #include <time.h>
45
46 #ifdef HAVE_SIGNAL_H
47 #include <signal.h>
48 #else
49 #error signal.h not found in the system
50 #endif
51
52 #ifdef HAVE_FCNTL_H
53 #include <fcntl.h>
54 #else
55 #error fcntl.h not found in the system
56 #endif
57
58 #ifdef HAVE_ERRNO_H
59 #include <errno.h>
60 #else
61 #error errno.h not found in the system
62 #endif
63
64 #ifdef HAVE_ASSERT_H
65 #include <assert.h>
66 #else
67 #error assert.h not found in the system
68 #endif
69
70 #ifndef SILC_WIN32
71
72 #include <pwd.h>
73 #include <grp.h>
74 #include <sys/times.h>
75
76 #ifdef HAVE_GETOPT_H
77 #include <getopt.h>
78 #endif
79
80 #ifdef SOCKS5
81 #include "socks.h"
82 #endif
83
84 #include <sys/socket.h>
85 #ifdef HAVE_NETINET_IN_H
86 #include <netinet/in.h>
87 #else
88 #error netinet/in.h not found in the system
89 #endif
90
91 #ifdef HAVE_NETINET_TCP_H
92 #include <netinet/tcp.h>
93 #else
94 #error netinet/tcp.h not found in the system
95 #endif
96
97 #ifdef HAVE_NETDB_H
98 #include <netdb.h>
99 #else
100 #error netdb.h not found in the system
101 #endif
102
103 #ifdef HAVE_ARPA_INET_H
104 #include <arpa/inet.h>
105 #else
106 #error arpa/inet.h not found in the system
107 #endif
108
109 #ifdef HAVE_SYS_MMAN_H
110 #include <sys/mman.h>
111 #endif
112
113 #ifdef HAVE_DLFCN_H
114 #include <dlfcn.h>
115 #endif
116
117 #ifdef HAVE_LIMITS_H
118 #include <limits.h>
119 #endif
120
121 #ifndef HAVE_REGEX_H
122 #include "../lib/contrib/regex.h"
123 #else
124 #include <regex.h>
125 #endif
126
127 #endif                          /* !SILC_WIN32 */
128
129 #ifndef HAVE_GETOPT_LONG
130 #include "../lib/contrib/getopt.h"
131 #endif
132
133 #ifndef TRUE
134 #define TRUE 1
135 #endif
136 #ifndef FALSE
137 #define FALSE 0
138 #endif
139
140 /* Define types. The types must be at least of the specified size */
141 #undef uint8
142 #undef uint16
143 #undef uint32
144 #undef uin64
145 #undef int8
146 #undef int16
147 #undef int32
148 #undef int64
149
150 typedef unsigned char uint8;
151 typedef signed char int8;
152
153 #if SILC_SIZEOF_SHORT > 2
154 #error "size of the short must be 2 bytes"
155 #endif
156
157 typedef unsigned short uint16;
158 typedef signed short int16;
159
160 #if SILC_SIZEOF_LONG == 4
161 typedef unsigned long uint32;
162 typedef signed long int32;
163 #else
164 #if SILC_SIZEOF_INT == 4
165 typedef unsigned long uint32;
166 typedef signed long int32;
167 #else
168 #if SILC_SIZEOF_LONG_LONG >= 4
169 typedef unsigned long long uint32;
170 typedef signed long long int32;
171 #endif
172 #endif
173 #endif
174
175 #if SILC_SIZEOF_LONG >= 8
176 typedef unsigned long uint64;
177 typedef signed long int64;
178 #else
179 #if SILC_SIZEOF_LONG_LONG >= 8
180 typedef unsigned long long uint64;
181 typedef signed long long int64;
182 #else
183 typedef uint32 uint64;
184 typedef int32 int64;
185 #endif
186 #endif
187
188 #if SILC_SIZEOF_VOID_P < 4
189 typedef uint32 * void *;
190 #endif
191
192 #ifndef bool
193 #define bool unsigned char
194 #endif
195
196 /* Generic global SILC includes */
197 #include "bitmove.h"
198
199 /* Math library includes */
200 #include "silcmp.h"
201 #include "silcmath.h"
202
203 /* Crypto library includes */
204 #include "silccipher.h"
205 #include "silchash.h"
206 #include "silchmac.h"
207 #include "silcrng.h"
208 #include "silcpkcs.h"
209
210 /* SILC util library includes */
211 #include "silchashtable.h"
212 #include "silclog.h"
213 #include "silcmemory.h"
214 #include "silcbuffer.h"
215 #include "silcbufutil.h"
216 #include "silcbuffmt.h"
217 #include "silcnet.h"
218 #include "silcutil.h"
219 #include "silcconfig.h"
220 #include "silctask.h"
221 #include "silcschedule.h"
222
223 /* SILC core library includes */
224 #include "silcid.h"
225 #include "silcidcache.h"
226 #include "silcprotocol.h"
227 #include "silcsockconn.h"
228 #include "silcpayload.h"
229 #include "silccommand.h"
230 #include "silcchannel.h"
231 #include "silcpacket.h"
232 #include "silcnotify.h"
233 #include "silcmode.h"
234 #include "silcauth.h"
235 #include "silcprivate.h"
236
237 /* TRQ (SilcList API and SilcDList API) */
238 #include "silclist.h"
239 #include "silcdlist.h"
240
241 #ifdef SILC_SIM
242 /* SILC Module library includes */
243 #include "silcsim.h"
244 #include "silcsimutil.h"
245 #endif
246
247 /* SILC Key Exchange library includes */
248 #include "silcske.h"
249 #include "payload.h"
250 #include "groups.h"
251
252 #endif
253