-/* Attributes for colour output.
- *
- * An attribute word holds a foreground colour in the low nibble, a
- * background colour in the next nibble, and some flags in the next few bits.
- * A colour is expressed in classic 1-bit-per-channel style, with red, green,
- * and blue in bits 0, 1, and 2, and a `bright' flag in bit 3.
- */
-typedef unsigned short ttycolour_attr; /* type of an attribute */
-
-#define TCAF_FGMASK 0x0f /* foreground colour mask */
-#define TCAF_FGSHIFT 0 /* foreground colour shift */
-#define TCAF_BGMASK 0xf0 /* background colour mask */
-#define TCAF_BGSHIFT 4 /* background colour shift */
-#define TCAF_FG 256u /* set foreground? */
-#define TCAF_BG 512u /* set background? */
-#define TCAF_BOLD 1024u /* set bold? */
-
-#define TCCF_RED 1u /* red channel */
-#define TCCF_GREEN 2u /* green channel */
-#define TCCF_BLUE 4u /* blue channel */
-#define TCCF_RGBMASK (TCCF_RED | TCCF_GREEN | TCCF_BLUE)
-#define TCCF_BRIGHT 8u /* bright colour flag */
-
-#define TTYCOL_BLACK 0u /* colour codes... */
-#define TTYCOL_RED (TCCF_RED)
-#define TTYCOL_GREEN (TCCF_GREEN)
-#define TTYCOL_YELLOW (TCCF_RED | TCCF_GREEN)
-#define TTYCOL_BLUE (TCCF_BLUE)
-#define TTYCOL_MAGENTA (TCCF_RED | TCCF_BLUE)
-#define TTYCOL_CYAN (TCCF_GREEN | TCCF_BLUE)
-#define TTYCOL_WHITE (TCCF_RED | TCCF_GREEN | TCCF_BLUE)
-
-#define TTYCOL_BRBLACK (TTYCOL_BLACK | TCCF_BRIGHT)
-#define TTYCOL_BRRED (TTYCOL_RED | TCCF_BRIGHT)
-#define TTYCOL_BRGREEN (TTYCOL_GREEN | TCCF_BRIGHT)
-#define TTYCOL_BRYELLOW (TTYCOL_YELLOW | TCCF_BRIGHT)
-#define TTYCOL_BRBLUE (TTYCOL_BLUE | TCCF_BRIGHT)
-#define TTYCOL_BRMAGENTA (TTYCOL_MAGENTA | TCCF_BRIGHT)
-#define TTYCOL_BRCYAN (TTYCOL_CYAN | TCCF_BRIGHT)
-#define TTYCOL_BRWHITE (TTYCOL_WHITE | TCCF_BRIGHT)
-
-#define TC_FG(col) (TCAF_FG | (TTYCOL_##col) << TCAF_FGSHIFT) /* set fg */
-#define TC_BG(col) (TCAF_BG | (TTYCOL_##col) << TCAF_BGSHIFT) /* set bg */