+extern void mem_dbg_initialise(void);
+
+/*----------------------------------------------------------------------------
+ * Constants / Enums
+ *--------------------------------------------------------------------------*/
+enum {
+ BOOT_DEBUG = 1, /**< Enable debug output. */
+ BOOT_TTY = 2, /**< Stay connected to TTY. */
+ BOOT_CHKCONF = 4 /**< Exit after reading configuration file. */
+};
+
+
+/*----------------------------------------------------------------------------
+ * Global data (YUCK!)
+ *--------------------------------------------------------------------------*/
+struct Client me; /**< That's me */
+struct Connection me_con; /**< That's me too */
+struct Client *GlobalClientList = &me; /**< Pointer to beginning of
+ Client list */
+time_t TSoffset = 0; /**< Offset of timestamps to system clock */
+int GlobalRehashFlag = 0; /**< do a rehash if set */
+int GlobalRestartFlag = 0; /**< do a restart if set */
+time_t CurrentTime; /**< Updated every time we leave select() */
+
+char *configfile = CPATH; /**< Server configuration file */
+int debuglevel = -1; /**< Server debug level */
+char *debugmode = ""; /**< Server debug level */
+static char *dpath = DPATH; /**< Working directory for daemon */
+static char *dbg_client; /**< Client specifier for chkconf */
+
+static struct Timer connect_timer; /**< timer structure for try_connections() */
+static struct Timer ping_timer; /**< timer structure for check_pings() */
+static struct Timer destruct_event_timer; /**< timer structure for exec_expired_destruct_events() */
+
+/** Daemon information. */
+static struct Daemon thisServer = { 0, 0, 0, 0, 0, 0, -1 };
+
+/** Non-zero until we want to exit. */
+int running = 1;
+
+
+/*----------------------------------------------------------------------------
+ * API: server_die
+ *--------------------------------------------------------------------------*/
+/** Terminate the server with a message.
+ * @param[in] message Message to log and send to operators.
+ */
+void server_die(const char *message)
+{
+ /* log_write will send out message to both log file and as server notice */
+ log_write(LS_SYSTEM, L_CRIT, 0, "Server terminating: %s", message);
+ flush_connections(0);
+ close_connections(1);
+ running = 0;
+}