- The big forward port. I probably broke lots of stuff, so please look over any
[ircu2.10.12-pk.git] / include / ircd.h
index e62ea9dd87bf5499291e9799bbadbaaca8ff3047..bca996f6c4cf0ce6751a26156d0356cf64389ef3 100644 (file)
@@ -1,55 +1,66 @@
-#ifndef IRCD_H
-#define IRCD_H
-
-/*=============================================================================
- * Macro's
+/*
+ * ircd.h
+ *
+ * $Id$
  */
+#ifndef INCLUDED_ircd_h
+#define INCLUDED_ircd_h
+#ifndef INCLUDED_struct_h
+#include "struct.h"           /* struct Client */
+#endif
+#ifndef INCLUDED_sys_types_h
+#include <sys/types.h>        /* size_t, time_t */
+#endif
 
-#define TStime() (now + TSoffset)
+struct Daemon
+{
+  int          argc;
+  char**       argv;
+  pid_t        pid;
+  uid_t        uid;
+  uid_t        euid;
+  unsigned int bootopt;
+  int          running;
+  int          pid_fd;
+  const char*  server_bin;
+  const char*  server_root;
+  const char*  server_log;
+};
+
+/*
+ * Macros
+ */
+#define TStime() (CurrentTime + TSoffset)
+#define OLDEST_TS 780000000    /* Any TS older than this is bogus */
 #define BadPtr(x) (!(x) || (*(x) == '\0'))
 
 /* Miscellaneous defines */
 
-#define UDP_PORT       "7007"
-#define MINOR_PROTOCOL "09"
-#define MAJOR_PROTOCOL "10"
-#define BASE_VERSION   "u2.10"
+#define UDP_PORT        "7007"
+#define MINOR_PROTOCOL  "09"
+#define MAJOR_PROTOCOL  "10"
+#define BASE_VERSION    "u2.10"
 
-/* Flags for bootup options (command line flags) */
-
-#define BOOT_CONSOLE   1
-#define BOOT_QUICK     2
-#define BOOT_DEBUG     4
-#define BOOT_INETD     8
-#define BOOT_TTY       16
-#define BOOT_OPER      32
-#define BOOT_AUTODIE   64
-
-/*=============================================================================
+/*
  * Proto types
  */
+extern void server_die(const char* message);
+extern void server_panic(const char* message);
+extern void server_restart(const char* message);
+
+extern struct Client  me;
+extern time_t         CurrentTime;
+extern struct Client* GlobalClientList;
+extern time_t         TSoffset;
+extern time_t         nextdnscheck;
+extern time_t         nextconnect;
+extern int            GlobalRehashFlag;      /* 1 if SIGHUP is received */
+extern int            GlobalRestartFlag;     /* 1 if SIGINT is received */
+extern time_t         nextping;
+extern char*          configfile;
+extern int            debuglevel;
+extern char*          debugmode;
+extern int           running;
+
+#endif /* INCLUDED_ircd_h */
 
-#ifdef PROFIL
-extern RETSIGTYPE s_monitor(HANDLER_ARG(int sig));
-#endif
-extern RETSIGTYPE s_die(HANDLER_ARG(int sig));
-extern RETSIGTYPE s_restart(HANDLER_ARG(int sig));
-
-extern void restart(char *mesg);
-extern void server_reboot(void);
-
-extern aClient me;
-extern time_t now;
-extern aClient *client;
-extern time_t TSoffset;
-extern unsigned int bootopt;
-extern time_t nextdnscheck;
-extern time_t nextconnect;
-extern int dorehash;
-extern time_t nextping;
-extern unsigned short int portnum;
-extern char *configfile;
-extern int debuglevel;
-extern char *debugmode;
-
-#endif /* IRCD_H */