Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / ircd.h
1 /*
2  * ircd.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_ircd_h
7 #define INCLUDED_ircd_h
8 #ifndef INCLUDED_config_h
9 #include "config.h"
10 #endif
11 #ifndef INCLUDED_struct_h
12 #include "struct.h"           /* struct Client */
13 #endif
14 #ifndef INCLUDED_sys_types_h
15 #include <sys/types.h>        /* size_t, time_t */
16 #endif
17
18 struct Daemon
19 {
20   int          argc;
21   char**       argv;
22   pid_t        pid;
23   uid_t        uid;
24   uid_t        euid;
25   unsigned int bootopt;
26   int          running;
27   int          pid_fd;
28   const char*  server_bin;
29   const char*  server_root;
30   const char*  server_log;
31 };
32
33 /*
34  * Macros
35  */
36 #define TStime() (CurrentTime + TSoffset)
37 #define OLDEST_TS 780000000     /* Any TS older than this is bogus */
38 #define BadPtr(x) (!(x) || (*(x) == '\0'))
39
40 /* Miscellaneous defines */
41
42 #define UDP_PORT        "7007"
43 #define MINOR_PROTOCOL  "09"
44 #define MAJOR_PROTOCOL  "10"
45 #define BASE_VERSION    "u2.10"
46
47 /*
48  * Proto types
49  */
50 extern void server_die(const char* message);
51 extern void server_restart(const char* message);
52
53 extern struct Client  me;
54 extern time_t         CurrentTime;
55 extern struct Client* GlobalClientList;
56 extern time_t         TSoffset;
57 extern time_t         nextdnscheck;
58 extern time_t         nextconnect;
59 extern int            GlobalRehashFlag;      /* 1 if SIGHUP is received */
60 extern int            GlobalRestartFlag;     /* 1 if SIGINT is received */
61 extern time_t         nextping;
62 extern char*          configfile;
63 extern int            debuglevel;
64 extern char*          debugmode;
65
66 #endif /* INCLUDED_ircd_h */
67