aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libman.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:02:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:02:05 +0000
commit71ddcd873082a3c68ed2be7b7661075fb09d5849 (patch)
tree7eb75a067079e8a591b76791b56f0b7673b109d5 /libman.h
parent58ca7d3112e5d39b93ab732cf103b4b0b834b106 (diff)
downloadmandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.tar.gz
mandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.tar.zst
mandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.zip
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 'libman.h')
-rw-r--r--libman.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/libman.h b/libman.h
index b264a3ac..3094cb8a 100644
--- a/libman.h
+++ b/libman.h
@@ -1,4 +1,4 @@
-/* $Id: libman.h,v 1.46 2011/03/17 11:56:17 kristaps Exp $ */
+/* $Id: libman.h,v 1.47 2011/03/20 16:02:05 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -25,8 +25,7 @@ enum man_next {
};
struct man {
- void *data; /* private application data */
- mandocmsg msg; /* output message handler */
+ struct mparse *parse; /* parse pointer */
int flags; /* parse flags */
#define MAN_HALT (1 << 0) /* badness happened: die */
#define MAN_ELINE (1 << 1) /* Next-line element scope. */
@@ -64,9 +63,9 @@ extern const struct man_macro *const man_macros;
__BEGIN_DECLS
#define man_pmsg(m, l, p, t) \
- (*(m)->msg)((t), (m)->data, (l), (p), NULL)
+ mandoc_msg((t), (m)->parse, (l), (p), NULL)
#define man_nmsg(m, n, t) \
- (*(m)->msg)((t), (m)->data, (n)->line, (n)->pos, NULL)
+ mandoc_msg((t), (m)->parse, (n)->line, (n)->pos, NULL)
int man_word_alloc(struct man *, int, int, const char *);
int man_block_alloc(struct man *, int, int, enum mant);
int man_head_alloc(struct man *, int, int, enum mant);
@@ -81,8 +80,6 @@ int man_args(struct man *, int, int *, char *, char **);
#define ARGS_EOLN (0)
#define ARGS_WORD (1)
#define ARGS_QWORD (1)
-void man_vmsg(struct man *, enum mandocerr,
- int, int, const char *, ...);
int man_valid_post(struct man *);
int man_valid_pre(struct man *, struct man_node *);
int man_unscope(struct man *,