/* config.h.  Generated automatically by configure.  */
/*
        Netrek Configuration file       -              by Kurt Siegl
*/

#ifndef __CONFIG_H
#define __CONFIG_H

/* 
################################################################################
	Type of code (select in configure.in)    
################################################################################
*/

/* #undef COW */
#define SERVER 1
#define TSANG_MODS

/* 
################################################################################
	All The fun defines      
################################################################################
*/

/*
   Defines
      Some possible values:
   NOTE: Only NON-system specific defines belong here
*/

/* 
   ------------------------------------------------------------
	 	Common defines
   ------------------------------------------------------------
*/


/*  	RSA 			- New RSA reserved packets stuff 		*/
/* #define RSA  		- Defined in the Makefile 			*/

#define RCD                     /* RCD             - Support Reciever variable
                                                     distresses */

                                /* PING            - Ping statistics */
#define PING

                                /* SHORT_PACKETS   - Reduce Network load */
#define SHORT_PACKETS

                                /* SPEEDUP         - Misc improvements to make
                                                     the code faster */
#define SPEEDUP

                                /* FEATURE_PACKETS - feature packets */
#define FEATURE_PACKETS

				/* DEBUG   	   - Various useful debugging 
						     stuff.  No signal trap */
/* #undef  DEBUG */

/* 
   ------------------------------------------------------------
	 	COW only defines
   ------------------------------------------------------------
*/
#ifdef COW

/*	NBT 			- Nick trown's macro code			*/
#define NBT

/*	MAXPLAYER		- Maximal number of players + observers 	*/
#define MAXPLAYER 36

/*	CORRUPTED_PACKETS 	- prevents some seg faults but verbose output	*/
#define CORRUPTED_PACKETS

/*	EXPIRE=#      		- number of days this version will work for	*/
#define EXPIRE 365

/*	ARMY_SLIDER   		- some sort of funky status window thing	*/
#define ARMY_SLIDER

/*	META          		- show active servers via metaserver - NBT	*/
#define META

/*	PACKET_LOG    		- log packets to stdout (for bandwith measurement) */
#define PACKET_LOG

/*	NEWMACRO 		- newmacro language				*/
#define NEWMACRO 

/*	SMARTMACRO 		- macro extension (needs NEWMACRO)		*/
#define SMARTMACRO

/*	MULTILINE_MACROS	- enables multiline macros			*/
#define MULTILINE_MACROS

/*	XTREKRC_HELP 		- Hadley's xtrekrc window (stolden by KP)	*/
#define XTREKRC_HELP

/*	TOOLS			- Various tools, like shell escape, ...		*/
#define TOOLS

/*	SOUND			- support of external sound players		*/
#define SOUND

/*      HOCKEY_LINES            - allow showing of hockey lines			*/
#define HOCKEY_LINES

/*	SMALL_SCREEN		- for 800x600 resolution screens		*/
/* #define SMALL_SCREEN */

/*	BEEPLITE		- player and planets highlighting		*/
#define BEEPLITE

/*	VSHIELD_BITMAPS		- damage dependent shields (hull)		*/
#define VSHIELD_BITMAPS
#define VARY_HULL 

/*      WARP_DEAD		- Use death detection
*/
/* #undef  WARP_DEAD */

/*    RCM                     	- Receiver configurable Server messages 	*/
#define RCM

/* 	RACE_COLORS		- additional bitplane for race colors		*/
#define RACE_COLORS


#define PLIST1 
#define PLIST 
#define CONTROL_KEY
#define BRMH 
#define DOC_WIN
#define RABBIT_EARS 
#define ROTATERACE

/* client options */
#define IGNORE_SIGNALS_SEGV_BUS
#define NEW_DASHBOARD_2
#define MOUSE_AS_SHIFT
#define SHIFTED_MOUSE
#define TNG_FED_BITMAPS
#define MOTION_MOUSE
#define DIST_KEY_NAME

#endif		/* COW */


/* 
   ------------------------------------------------------------
	 	SERVER only defines
   ------------------------------------------------------------
*/
#ifdef SERVER

                                /*  AUTOMOTD       - Updates your MOTD every
                                                     12 hours */
/* #undef AUTOMOTD */

                                /*  CHAIN_REACTION - Don't give credit for
                                                     chain reactions */
