=================================================================== RCS file: /cvs/mandoc/tbl_opts.c,v retrieving revision 1.7 retrieving revision 1.10 diff -u -p -r1.7 -r1.10 --- mandoc/tbl_opts.c 2011/01/07 13:20:58 1.7 +++ mandoc/tbl_opts.c 2011/03/20 16:02:05 1.10 @@ -1,4 +1,4 @@ -/* $Id: tbl_opts.c,v 1.7 2011/01/07 13:20:58 kristaps Exp $ */ +/* $Id: tbl_opts.c,v 1.10 2011/03/20 16:02:05 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * @@ -20,6 +20,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #include "libroff.h" enum tbl_ident { @@ -88,7 +89,8 @@ arg(struct tbl_node *tbl, int ln, const char *p, int * /* Arguments always begin with a parenthesis. */ if ('(' != p[*pos]) { - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos); + mandoc_msg(MANDOCERR_TBL, tbl->parse, + ln, *pos, NULL); return(0); } @@ -103,12 +105,14 @@ arg(struct tbl_node *tbl, int ln, const char *p, int * switch (key) { case (KEY_DELIM): if ('\0' == p[(*pos)++]) { - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBL, tbl->parse, + ln, *pos - 1, NULL); return(0); } if ('\0' == p[(*pos)++]) { - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBL, tbl->parse, + ln, *pos - 1, NULL); return(0); } break; @@ -116,7 +120,8 @@ arg(struct tbl_node *tbl, int ln, const char *p, int * if ('\0' != (tbl->opts.tab = p[(*pos)++])) break; - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBL, tbl->parse, + ln, *pos - 1, NULL); return(0); case (KEY_LINESIZE): for (i = 0; i < KEY_MAXNUMSZ && p[*pos]; i++, (*pos)++) { @@ -131,13 +136,14 @@ arg(struct tbl_node *tbl, int ln, const char *p, int * break; } - (*tbl->msg)(MANDOCERR_TBL, tbl->data, ln, *pos, NULL); + mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos, NULL); return(0); case (KEY_DPOINT): if ('\0' != (tbl->opts.decimal = p[(*pos)++])) break; - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBL, tbl->parse, + ln, *pos - 1, NULL); return(0); default: abort(); @@ -149,7 +155,7 @@ arg(struct tbl_node *tbl, int ln, const char *p, int * if (')' == p[(*pos)++]) return(1); - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos - 1, NULL); return(0); } @@ -188,7 +194,7 @@ again: /* /* Copy up to first non-alpha character. */ for (sv = *pos, i = 0; i < KEY_MAXNAME; i++, (*pos)++) { - buf[i] = tolower(p[*pos]); + buf[i] = (char)tolower((unsigned char)p[*pos]); if ( ! isalpha((unsigned char)buf[i])) break; } @@ -196,7 +202,7 @@ again: /* /* Exit if buffer is empty (or overrun). */ if (KEY_MAXNAME == i || 0 == i) { - TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos); + mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos, NULL); return; } @@ -235,7 +241,7 @@ again: /* */ if (KEY_MAXKEYS == i) - TBL_MSG(tbl, MANDOCERR_TBLOPT, ln, sv); + mandoc_msg(MANDOCERR_TBLOPT, tbl->parse, ln, sv, NULL); goto again; /* NOTREACHED */