ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/common.h
Revision: 1.2
Committed: Sat Jul 21 01:29:07 2007 UTC (16 years, 10 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +2 -2 lines
Log Message:
- moved to new documentation system
- fixed small build error

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005-2006 Atheme Development Group
3 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * Defines needed by multiple header files.
6     *
7 pippijn 1.2 * $Id: common.h,v 1.1 2007-07-19 08:24:50 pippijn Exp $
8 pippijn 1.1 */
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     enum faultcode_t
74     {
75     fault_needmoreparams = 1,
76     fault_badparams = 2,
77     fault_nosuch_source = 3,
78     fault_nosuch_target = 4,
79     fault_authfail = 5,
80     fault_noprivs = 6,
81     fault_nosuch_key = 7,
82     fault_alreadyexists = 8,
83     fault_toomany = 9,
84     fault_emailfail = 10,
85     fault_notverified = 11,
86     fault_nochange = 12,
87     fault_already_authed = 13,
88     fault_unimplemented = 14
89     };
90    
91     #endif