-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcol.h
More file actions
61 lines (50 loc) · 1023 Bytes
/
col.h
File metadata and controls
61 lines (50 loc) · 1023 Bytes
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
59
60
61
#if !defined(COL_H)
# define COL_H
# include "vec.h"
# include <stdio.h>
typedef enum
{
col_bold = 0x01,
col_under = 0x02,
col_rev = 0x04,
col_blink = 0x08,
col_allflgs = 0x0f
} col_flag;
typedef enum
{
col_black = 0x00,
col_red = 0x01,
col_green = 0x02,
col_yellow = 0x03,
col_blue = 0x04,
col_magenta = 0x05,
col_cyan = 0x06,
col_white = 0x07,
col_bright = 0x08,
col_allcols = 0x07,
col_none = 0x10,
col_null = 0x11
} col_value;
typedef struct col_s col;
typedef struct col_delta_s col_delta;
typedef struct col_desc_s col_desc;
struct col_s
{
col_flag attr;
col_value fg;
col_value bg;
};
struct col_desc_s
{
col_flag set;
col_flag del;
col_flag inv;
col_value fg;
col_value bg;
};
extern col col_default;
col col_update(col c, col_desc d);
void col_print(col c, FILE *f);
int col_parse(col *c, char **str);
void col_parse_string(col c, vec *chrs, char *str);
#endif