aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-05 15:17:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-05 15:17:32 +0000
commitac714e0488d7c68718c62be1daa50511092a070d (patch)
tree23603ba00471fb588afdd3b7c5765fab62424249 /man_term.c
parent264209da4a75cf323caf3e1a5e89534f15086b73 (diff)
downloadmandoc-ac714e0488d7c68718c62be1daa50511092a070d.tar.gz
mandoc-ac714e0488d7c68718c62be1daa50511092a070d.tar.zst
mandoc-ac714e0488d7c68718c62be1daa50511092a070d.zip
Move .sp to the roff modules. Enough infrastructure is in place
now that this actually saves code: -70 LOC.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/man_term.c b/man_term.c
index ba096f0d..41d13fc9 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.196 2017/05/05 13:17:55 schwarze Exp $ */
+/* $Id: man_term.c,v 1.197 2017/05/05 15:17:32 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -83,7 +83,6 @@ static int pre_alternate(DECL_ARGS);
static int pre_ign(DECL_ARGS);
static int pre_in(DECL_ARGS);
static int pre_literal(DECL_ARGS);
-static int pre_sp(DECL_ARGS);
static void post_IP(DECL_ARGS);
static void post_HP(DECL_ARGS);
@@ -114,7 +113,6 @@ static const struct termact __termacts[MAN_MAX - MAN_TH] = {
{ pre_I, NULL, 0 }, /* I */
{ pre_alternate, NULL, 0 }, /* IR */
{ pre_alternate, NULL, 0 }, /* RI */
- { pre_sp, NULL, MAN_NOTEXT }, /* sp */
{ pre_literal, NULL, 0 }, /* nf */
{ pre_literal, NULL, 0 }, /* fi */
{ NULL, NULL, 0 }, /* RE */
@@ -392,55 +390,6 @@ pre_in(DECL_ARGS)
}
static int
-pre_sp(DECL_ARGS)
-{
- struct roffsu su;
- int i, len;
-
- if ((NULL == n->prev && n->parent)) {
- switch (n->parent->tok) {
- case MAN_SH:
- case MAN_SS:
- case MAN_PP:
- case MAN_LP:
- case MAN_P:
- return 0;
- default:
- break;
- }
- }
-
- if (n->child == NULL)
- len = 1;
- else {
- if ( ! a2roffsu(n->child->string, &su, SCALE_VS))
- su.scale = 1.0;
- len = term_vspan(p, &su);
- }
-
- if (len == 0)
- term_newln(p);
- else if (len < 0)
- p->skipvsp -= len;
- else
- for (i = 0; i < len; i++)
- term_vspace(p);
-
- /*
- * Handle an explicit break request in the same way
- * as an overflowing line.
- */
-
- if (p->flags & TERMP_BRIND) {
- p->offset = p->rmargin;
- p->rmargin = p->maxrmargin;
- p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
- }
-
- return 0;
-}
-
-static int
pre_HP(DECL_ARGS)
{
struct roffsu su;