From 71ddcd873082a3c68ed2be7b7661075fb09d5849 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 20 Mar 2011 16:02:05 +0000 Subject: 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. --- libmandoc.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'libmandoc.h') diff --git a/libmandoc.h b/libmandoc.h index eadaf257..6f4a318a 100644 --- a/libmandoc.h +++ b/libmandoc.h @@ -1,4 +1,4 @@ -/* $Id: libmandoc.h,v 1.12 2011/03/17 08:49:34 kristaps Exp $ */ +/* $Id: libmandoc.h,v 1.13 2011/03/20 16:02:05 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * @@ -19,12 +19,16 @@ __BEGIN_DECLS -int mandoc_special(char *); -char *mandoc_strdup(const char *); -char *mandoc_getarg(char **, mandocmsg, void *, int, int *); -char *mandoc_normdate(char *, mandocmsg, void *, int, int); -int mandoc_eos(const char *, size_t, int); -int mandoc_hyph(const char *, const char *); +void mandoc_msg(enum mandocerr, struct mparse *, + int, int, const char *); +void mandoc_vmsg(enum mandocerr, struct mparse *, + int, int, const char *, ...); +int mandoc_special(char *); +char *mandoc_strdup(const char *); +char *mandoc_getarg(struct mparse *, char **, int, int *); +char *mandoc_normdate(struct mparse *, char *, int, int); +int mandoc_eos(const char *, size_t, int); +int mandoc_hyph(const char *, const char *); __END_DECLS -- cgit v1.2.3-56-ge451