version 1.27, 2009/03/03 21:07:01 |
version 1.31, 2009/03/04 14:13:05 |
Line 78 static struct termenc termenc1[] = { |
|
Line 78 static struct termenc termenc1[] = { |
|
static struct termenc termenc2[] = { |
static struct termenc termenc2[] = { |
{ "rB", TERMSYM_RBRACK }, |
{ "rB", TERMSYM_RBRACK }, |
{ "lB", TERMSYM_LBRACK }, |
{ "lB", TERMSYM_LBRACK }, |
|
{ "ra", TERMSYM_RANGLE }, |
|
{ "la", TERMSYM_LANGLE }, |
{ "Lq", TERMSYM_LDQUOTE }, |
{ "Lq", TERMSYM_LDQUOTE }, |
{ "lq", TERMSYM_LDQUOTE }, |
{ "lq", TERMSYM_LDQUOTE }, |
{ "Rq", TERMSYM_RDQUOTE }, |
{ "Rq", TERMSYM_RDQUOTE }, |
Line 99 static struct termenc termenc2[] = { |
|
Line 101 static struct termenc termenc2[] = { |
|
{ "Le", TERMSYM_LE }, |
{ "Le", TERMSYM_LE }, |
{ "<=", TERMSYM_LE }, |
{ "<=", TERMSYM_LE }, |
{ "Ge", TERMSYM_GE }, |
{ "Ge", TERMSYM_GE }, |
{ "=>", TERMSYM_GE }, |
{ ">=", TERMSYM_GE }, |
{ "==", TERMSYM_EQ }, |
{ "==", TERMSYM_EQ }, |
{ "Ne", TERMSYM_NEQ }, |
{ "Ne", TERMSYM_NEQ }, |
{ "!=", TERMSYM_NEQ }, |
{ "!=", TERMSYM_NEQ }, |
Line 161 static struct termsym termsym_ansi[] = { |
|
Line 163 static struct termsym termsym_ansi[] = { |
|
{ " ", 1 }, /* TERMSYM_SPACE */ |
{ " ", 1 }, /* TERMSYM_SPACE */ |
{ ".", 1 }, /* TERMSYM_PERIOD */ |
{ ".", 1 }, /* TERMSYM_PERIOD */ |
{ "", 0 }, /* TERMSYM_BREAK */ |
{ "", 0 }, /* TERMSYM_BREAK */ |
|
{ "<", 1 }, /* TERMSYM_LANGLE */ |
|
{ ">", 1 }, /* TERMSYM_RANGLE */ |
}; |
}; |
|
|
static const char ansi_clear[] = { 27, '[', '0', 'm' }; |
static const char ansi_clear[] = { 27, '[', '0', 'm' }; |
Line 189 main(int argc, char *argv[]) |
|
Line 193 main(int argc, char *argv[]) |
|
if (NULL == (mdoc = mmain_mdoc(p))) |
if (NULL == (mdoc = mmain_mdoc(p))) |
mmain_exit(p, 1); |
mmain_exit(p, 1); |
|
|
termp.maxrmargin = 78; /* XXX */ |
termp.maxrmargin = termp.rmargin = 78; /* XXX */ |
termp.rmargin = termp.maxrmargin; |
|
termp.maxcols = 1024; |
termp.maxcols = 1024; |
termp.offset = termp.col = 0; |
termp.offset = termp.col = 0; |
termp.flags = TERMP_NOSPACE; |
termp.flags = TERMP_NOSPACE; |
Line 227 main(int argc, char *argv[]) |
|
Line 230 main(int argc, char *argv[]) |
|
* offset value. This is useful when doing columnar lists where the |
* offset value. This is useful when doing columnar lists where the |
* prior column has right-padded. |
* prior column has right-padded. |
* |
* |
* - TERMP_LITERAL: don't break apart words. Note that a long literal |
|
* word will violate the right margin. |
|
* |
|
* - TERMP_NOBREAK: this is the most important and is used when making |
* - TERMP_NOBREAK: this is the most important and is used when making |
* columns. In short: don't print a newline and instead pad to the |
* columns. In short: don't print a newline and instead pad to the |
* right margin. Used in conjunction with TERMP_NOLPAD. |
* right margin. Used in conjunction with TERMP_NOLPAD. |
Line 320 flushln(struct termp *p) |
|
Line 320 flushln(struct termp *p) |
|
putchar('\n'); |
putchar('\n'); |
for (j = 0; j < p->rmargin; j++) |
for (j = 0; j < p->rmargin; j++) |
putchar(' '); |
putchar(' '); |
vis = p->rmargin; |
vis = p->rmargin - p->offset; |
} else if (vis + vsz > bp) |
} else if (vis + vsz > bp) |
warnx("word breaks right margin"); |
warnx("word breaks right margin"); |
|
|
Line 363 flushln(struct termp *p) |
|
Line 363 flushln(struct termp *p) |
|
* pad to the right margin and stay off. |
* pad to the right margin and stay off. |
*/ |
*/ |
|
|
if (p->flags & TERMP_NOBREAK) { |
if (p->flags & TERMP_NOBREAK) |
for ( ; vis < maxvis; vis++) |
for ( ; vis < maxvis; vis++) |
putchar(' '); |
putchar(' '); |
} else |
else |
putchar('\n'); |
putchar('\n'); |
|
|
p->col = 0; |
p->col = 0; |