summaryrefslogtreecommitdiffstats
path: root/term_ps.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
commite140259c6ca1889b0dddef8b075524723b147cfe (patch)
tree351a20004d594caa3735ca29afb581ace2b8ea76 /term_ps.c
parent9a3f7e6d544fc2f5c114c480cb724e44cfac1ea9 (diff)
downloadmandoc-e140259c6ca1889b0dddef8b075524723b147cfe.tar.gz
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_ps.c')
-rw-r--r--term_ps.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/term_ps.c b/term_ps.c
index 35eec3c4..f1129c2d 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -106,7 +106,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);
/*
@@ -507,29 +507,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;
@@ -539,6 +539,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));