+/*
+ * A mapping of color names to terminfo color numbers.
+ *
+ * There are two sets of terminal-setting codes: 'setaf/setab' (ANSI) and
+ * 'setf/setb'. Different terminals support different capabilities, so
+ * we provide a mapping for both. I'm not crazy about putting numbers
+ * directly in here, but it seems these are well defined by terminfo
+ * so it should be okay.
+ */
+
+struct colormap {
+ char *colorname; /* Name of color */
+ int ansinum; /* The ANSI escape color number */
+ int nonansinum; /* The non-ANSI escape color number */
+};
+
+static struct colormap colortable[] = {
+ { "black", 0, 0 },
+ { "red", 1, 4 },
+ { "green", 2, 2 },
+ { "yellow", 3, 6 },
+ { "blue", 4, 1 },
+ { "magenta", 5, 5 },
+ { "cyan", 6, 3 },
+ { "white", 7, 7 },
+ { NULL, 0, 0 }
+};
+