dccf2ee38b0d055ee9b55c5f01a2391ad597c997
[NeonServV5.git] / src / main.h
1 #ifndef _main_h
2 #define _main_h
3
4 #define NEONSERV_VERSION "5.0.1-dev"
5
6 #ifndef BOTWAR_ALERT_CHAN
7 #define BOTWAR_ALERT_CHAN NULL
8 #endif
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <ctype.h>
14 #ifdef WIN32
15 #include <windows.h>
16 #include <winsock2.h>
17 #else
18 #include <sys/types.h>
19 #include <sys/socket.h>
20 #include <netinet/in.h>
21 #include <arpa/inet.h>
22 #include <netdb.h>
23 #endif
24 #include <unistd.h>
25 #include <stdarg.h>
26 #include <time.h>
27
28 #if __GNUC__
29 #define PRINTF_LIKE(M,N) __attribute__((format (printf, M, N)))
30 #else
31 #define PRINTF_LIKE(M,N)
32 #endif
33
34 #if __GNUC__ >= 2
35 #define UNUSED_ARG(ARG) ARG __attribute__((unused))
36 #elif defined(S_SPLINT_S)
37 #define UNUSED_ARG(ARG) /*@unused@*/ ARG
38 #define const /*@observer@*/ /*@temp@*/
39 #else
40 #define UNUSED_ARG(ARG) ARG
41 #endif
42
43 #define STRINGIFY_(x) #x
44 #define STRINGIFY(x) STRINGIFY_(x)
45  
46 #if defined(__GNUC__)
47 #if defined(__GNUC_PATCHLEVEL__)
48 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__) "." STRINGIFY(__GNUC_PATCHLEVEL__)
49 #else
50 #define COMPILER "GCC" " " STRINGIFY(__GNUC__) "." STRINGIFY(__GNUC_MINOR__)
51 #endif
52 #elif defined (__IMAGECRAFT__)
53 #define COMPILER "ICCAVR"
54 #else
55 #define COMPILER "Unknown"
56 #endif
57
58 #define SOCKET_SELECT_TIME 2
59
60 #define NICKLEN         30
61 #define USERLEN         10
62 #define AUTHLEN         32
63 #define HOSTLEN         63
64 #define REALLEN         50
65 #define TOPICLEN        500
66 #define CHANNELLEN      200
67 #define MAXLEN          512
68 #define TRIGGERLEN      50
69 #define MAXNUMPARAMS    200 /* maximum number of parameters in one line */
70 #define MAXLANGUAGES    5
71 #define MAXMODES        6
72 #define INVITE_TIMEOUT  30
73 #define BOTWAR_DETECTION_TIME 7
74 #define BOTWAR_DETECTION_EVENTS 6
75
76 //valid nick chars
77 #define VALID_NICK_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890{|}~[\\]^-_`"
78 //the first char is a little bit different
79 //                              0        1         2         3         4         5          6
80 //                              1234567890123456789012345678901234567890123456789012345678 9012   62
81 #define VALID_NICK_CHARS_FIRST "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~[\\]^_`"
82 #define VALID_NICK_CHARS_FIRST_LEN 62
83
84 #define TEMPUSER_LIST_INDEX VALID_NICK_CHARS_FIRST_LEN
85
86 extern time_t start_time;
87
88 int stricmp (const char *s1, const char *s2);
89 int stricmplen (const char *s1, const char *s2, int len);
90
91 #endif