26 lines
437 B
C
26 lines
437 B
C
#ifndef SHADE_CANSID_H
|
|
#define SHADE_CANSID_H
|
|
|
|
typedef struct {
|
|
enum {
|
|
CANSID_ESC,
|
|
CANSID_BRACKET,
|
|
CANSID_PARSE,
|
|
CANSID_BGCOLOR,
|
|
CANSID_FGCOLOR,
|
|
CANSID_EQUALS,
|
|
CANSID_ENDVAL,
|
|
} state;
|
|
unsigned char style;
|
|
unsigned char next_style;
|
|
} cansid_state;
|
|
|
|
typedef struct {
|
|
unsigned char style;
|
|
unsigned char ascii;
|
|
} color_char;
|
|
|
|
cansid_state cansid_init(void);
|
|
color_char cansid_process(cansid_state *state, char x);
|
|
|
|
#endif |