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 #endif                          /* !SILC_WIN32 */
118
119 #ifndef HAVE_GETOPT_LONG
120 #include "../lib/contrib/getopt.h"
121 #endif
122
123 #ifndef HAVE_REGEX_H
124 #include "../lib/contrib/regex.h"
125 #else
126 #include <regex.h>
127 #endif
128
129 #ifndef TRUE
130 #define TRUE 1
131 #endif
132 #ifndef FALSE
133 #define FALSE 0
134 #endif
135
136 /* Define types. The types must be at least of the specified size */
137 #undef uint8
138 #undef uint16
139 #undef uint32
140 #undef uin64
141 #undef int8
142 #undef int16
143 #undef int32
144 #undef int64
145
146 typedef unsigned char uint8;
147 typedef signed char int8;
148
149 #if SILC_SIZEOF_SHORT > 2
150 #error "size of the short must be 2 bytes"
151 #endif
152
153 typedef unsigned short uint16;
154 typedef signed short int16;
155
156 #if SILC_SIZEOF_LONG == 4
157 typedef unsigned long uint32;
158 typedef signed long int32;
159 #else
160 #if SILC_SIZEOF_INT == 4
161 typedef unsigned long uint32;
162 typedef signed long int32;
163 #else
164 #if SILC_SIZEOF_LONG_LONG >= 4
165 typedef unsigned long long uint32;
166 typedef signed long long int32;
167 #endif
168 #endif
169 #endif
170
171 #if SILC_SIZEOF_LONG >= 8
172 typedef unsigned long uint64;
173 typedef signed long int64;
174 #else
175 #if SILC_SIZEOF_LONG_LONG >= 8
176 typedef unsigned long long uint64;
177 typedef signed long long int64;
178 #else
179 typedef uint32 uint64;
180 typedef int32 int64;
181 #endif
182 #endif
183
184 #if SILC_SIZEOF_VOID_P < 4
185 typedef uint32 * void *;
186 #endif
187
188 #ifndef bool
189 #define bool unsigned char
190 #endif
191
192 /* Generic global SILC includes */
193 #include "bitmove.h"
194
195 /* Math library includes */
196 #include "silcmp.h"
197 #include "silcmath.h"
198
199 /* Crypto library includes */
200 #include "silccipher.h"
201 #include "silchash.h"
202 #include "silchmac.h"
203 #include "silcrng.h"
204 #include "silcpkcs.h"
205
206 /* SILC util library includes */
207 #include "silchashtable.h"
208 #include "silclog.h"
209 #include "silcmemory.h"
210 #include "silcbuffer.h"
211 #include "silcbufutil.h"
212 #include "silcbuffmt.h"
213 #include "silcnet.h"
214 #include "silcutil.h"
215 #include "silcconfig.h"
216 #include "silctask.h"
217 #include "silcschedule.h"
218
219 /* SILC core library includes */
220 #include "silcid.h"
221 #include "silcidcache.h"
222 #include "silcprotocol.h"
223 #include "silcsockconn.h"
224 #include "silcpayload.h"
225 #include "silccommand.h"
226 #include "silcchannel.h"
227 #include "silcpacket.h"
228 #include "silcnotify.h"
229 #include "silcmode.h"
230 #include "silcauth.h"
231 #include "silcprivate.h"
232
233 /* TRQ (SilcList API and SilcDList API) */
234 #include "silclist.h"
235 #include "silcdlist.h"
236
237 #ifdef SILC_SIM
238 /* SILC Module library includes */
239 #include "silcsim.h"
240 #include "silcsimutil.h"
241 #endif
242
243 /* SILC Key Exchange library includes */
244 #include "silcske.h"
245 #include "payload.h"
246 #include "groups.h"
247
248 #endif
249