#ifndef _ANSI_H_ #define _ANSI_H_ #include struct AttrState { uint8_t cattrs; uint8_t attrs; enum { NORMAL, ESC, BRACKET, COLOR_FG, COLOR } state; }; void ansi_step(void (*putcf)(int), int c, struct AttrState* s); #endif