Author: Bleep <tomh@inxpress.net>
[ircu2.10.12-pk.git] / include / sys.h
1 /*
2  * IRC - Internet Relay Chat, include/sys.h
3  * Copyright (C) 1990 University of Oulu, Computing Center
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 1, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * $Id$
20  */
21 #ifndef INCLUDED_sys_h
22 #define INCLUDED_sys_h
23 #ifndef INCLUDED_config_h
24 #include "config.h"
25 #endif
26
27 #if WORDS_BIGENDIAN
28 # define BIT_ZERO_ON_LEFT
29 #else
30 # define BIT_ZERO_ON_RIGHT
31 #endif
32
33 #define HAVE_RELIABLE_SIGNALS
34
35 /*
36  * safety margin so we can always have one spare fd, for motd/authd or
37  * whatever else.  -24 allows "safety" margin of 10 listen ports, 8 servers
38  * and space reserved for logfiles, DNS sockets and identd sockets etc.
39  */
40 #define MAXCLIENTS      (MAXCONNECTIONS-24)
41
42 #ifdef HAVECURSES
43 #define DOCURSES
44 #else
45 #undef DOCURSES
46 #endif
47
48 #ifdef HAVETERMCAP
49 #define DOTERMCAP
50 #else
51 #undef DOTERMCAP
52 #endif
53
54 #if defined(CLIENT_FLOOD)
55 #if (CLIENT_FLOOD > 8000) || (CLIENT_FLOOD < 512)
56 #error CLIENT_FLOOD needs redefining.
57 #endif
58 #else
59 #error CLIENT_FLOOD undefined
60 #endif
61
62 #ifndef CONFIG_SETUGID
63 #undef IRC_UID
64 #undef IRC_GID
65 #endif
66
67 /* Define FD_SETSIZE to what we want before including sys/types.h on BSD */
68 #if  defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
69 #if ((!defined(USE_POLL)) && (!defined(FD_SETSIZE)))
70 #define FD_SETSIZE ((MAXCONNECTIONS)+4)
71 #endif
72 #endif
73
74 #define LIMIT_FMT "%d"
75
76 #define IRCD_MAX(a, b)  ((a) > (b) ? (a) : (b))
77 #define IRCD_MIN(a, b)  ((a) < (b) ? (a) : (b))
78
79 #ifndef FALSE
80 #define FALSE 0
81 #endif
82 #ifndef TRUE
83 #define TRUE  1
84 #endif
85
86 #endif /* INCLUDED_sys_h */