1 |
/* |
2 |
* Copyright © 2005-2006 Atheme Development Group |
3 |
* Rights to this code are as documented in doc/pod/license.pod. |
4 |
* |
5 |
* Defines needed by multiple header files. |
6 |
* |
7 |
* $Id: common.h,v 1.3 2007-08-28 17:08:06 pippijn Exp $ |
8 |
*/ |
9 |
|
10 |
#ifndef COMMON_H |
11 |
#define COMMON_H |
12 |
|
13 |
/* D E F I N E S */ |
14 |
#define BUFSIZE 1024 /* maximum size of a buffer */ |
15 |
#define MAXMODES 4 |
16 |
#define MAX_EVENTS 1024 /* that's enough events, really! */ |
17 |
|
18 |
/* lengths of buffers (string length is 1 less) */ |
19 |
#define HOSTLEN 64 /* seems good enough */ |
20 |
#define NICKLEN 51 |
21 |
#define IDLEN 10 |
22 |
#define CHANNELLEN 201 |
23 |
#define USERLEN 11 |
24 |
#define HOSTIPLEN 54 |
25 |
#define GECOSLEN 51 |
26 |
#define KEYLEN 24 |
27 |
#define EMAILLEN 120 |
28 |
#define MEMOLEN 300 |
29 |
|
30 |
#define MAXMSIGNORES 40 |
31 |
|
32 |
/* H A S H */ |
33 |
#define HASHINIT 0x811c9dc5 |
34 |
#define HASHBITS 16 |
35 |
#define HASHSIZE (1 << HASHBITS) /* 2^16 = 65536 */ |
36 |
|
37 |
#undef DEBUG_BALLOC |
38 |
|
39 |
#ifdef DEBUG_BALLOC |
40 |
#define BALLOC_MAGIC 0x3d3a3c3d |
41 |
#endif |
42 |
|
43 |
#ifdef LARGE_NETWORK |
44 |
#define HEAP_NODE 1024 |
45 |
#define HEAP_CHANNEL 1024 |
46 |
#define HEAP_CHANUSER 1024 |
47 |
#define HEAP_USER 1024 |
48 |
#define HEAP_SERVER 16 |
49 |
#define HEAP_CHANACS 1024 |
50 |
#define HASH_USER 65535 |
51 |
#define HASH_CHANNEL 32768 |
52 |
#define HASH_SERVER 128 |
53 |
#else |
54 |
#define HEAP_NODE 1024 |
55 |
#define HEAP_CHANNEL 64 |
56 |
#define HEAP_CHANUSER 128 |
57 |
#define HEAP_USER 128 |
58 |
#define HEAP_SERVER 8 |
59 |
#define HEAP_CHANACS 128 |
60 |
#define HASH_USER 1024 |
61 |
#define HASH_CHANNEL 512 |
62 |
#define HASH_SERVER 32 |
63 |
#endif |
64 |
|
65 |
#define HASH_COMMAND 256 |
66 |
#define HASH_SMALL 32 |
67 |
#define HASH_ITRANS 128 |
68 |
#define HASH_TRANS 2048 |
69 |
|
70 |
#define CACHEFILE_HEAP_SIZE 32 |
71 |
#define CACHELINE_HEAP_SIZE 64 |
72 |
|
73 |
namespace fault |
74 |
{ |
75 |
enum code |
76 |
{ |
77 |
ok = 0, |
78 |
needmoreparams = 1, |
79 |
badparams = 2, |
80 |
nosuch_source = 3, |
81 |
nosuch_target = 4, |
82 |
authfail = 5, |
83 |
noprivs = 6, |
84 |
nosuch_key = 7, |
85 |
alreadyexists = 8, |
86 |
toomany = 9, |
87 |
emailfail = 10, |
88 |
notverified = 11, |
89 |
nochange = 12, |
90 |
already_authed = 13, |
91 |
unimplemented = 14, |
92 |
failed = 15 |
93 |
}; |
94 |
} |
95 |
|
96 |
#endif |