ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/common.h
Revision: 1.3
Committed: Tue Aug 28 17:08:06 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +5 -3 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 /*
2 pippijn 1.3 * 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.3 * $Id: common.h,v 1.2 2007-07-21 01:29:07 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 pippijn 1.3 fault_ok = 0,
76 pippijn 1.1 fault_needmoreparams = 1,
77     fault_badparams = 2,
78     fault_nosuch_source = 3,
79     fault_nosuch_target = 4,
80     fault_authfail = 5,
81     fault_noprivs = 6,
82     fault_nosuch_key = 7,
83     fault_alreadyexists = 8,
84     fault_toomany = 9,
85     fault_emailfail = 10,
86     fault_notverified = 11,
87     fault_nochange = 12,
88     fault_already_authed = 13,
89 pippijn 1.3 fault_unimplemented = 14,
90     fault_failed = 15
91 pippijn 1.1 };
92    
93     #endif