+static void
+ircd_log_cb(const char *str)
+{
+ ilog(L_MAIN, "libratbox reports: %s", str);
+}
+
+static void
+ircd_restart_cb(const char *str)
+{
+ inotice("libratbox has called the restart callback: %s", str);
+ restart(str);
+}
+
+/*
+ * Why EXIT_FAILURE here?
+ * Because if ircd_die_cb() is called it's because of a fatal
+ * error inside libcharybdis, and we don't know how to handle the
+ * exception, so it is logical to return a FAILURE exit code here.
+ * --nenolod
+ */
+static void
+ircd_die_cb(const char *str)
+{
+ if(str != NULL)
+ {
+ /* Try to get the message out to currently logged in operators. */
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "libratbox has called the die callback..aborting: %s", str);
+ inotice("libratbox has called the die callback..aborting: %s", str);
+ }
+ else
+ inotice("libratbox has called the die callback..aborting");
+
+ unlink(pidFileName);
+ exit(EXIT_FAILURE);
+}
+