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