aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_ascii.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-28 17:36:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-28 17:36:19 +0000
commitd0ac87d04f62f2c8e644686b707cb2602c2ddba6 (patch)
tree69a250d8b0b0b75bc58e1c8af72b3c3269561aed /term_ascii.c
parent5fa1bace54f386a9b3ce23690f136232e1e5bb2e (diff)
downloadmandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.tar.gz
mandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.tar.zst
mandoc-d0ac87d04f62f2c8e644686b707cb2602c2ddba6.zip
Make the character table available to libroff so it can check the
validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
Diffstat (limited to 'term_ascii.c')
-rw-r--r--term_ascii.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/term_ascii.c b/term_ascii.c
index 0f1c1e01..6ec27be0 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -1,4 +1,4 @@
-/* $Id: term_ascii.c,v 1.37 2014/10/28 02:43:59 schwarze Exp $ */
+/* $Id: term_ascii.c,v 1.38 2014/10/28 17:36:19 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -36,7 +36,8 @@
#include "term.h"
#include "main.h"
-static struct termp *ascii_init(enum termenc, char *);
+static struct termp *ascii_init(enum termenc,
+ const struct mchars *, char *);
static double ascii_hspan(const struct termp *,
const struct roffsu *);
static size_t ascii_width(const struct termp *, int);
@@ -56,7 +57,7 @@ static size_t locale_width(const struct termp *, int);
static struct termp *
-ascii_init(enum termenc enc, char *outopts)
+ascii_init(enum termenc enc, const struct mchars *mchars, char *outopts)
{
const char *toks[5];
char *v;
@@ -64,6 +65,7 @@ ascii_init(enum termenc enc, char *outopts)
p = mandoc_calloc(1, sizeof(struct termp));
+ p->symtab = mchars;
p->tabwidth = 5;
p->defrmargin = p->lastrmargin = 78;
@@ -131,24 +133,24 @@ ascii_init(enum termenc enc, char *outopts)
}
void *
-ascii_alloc(char *outopts)
+ascii_alloc(const struct mchars *mchars, char *outopts)
{
- return(ascii_init(TERMENC_ASCII, outopts));
+ return(ascii_init(TERMENC_ASCII, mchars, outopts));
}
void *
-utf8_alloc(char *outopts)
+utf8_alloc(const struct mchars *mchars, char *outopts)
{
- return(ascii_init(TERMENC_UTF8, outopts));
+ return(ascii_init(TERMENC_UTF8, mchars, outopts));
}
void *
-locale_alloc(char *outopts)
+locale_alloc(const struct mchars *mchars, char *outopts)
{
- return(ascii_init(TERMENC_LOCALE, outopts));
+ return(ascii_init(TERMENC_LOCALE, mchars, outopts));
}
static void