Major code revamping:
[TP_AL_C.git] / lexer / print_helper.c
diff --git a/lexer/print_helper.c b/lexer/print_helper.c
new file mode 100644 (file)
index 0000000..d5ca8f0
--- /dev/null
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+
+void pr_warning(const char *format, ...) {
+    va_list args;
+
+    va_start(args, format);
+    fprintf(stdout, format, args);
+    va_end(args);
+}
+
+void pr_error(const char *format, ...) {
+    va_list args;
+
+    va_start(args, format);
+    fprintf(stderr, format, args);
+    va_end(args);
+}
+
+void wpr_warning(const wchar_t *format, ...) {
+    va_list args;
+
+    va_start(args, format);
+    fwprintf(stdout, format, args);
+    va_end(args);
+}
+
+void wpr_error(const wchar_t *format, ...) {
+    va_list args;
+
+    va_start(args, format);
+    fwprintf(stderr, format, args);
+    va_end(args);
+}