#if !defined (sgi) && !defined(Solaris)
#define CHAIN_REACTION
#endif

                                /*  CHECKMESG      - Check for god messages
                                                     and/or log all messages */
#define CHECKMESG

                                /*  ERIKPLAGUE     - Define for Erik's
                                                     Plagueing */
#define ERIKPLAGUE

                                /*  FEATURES       - Server/client
                                                     communication */
#define FEATURES

                                /*  FULL_HOSTNAMES - Show entire player
                                                     location (domain) */
#define FULL_HOSTNAMES

                                /*  INL_RESOURCES  - Use INL resources */
#define INL_RESOURCES

                                /*  INL_POP        - Use INL style planet
                                                     popping scheme */
#define INL_POP

                                /*  NO_PLANET_PLAGUE -Define for plagueing
                                                     (Don't use with
                                                     ERIKPLAGUE) */
/* #undef  NO_PLANET_PLAGUE */

                                /* NO_UNWARRING_BOMBING -No 3rd space bombing */
#define NO_UNWARRING_BOMBING

                                /* SHOW_RSA        - Display the client type
                                                     at login */
#define SHOW_RSA

                                /* RESETGALAXY     - Reset the galaxy after
                                                     each conquer */
#define RESETGALAXY

                                /* RESTRICT_BOMB   - No bombing out of t-mode */
#define RESTRICT_BOMB

                                /* SELF_RESET      - Galaxy will reset if the
                                                     daemon dies */
#define SELF_RESET

                                /* SHORT_THRESHOLD - For Short Packets */
#define SHORT_THRESHOLD

                                /* SURRENDER_SHORT - Cut surrender time in
                                                     half */
/* #undef  SURRENDER_SHORT */

                                /* TWO_RACE        - Conquer only a 1/4 of the
                                                     galaxy for reset */
#define TWO_RACE

                                /* SENDFLAGS       - Print flags set in MOTD */
/* #undef  SENDFLAGS */

                                /* CHECK_ENV       - Check environment variable                                                     NTSERV_PATH for location
                                                     of system files */
/* #undef  CHECK_ENV */

                                /* GPPRINT         - Print which path is being
                                                     used to find the system
                                                     files */
/* #undef  GPPRINT */

                                /* ONCHECK         - support for trekon player
                                                     check */
#define  ONCHECK

                                /* NBR             - Leave in for server. It
                                                     tells programs like xsg
                                                     that it is this code. */
#define NBR

                                /* DS              - Daemon Sychronization -
                                                     Tedd Hadley */
#define DS


                                /* NEED_EXIT       - For systems that need exit                                                     defined */
#define NEED_EXIT

                                /* SB_TRANSWARP    - starbase transwarp */
#define SB_TRANSWARP

                                /* FLAT_BONUS      - 3x bonus for killing last
                                                     army on a planet */
/* #undef FLAT_BONUS */

                                /* BASEPRACTICE    - trainingserver support */
#define BASEPRACTICE

                                /* NEW_CREDIT      - give 1 planet for
                                                     destroying, two planets
                                                     for taking.  Be sure to
						     scale your player
						     database's planet counts
						     by a factor of three -
						     running newscores as
						     compiled with a -DCONVERT
						     _once_ will do this
						     scaling for you */
/* #undef NEW_CREDIT */

                                /* FASTER_SB_MAXUPDATES - allow 10 ups/sec for
                                                           SB's */
#define FASTER_SB_MAXUPDATES

                                /* SBFUEL_FIX      - fix starbase re-fueling */
#define SBFUEL_FIX

                                /* NEW_ETEMP       - Wreck's etemp fix */
/* #undef NEW_ETEMP */

                                /* DOGFIGHT        - .sysdef interface
                                                   for dogfight robot */
#define DOGFIGHT

                                /* OBSERVERS       - allow players to watch */
#define OBSERVERS

                                /* VOTING          - allow voting mode */
#define VOTING

                                /* ALLOW_EJECT     - define to allow players to                                                     eject others*/
#ifdef VOTING
/* #undef ALLOW_EJECT */
#endif

                                /* NO_BRUTALITY    - disallow fighting between
                                                     waiting players in the
                                                     dogfighting mode */
#ifdef DOGFIGHT
#define NO_BRUTALITY
#endif

                                /* AS_CLOAK        - gives cloaked AS's more
                                                     randomness in their
                                                     apparent positions */
