diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-24 14:38:32 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-24 14:38:32 +0000 |
commit | 07569d42d40c11c0305c5b07d2c1bbb04047c52f (patch) | |
tree | 0ca3f05c4302f6bc52990f37471deafaec85364e /mandoc.h | |
parent | 913045bd69043c5a0ba155b88f2ef24c6bcae97f (diff) | |
download | mandoc-07569d42d40c11c0305c5b07d2c1bbb04047c52f.tar.gz |
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.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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 *); |