summaryrefslogtreecommitdiffstats
path: root/term_ps.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-10-13 22:59:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-10-13 22:59:54 +0000
commitb26f648a71b3259c793410232a0d3bbdd0aa54e3 (patch)
tree38c696a975659d4498c81dddfc966f0e30bc6326 /term_ps.c
parent35c8bbbbc8de3992d8c2d207662d365f4d566865 (diff)
downloadmandoc-b26f648a71b3259c793410232a0d3bbdd0aa54e3.tar.gz
Major character table cleanup:
* Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/term_ps.c b/term_ps.c
index aa9b4b59..d1f56f70 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -108,8 +108,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, int);
-static struct termp *pspdf_alloc(const struct mchars *,
- const struct manoutput *);
+static struct termp *pspdf_alloc(const struct manoutput *);
static void pdf_obj(struct termp *, size_t);
/*
@@ -510,29 +509,29 @@ static const struct font fonts[TERMFONT__MAX] = {
};
void *
-pdf_alloc(const struct mchars *mchars, const struct manoutput *outopts)
+pdf_alloc(const struct manoutput *outopts)
{
struct termp *p;
- if (NULL != (p = pspdf_alloc(mchars, outopts)))
+ if (NULL != (p = pspdf_alloc(outopts)))
p->type = TERMTYPE_PDF;
return p;
}
void *
-ps_alloc(const struct mchars *mchars, const struct manoutput *outopts)
+ps_alloc(const struct manoutput *outopts)
{
struct termp *p;
- if (NULL != (p = pspdf_alloc(mchars, outopts)))
+ if (NULL != (p = pspdf_alloc(outopts)))
p->type = TERMTYPE_PS;
return p;
}
static struct termp *
-pspdf_alloc(const struct mchars *mchars, const struct manoutput *outopts)
+pspdf_alloc(const struct manoutput *outopts)
{
struct termp *p;
unsigned int pagex, pagey;
@@ -540,7 +539,6 @@ pspdf_alloc(const struct mchars *mchars, const struct manoutput *outopts)
const char *pp;
p = mandoc_calloc(1, sizeof(struct termp));
- p->symtab = mchars;
p->enc = TERMENC_ASCII;
p->fontq = mandoc_reallocarray(NULL,
(p->fontsz = 8), sizeof(enum termfont));