ir testing
[henge/apc.git] / src / print.h
1 /*!@file
2 \brief Macros for printing unicode to streams
3 \details Standardized method of handling unicodes in warnings, and errors
4 \author Jordan Lavatai
5 \date Aug 2016
6 ----------------------------------------------------------------------------*/
7 /* u8 print macros */
8 #ifndef _PRINT_H_
9 #define _PRINT_H_
10 #include <unistdio.h>
11 #ifndef DEBUG
12 #define DEBUG 0
13 #endif
14 #define uprintf(...) do { \
15 ulc_fprintf(stdout, __VA_ARGS__); \
16 } while (0)
17 #define ufprintf(_STREAM,...) do { \
18 ulc_fprintf(_STREAM, __VA_ARGS__); \
19 } while (0)
20 #define do_warn(...) do { \
21 } while (0)
22 #define wprintf(...) do { \
23 ufprintf(stderr, __VA_ARGS__); \
24 do_warn(__VA_ARGS__); \
25 } while (0)
26 #define do_error(...) do { \
27 } while (0)
28 #define eprintf(...) do { \
29 ufprintf(stderr, __VA_ARGS__); \
30 do_error(__VA_ARGS_); \
31 } while (0)
32 #define bprintf(_BOOL,...) do { \
33 if (_BOOL) \
34 ufprintf(stdout, __VA_ARGS__); \
35 } while (0)
36 #define dprintf(...) do { \
37 bprintf(DEBUG, __VA_ARGS__); \
38 } while (0)
39 #endif