-/*
- * Apply a style to the output buffer. This is looked up by means of
- * the styletab.
- */
-static void
-style(struct termp *p, enum tstyle esc)
-{
-
- if (p->col + 4 >= p->maxcols)
- errx(1, "line overrun");
-
- p->buf[(p->col)++] = 27;
- p->buf[(p->col)++] = '[';
- switch (esc) {
- case (TERMSTYLE_CLEAR):
- p->buf[(p->col)++] = '0';
- break;
- case (TERMSTYLE_BOLD):
- p->buf[(p->col)++] = '1';
- break;
- case (TERMSTYLE_UNDER):
- p->buf[(p->col)++] = '4';
- break;
- default:
- abort();
- /* NOTREACHED */
- }
- p->buf[(p->col)++] = 'm';
-}
-
-