=================================================================== RCS file: /cvs/mandoc/chars.c,v retrieving revision 1.12 retrieving revision 1.20 diff -u -p -r1.12 -r1.20 --- mandoc/chars.c 2009/11/01 07:44:32 1.12 +++ mandoc/chars.c 2010/06/19 20:46:27 1.20 @@ -1,6 +1,6 @@ -/* $Id: chars.c,v 1.12 2009/11/01 07:44:32 kristaps Exp $ */ +/* $Id: chars.c,v 1.20 2010/06/19 20:46:27 kristaps Exp $ */ /* - * Copyright (c) 2009 Kristaps Dzonsons + * Copyright (c) 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,11 +14,16 @@ * 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 #include +#include "mandoc.h" #include "chars.h" #define PRINT_HI 126 @@ -38,7 +43,7 @@ struct ln { #define CHARS_BOTH (CHARS_CHAR | CHARS_STRING) }; -#define LINES_MAX 351 +#define LINES_MAX 370 #define CHAR(w, x, y, z, a, b) \ { NULL, (w), (y), (a), (x), (z), (b), CHARS_CHAR }, @@ -47,9 +52,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; @@ -160,18 +166,6 @@ find(struct tbl *tab, const char *p, size_t sz, size_t 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)) {