Remove spy hooks.
[seven.git] / include / ircd_defs.h
blobde4c54cdc5ffce63d2c63a67510f98eeb45f77d6
1 /* {{{ irc-seven: Cows like it.
3 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center.
4 * Copyright (C) 1996-2002 Hybrid Development Team.
5 * Copyright (C) 2002-2004 ircd-ratbox development team.
6 * Copyright (C) 2005-2006 Charybdis development team.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
21 * Free Software Foundation, Inc.
22 * 51 Franklin St - Fifth Floor
23 * Boston, MA 02110-1301
24 * USA
26 * }}} */
29 * ircd_defs.h - Global size definitions for record entries used
30 * througout ircd-seven. Please think 3 times before adding anything
31 * to this file.
34 #ifndef _SEVEN_IRCD_DEFS_H
35 # define _SEVEN_IRCD_DEFS_H
37 # include "config.h"
39 # ifdef __GNUC__
40 # define AFP(a, b) __attribute__((format(printf, a, b)))
41 # else
42 # define AFP(a, b)
43 # endif
45 # include "s_log.h"
46 # include "send.h"
48 /* {{{ #define s_assert(expr) */
49 # ifdef SOFT_ASSERT
50 # ifdef __GNUC__
51 # define s_assert(expr) \
52 do \
53 { \
54 if (!(expr)) \
55 { \
56 ilog(L_MAIN, \
57 "file: %s line: %d (%s): Assertion failed: (%s)", \
58 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
59 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
60 "file: %s line: %d (%s): Assertion failed: (%s)", \
61 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
62 } \
63 } \
64 while(0)
65 # else
66 # define s_assert(expr) \
67 do \
68 { \
69 if (!(expr)) \
70 { \
71 ilog(L_MAIN, \
72 "file: %s line: %d (%s): Assertion failed: (%s)", \
73 __FILE__, __LINE__, __FUNCTION__, #expr); \
74 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
75 "file: %s line: %d (%s): Assertion failed: (%s)", \
76 __FILE__, __LINE__, __FUNCTION__, #expr); \
77 } \
78 } \
79 while(0)
80 # endif
81 # else
82 # define s_assert(expr) assert(expr)
83 # endif
84 /* }}} */
86 # if !defined(CONFIG_RATBOX_LEVEL_1)
87 # error Incorrect config.h for this revision of ircd.
88 # endif
91 * This defines the version of the data structures used in the ircd.
92 * In the event of a mismatch (i.e. this is incremented due to a major
93 * change that cannot be accomidated for in the ircd), then a hard
94 * restart occurs.
96 # define SEVEN_DV 0x00000900 /* 0.9.0 */
99 * Change the below definition of BUFSIZE and expect bad things to happen...
101 # define BUFSIZE 512
103 # define HOSTLEN 63
104 # define USERLEN 10
105 # define REALLEN 50
106 # define CHANNELLEN 200
107 # define LOC_CHANNELLEN 50
109 /* reason length of klines, parts, quits etc */
110 # define REASONLEN TOPICLEN
111 # define AWAYLEN TOPICLEN
112 # define KILLLEN TOPICLEN
114 # define KEYLEN 24
115 # define MAXRECIPIENTS 20
116 # define MAXBANLENGTH 1024
117 # define OPERNICKLEN (NICKLEN * 2)
119 # define USERHOST_REPLYLEN (NICKLEN + HOSTLEN + USERLEN + 5)
120 # define MAX_DATE_STRING 32 /* maximum length for a date string. */
122 # define HELPLEN 400
123 # define IDPREFIXLEN 3
126 * message return values
128 # define CLIENT_EXITED (-2)
129 # define CLIENT_PARSE_ERROR (-1)
130 # define CLIENT_OK (1)
132 # ifdef IPV6
133 # ifndef AF_INET6
134 # error "AF_INET6 not defined"
135 # endif
136 # else /* #ifdef IPV6 */
137 # ifndef AF_INET6
138 # define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
139 # endif
140 # endif /* #ifdef IPV6 */
142 # ifdef IPV6
143 # define PATRICIA_BITS 128
144 # define irc_sockaddr_storage sockaddr_storage
145 # else
146 # define PATRICIA_BITS 32
147 # define irc_sockaddr_storage sockaddr
148 # define ss_family sa_family
149 # ifdef SOCKADDR_IN_HAS_LEN
150 # define ss_len sa_len
151 # endif
152 # endif
154 # ifdef SOCKADDR_IN_HAS_LEN
155 # define SET_SS_LEN(x, y) (x).ss_len = (y)
156 # define GET_SS_LEN(x) x.ss_len
157 # else
158 # define SET_SS_LEN(x, y)
159 # ifdef IPV6
160 # define GET_SS_LEN(x) x.ss_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)
161 # else
162 # define GET_SS_LEN(x) sizeof(struct sockaddr_in)
163 # endif
164 # endif
166 #endif /* ! _SEVEN_IRCD_DEFS_H */
169 * vim: ts=8 sw=8 noet fdm=marker tw=80