/* #undef AS_CLOAK */

                                /* GENO_COUNT      - keep track of a player's
                                                     winning genocides, see
						     tools/conq_vert.c for a
						     description of how to use
						     this define. */
/* #undef GENO_COUNT */

#ifdef VOTING
                                /* AUTO_INL        - starts up INL robot
                                                     by majority vote   */
#define AUTO_INL
                                /* AUTO_PRACTICE   - starts up PRACTICE robot
                                                     by majority vote   */
#ifdef BASEPRACTICE
#define AUTO_PRACTICE
#endif
                                /* AUTO_HOCKEY     - starts up HOCKEY robot
                                                     by majority vote   */
#define AUTO_HOCKEY
                                /* AUTO_DOGFIGHT   - starts up DOGFIGHT robot
                                                     by majority vote   */
#ifdef DOGFIGHT
#define AUTO_DOGFIGHT
#endif

                                /* TRIPLE_PLANET_MAYHEM - enable voting
                                for the three planet cool server idea
                                by felix@coop.com */
#define TRIPLE_PLANET_MAYHEM
#endif
                                /* MESSAGES_ALL_TIME - allow messaging during
                                freezes like twarp, refit, and war decl.  */
/* #undef MESSAGES_ALL_TIME */
				/* RANDOM_PRACTICE_ROBOT - Gives the practice
				robot (Hoser) the option of comming out in
				a random ship type. */
/* #undef RANDOM_PRACTICE_ROBOT */

#endif		/* SERVER */


/*
##############################################################################
       All system dependencies should be defined here 
##############################################################################
*/

#define NEED_EXIT

/* Automatic generated system dependend defines 			*/

/* #undef _ALL_SOURCES */
#define BSD_SIGNALS 1 
/* #undef SYSV_SIGNALS */ 
/* #undef POSIX_SIGNALS */
/* #undef RESTARTABLE_SYSCALLS */  
/* #undef NEED_MEMORY_H */ 
#define STDC_HEADERS 1 		/* 13/01/94 omit hosed index [007] */
#define HAVE_WAIT3 1 
/* #undef NEED_SYS_SELECT_H */ 
/* #undef NO_FD_SET */		/* Guess we suck badly if that happens :( */
#define HAVE_UNISTD_H 1 
#define HAVE_SYS_TIMEB_H 1
/* #undef TM_IN_SYS_TIME */ 
/* #undef TIME_WITH_SYS_TIME */
#define NEED_SYS_TIME_H 1 
/* #undef HAVE_SYS_PTYIO_H */ 
#define HAVE_SYS_FCNTL_H 1
#define HAVE_FCNTL_H 1
#define HAVE_CTYPE_H 1
/* #undef HAVE_MACHINE_ENDIAN_H */
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_NETINET_IN_H 1
/* #undef NO_U_INT */ 
#define SIZEOF_LONG 4
#define HAVE_USLEEP 1 
#define HAVE_SETSTATE 1
#define HAVE_RANDOM 1
#define HAVE_FTIME 1
/* #undef STRFTIME */
#define HAVE_NINT 1
/* #undef NEED_RINT_DEC */
#define RETSIGTYPE void
/* #undef pid_t */ 
/* #undef uid_t */ 
/* #undef gid_t */
/* #undef size_t */ 
/* #undef vfork */ 
#define NO_PATH_MAX 1
/* #undef inline */

#ifdef SERVER
#define LIBDIR "libdir"

/* System dependend programs */
#define UPTIME "/usr/ucb/uptime"
#define NETSTAT "nice -20 /usr/ucb/netstat -f inet"

/*  UDP connection timeout fix for SYSV machines */
#ifdef HAVE_UNISTD_H
#define UDP_FIX
#endif
#endif

/* System dependend macros						*/

/* SYSV signal handling */
#ifdef SYSV_SIGNALS
#include <signal.h>
#define SIGNAL(x,y)   sigset(x,y)
#define PAUSE(x)      sigpause(x)
#define SIGSETMASK(x) { }
#else
#define SIGNAL(x,y)   signal(x,y)
#define PAUSE(x)      pause()
#define SIGSETMASK(x) sigsetmask(x)
#endif

#ifdef POSIX_SIGNALS
#define HANDLE_SIG(s,h)	signal(s,h)
#else
#define HANDLE_SIG(s,h) {}
#endif

#ifdef STDC_HEADERS
#define INC_STRINGS	<string.h>
#else
#define INC_STRINGS	<strings.h>
#endif

