summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/term_ps.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-10-28 17:35:43 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-10-28 17:35:43 +0000
commite65351f6a3dd637d14b3fcf8be0e8367a1aacc0d (patch)
tree492cb187aebcd5f308bdfabec30d31afbaa8de63 /usr.bin/mandoc/term_ps.c
parent24322f395665631cc678573c61a088bf15bc333c (diff)
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 'usr.bin/mandoc/term_ps.c')
-rw-r--r--usr.bin/mandoc/term_ps.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/mandoc/term_ps.c b/usr.bin/mandoc/term_ps.c
index ed34c4393b5..5c2dfceb20c 100644
--- a/usr.bin/mandoc/term_ps.c
+++ b/usr.bin/mandoc/term_ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term_ps.c,v 1.32 2014/10/27 20:41:16 schwarze Exp $ */
+/* $OpenBSD: term_ps.c,v 1.33 2014/10/28 17:35:42 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -101,7 +101,7 @@ static void ps_printf(struct termp *, const char *, ...);
static void ps_putchar(struct termp *, char);
static void ps_setfont(struct termp *, enum termfont);
static void ps_setwidth(struct termp *, int, size_t);
-static struct termp *pspdf_alloc(char *);
+static struct termp *pspdf_alloc(const struct mchars *, char *);
static void pdf_obj(struct termp *, size_t);
/*
@@ -502,29 +502,29 @@ static const struct font fonts[TERMFONT__MAX] = {
};
void *
-pdf_alloc(char *outopts)
+pdf_alloc(const struct mchars *mchars, char *outopts)
{
struct termp *p;
- if (NULL != (p = pspdf_alloc(outopts)))
+ if (NULL != (p = pspdf_alloc(mchars, outopts)))
p->type = TERMTYPE_PDF;
return(p);
}
void *
-ps_alloc(char *outopts)
+ps_alloc(const struct mchars *mchars, char *outopts)
{
struct termp *p;
- if (NULL != (p = pspdf_alloc(outopts)))
+ if (NULL != (p = pspdf_alloc(mchars, outopts)))
p->type = TERMTYPE_PS;
return(p);
}
static struct termp *
-pspdf_alloc(char *outopts)
+pspdf_alloc(const struct mchars *mchars, char *outopts)
{
struct termp *p;
unsigned int pagex, pagey;
@@ -534,6 +534,7 @@ pspdf_alloc(char *outopts)
char *v;
p = mandoc_calloc(1, sizeof(struct termp));
+ p->symtab = mchars;
p->enc = TERMENC_ASCII;
p->ps = mandoc_calloc(1, sizeof(struct termp_ps));