version 1.78, 2009/06/15 09:55:43 |
version 1.81, 2009/06/16 19:13:28 |
Line 242 mdoc_parseln(struct mdoc *m, int ln, char *buf) |
|
Line 242 mdoc_parseln(struct mdoc *m, int ln, char *buf) |
|
} |
} |
|
|
|
|
void |
|
mdoc_vmsg(struct mdoc *mdoc, int ln, int pos, const char *fmt, ...) |
|
{ |
|
char buf[256]; |
|
va_list ap; |
|
|
|
if (NULL == mdoc->cb.mdoc_msg) |
|
return; |
|
|
|
va_start(ap, fmt); |
|
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); |
|
va_end(ap); |
|
(*mdoc->cb.mdoc_msg)(mdoc->data, ln, pos, buf); |
|
} |
|
|
|
|
|
int |
int |
mdoc_verr(struct mdoc *mdoc, int ln, int pos, |
mdoc_verr(struct mdoc *mdoc, int ln, int pos, |
const char *fmt, ...) |
const char *fmt, ...) |
Line 293 mdoc_vwarn(struct mdoc *mdoc, int ln, int pos, |
|
Line 277 mdoc_vwarn(struct mdoc *mdoc, int ln, int pos, |
|
|
|
|
|
int |
int |
mdoc_nwarn(struct mdoc *mdoc, const struct mdoc_node *node, 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, node->line, node->pos, type, |
|
buf)); |
|
} |
|
|
|
int |
|
mdoc_nerr(struct mdoc *mdoc, const struct mdoc_node *node, const char *fmt, ...) |
mdoc_nerr(struct mdoc *mdoc, const struct mdoc_node *node, const char *fmt, ...) |
{ |
{ |
char buf[256]; |
char buf[256]; |
Line 359 mdoc_err(struct mdoc *mdoc, const char *fmt, ...) |
|
Line 326 mdoc_err(struct mdoc *mdoc, const char *fmt, ...) |
|
} |
} |
|
|
|
|
void |
|
mdoc_msg(struct mdoc *mdoc, const char *fmt, ...) |
|
{ |
|
char buf[256]; |
|
va_list ap; |
|
|
|
if (NULL == mdoc->cb.mdoc_msg) |
|
return; |
|
|
|
va_start(ap, fmt); |
|
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); |
|
va_end(ap); |
|
(*mdoc->cb.mdoc_msg)(mdoc->data, mdoc->last->line, mdoc->last->pos, |
|
buf); |
|
} |
|
|
|
|
|
void |
|
mdoc_pmsg(struct mdoc *mdoc, int line, int pos, const char *fmt, ...) |
|
{ |
|
char buf[256]; |
|
va_list ap; |
|
|
|
if (NULL == mdoc->cb.mdoc_msg) |
|
return; |
|
|
|
va_start(ap, fmt); |
|
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap); |
|
va_end(ap); |
|
(*mdoc->cb.mdoc_msg)(mdoc->data, line, pos, buf); |
|
} |
|
|
|
|
|
int |
int |
mdoc_pwarn(struct mdoc *mdoc, int line, int pos, enum mdoc_warn type, |
mdoc_pwarn(struct mdoc *mdoc, int line, int pos, enum mdoc_warn type, |
const char *fmt, ...) |
const char *fmt, ...) |
Line 723 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 657 parsemacro(struct mdoc *m, int ln, char *buf) |
|
int i, c; |
int i, c; |
char mac[5]; |
char mac[5]; |
|
|
/* Comments and empties are quickly ignored. */ |
/* Empty lines are ignored. */ |
|
|
if (0 == buf[1]) |
if (0 == buf[1]) |
return(1); |
return(1); |
Line 736 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 670 parsemacro(struct mdoc *m, int ln, char *buf) |
|
return(1); |
return(1); |
return(perr(m, ln, 1, ESPACE)); |
return(perr(m, ln, 1, ESPACE)); |
} |
} |
|
|
if (buf[1] && '\\' == buf[1]) |
|
if (buf[2] && '\"' == buf[2]) |
|
return(1); |
|
|
|
/* Copy the first word into a nil-terminated buffer. */ |
/* Copy the first word into a nil-terminated buffer. */ |
|
|