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