From ace65b453151845bc361f21f3e5b651c35f9f126 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 May 2024 13:00:41 -0400 Subject: massive refactor for mp and organization --- include/print.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/print.h (limited to 'include/print.h') 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 + +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 -- cgit v1.2.1