X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/f3bb876e3422b8b2f16b0a2ef93cfde924fe19ee..ed088b20c8d258b687399136f7b92df974abf6f3:/chars.c?ds=inline diff --git a/chars.c b/chars.c index 7ce4666d..461ac067 100644 --- a/chars.c +++ b/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.12 2009/11/01 07:44:32 kristaps Exp $ */ +/* $Id: chars.c,v 1.17 2010/03/23 13:25:01 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -14,6 +14,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -38,7 +42,7 @@ struct ln { #define CHARS_BOTH (CHARS_CHAR | CHARS_STRING) }; -#define LINES_MAX 351 +#define LINES_MAX 369 #define CHAR(w, x, y, z, a, b) \ { NULL, (w), (y), (a), (x), (z), (b), CHARS_CHAR }, @@ -47,9 +51,10 @@ struct ln { #define BOTH(w, x, y, z, a, b) \ { NULL, (w), (y), (a), (x), (z), (b), CHARS_BOTH }, -static struct ln lines[LINES_MAX] = { +#define CHAR_TBL_START static struct ln lines[LINES_MAX] = { +#define CHAR_TBL_END }; + #include "chars.in" -}; struct tbl { enum chars type; @@ -161,18 +166,6 @@ find(struct tbl *tab, const char *p, size_t sz, size_t *rsz, int type) if (NULL == (pp = htab[hash])) return(NULL); - if (NULL == pp->next) { - if ( ! match(pp, p, sz, type)) - return(NULL); - - if (CHARS_HTML == tab->type) { - *rsz = pp->htmlsz; - return(pp->html); - } - *rsz = pp->asciisz; - return(pp->ascii); - } - for (prev = NULL; pp; pp = pp->next) { if ( ! match(pp, p, sz, type)) { prev = pp;