diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:02:05 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:02:05 +0000 |
commit | 80339b751a1833d9bbbf9856e7f48f56d91ba1d3 (patch) | |
tree | 4e59124e25202b7fa3543b670ae8434c1256cd45 /libmdoc.h | |
parent | 7ff718a5d9d20e97b6431bb61dc4cb34a1f431c7 (diff) | |
download | mandoc-80339b751a1833d9bbbf9856e7f48f56d91ba1d3.tar.gz |
Consolidate messages. Have all parse-time messages (in libmdoc,
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h. This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.
Diffstat (limited to 'libmdoc.h')
-rw-r--r-- | libmdoc.h | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -25,9 +25,8 @@ enum mdoc_next { }; struct mdoc { - void *data; /* private application data */ - mandocmsg msg; /* message callback */ - int flags; + struct mparse *parse; /* parse pointer */ + int flags; /* parse flags */ #define MDOC_HALT (1 << 0) /* error in parse: halt */ #define MDOC_LITERAL (1 << 1) /* in a literal scope */ #define MDOC_PBODY (1 << 2) /* in the document body */ @@ -86,11 +85,9 @@ extern const struct mdoc_macro *const mdoc_macros; __BEGIN_DECLS #define mdoc_pmsg(m, l, p, t) \ - (*(m)->msg)((t), (m)->data, (l), (p), NULL) + mandoc_msg((t), (m)->parse, (l), (p), NULL) #define mdoc_nmsg(m, n, t) \ - (*(m)->msg)((t), (m)->data, (n)->line, (n)->pos, NULL) -void mdoc_vmsg(struct mdoc *, enum mandocerr, - int, int, const char *, ...); + mandoc_msg((t), (m)->parse, (n)->line, (n)->pos, NULL) int mdoc_macro(MACRO_PROT_ARGS); int mdoc_word_alloc(struct mdoc *, int, int, const char *); |