changed version numbering a little bit (3th path is now the commit count)
[NeonServV5.git] / src / main.h
1 /* main.h - NeonServ v5.1
2  * Copyright (C) 2011  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License 
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
16  */
17 #ifndef _main_h
18 #define _main_h
19
20 #define NEONSERV_VERSION "5.1"
21 #define VERSION_PATCHLEVEL 352
22
23 #ifndef BOTWAR_ALERT_CHAN
24 #define BOTWAR_ALERT_CHAN NULL
25 #endif
26
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <ctype.h>
31 #ifdef WIN32
32 #include <windows.h>
33 #include <winsock2.h>
34 #else
35 #include <sys/types.h>
36 #include <sys/socket.h>
37 #include <netinet/in.h>
38 #include <arpa/inet.h>
39 #include <netdb.h>
40 #endif
41 #include <unistd.h>
42 #include <stdarg.h>
43 #include <time.h>
44
45 #if __GNUC__
46 #define PRINTF_LIKE(M,N) __attribute__((format (printf, M, N)))
47 #else
48 #define PRINTF_LIKE(M,N)
49 #endif
50
51 #if __GNUC__ >= 2
52 #define UNUSED_ARG(ARG) ARG __attribute__((unused))
53 #elif defined(S_SPLINT_S)
54 #define UNUSED_ARG(ARG) /*@unused@*/ ARG
55 #define const /*@observer@*/ /*@temp@*/
56 #else
57 #define UNUSED_ARG(ARG) ARG
58 #endif
59
60 #define STRINGIFY_(x) #x
61 #define STRINGIFY(x) STRINGIFY_(x)
62  
63 #if defined(__GNUC__)
64 #if defined(__GNUC_PATCHLEVEL__)
65 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__) "." STRINGIFY(__GNUC_PATCHLEVEL__)
66 #else
67 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__)
68 #endif
69 #elif defined (__IMAGECRAFT__)
70 #define COMPILER "ICCAVR"
71 #else
72 #define COMPILER "Unknown"
73 #endif
74
75 #define SOCKET_SELECT_TIME 2
76
77 #define NICKLEN         30
78 #define USERLEN         10
79 #define AUTHLEN         32
80 #define HOSTLEN         63
81 #define REALLEN         50
82 #define TOPICLEN        500
83 #define CHANNELLEN      200
84 #define MAXLEN          512
85 #define TRIGGERLEN      50
86 #define MAXNUMPARAMS    200 /* maximum number of parameters in one line */
87 #define MAXLANGUAGES    5
88 #define MAXMODES        6
89 #define INVITE_TIMEOUT  30
90 #define BOTWAR_DETECTION_TIME 7
91 #define BOTWAR_DETECTION_EVENTS 6
92
93 //valid nick chars
94 #define VALID_NICK_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890{|}~[\\]^-_`"
95 //the first char is a little bit different
96 //                              0        1         2         3         4         5          6
97 //                              1234567890123456789012345678901234567890123456789012345678 9012   62
98 #define VALID_NICK_CHARS_FIRST "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~[\\]^_`"
99 #define VALID_NICK_CHARS_FIRST_LEN 62
100
101 #define TEMPUSER_LIST_INDEX VALID_NICK_CHARS_FIRST_LEN
102
103 extern time_t start_time;
104
105 int stricmp (const char *s1, const char *s2);
106 int stricmplen (const char *s1, const char *s2, int len);
107
108 #endif