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