diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-14 12:35:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-14 12:35:02 +0000 |
commit | ff2d2efac021b47be5131aeb11372e2fa6c73f0f (patch) | |
tree | 1f39ca4e4068ff7b4589e4259eb1997fb02e067f /term.h | |
parent | f24d8846442dca61e961b029eb67ce69c086dc41 (diff) | |
download | mandoc-ff2d2efac021b47be5131aeb11372e2fa6c73f0f.tar.gz mandoc-ff2d2efac021b47be5131aeb11372e2fa6c73f0f.tar.zst mandoc-ff2d2efac021b47be5131aeb11372e2fa6c73f0f.zip |
Added colour styles (not being used) to struct termp.
Added nroff style-escape encoding.
Removed ANSI schema string tables (there's only ANSI and nroff/backspace).
Pushed styling directly into pword (simpler).
Diffstat (limited to 'term.h')
-rw-r--r-- | term.h | 39 |
1 files changed, 22 insertions, 17 deletions
@@ -1,4 +1,4 @@ -/* $Id: term.h,v 1.21 2009/03/14 05:36:07 kristaps Exp $ */ +/* $Id: term.h,v 1.22 2009/03/14 12:35:02 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> * @@ -70,12 +70,9 @@ enum tsym { TERMSYM_MAX = 41 }; - -enum tstyle { - TERMSTYLE_CLEAR = 0, - TERMSTYLE_BOLD = 1, - TERMSTYLE_UNDER = 2, - TERMSTYLE_MAX = 3 +enum termenc { + TERMENC_ANSI, + TERMENC_NROFF }; struct termsym { @@ -90,18 +87,26 @@ struct termp { size_t offset; size_t col; int flags; -#define TERMP_BOLD (1 << 0) /* Embolden words. */ -#define TERMP_UNDERLINE (1 << 1) /* Underline words. */ -#define TERMP_NOSPACE (1 << 2) /* No space before words. */ -#define TERMP_NOLPAD (1 << 3) /* No leftpad before flush. */ -#define TERMP_NOBREAK (1 << 4) /* No break after flush. */ -#define TERMP_LITERAL (1 << 5) /* Literal words. */ -#define TERMP_IGNDELIM (1 << 6) /* Delims like regulars. */ -#define TERMP_NONOSPACE (1 << 7) /* No space (no autounset). */ -#define TERMP_NONOBREAK (1 << 8) +#define TERMP_NOSPACE (1 << 0) /* No space before words. */ +#define TERMP_NOLPAD (1 << 1) /* No leftpad before flush. */ +#define TERMP_NOBREAK (1 << 2) /* No break after flush. */ +#define TERMP_LITERAL (1 << 3) /* Literal words. */ +#define TERMP_IGNDELIM (1 << 4) /* Delims like regulars. */ +#define TERMP_NONOSPACE (1 << 5) /* No space (no autounset). */ +#define TERMP_NONOBREAK (1 << 7) /* Don't newln NOBREAK. */ + +#define TERMP_STYLE 0xff00 /* Style mask. */ +#define TERMP_BOLD (1 << 8) /* Styles... */ +#define TERMP_UNDER (1 << 9) +#define TERMP_BLUE (1 << 10) +#define TERMP_RED (1 << 11) +#define TERMP_YELLOW (1 << 12) +#define TERMP_MAGENTA (1 << 13) +#define TERMP_CYAN (1 << 14) +#define TERMP_GREEN (1 << 15) char *buf; struct termsym *symtab; /* Special-symbol table. */ - struct termsym *styletab; /* Style table. */ + enum termenc enc; /* Encoding. */ }; struct termpair { |