/** * common.h: Defines needed by multiple header files. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005-2006 Atheme Development Group * Rights to this code are as documented in doc/pod/license.pod. * * $Id: common.h,v 1.5 2007/09/16 18:54:42 pippijn Exp $ */ #ifndef COMMON_H #define COMMON_H /* D E F I N E S */ #define BUFSIZE 1024 /* maximum size of a buffer */ #define MAXMODES 4 #define MAX_EVENTS 1024 /* that's enough events, really! */ /* lengths of buffers (string length is 1 less) */ #define HOSTLEN 64 /* seems good enough */ #define NICKLEN 51 #define IDLEN 10 #define CHANNELLEN 201 #define USERLEN 11 #define HOSTIPLEN 54 #define GECOSLEN 51 #define KEYLEN 24 #define EMAILLEN 120 #define MEMOLEN 300 #define MAXMSIGNORES 40 /* H A S H */ #define HASHINIT 0x811c9dc5 #define HASHBITS 16 #define HASHSIZE (1 << HASHBITS) /* 2^16 = 65536 */ #undef DEBUG_BALLOC #ifdef DEBUG_BALLOC #define BALLOC_MAGIC 0x3d3a3c3d #endif #ifdef LARGE_NETWORK #define HEAP_NODE 1024 #define HEAP_CHANNEL 1024 #define HEAP_CHANUSER 1024 #define HEAP_USER 1024 #define HEAP_SERVER 16 #define HEAP_CHANACS 1024 #define HASH_USER 65535 #define HASH_CHANNEL 32768 #define HASH_SERVER 128 #else #define HEAP_NODE 1024 #define HEAP_CHANNEL 64 #define HEAP_CHANUSER 128 #define HEAP_USER 128 #define HEAP_SERVER 8 #define HEAP_CHANACS 128 #define HASH_USER 1024 #define HASH_CHANNEL 512 #define HASH_SERVER 32 #endif #define HASH_COMMAND 256 #define HASH_SMALL 32 #define HASH_ITRANS 128 #define HASH_TRANS 2048 #define CACHEFILE_HEAP_SIZE 32 #define CACHELINE_HEAP_SIZE 64 namespace fault { enum code { ok = 0, needmoreparams = 1, badparams = 2, nosuch_source = 3, nosuch_target = 4, authfail = 5, noprivs = 6, nosuch_key = 7, alreadyexists = 8, toomany = 9, emailfail = 10, notverified = 11, nochange = 12, already_authed = 13, unimplemented = 14, failed = 15 }; } #endif