general debug printing
[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 do_warn(...) do { \
15 } while (0)
16 #define wprintf(...) do { \
17 ulc_fprintf(stderr, __VA_ARGS__); \
18 do_warn(__VA_ARGS__); \
19 } while (0)
20 #define do_error(...) do { \
21 } while (0)
22 #define eprintf(...) do { \
23 ulc_fprintf(stderr, __VA_ARGS__); \
24 do_error(__VA_ARGS_); \
25 } while (0)
26 #define bprintf(_BOOL,...) do { \
27 if (_BOOL) \
28 ulc_fprintf(stdout, __VA_ARGS__); \
29 } while (0)
30 #define dprintf(...) do { \
31 bprintf(DEBUG, __VA_ARGS__); \
32 } while (0)
33 #endif