diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-28 17:36:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-28 17:36:19 +0000 |
commit | e140259c6ca1889b0dddef8b075524723b147cfe (patch) | |
tree | 351a20004d594caa3735ca29afb581ace2b8ea76 /html.c | |
parent | 9a3f7e6d544fc2f5c114c480cb724e44cfac1ea9 (diff) | |
download | mandoc-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 'html.c')
-rw-r--r-- | html.c | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -127,11 +127,10 @@ static int print_escape(char); static int print_encode(struct html *, const char *, int); static void print_metaf(struct html *, enum mandoc_esc); static void print_attr(struct html *, const char *, const char *); -static void *ml_alloc(char *); -static void * -ml_alloc(char *outopts) +void * +html_alloc(const struct mchars *mchars, char *outopts) { struct html *h; const char *toks[5]; @@ -146,7 +145,7 @@ ml_alloc(char *outopts) h = mandoc_calloc(1, sizeof(struct html)); h->tags.head = NULL; - h->symtab = mchars_alloc(); + h->symtab = mchars; while (outopts && *outopts) switch (getsubopt(&outopts, UNCONST(toks), &v)) { @@ -169,20 +168,6 @@ ml_alloc(char *outopts) return(h); } -void * -html_alloc(char *outopts) -{ - - return(ml_alloc(outopts)); -} - -void * -xhtml_alloc(char *outopts) -{ - - return(ml_alloc(outopts)); -} - void html_free(void *p) { @@ -196,9 +181,6 @@ html_free(void *p) free(tag); } - if (h->symtab) - mchars_free(h->symtab); - free(h); } |