#ifdef STDC_HEADERS
#define MCMP(x,y,z)     memcmp(x,y,z)
#define MCOPY(b1,b2,l)  memcpy(b2,b1,l)
#define MZERO(b1,l)     memset(b1,0,l)
#define INDEX(s,c)      strchr(s,c)
#define RINDEX(s,c)     strrchr(s,c)
#else
#define INDEX(s,c)	index(s,c)
#define RINDEX(s,c)	rindex(s,c) 
#define MCMP(x,y,z)     bcmp(x,y,z)
#define MCOPY(b1,b2,l)  bcopy(b1,b2,l)
#define MZERO(b1,l)     bzero(b1,l)
#endif

#ifdef SPEEDUP          /* strncpy is terrible slow */
#ifdef NEED_MEMORY_H
#include <memory.h>
#else
#include <string.h>
#endif
/* #define STRNCPY(x,y,z)	memcpy(x,y,z) */
#define STRNCPY(x,y,z)  memccpy(x,y,'\0',z) 
#else
#define STRNCPY(x,y,z)	strncpy(x,y,z)
#endif

#ifndef HAVE_WAIT3
#define WAIT3(x,y,z)  waitpid(-1, x, y ) 
#else
#define WAIT3(x,y,z)  wait3(x, y, z)
#endif

#if (defined(HAVE_RANDOM) && defined(HAVE_SETSTATE)) || !defined(HAVE_RANDOM)
#define RANDOM()        random()
#define SRANDOM(x)      srandom(x)
#else
#define RANDOM()        rrandom()
#define SRANDOM(x)      ssrandom(x)
extern void ssrandom ();
extern long rrandom ();
#endif

#if !defined(HAVE_RANDOM)
extern void srandom ();
extern long random ();
#endif

#if (SIZEOF_LONG == 8)
#define _64BIT
#define LONG int
#define U_LONG u_int
#else
#define LONG long
#define U_LONG u_long
#endif

/*	Some Server specific programs */
#ifdef SERVER

#include <sys/types.h>
/* SYSV Types */
#ifdef NO_U_INT
#define u_char unchar
#define u_int uint
#define u_long ulong
#define u_short ushort
#endif

#ifdef HAVE_UNISTD_H
#if defined (hpux)
#define SETPGRP()       setsid()
#else
#if defined (linux) || defined(sgi) || defined(Solaris)
#define SETPGRP()       setpgrp()
#else
#define SETPGRP()       setpgrp (0, 0)
#endif
#endif
#else
#define SETPGRP()       setpgrp (0, getpid())
#endif

#ifdef _SEQUENT_
#define PERMS O_RDWR | O_NOCTTY
#else
#define PERMS O_RDWR
#endif

#if defined(HAVE_UNISTD_H) && defined(TIOCTTY)
#define IOCTL(i) \
        int zero = 0;                           \
        (void) ioctl (i, TIOCTTY, &zero);
#else
#if defined(TIOCNOTTY)
#define IOCTL(i) \
        (void) ioctl (i, TIOCNOTTY, (char *) 0);
#else
#define IOCTL(i)
#endif
#endif

#define DETACH {\
    int i;                                                      \
    if ((i = open("/dev/tty", PERMS, 0)) >=0) {                 \
        IOCTL(i)                                                \
        (void) close (i);                                       \
    }                                                           \
    SETPGRP();                                                  \
    }

#ifdef HAVE_USLEEP
#define USLEEP(x)       usleep(x)
#else
#define USLEEP(x)       microsleep(x)           /* from util.c */
#endif

#if defined (SunOS)            /*  this core dumps with SIGSEGV on a sparc-10 */
#define LONGJMP(x,y)    return;
#else
#define LONGJMP(x,y)    longjmp(x,y);
#endif

#if defined (hpux)
#define PCLOSE(x)       fclose(x)
#else
#define PCLOSE(x)       pclose(x)
#endif

#if defined (__sequent__)
#define WAIT_TYPE    union wait
#define WSTOPSIG(foo)   0
#else
#define WAIT_TYPE int
#endif

#endif		/* SERVER programs */


/*  System dependend Include files */

#ifdef SERVER
#define NULLFILE		"../null"
#else
#define NULLFILE        	"null"
#endif

