X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/437eb74af037fff6e93890f2a4f81426d7142fab..c627c71afa8524db228768513547b8d836cc40c0:/mandoc_msg.c diff --git a/mandoc_msg.c b/mandoc_msg.c index aa0cce5a..ff4d8031 100644 --- a/mandoc_msg.c +++ b/mandoc_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD$ */ +/* $Id: mandoc_msg.c,v 1.6 2019/03/06 15:55:38 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze @@ -15,6 +15,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include @@ -167,6 +169,7 @@ static const char *const type_message[MANDOCERR_MAX] = { "tab in filled text", "new sentence, new line", "invalid escape sequence", + "undefined escape, printing literally", "undefined string, using \"\"", /* related to tables */ @@ -228,6 +231,7 @@ static const char *const type_message[MANDOCERR_MAX] = { "unsupported feature", "input too large", "unsupported control character", + "unsupported escape sequence", "unsupported roff request", "nested .while loops", "end of scope with open .while loop", @@ -238,7 +242,7 @@ static const char *const type_message[MANDOCERR_MAX] = { "ignoring macro in table", }; -static FILE *fileptr = stderr; +static FILE *fileptr = NULL; static const char *filename = NULL; static enum mandocerr min_type = MANDOCERR_MAX; static enum mandoclevel rc = MANDOCLEVEL_OK; @@ -288,8 +292,7 @@ mandoc_msg_setrc(enum mandoclevel level) } void -mandoc_vmsg(enum mandocerr t, void *dummy, int line, int col, - const char *fmt, ...) +mandoc_msg(enum mandocerr t, int line, int col, const char *fmt, ...) { va_list ap; enum mandoclevel level; @@ -324,12 +327,3 @@ mandoc_vmsg(enum mandocerr t, void *dummy, int line, int col, } fputc('\n', fileptr); } - -void -mandoc_msg(enum mandocerr t, void *dummy, int line, int col, const char *msg) -{ - if (msg == NULL) - mandoc_vmsg(t, dummy, line, col, NULL); - else - mandoc_vmsg(t, dummy, line, col, "%s", msg); -}