-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathtextcolor.h
58 lines (36 loc) · 1.05 KB
/
textcolor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*-------------------------------------------------------------------
*
* Name: textcolor.h
*
* Purpose: Set color of text.
*
*--------------------------------------------------------------------*/
#ifndef TEXTCOLOR_H
#define TEXTCOLOR_H 1
enum dw_color_e { DW_COLOR_INFO, /* black */
DW_COLOR_ERROR, /* red */
DW_COLOR_REC, /* green */
DW_COLOR_DECODED, /* blue */
DW_COLOR_XMIT, /* magenta */
DW_COLOR_DEBUG /* dark_green */
};
typedef enum dw_color_e dw_color_t;
void text_color_init (int enable_color);
void text_color_set (dw_color_t c);
void text_color_term (void);
/* Degree symbol. */
#if __WIN32__
//#define CH_DEGREE "\xc2\xb0" /* UTF-8. */
#define CH_DEGREE " "
#else
/* Maybe we could change this based on LANG environment variable. */
//#define CH_DEGREE "\xc2\xb0" /* UTF-8. */
#define CH_DEGREE " "
#endif
int dw_printf (const char *fmt, ...)
#if __WIN32__
__attribute__((format(ms_printf,1,2))); /* Win C lib. */
#else
__attribute__((format(printf,1,2))); /* gnu C lib. */
#endif
#endif