From 35c319dedab41299e8ad1ec62697c36315fb88da Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 13 Oct 2015 22:59:54 +0000 Subject: 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. --- main.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index 19dd0f65..bf2a0646 100644 --- a/main.h +++ b/main.h @@ -1,4 +1,4 @@ -/* $Id: main.h,v 1.22 2015/04/18 16:06:40 schwarze Exp $ */ +/* $Id: main.h,v 1.23 2015/10/13 22:59:54 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -20,7 +20,6 @@ __BEGIN_DECLS -struct mchars; struct roff_man; struct manoutput; @@ -31,8 +30,7 @@ struct manoutput; * terminal output routines with different character settings. */ -void *html_alloc(const struct mchars *, - const struct manoutput *); +void *html_alloc(const struct manoutput *); void html_mdoc(void *, const struct roff_man *); void html_man(void *, const struct roff_man *); void html_free(void *); @@ -43,19 +41,14 @@ void tree_man(void *, const struct roff_man *); void man_mdoc(void *, const struct roff_man *); void man_man(void *, const struct roff_man *); -void *locale_alloc(const struct mchars *, - const struct manoutput *); -void *utf8_alloc(const struct mchars *, - const struct manoutput *); -void *ascii_alloc(const struct mchars *, - const struct manoutput *); +void *locale_alloc(const struct manoutput *); +void *utf8_alloc(const struct manoutput *); +void *ascii_alloc(const struct manoutput *); void ascii_free(void *); void ascii_sepline(void *); -void *pdf_alloc(const struct mchars *, - const struct manoutput *); -void *ps_alloc(const struct mchars *, - const struct manoutput *); +void *pdf_alloc(const struct manoutput *); +void *ps_alloc(const struct manoutput *); void pspdf_free(void *); void terminal_mdoc(void *, const struct roff_man *); -- cgit v1.2.3