00001
00002
00003
00004
00005
00006 #ifndef __CONFIG_H
00007 #define __CONFIG_H
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #define RCD
00040
00041
00042
00043 #define PING
00044
00045
00046 #define SHORT_PACKETS
00047
00048
00049
00050 #define SPEEDUP
00051
00052
00053 #define FEATURE_PACKETS
00054
00055
00056
00057
00058
00059 #define UDP_PORTSWAP
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 #define NBT
00073
00074
00075 #define MAXPLAYER 36
00076
00077
00078 #define CORRUPTED_PACKETS
00079
00080
00081 #if 0
00082 #define EXPIRE 365
00083 #endif
00084
00085
00086 #define ARMY_SLIDER
00087
00088
00089 #define META
00090
00091
00092 #define PACKET_LOG
00093
00094
00095 #define NEWMACRO
00096
00097
00098 #define SMARTMACRO
00099
00100
00101 #define MULTILINE_MACROS
00102
00103
00104 #define XTREKRC_HELP
00105
00106
00107 #define TOOLS
00108
00109
00110
00111
00112
00113 #ifndef SKIP_SOUND
00114 #define SOUND
00115 #endif
00116
00117
00118 #define HOCKEY_LINES
00119
00120
00121
00122
00123
00124 #define BEEPLITE
00125
00126
00127 #define VSHIELD_BITMAPS
00128 #define VARY_HULL
00129
00130
00131
00132
00133
00134
00135 #define RCM
00136
00137
00138 #define RACE_COLORS
00139
00140
00141 #define XTRA_MESSAGE_UI
00142
00143
00144 #define SYSTEM_DEFAULTFILE "/etc/netrekrc"
00145
00146
00147 #ifdef linux
00148 #define WINDOWMAKER
00149 #endif
00150
00151 #define PLIST1
00152 #define PLIST
00153 #define CONTROL_KEY
00154 #define DOC_WIN
00155 #define ROTATERACE
00156 #define FUNCTION_KEYS
00157
00158
00159 #define IGNORE_SIGNALS_SEGV_BUS
00160 #define MOUSE_AS_SHIFT
00161 #define SHIFTED_MOUSE
00162 #define TNG_FED_BITMAPS
00163 #define MOTION_MOUSE
00164 #define DIST_KEY_NAME
00165 #define PHASER_STATS
00166 #define RECORDGAME
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 #define NEED_EXIT
00178
00179
00180
00181 #define HAVE_MATH_H 1
00182 #define HAVE_STDLIB_H 1
00183
00184
00185 #define BSD_SIGNALS 1
00186
00187
00188
00189
00190 #define STDC_HEADERS 1
00191 #define HAVE_WAIT3 1
00192
00193
00194 #define HAVE_UNISTD_H 1
00195 #define HAVE_SYS_TIMEB_H 1
00196
00197
00198 #define NEED_SYS_TIME_H 1
00199
00200 #define HAVE_SYS_FCNTL_H 1
00201 #define HAVE_FCNTL_H 1
00202 #define HAVE_CTYPE_H 1
00203 #define HAVE_MACHINE_ENDIAN_H 1
00204 #define HAVE_SYS_RESOURCE_H 1
00205 #define HAVE_SYS_WAIT_H 1
00206 #define HAVE_NETINET_IN_H 1
00207 #define HAVE_NETINET_TCP_H 1
00208 #define HAVE_SYS_FILIO_H 1
00209
00210
00211 #define SIZEOF_LONG 4
00212 #define HAVE_USLEEP 1
00213 #define HAVE_SETSTATE 1
00214 #define HAVE_RANDOM 1
00215 #define HAVE_STRFTIME 1
00216 #define HAVE_FTIME 1
00217
00218
00219
00220
00221 #define RETSIGTYPE void
00222
00223
00224
00225
00226
00227 #if (defined(sparc) && defined(sun))
00228 #define vfork fork
00229 #endif
00230
00231
00232
00233 #define HAVE_X11 1
00234
00235
00236
00237
00238
00239
00240
00241 #ifdef SYSV_SIGNALS
00242 #include <signal.h>
00243 #define SIGNAL(x,y) sigset(x,y)
00244 #define PAUSE(x) sigpause(x)
00245 #define SIGSETMASK(x) { }
00246 #else
00247 #define SIGNAL(x,y) signal(x,y)
00248 #define PAUSE(x) pause()
00249 #define SIGSETMASK(x) sigsetmask(x)
00250 #endif
00251
00252 #ifdef POSIX_SIGNALS
00253 #define HANDLE_SIG(s,h) signal(s,h)
00254 #define setjmp(x) sigsetjmp(x,1)
00255 #define longjmp(x,y) siglongjmp(x,y)
00256 #else
00257 #define HANDLE_SIG(s,h) {}
00258 #endif
00259
00260 #ifdef STDC_HEADERS
00261 #define INC_STRINGS <string.h>
00262 #else
00263 #define INC_STRINGS <strings.h>
00264 #endif
00265
00266 #ifdef STDC_HEADERS
00267 #define MCMP(x,y,z) memcmp(x,y,z)
00268 #define MCOPY(b1,b2,l) memcpy(b2,b1,l)
00269 #define MZERO(b1,l) memset(b1,0,l)
00270 #define INDEX(s,c) strchr(s,c)
00271 #define RINDEX(s,c) strrchr(s,c)
00272 #else
00273 #define INDEX(s,c) index(s,c)
00274 #define RINDEX(s,c) rindex(s,c)
00275 #define MCMP(x,y,z) bcmp(x,y,z)
00276 #define MCOPY(b1,b2,l) bcopy(b1,b2,l)
00277 #define MZERO(b1,l) bzero(b1,l)
00278 #endif
00279
00280 #ifdef SPEEDUP
00281 #ifdef NEED_MEMORY_H
00282 #include <memory.h>
00283 #else
00284 #include <string.h>
00285 #endif
00286
00287 #define STRNCPY(x,y,z) memccpy(x,y,'\0',z)
00288 #else
00289 #define STRNCPY(x,y,z) strncpy(x,y,z)
00290 #endif
00291
00292 #ifndef HAVE_WAIT3
00293 #define WAIT3(x,y,z) waitpid(-1, x, y )
00294 #else
00295 #define WAIT3(x,y,z) wait3(x, y, z)
00296 #endif
00297
00298 #if (defined(HAVE_RANDOM) && defined(HAVE_SETSTATE)) || !defined(HAVE_RANDOM)
00299 #define RANDOM() random()
00300 #define SRANDOM(x) srandom(x)
00301 #else
00302 #define RANDOM() rrandom()
00303 #define SRANDOM(x) ssrandom(x)
00304 extern void ssrandom ();
00305 extern long rrandom ();
00306 #endif
00307
00308 #if !defined(HAVE_RANDOM)
00309 extern void srandom ();
00310 extern long random ();
00311 #endif
00312
00313 #if (SIZEOF_LONG == 8)
00314 #define _64BIT
00315 #define LONG int
00316 #define U_LONG u_int
00317 #else
00318 #define LONG long
00319 #define U_LONG u_long
00320 #endif
00321
00322
00323
00324 #define NULLFILE "null"
00325
00326 #ifdef NEED_SYS_SELECT_H
00327 #define INC_SYS_SELECT <sys/select.h>
00328 #else
00329 #define INC_SYS_SELECT NULLFILE
00330 #endif
00331 #define SELECT select
00332
00333 #ifdef HAVE_UNISTD_H
00334 #define INC_UNISTD <unistd.h>
00335 #else
00336 #define INC_UNISTD NULLFILE
00337 #endif
00338
00339 #ifdef HAVE_SYS_SIGNAL_H
00340 #define INC_SYS_SIGNAL <sys/signal.h>
00341 #else
00342 #define INC_SYS_SIGNAL NULLFILE
00343 #endif
00344
00345 #ifdef HAVE_SYS_FCNTL_H
00346 #define INC_SYS_FCNTL <sys/fcntl.h>
00347 #else
00348 #define INC_SYS_FCNTL NULLFILE
00349 #endif
00350
00351 #ifndef VMS
00352 #ifdef HAVE_FCNTL_H
00353 #define INC_FCNTL <fcntl.h>
00354 #else
00355 #define INC_FCNTL NULLFILE
00356 #endif
00357 #else
00358 #define INC_FCNTL <file.h>
00359 #endif
00360
00361
00362
00363 #if defined(TM_IN_SYS_TIME) || defined(NEED_SYS_TIME_H)
00364 #define INC_SYS_TIME <sys/time.h>
00365 #else
00366 #define INC_SYS_TIME NULLFILE
00367 #endif
00368
00369 #ifdef HAVE_SYS_PTYIO_H
00370 #define INC_SYS_PTYIO <sys/ptyio.h>
00371 #else
00372 #define INC_SYS_PTYIO NULLFILE
00373 #endif
00374
00375 #ifdef HAVE_CTYPE_H
00376 #define INC_CTYPE <ctype.h>
00377 #else
00378 #define INC_CTYPE NULLFILE
00379 #endif
00380
00381 #ifdef HAVE_MACHINE_ENDIAN_H
00382 #define INC_MACHINE_ENDIAN <machine/endian.h>
00383 #else
00384 #define INC_MACHINE_ENDIAN NULLFILE
00385 #endif
00386
00387 #ifdef HAVE_SYS_RESOURCE_H
00388 #define INC_SYS_RESOURCE <sys/resource.h>
00389 #else
00390 #define INC_SYS_RESOURCE NULLFILE
00391 #endif
00392
00393 #ifdef HAVE_SYS_WAIT_H
00394 #define INC_SYS_WAIT <sys/wait.h>
00395 #else
00396 #define INC_SYS_WAIT NULLFILE
00397 #endif
00398
00399 #ifdef HAVE_NETINET_IN_H
00400 #define INC_NETINET_IN <netinet/in.h>
00401 #else
00402 #define INC_NETINET_IN NULLFILE
00403 #endif
00404
00405 #ifdef HAVE_NETINET_TCP_H
00406 #define INC_NETINET_TCP <netinet/tcp.h>
00407 #else
00408 #define INC_NETINET_TCP NULLFILE
00409 #endif
00410
00411
00412 #if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
00413 #define INC_SYS_TIMEB <sys/timeb.h>
00414 #else
00415 #define NOTIMEB
00416 #define INC_SYS_TIMEB <sys/time.h>
00417 #endif
00418
00419 #ifdef HAVE_GMP2_H
00420 #define INC_MP <gmp.h>
00421 #define MPTYPEDEF typedef mpz_t MPTYPE;
00422
00423 #define assignItom(x,i) {mpz_init(x); mpz_set_ui(x,i);}
00424 #define madd(x, y, z) mpz_add(z, x, y)
00425 #define msub(x, y, z) mpz_sub(z, x, y)
00426 #define mult(x, y, z) mpz_mul(z, x, y)
00427 #define mdiv(n, d, q, r) mpz_fdiv_qr(q, r, n, d)
00428 #define sdiv(n, d, q, r) *r = mpz_fdiv_q_ui(q, n, d)
00429 #define msqrt(x, y, z) mpz_sqrt(z, x, y)
00430 #define mp_pow(x, y, z, a) mpz_powm(a, x, y, z)
00431 #define gcd(x, y, z) mpz_gcd(z, x, y)
00432 #define mcmp(x, y) mpz_cmp(x, y)
00433 #define min(x) mpz_min(x)
00434 #define mout(x) mpz_mout(x)
00435 #define mfree(x) mpz_clear(x)
00436
00437 #else
00438 #define MPTYPEDEF typedef MINT *MPTYPE;
00439 #define assignItom(x,i) x= itom(i)
00440 #define mp_pow(x, y, z, a) pow(x, y, z, a)
00441 #define INC_MP <mp.h>
00442 #endif
00443
00444 #ifdef NO_PATH_MAX
00445 #define PATH_MAX 255
00446 #define INC_LIMITS NULLFILE
00447 #else
00448 #define INC_LIMITS <limits.h>
00449 #endif
00450
00451 #ifdef HAVE_XPM
00452 #ifdef HAVE_X11_XPM_H
00453 #define INC_XPM <X11/xpm.h>
00454 #else
00455 #define INC_XPM <xpm.h>
00456 #endif
00457 #else
00458 #define INC_XPM NULLFILE
00459 #endif
00460
00461
00462
00463 #ifdef linux
00464 #define SHMFLAG sizeof(struct memory)
00465 #else
00466 #define SHMFLAG 0
00467 #endif
00468
00469 #if defined(sun3)
00470 #define INC_STDLIB NULLFILE
00471 #else
00472 #define INC_STDLIB <stdlib.h>
00473 #endif
00474
00475 #ifndef sun4
00476 #if defined(HAVE_NINT) && defined(HAVE_MATH_H)
00477 #define INC_MATH <math.h>
00478 #else
00479 #if defined(NEED_RINT_DEC)
00480 extern double rint(double);
00481 #define INC_MATH NULLFILE
00482 #else
00483 #define INC_MATH <math.h>
00484 #endif
00485 #define nint(x) ((int) rint(x))
00486 #endif
00487 #endif
00488
00489 #ifdef VMS
00490 #define R_OK 04
00491 typedef unsigned short int ushort;
00492 #define Sin sinetable
00493 #define Cos cosinetable
00494 #define strncasecmp strncmp
00495 #include <socket.h>
00496 #include "vmsutils.h"
00497 #endif
00498
00499
00500
00501
00502
00503
00504
00505 #ifdef sun4
00506 #include <stdio.h>
00507 #include <sys/types.h>
00508 #include <sys/socket.h>
00509
00510 int close(int);
00511 int connect(int, struct sockaddr *, int);
00512 int fprintf(FILE *, const char *, ...);
00513 int fputs(char *, FILE *);
00514 char *memccpy(char *, char *, int, int);
00515 int perror(char *);
00516 int socket(int, int, int);
00517 int sscanf(char *, char *, ...);
00518 char *strdup(char *arg);
00519
00520 char _filbuf(FILE *);
00521 int _flsbuf(unsigned char, FILE *);
00522
00523 #endif
00524
00525 #ifdef WIN32
00526 typedef unsigned short int ushort;
00527 #define strncasecmp strncmp
00528 #ifdef THREADED
00529 #define THREAD(fn) { DWORD junk; CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)f
00530 #define ENDTHREAD ExitThread(0);
00531 typedef unsigned long int SEMAPHORE;
00532 #define CREATE_SEMAPHORE(initstate) CreateEvent(NULL, 1, initstate, NULL)
00533 #define SET_SEMAPHORE(sem) SetEvent((HANDLE)sem)
00534 #define RESET_SEMAPHORE(sem) ResetEvent((HANDLE)sem)
00535 #endif
00536 #endif
00537
00538 #ifdef _MSC_VER
00539 #define INC_STRINGS <ntstring.h>
00540 #define INC_IO <ntio.h>
00541 #else
00542 #define INC_IO NULLFILE
00543 #endif
00544
00545
00546
00547 #if defined(HAVE_SYS_FILIO_H)
00548 #define INC_SYS_FILIO <sys/filio.h>
00549 #else
00550 #define INC_SYS_FILIO NULLFILE
00551 #endif
00552
00553
00554
00555
00556 #endif