#ifndef CANSID_H #define 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