summaryrefslogtreecommitdiffstats
path: root/include/print.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/print.h')
-rw-r--r--include/print.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/print.h b/include/print.h
new file mode 100644
index 0000000..38a1dbc
--- /dev/null
+++ b/include/print.h
@@ -0,0 +1,25 @@
+#ifndef _JOVE_PRINT_H
+#define _JOVE_PRINT_H 1
+
+#include <stdarg.h>
+
+enum {
+ PRINT_DEBUG = 0,
+ PRINT_LOG,
+ PRINT_WARN,
+ PRINT_ERROR
+};
+
+#define PRINT_BUFFERW 512
+
+void prawf(const char *fmt, ...);
+
+void _plogvf(const char *file, const char *func, int line, int lvl, const char *fmt, va_list ap);
+void _plogf(const char *file, const char *func, int line, int lvl, const char *fmt, ...);
+
+#define kdbgf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_DEBUG, __VA_ARGS__)
+#define klogf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_LOG , __VA_ARGS__)
+#define kwarnf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_WARN, __VA_ARGS__)
+#define kerrf(...) _plogf(__FILE__, __FUNCTION__, __LINE__, PRINT_ERROR, __VA_ARGS__)
+
+#endif