#ifdef NEED_SYS_SELECT_H
#define INC_SYS_SELECT 	<sys/select.h>
#ifdef SERVER
/* fd_set is used in data.h of the server */
#include <sys/select.h>
#endif
#else
#define INC_SYS_SELECT 	NULLFILE
#endif

#ifdef HAVE_UNISTD_H
#define INC_UNISTD      <unistd.h>
#else
#define INC_UNISTD      NULLFILE
#endif

#ifdef HAVE_SYS_FCNTL_H
#define INC_SYS_FCNTL   <sys/fcntl.h>
#else
#define INC_SYS_FCNTL   NULLFILE
#endif

#ifndef VMS
#ifdef HAVE_FCNTL_H
#define INC_FCNTL       <fcntl.h>
#else
#define INC_FCNTL       NULLFILE
#endif
#else
#define INC_FCNTL 	<file.h>
#endif


/* Some systems don't include <sys/time.h> in <time.h>  */
#if defined(TM_IN_SYS_TIME) || defined(NEED_SYS_TIME_H)
#define INC_SYS_TIME 	<sys/time.h>
#else
#define INC_SYS_TIME 	NULLFILE
#endif

#ifdef HAVE_SYS_PTYIO_H
#define INC_SYS_PTYIO 	<sys/ptyio.h>
#else
#define INC_SYS_PTYIO   NULLFILE
#endif

#ifdef HAVE_CTYPE_H
#define INC_CTYPE	<ctype.h>
#else
#define INC_CTYPE 	NULLFILE
#endif

#ifdef HAVE_MACHINE_ENDIAN_H
#define INC_MACHINE_ENDIAN <machine/endian.h>
#else
#define INC_MACHINE_ENDIAN NULLFILE
#endif

#ifdef HAVE_SYS_RESOURCE_H
#define INC_SYS_RESOURCE <sys/resource.h>
#else
#define INC_SYS_RESOURCE NULLFILE
#endif

#ifdef HAVE_SYS_WAIT_H
#define INC_SYS_WAIT 	<sys/wait.h>
#else
#define INC_SYS_WAIT 	NULLFILE
#endif
 
#if HAVE_NETINET_IN_H
#define INC_NETINET_IN 	<netinet/in.h>
#else
#define INC_NETINET_IN 	NULLFILE
#endif 

/* Replace outdated ftime with gettimeofday */
#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
#define INC_SYS_TIMEB   <sys/timeb.h>
#else
#define NOTIMEB
#define INC_SYS_TIMEB   <sys/time.h>
#endif

#ifdef NO_PATH_MAX
#define PATH_MAX 255
#define INC_LIMITS	NULLFILE
#else
#define INC_LIMITS	<limits.h>
#endif

/* Unchecked machine dependencies */

#ifdef linux
/* #define SIGBUS	SIGUNUSED 	Not required anymore */
#define SIGSYS		SIGUSR2
#endif

#ifdef linux
#define SHMFLAG         sizeof(struct memory)
#else
#define SHMFLAG         0
#endif

#ifdef sun3
#define INC_STDLIB 	NULLFILE
#else
#define INC_STDLIB	<stdlib.h>
#endif

#ifndef sun4
#ifdef HAVE_NINT
#define INC_MATH	<math.h>
#else
#ifdef NEED_RINT_DEC
extern double rint(double);
#define INC_MATH        NULLFILE
#else
#define INC_MATH        <math.h>
#endif
#define  nint(x) ((int) rint(x))
#endif
#endif

#ifdef VMS
#define  R_OK  04
typedef unsigned short int ushort;
#define Sin sinetable
#define Cos cosinetable
#define strncasecmp strncmp
#include <socket.h>    /* for struct timeval */
#include "vmsutils.h"  /* for typedef fd_set & FD_ macros */
#endif

/*
   Some systems, most notably SunOS 4.1.3, don't include function definitions
   in the libraries.  This results in some warning we don't want.
   This header defines the type for all these functions.
*/

#ifdef sun4
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>

int close(int);
int connect(int, struct sockaddr *, int);
int fprintf(FILE *, const char *, ...);
int fputs(char *, FILE *);
char *memccpy(char *, char *, int, int);
int perror(char *);
int socket(int, int, int);
int sscanf(char *, char *, ...);
char *strdup(char *arg);

char _filbuf(FILE *);
int _flsbuf(unsigned char, FILE *);

#endif /* defined sun4 */

#endif  /* __CONFIG_H */
