]> jfr.im git - irc/rqf/shadowircd.git/blame - include/ircd_defs.h
SVN Id removal part two
[irc/rqf/shadowircd.git] / include / ircd_defs.h
CommitLineData
212380e3 1/*
2 * charybdis: An advanced IRCd.
3 * ircd_defs.h: A header for ircd global definitions.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
8 * Copyright (C) 2005-2006 Charybdis development team
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 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
212380e3 25 */
26
27/*
28 * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
29 * Otherwise there are no user servicable part here.
30 *
31 */
4a8fab1f 32
33/* ircd_defs.h - Global size definitions for record entries used
34 * througout ircd. Please think 3 times before adding anything to this
35 * file.
36 */
212380e3 37#ifndef INCLUDED_ircd_defs_h
38#define INCLUDED_ircd_defs_h
39
40#include "config.h"
41
42/* For those unfamiliar with GNU format attributes, a is the 1 based
43 * argument number of the format string, and b is the 1 based argument
44 * number of the variadic ... */
45#ifdef __GNUC__
46#define AFP(a,b) __attribute__((format (printf, a, b)))
47#else
48#define AFP(a,b)
49#endif
50
4a8fab1f 51/*
52 * This ensures that __attribute__((deprecated)) is not used in for example
53 * sun CC, since it's a GNU-specific extension. -nenolod
54 */
55#ifdef __GNUC__
56#define IRC_DEPRECATED __attribute__((deprecated))
57#else
58#define IRC_DEPRECATED
59#endif
212380e3 60
d3455e2c 61#include "logger.h"
212380e3 62#include "send.h"
63
64#ifdef SOFT_ASSERT
65#ifdef __GNUC__
66#define s_assert(expr) do \
67 if(!(expr)) { \
68 ilog(L_MAIN, \
69 "file: %s line: %d (%s): Assertion failed: (%s)", \
70 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
71 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
72 "file: %s line: %d (%s): Assertion failed: (%s)", \
73 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
74 } \
75 while(0)
76#else
77#define s_assert(expr) do \
78 if(!(expr)) { \
79 ilog(L_MAIN, \
80 "file: %s line: %d: Assertion failed: (%s)", \
81 __FILE__, __LINE__, #expr); \
82 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
83 "file: %s line: %d: Assertion failed: (%s)" \
84 __FILE__, __LINE__, #expr); \
85 } \
86 while(0)
87#endif
88#else
89#define s_assert(expr) assert(expr)
90#endif
91
92#if !defined(CONFIG_RATBOX_LEVEL_1)
93# error Incorrect config.h for this revision of ircd.
94#endif
95
212380e3 96#define HOSTLEN 63 /* Length of hostname. Updated to */
97 /* comply with RFC1123 */
98
99#define USERLEN 10
100#define REALLEN 50
101#define CHANNELLEN 200
102#define LOC_CHANNELLEN 50
103
104/* reason length of klines, parts, quits etc */
61569b65 105/* for quit messages, note that a client exit server notice
106 * :012345678901234567890123456789012345678901234567890123456789123 NOTICE * :*** Notice -- Client exiting: 012345678901234567 (0123456789@012345678901234567890123456789012345678901234567890123456789123) [] [1111:2222:3333:4444:5555:6666:7777:8888]
107 * takes at most 246 bytes (including CRLF and '\0') and together with the
108 * quit reason should fit in 512 */
109#define REASONLEN 260 /* kick/part/quit */
d5a432fa 110#define BANREASONLEN 390 /* kline/dline */
61569b65 111#define AWAYLEN TOPICLEN
112#define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */
212380e3 113
114/* 23+1 for \0 */
115#define KEYLEN 24
116#define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */
83ad8add 117#define OPERNICKLEN (NICKLEN*2) /* Length of OPERNICKs. */
212380e3 118
119#define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5)
120#define MAX_DATE_STRING 32 /* maximum string length for a date string */
121
122#define HELPLEN 400
123
124/*
125 * message return values
126 */
127#define CLIENT_EXITED -2
128#define CLIENT_PARSE_ERROR -1
129#define CLIENT_OK 1
130
2c2e0aa9 131#ifdef RB_IPV6
212380e3 132#ifndef AF_INET6
133#error "AF_INET6 not defined"
134#endif
135
136
2c2e0aa9 137#else /* #ifdef RB_IPV6 */
212380e3 138
139#ifndef AF_INET6
140#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
141#endif
2c2e0aa9 142#endif /* #ifdef RB_IPV6 */
212380e3 143
2c2e0aa9 144#ifdef RB_IPV6
212380e3 145#define PATRICIA_BITS 128
146#else
147#define PATRICIA_BITS 32
148#endif
149
212380e3 150#endif /* INCLUDED_ircd_defs_h */