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