aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-24 14:38:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-24 14:38:32 +0000
commita70f21c0692d63a23e666b09912d21d50f61f0cb (patch)
tree1af950fd45e8960526ae05ff29dbcbce612efd50 /mandoc.h
parent5ade79f1a4ef39ab8eb8088ec66210650561d148 (diff)
downloadmandoc-a70f21c0692d63a23e666b09912d21d50f61f0cb.tar.gz
mandoc-a70f21c0692d63a23e666b09912d21d50f61f0cb.tar.zst
mandoc-a70f21c0692d63a23e666b09912d21d50f61f0cb.zip
Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of a specific operating system. Mark operating system specific messages with "(OpenBSD)" at the end. Please use just "-Tlint" to check base system manuals (defaulting to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the manuals of portable software projects you maintain that are not part of OpenBSD base, to avoid bogus recommendations about base system conventions that do not apply. Issue originally reported by semarie@, solution using an idea from tedu@, discussed with jmc@ and jca@.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/mandoc.h b/mandoc.h
index 83623167..aea9bcf4 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.232 2017/06/17 23:07:00 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.233 2017/06/24 14:38:32 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -44,12 +44,15 @@ enum mandoclevel {
enum mandocerr {
MANDOCERR_OK,
- MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
+ MANDOCERR_BASE, /* ===== start of base system conventions ===== */
MANDOCERR_MDOCDATE, /* Mdocdate found: Dd ... */
MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */
- MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */
MANDOCERR_RCS_MISSING, /* RCS id missing */
+
+ MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
+
+ MANDOCERR_DATE_LEGACY, /* legacy man(7) date format: Dd ... */
MANDOCERR_RCS_REP, /* duplicate RCS id: ... */
MANDOCERR_MACRO_USELESS, /* useless macro: macro */
MANDOCERR_BX, /* consider using OS macro: macro */
@@ -413,6 +416,12 @@ struct eqn {
#define MPARSE_UTF8 16 /* accept UTF-8 input */
#define MPARSE_LATIN1 32 /* accept ISO-LATIN-1 input */
+enum mandoc_os {
+ MANDOC_OS_OTHER = 0,
+ MANDOC_OS_NETBSD,
+ MANDOC_OS_OPENBSD
+};
+
enum mandoc_esc {
ESCAPE_ERROR = 0, /* bail! unparsable escape */
ESCAPE_IGNORE, /* escape to be ignored */
@@ -448,7 +457,8 @@ const char *mchars_uc2str(int);
int mchars_num2uc(const char *, size_t);
int mchars_spec2cp(const char *, size_t);
const char *mchars_spec2str(const char *, size_t, size_t *);
-struct mparse *mparse_alloc(int, enum mandoclevel, mandocmsg, const char *);
+struct mparse *mparse_alloc(int, enum mandocerr, mandocmsg,
+ enum mandoc_os, const char *);
void mparse_free(struct mparse *);
void mparse_keep(struct mparse *);
int mparse_open(struct mparse *, const char *);