Merge branch 'u2_10_12_branch' of git://git.code.sf.net/p/undernet-ircu/ircu2
[ircu2.10.12-pk.git] / ircd / test / test_stub.c
diff --git a/ircd/test/test_stub.c b/ircd/test/test_stub.c
new file mode 100644 (file)
index 0000000..e5fe4a4
--- /dev/null
@@ -0,0 +1,41 @@
+/* test_stub.c - support stubs for test programs */
+
+#include "client.h"
+#include "ircd_log.h"
+#include "s_debug.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+struct Client me;
+int log_inassert;
+
+void
+log_write(enum LogSys subsys, enum LogLevel severity, unsigned int flags,
+          const char *fmt, ...)
+{
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    fputc('\n', stderr);
+    va_end(args);
+}
+
+void
+debug(int level, const char *form, ...)
+{
+    va_list args;
+
+    va_start(args, form);
+    vfprintf(stdout, form, args);
+    fputc('\n', stdout);
+    va_end(args);
+}
+
+int
+exit_client(struct Client *cptr, struct Client *victim, struct Client *killer,
+            const char *comment)
+{
+    Debug((DEBUG_LIST, "exit_client(%p, %p, %p, \"%s\")\n", cptr, victim, killer, comment));
+    return 0;
+}