diff --git a/kern/ansi.h b/kern/ansi.h index 970f9c6..c5df2d5 100644 --- a/kern/ansi.h +++ b/kern/ansi.h @@ -3,6 +3,22 @@ #include +#define ACOL_WRAP(s) "\33[" s "m" +#define ACOL_BLACK ACOL_WRAP("30") +#define ACOL_RED ACOL_WRAP("31") +#define ACOL_GREEM ACOL_WRAP("32") +#define ACOL_YELLOW ACOL_WRAP("33") +#define ACOL_BLUE ACOL_WRAP("34") +#define ACOL_MAGENTA ACOL_WRAP("35") +#define ACOL_CYAN ACOL_WRAP("36") +#define ACOL_WHITE ACOL_WRAP("37") +#define ACOL_CLEAR ACOL_WRAP("0") + +#define ACOL_TAG(c, s) "[" c s ACOL_CLEAR "] " +#define ACOL_NOTE(s) ACOL_TAG(ACOL_WHITE, "Note ") s +#define ACOL_WARN(s) ACOL_TAG(ACOL_YELLOW, "Warning") s +#define ACOL_ERR(s) ACOL_TAG(ACOL_RED, "Error ") s + struct AttrState { uint8_t cattrs; uint8_t attrs;