bf72d283d5dd345a76771d234ba4045f5ec60a5e
[NeonServV5.git] / main.h
1 #ifndef _main_h
2 #define _main_h
3
4 #include "config.h"
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <ctype.h>
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/in.h>
13 #include <arpa/inet.h>
14 #include <unistd.h>
15 #include <netdb.h>
16 #include <stdarg.h>
17 #include <time.h>
18
19 #if __GNUC__
20 #define PRINTF_LIKE(M,N) __attribute__((format (printf, M, N)))
21 #else
22 #define PRINTF_LIKE(M,N)
23 #endif
24
25 #if __GNUC__ >= 2
26 #define UNUSED_ARG(ARG) ARG __attribute__((unused))
27 #elif defined(S_SPLINT_S)
28 #define UNUSED_ARG(ARG) /*@unused@*/ ARG
29 #define const /*@observer@*/ /*@temp@*/
30 #else
31 #define UNUSED_ARG(ARG) ARG
32 #endif
33
34 #define SOCKET_SELECT_TIME 2
35
36 #define NICKLEN         30
37 #define USERLEN         10
38 #define AUTHLEN         32
39 #define HOSTLEN         63
40 #define REALLEN         50
41 #define TOPICLEN        500
42 #define CHANNELLEN      200
43 #define MAXLEN          512
44 #define TRIGGERLEN      50
45 #define MAXNUMPARAMS    200 /* maximum number of parameters in one line */
46 #define MAXLANGUAGES    5
47 #define MAXMODES        6
48
49 //valid nick chars
50 #define VALID_NICK_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890{|}~[\\]^_`"
51 //the first char is a little bit different
52 //                              0        1         2         3         4         5          6
53 //                              1234567890123456789012345678901234567890123456789012345678 9012   62
54 #define VALID_NICK_CHARS_FIRST "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~[\\]^_`"
55 #define VALID_NICK_CHARS_FIRST_LEN 62
56
57 #define TEMPUSER_LIST_INDEX VALID_NICK_CHARS_FIRST_LEN
58
59 extern time_t start_time;
60
61 int stricmp (const char *s1, const char *s2);
62 int stricmplen (const char *s1, const char *s2, int len);
63
64 #endif