2f449706114ab234d7d598d0281a05998d13bb6d
2 \brief Macros for printing unicode to streams
3 \details Standardized method of handling unicodes in warnings, and errors
6 ----------------------------------------------------------------------------*/
14 /* wprintf callback, may be defined prior to include
15 or undefined and redefined later
17 #ifndef wprintf_callback
18 #define wprintf_callback(...) do { \
21 /* eprintf callback, may be defined prior to include
22 or undefined and redefined later
24 #ifndef eprintf_callback
25 #define eprintf_callback(...) do { \
29 /* Print a unicode string */
30 #define uprintf(...) do { \
31 ulc_fprintf(stdout, __VA_ARGS__); \
33 /* Print a unicode string to a filestream */
34 #define ufprintf(_STREAM,...) do { \
35 ulc_fprintf(_STREAM, __VA_ARGS__); \
37 /* Print a warning message to stderr, then do_warn */
38 #define wprintf(...) do { \
39 ufprintf(stderr, __VA_ARGS__); \
40 wprintf_callback(__VA_ARGS__); \
42 /* Print an error message to stderr, then do_error */
43 #define eprintf(...) do { \
44 ufprintf(stderr, __VA_ARGS__); \
45 eprintf_callback(__VA_ARGS_); \
47 /* Print only when the provided boolean is true */
48 #define bprintf(_BOOL,...) do { \
50 ufprintf(stdout, __VA_ARGS__); \
52 /* Print only when DEBUG is set to a value */
53 #define dprintf(...) do { \
54 bprintf(DEBUG, __VA_ARGS__); \