[IOMultiplexerV2] alpha
[NextIRCd.git] / src / IOHandler / IOLog.h
diff --git a/src/IOHandler/IOLog.h b/src/IOHandler/IOLog.h
new file mode 100644 (file)
index 0000000..451155e
--- /dev/null
@@ -0,0 +1,41 @@
+/* IOLog.h - IOMultiplexer v2
+ * Copyright (C) 2014  Philipp Kreil (pk910)
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ */
+#ifndef _IOLog_h
+#define _IOLog_h
+#ifndef _IOHandler_internals
+#include "IOHandler.h"
+#else
+enum IOLogType;
+
+void iolog_init();
+void iolog_trigger(enum IOLogType type, char *text, ...);
+
+#endif
+
+enum IOLogType {
+    IOLOG_DEBUG,
+    IOLOG_WARNING,
+    IOLOG_ERROR,
+    IOLOG_FATAL
+};
+
+#define IOLOG_CALLBACK(NAME) void NAME(enum IOLogType type, char *message)
+typedef IOLOG_CALLBACK(iolog_callback);
+
+void iolog_register_callback(iolog_callback *callback);
+
+#endif