/* ------------------------------------------------------------------ * -- project: SCAN * -- description: abstraction for terminal control sequences * ------------------------------------------------------------------ */ #ifndef __FORMAT_H #define __FORMAT_H #include "stdint.h" /* -- defines */ #define NUMBER_STYLES ( ( int )8 ) #define NUMBER_COLOURS ( ( int )9 ) #define ESCAPE "\x1b" #define SEQUENCE_PREFIX ESCAPE"[" #define SEQUENCE_SUFFIX "m" /* -- type definitions */ typedef enum { style_bold = 0u, style_dim, style_italic, style_underlined, style_blinking, style_reversed, style_invisible, style_strikethrough } style_t; /* -- constant definitions */ extern const uint8_t STYLE_SET[ NUMBER_STYLES ]; extern const uint8_t STYLE_RESET[ NUMBER_STYLES ]; /* -- function prototypes */ void format_clear( void ); void format_set_style( style_t* styles, uint8_t number_styles ); void format_reset_style( style_t* styles, uint8_t number_styles ); void format_set_fg_colour( uint32_t colour ); void format_set_bg_colour( uint32_t colour ); void format_clear_fg_colour( void ); void format_clear_bg_colour( void ); #endif