2022-05-17 14:44:08 +00:00
|
|
|
#ifndef SHADE_CANSID_H
|
|
|
|
#define SHADE_CANSID_H
|
2022-05-15 21:42:53 +00:00
|
|
|
typedef struct {
|
2022-10-07 23:44:50 +00:00
|
|
|
enum {
|
|
|
|
CANSID_ESC,
|
|
|
|
CANSID_BRACKET,
|
|
|
|
CANSID_PARSE,
|
|
|
|
CANSID_BGCOLOR,
|
|
|
|
CANSID_FGCOLOR,
|
|
|
|
CANSID_EQUALS,
|
|
|
|
CANSID_ENDVAL,
|
|
|
|
} state;
|
|
|
|
unsigned char style;
|
|
|
|
unsigned char next_style;
|
2022-05-15 21:42:53 +00:00
|
|
|
} cansid_state;
|
|
|
|
typedef struct {
|
2022-10-07 23:44:50 +00:00
|
|
|
unsigned char style;
|
|
|
|
unsigned char ascii;
|
2022-05-15 21:42:53 +00:00
|
|
|
} color_char;
|
|
|
|
cansid_state cansid_init(void);
|
|
|
|
color_char cansid_process(cansid_state *state, char x);
|
|
|
|
#endif
|