diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-07-12 22:35:09 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-07-12 22:35:09 +0000 |
commit | 31ef1ce0e9d80ed34071bc98f128ab5d287cf750 (patch) | |
tree | dff215c1b34d5bee6654b83ee87d0d13d9d28029 /usr.bin/mandoc | |
parent | 3eb240ff678fd37282294ad073495b91b076deeb (diff) |
sync to 1.7.23: pass warning code to mdoc_pwarn() instead of warning message
define additional warning macro mdoc_nwarn()
remove obsolete warning functions mdoc_warn(), pwarn(), vwarn(), nwarn()
remove various now unused "enum mdoc_warn" and "enum mwarn"
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/libmdoc.h | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 37 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.h | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_action.c | 44 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_argv.c | 65 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 45 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 153 |
7 files changed, 60 insertions, 301 deletions
diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h index 7b6b604e16a..5ca3f05074f 100644 --- a/usr.bin/mandoc/libmdoc.h +++ b/usr.bin/mandoc/libmdoc.h @@ -1,4 +1,4 @@ -/* $Id: libmdoc.h,v 1.12 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: libmdoc.h,v 1.13 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -118,13 +118,14 @@ extern const struct mdoc_macro *const mdoc_macros; __BEGIN_DECLS -int mdoc_warn(struct mdoc *, enum mdoc_warn, const char *, ...); -int mdoc_pwarn(struct mdoc *, int, int, - enum mdoc_warn,const char *, ...); #define mdoc_perr(m, l, p, t) \ mdoc_err((m), (l), (p), 1, (t)) +#define mdoc_pwarn(m, l, p, t) \ + mdoc_err((m), (l), (p), 0, (t)) #define mdoc_nerr(m, n, t) \ mdoc_err((m), (n)->line, (n)->pos, 0, (t)) +#define mdoc_nwarn(m, n, t) \ + mdoc_err((m), (n)->line, (n)->pos, 1, (t)) int mdoc_err(struct mdoc *, int, int, int, enum merr); int mdoc_verr(struct mdoc *, int, int, const char *, ...); diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index 94ebf3b0059..478f08c4e19 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.16 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.17 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -324,25 +324,8 @@ mdoc_vwarn(struct mdoc *mdoc, int ln, int pos, const char *fmt, ...) va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); va_end(ap); - return((*mdoc->cb.mdoc_warn)(mdoc->data, ln, pos, buf)); -} - -int -mdoc_warn(struct mdoc *mdoc, enum mdoc_warn type, - const char *fmt, ...) -{ - char buf[256]; - va_list ap; - - if (NULL == mdoc->cb.mdoc_warn) - return(0); - - va_start(ap, fmt); - (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); - va_end(ap); - return((*mdoc->cb.mdoc_warn)(mdoc->data, mdoc->last->line, - mdoc->last->pos, buf)); + return((*mdoc->cb.mdoc_warn)(mdoc->data, ln, pos, buf)); } @@ -362,22 +345,6 @@ mdoc_err(struct mdoc *m, int line, int pos, int iserr, enum merr type) int -mdoc_pwarn(struct mdoc *mdoc, int line, int pos, enum mdoc_warn type, - const char *fmt, ...) -{ - char buf[256]; - va_list ap; - - if (NULL == mdoc->cb.mdoc_warn) - return(0); - - va_start(ap, fmt); - (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); - va_end(ap); - return((*mdoc->cb.mdoc_warn)(mdoc->data, line, pos, buf)); -} - -int mdoc_macro(struct mdoc *m, int tok, int ln, int pp, int *pos, char *buf) { diff --git a/usr.bin/mandoc/mdoc.h b/usr.bin/mandoc/mdoc.h index e81c2970df2..89f1925db54 100644 --- a/usr.bin/mandoc/mdoc.h +++ b/usr.bin/mandoc/mdoc.h @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.8 2009/07/12 18:28:29 schwarze Exp $ */ +/* $Id: mdoc.h,v 1.9 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -179,12 +179,6 @@ #define MDOC_Nested 25 #define MDOC_ARG_MAX 26 -/* Warnings are either syntax or groff-compatibility. */ -enum mdoc_warn { - WARN_SYNTAX, - WARN_COMPAT -}; - /* Type of a syntax node. */ enum mdoc_type { MDOC_TEXT, diff --git a/usr.bin/mandoc/mdoc_action.c b/usr.bin/mandoc/mdoc_action.c index 069fd35c535..95ee2b88db7 100644 --- a/usr.bin/mandoc/mdoc_action.c +++ b/usr.bin/mandoc/mdoc_action.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.13 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: mdoc_action.c,v 1.14 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -24,12 +24,6 @@ #include "libmdoc.h" -enum mwarn { - WBADSEC, - WNOWIDTH, - WBADDATE -}; - #define PRE_ARGS struct mdoc *m, const struct mdoc_node *n #define POST_ARGS struct mdoc *m @@ -38,7 +32,6 @@ struct actions { int (*post)(POST_ARGS); }; -static int pwarn(struct mdoc *, int, int, enum mwarn); static int concat(struct mdoc *, const struct mdoc_node *, char *, size_t); @@ -60,8 +53,6 @@ static int post_std(POST_ARGS); static int pre_bd(PRE_ARGS); static int pre_dl(PRE_ARGS); -#define vwarn(m, t) pwarn((m), (m)->last->line, (m)->last->pos, (t)) - const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ap */ { NULL, post_dd }, /* Dd */ @@ -246,31 +237,6 @@ concat(struct mdoc *m, const struct mdoc_node *n, static int -pwarn(struct mdoc *m, int line, int pos, enum mwarn type) -{ - char *p; - int c; - - p = NULL; - c = WARN_SYNTAX; - switch (type) { - case (WBADSEC): - p = "inappropriate document section in manual section"; - c = WARN_COMPAT; - break; - case (WNOWIDTH): - p = "cannot determine default width"; - break; - case (WBADDATE): - p = "malformed date syntax"; - break; - } - assert(p); - return(mdoc_pwarn(m, line, pos, c, p)); -} - - -static int post_std(POST_ARGS) { @@ -351,7 +317,7 @@ post_sh(POST_ARGS) case (9): break; default: - return(vwarn(m, WBADSEC)); + return(mdoc_nwarn(m, m->last, EBADSEC)); } break; default: @@ -514,7 +480,7 @@ post_bl_tagwidth(struct mdoc *m) if (n) { if (MDOC_TEXT != n->type) { if (0 == (sz = (int)mdoc_macro2len(n->tok))) - if ( ! vwarn(m, WNOWIDTH)) + if ( ! mdoc_nwarn(m, m->last, ENOWIDTH)) return(0); } else sz = (int)strlen(n->string) + 1; @@ -582,7 +548,7 @@ post_bl_width(struct mdoc *m) else if (MDOC_MAX == (tok = mdoc_hash_find(m->htab, p))) return(1); else if (0 == (width = mdoc_macro2len(tok))) - return(vwarn(m, WNOWIDTH)); + return(mdoc_nwarn(m, m->last, ENOWIDTH)); /* The value already exists: free and reallocate it. */ @@ -739,7 +705,7 @@ post_dd(POST_ARGS) return(0); if (0 == (m->meta.date = mdoc_atotime(buf))) { - if ( ! vwarn(m, WBADDATE)) + if ( ! mdoc_nwarn(m, m->last, EBADDATE)) return(0); m->meta.date = time(NULL); } diff --git a/usr.bin/mandoc/mdoc_argv.c b/usr.bin/mandoc/mdoc_argv.c index f2dd8ba3d89..4a840c11384 100644 --- a/usr.bin/mandoc/mdoc_argv.c +++ b/usr.bin/mandoc/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.7 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: mdoc_argv.c,v 1.8 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -47,13 +47,6 @@ #define MULTI_STEP 5 -enum mwarn { - WQUOTPARM, - WARGVPARM, - WCOLEMPTY, - WTAILWS -}; - static int argv_a2arg(int, const char *); static int args(struct mdoc *, int, int *, char *, int, char **); @@ -65,7 +58,6 @@ static int argv_opt_single(struct mdoc *, int, struct mdoc_argv *, int *, char *); static int argv_multi(struct mdoc *, int, struct mdoc_argv *, int *, char *); -static int pwarn(struct mdoc *, int, int, enum mwarn); /* Per-argument flags. */ @@ -275,7 +267,7 @@ mdoc_argv(struct mdoc *m, int line, int tok, /* XXX - restore saved zeroed byte. */ if (sv) buf[*pos - 1] = sv; - if ( ! pwarn(m, line, i, WARGVPARM)) + if ( ! mdoc_pwarn(m, line, i, EARGVPARM)) return(ARGV_ERROR); return(ARGV_WORD); } @@ -342,37 +334,8 @@ mdoc_argv_free(struct mdoc_arg *p) } -static int -pwarn(struct mdoc *mdoc, int line, int pos, enum mwarn code) -{ - char *p; - int c; - - p = NULL; - c = WARN_SYNTAX; - switch (code) { - case (WQUOTPARM): - p = "unexpected quoted parameter"; - break; - case (WARGVPARM): - p = "argument-like parameter"; - break; - case (WCOLEMPTY): - p = "last list column is empty"; - c = WARN_COMPAT; - break; - case (WTAILWS): - p = "trailing whitespace"; - c = WARN_COMPAT; - break; - } - assert(p); - return(mdoc_pwarn(mdoc, line, pos, c, p)); -} - - int -mdoc_args(struct mdoc *mdoc, int line, +mdoc_args(struct mdoc *m, int line, int *pos, char *buf, int tok, char **v) { int fl, c, i; @@ -388,7 +351,7 @@ mdoc_args(struct mdoc *mdoc, int line, switch (tok) { case (MDOC_It): - for (n = mdoc->last; n; n = n->parent) + for (n = m->last; n; n = n->parent) if (MDOC_BLOCK == n->type && MDOC_Bl == n->tok) break; @@ -423,12 +386,12 @@ mdoc_args(struct mdoc *mdoc, int line, break; } - return(args(mdoc, line, pos, buf, fl, v)); + return(args(m, line, pos, buf, fl, v)); } static int -args(struct mdoc *mdoc, int line, +args(struct mdoc *m, int line, int *pos, char *buf, int fl, char **v) { int i; @@ -440,11 +403,11 @@ args(struct mdoc *mdoc, int line, return(ARGS_EOLN); if ('\"' == buf[*pos] && ! (fl & ARGS_QUOTED)) - if ( ! pwarn(mdoc, line, *pos, WQUOTPARM)) + if ( ! mdoc_pwarn(m, line, *pos, EQUOTPARM)) return(ARGS_ERROR); if ( ! (fl & ARGS_ARGVLIKE) && '-' == buf[*pos]) - if ( ! pwarn(mdoc, line, *pos, WARGVPARM)) + if ( ! mdoc_pwarn(m, line, *pos, EARGVPARM)) return(ARGS_ERROR); /* @@ -536,10 +499,10 @@ args(struct mdoc *mdoc, int line, } if (p && 0 == *p) - if ( ! pwarn(mdoc, line, *pos, WCOLEMPTY)) + if ( ! mdoc_pwarn(m, line, *pos, ECOLEMPTY)) return(0); if (p && 0 == *p && p > *v && ' ' == *(p - 1)) - if ( ! pwarn(mdoc, line, *pos, WTAILWS)) + if ( ! mdoc_pwarn(m, line, *pos, ETAILWS)) return(0); if (p) @@ -551,7 +514,7 @@ args(struct mdoc *mdoc, int line, assert(p); if (p > *v && ' ' == *(p - 1)) - if ( ! pwarn(mdoc, line, *pos, WTAILWS)) + if ( ! mdoc_pwarn(m, line, *pos, ETAILWS)) return(0); *pos += (int)(p - *v); @@ -583,7 +546,7 @@ args(struct mdoc *mdoc, int line, if (buf[*pos]) return(ARGS_WORD); - if ( ! pwarn(mdoc, line, *pos, WTAILWS)) + if ( ! mdoc_pwarn(m, line, *pos, ETAILWS)) return(ARGS_ERROR); return(ARGS_WORD); @@ -601,7 +564,7 @@ args(struct mdoc *mdoc, int line, (*pos)++; if (0 == buf[*pos]) { - (void)mdoc_perr(mdoc, line, *pos, EQUOTTERM); + (void)mdoc_perr(m, line, *pos, EQUOTTERM); return(ARGS_ERROR); } @@ -615,7 +578,7 @@ args(struct mdoc *mdoc, int line, if (buf[*pos]) return(ARGS_QWORD); - if ( ! pwarn(mdoc, line, *pos, WTAILWS)) + if ( ! mdoc_pwarn(m, line, *pos, ETAILWS)) return(ARGS_ERROR); return(ARGS_QWORD); diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index 163f812eb74..5752729efbc 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.9 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.10 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -22,13 +22,6 @@ #include "libmdoc.h" -enum mwarn { - WIGNE, - WIMPBRK, - WMACPARM, - WOBS -}; - #define REWIND_REWIND (1 << 0) #define REWIND_NOHALT (1 << 1) #define REWIND_HALT (1 << 2) @@ -55,7 +48,6 @@ static int rew_subblock(enum mdoc_type, static int rew_last(struct mdoc *, struct mdoc_node *); static int append_delims(struct mdoc *, int, int *, char *); static int lookup(struct mdoc *, int, int, int, const char *); -static int pwarn(struct mdoc *, int, int, enum mwarn); static int swarn(struct mdoc *, enum mdoc_type, int, int, const struct mdoc_node *); @@ -186,31 +178,6 @@ const struct mdoc_macro * const mdoc_macros = __mdoc_macros; static int -pwarn(struct mdoc *mdoc, int line, int pos, enum mwarn type) -{ - char *p; - - p = NULL; - switch (type) { - case (WIGNE): - p = "ignoring empty element"; - break; - case (WIMPBRK): - p = "crufty end-of-line scope violation"; - break; - case (WMACPARM): - p = "macro-like parameter"; - break; - case (WOBS): - p = "macro marked obsolete"; - break; - } - assert(p); - return(mdoc_pwarn(mdoc, line, pos, WARN_SYNTAX, p)); -} - - -static int swarn(struct mdoc *mdoc, enum mdoc_type type, int line, int pos, const struct mdoc_node *p) { @@ -293,7 +260,7 @@ lookup(struct mdoc *mdoc, int line, int pos, int from, const char *p) return(res); if (MDOC_MAX == res) return(res); - if ( ! pwarn(mdoc, line, pos, WMACPARM)) + if ( ! mdoc_pwarn(mdoc, line, pos, EMACPARM)) return(-1); return(MDOC_MAX); } @@ -836,7 +803,7 @@ in_line(MACRO_PROT_ARGS) return(0); } else if ( ! nc && 0 == cnt) { mdoc_argv_free(arg); - if ( ! pwarn(mdoc, line, ppos, WIGNE)) + if ( ! mdoc_pwarn(mdoc, line, ppos, EIGNE)) return(0); } c = mdoc_macro(mdoc, c, line, la, pos, buf); @@ -892,7 +859,7 @@ in_line(MACRO_PROT_ARGS) return(0); } else if ( ! nc && 0 == cnt) { mdoc_argv_free(arg); - if ( ! pwarn(mdoc, line, ppos, WIGNE)) + if ( ! mdoc_pwarn(mdoc, line, ppos, EIGNE)) return(0); } @@ -1076,7 +1043,7 @@ blk_part_imp(MACRO_PROT_ARGS) if (body == n) break; - if (NULL == n && ! pwarn(mdoc, body->line, body->pos, WIMPBRK)) + if (NULL == n && ! mdoc_nwarn(mdoc, body, EIMPBRK)) return(0); if (n && ! rew_last(mdoc, body)) @@ -1379,7 +1346,7 @@ static int obsolete(MACRO_PROT_ARGS) { - return(pwarn(mdoc, line, ppos, WOBS)); + return(mdoc_pwarn(mdoc, line, ppos, EOBS)); } diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 5592b069069..f80bb588431 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.20 2009/07/12 21:45:44 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.21 2009/07/12 22:35:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -31,26 +31,6 @@ #define PRE_ARGS struct mdoc *mdoc, const struct mdoc_node *n #define POST_ARGS struct mdoc *mdoc -enum mwarn { - WPRINT, - WNOWIDTH, - WMISSWIDTH, - WESCAPE, - WWRONGMSEC, - WSECOOO, - WSECREP, - WBADSTAND, - WNAMESECINC, - WNOMULTILINE, - WMULTILINE, - WLINE, - WNOLINE, - WPROLOOO, - WPROLREP, - WARGVAL, - WBADSEC, - WBADMSEC -}; typedef int (*v_pre)(PRE_ARGS); typedef int (*v_post)(POST_ARGS); @@ -60,7 +40,6 @@ struct valids { v_post *post; }; -static int pwarn(struct mdoc *, int, int, enum mwarn); static int check_parent(PRE_ARGS, int, enum mdoc_type); static int check_msec(PRE_ARGS, ...); static int check_sec(PRE_ARGS, ...); @@ -125,9 +104,6 @@ static int post_sh_body(POST_ARGS); static int post_sh_head(POST_ARGS); static int post_st(POST_ARGS); -#define vwarn(m, t) nwarn((m), (m)->last, (t)) -#define nwarn(m, n, t) pwarn((m), (n)->line, (n)->pos, (t)) - static v_pre pres_an[] = { pre_an, NULL }; static v_pre pres_bd[] = { pre_display, pre_bd, NULL }; static v_pre pres_bl[] = { pre_bl, NULL }; @@ -349,86 +325,11 @@ mdoc_valid_post(struct mdoc *mdoc) static int -pwarn(struct mdoc *m, int line, int pos, enum mwarn type) -{ - char *p; - enum mdoc_warn c; - - c = WARN_SYNTAX; - p = NULL; - switch (type) { - case (WBADMSEC): - p = "inappropriate manual section"; - c = WARN_COMPAT; - break; - case (WBADSEC): - p = "inappropriate document section"; - c = WARN_COMPAT; - break; - case (WARGVAL): - p = "argument value suggested"; - c = WARN_COMPAT; - break; - case (WPROLREP): - p = "prologue macros repeated"; - c = WARN_COMPAT; - break; - case (WPROLOOO): - p = "prologue macros out-of-order"; - c = WARN_COMPAT; - break; - case (WNOWIDTH): - p = "superfluous width argument"; - break; - case (WMISSWIDTH): - p = "missing width argument"; - break; - case (WPRINT): - p = "invalid character"; - break; - case (WESCAPE): - p = "invalid escape sequence"; - break; - case (WNOLINE): - p = "suggested no line arguments"; - break; - case (WLINE): - p = "suggested line arguments"; - break; - case (WMULTILINE): - p = "suggested multi-line arguments"; - break; - case (WNOMULTILINE): - p = "suggested no multi-line arguments"; - break; - case (WWRONGMSEC): - p = "document section in wrong manual section"; - c = WARN_COMPAT; - break; - case (WSECOOO): - p = "document section out of conventional order"; - break; - case (WSECREP): - p = "document section repeated"; - break; - case (WBADSTAND): - p = "unknown standard"; - break; - case (WNAMESECINC): - p = "NAME section contents incomplete/badly-ordered"; - break; - } - assert(p); - return(mdoc_pwarn(m, line, pos, c, p)); -} - - -static int warn_print(struct mdoc *m, int ln, int pos) { if (MDOC_IGN_CHARS & m->pflags) - return(pwarn(m, ln, pos, WPRINT)); + return(mdoc_pwarn(m, ln, pos, EPRINT)); return(mdoc_perr(m, ln, pos, EPRINT)); } @@ -522,7 +423,7 @@ check_stdarg(PRE_ARGS) if (n->args && 1 == n->args->argc) if (MDOC_Std == n->args->argv[0].arg) return(1); - return(nwarn(mdoc, n, WARGVAL)); + return(mdoc_nwarn(mdoc, n, EARGVAL)); } @@ -546,7 +447,7 @@ check_sec(PRE_ARGS, ...) } va_end(ap); - return(nwarn(mdoc, n, WBADSEC)); + return(mdoc_nwarn(mdoc, n, EBADSEC)); } @@ -568,7 +469,7 @@ check_msec(PRE_ARGS, ...) } va_end(ap); - return(nwarn(mdoc, n, WBADMSEC)); + return(mdoc_nwarn(mdoc, n, EBADMSEC)); } @@ -749,7 +650,7 @@ pre_bl(PRE_ARGS) switch (type) { case (MDOC_Tag): - if (-1 == width && ! nwarn(mdoc, n, WMISSWIDTH)) + if (-1 == width && ! mdoc_nwarn(mdoc, n, EMISSWIDTH)) return(0); break; case (MDOC_Column): @@ -759,7 +660,7 @@ pre_bl(PRE_ARGS) case (MDOC_Inset): /* FALLTHROUGH */ case (MDOC_Item): - if (-1 != width && ! nwarn(mdoc, n, WNOWIDTH)) + if (-1 != width && ! mdoc_nwarn(mdoc, n, ENOWIDTH)) return(0); break; default: @@ -898,10 +799,10 @@ pre_dt(PRE_ARGS) { if (0 == mdoc->meta.date || mdoc->meta.os) - if ( ! nwarn(mdoc, n, WPROLOOO)) + if ( ! mdoc_nwarn(mdoc, n, EPROLOOO)) return(0); if (mdoc->meta.title) - if ( ! nwarn(mdoc, n, WPROLREP)) + if ( ! mdoc_nwarn(mdoc, n, EPROLREP)) return(0); return(1); } @@ -912,10 +813,10 @@ pre_os(PRE_ARGS) { if (NULL == mdoc->meta.title || 0 == mdoc->meta.date) - if ( ! nwarn(mdoc, n, WPROLOOO)) + if ( ! mdoc_nwarn(mdoc, n, EPROLOOO)) return(0); if (mdoc->meta.os) - if ( ! nwarn(mdoc, n, WPROLREP)) + if ( ! mdoc_nwarn(mdoc, n, EPROLREP)) return(0); return(1); } @@ -926,10 +827,10 @@ pre_dd(PRE_ARGS) { if (mdoc->meta.title || mdoc->meta.os) - if ( ! nwarn(mdoc, n, WPROLOOO)) + if ( ! mdoc_nwarn(mdoc, n, EPROLOOO)) return(0); if (mdoc->meta.date) - if ( ! nwarn(mdoc, n, WPROLREP)) + if ( ! mdoc_nwarn(mdoc, n, EPROLREP)) return(0); return(1); } @@ -1073,7 +974,7 @@ post_it(POST_ARGS) switch (type) { case (MDOC_Tag): if (NULL == mdoc->last->head->child) - if ( ! vwarn(mdoc, WLINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ELINE)) return(0); break; case (MDOC_Hang): @@ -1084,10 +985,10 @@ post_it(POST_ARGS) /* FALLTHROUGH */ case (MDOC_Diag): if (NULL == mdoc->last->head->child) - if ( ! vwarn(mdoc, WLINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ELINE)) return(0); if (NULL == mdoc->last->body->child) - if ( ! vwarn(mdoc, WMULTILINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, EMULTILINE)) return(0); break; case (MDOC_Bullet): @@ -1100,18 +1001,18 @@ post_it(POST_ARGS) /* FALLTHROUGH */ case (MDOC_Item): if (mdoc->last->head->child) - if ( ! vwarn(mdoc, WNOLINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ENOLINE)) return(0); if (NULL == mdoc->last->body->child) - if ( ! vwarn(mdoc, WMULTILINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, EMULTILINE)) return(0); break; case (MDOC_Column): if (NULL == mdoc->last->head->child) - if ( ! vwarn(mdoc, WLINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ELINE)) return(0); if (mdoc->last->body->child) - if ( ! vwarn(mdoc, WNOMULTILINE)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ENOMULTILINE)) return(0); c = mdoc->last->child; for (i = 0; c && MDOC_HEAD == c->type; c = c->next) @@ -1224,7 +1125,7 @@ post_st(POST_ARGS) if (mdoc_a2st(mdoc->last->child->string)) return(1); - return(vwarn(mdoc, WBADSTAND)); + return(mdoc_nwarn(mdoc, mdoc->last, EBADSTAND)); } @@ -1256,20 +1157,20 @@ post_sh_body(POST_ARGS) */ if (NULL == (n = mdoc->last->child)) - return(vwarn(mdoc, WNAMESECINC)); + return(mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC)); for ( ; n && n->next; n = n->next) { if (MDOC_ELEM == n->type && MDOC_Nm == n->tok) continue; if (MDOC_TEXT == n->type) continue; - if ( ! vwarn(mdoc, WNAMESECINC)) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC)) return(0); } if (MDOC_ELEM == n->type && MDOC_Nd == n->tok) return(1); - return(vwarn(mdoc, WNAMESECINC)); + return(mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC)); } @@ -1313,9 +1214,9 @@ post_sh_head(POST_ARGS) if (SEC_CUSTOM == sec) return(1); if (sec == mdoc->lastnamed) - return(vwarn(mdoc, WSECREP)); + return(mdoc_nwarn(mdoc, mdoc->last, ESECREP)); if (sec < mdoc->lastnamed) - return(vwarn(mdoc, WSECOOO)); + return(mdoc_nwarn(mdoc, mdoc->last, ESECOOO)); /* * Check particular section/manual conventions. LIBRARY can @@ -1330,7 +1231,7 @@ post_sh_head(POST_ARGS) case (3): break; default: - return(vwarn(mdoc, WWRONGMSEC)); + return(mdoc_nwarn(mdoc, mdoc->last, EWRONGMSEC)); } break; default: |