version 1.16, 2009/07/12 21:45:44 |
version 1.17, 2009/07/12 22:35:08 |
|
|
va_start(ap, fmt); |
va_start(ap, fmt); |
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); |
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); |
va_end(ap); |
va_end(ap); |
|
|
return((*mdoc->cb.mdoc_warn)(mdoc->data, ln, pos, buf)); |
return((*mdoc->cb.mdoc_warn)(mdoc->data, ln, pos, buf)); |
} |
} |
|
|
|
|
int |
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)); |
|
} |
|
|
|
|
|
int |
|
mdoc_err(struct mdoc *m, int line, int pos, int iserr, enum merr type) |
mdoc_err(struct mdoc *m, int line, int pos, int iserr, enum merr type) |
{ |
{ |
const char *p; |
const char *p; |
|
|
return(mdoc_vwarn(m, line, pos, p)); |
return(mdoc_vwarn(m, line, pos, p)); |
} |
} |
|
|
|
|
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 |
int |
mdoc_macro(struct mdoc *m, int tok, |
mdoc_macro(struct mdoc *m, int tok, |