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