discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Yuri Pankov <yuripv@gmx.com>
To: mdocml-discuss <discuss@mdocml.bsd.lv>
Subject: move roff sections to a separate file
Date: Tue, 30 May 2017 01:14:35 +0300	[thread overview]
Message-ID: <b34a95bc-8e9f-66b0-27d0-0fb01fed6ad1@gmx.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

I'd like a propose a small change which would simplify maintaining a 
downstream version for us (as we need it modified and with a bit changed 
order) - move list of sections (roff_sec) and their descriptions 
(secnames) to separate file which we keep without a need to sync with 
upstream, roffsec.in. Patch is pretty straightforward and simply moves 
both there.

[-- Attachment #2: roffsec.diff --]
[-- Type: text/plain, Size: 3542 bytes --]

commit 369032da926596cc6cec2a5615fe3afd9f6083db
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   Tue May 30 01:02:14 2017 +0300

    move section list to separate file

diff --git a/mdoc_validate.c b/mdoc_validate.c
index 1d3d81e..ede6863 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -251,33 +251,6 @@ static	const enum roff_tok rsord[RSORD_MAX] = {
 	MDOC__O
 };
 
-static	const char * const secnames[SEC__MAX] = {
-	NULL,
-	"NAME",
-	"LIBRARY",
-	"SYNOPSIS",
-	"DESCRIPTION",
-	"CONTEXT",
-	"IMPLEMENTATION NOTES",
-	"RETURN VALUES",
-	"ENVIRONMENT",
-	"FILES",
-	"EXIT STATUS",
-	"EXAMPLES",
-	"DIAGNOSTICS",
-	"COMPATIBILITY",
-	"ERRORS",
-	"SEE ALSO",
-	"STANDARDS",
-	"HISTORY",
-	"AUTHORS",
-	"CAVEATS",
-	"BUGS",
-	"SECURITY CONSIDERATIONS",
-	NULL
-};
-
-
 void
 mdoc_node_validate(struct roff_man *mdoc)
 {
diff --git a/roff.h b/roff.h
index f0c2bf4..8f90faa 100644
--- a/roff.h
+++ b/roff.h
@@ -16,6 +16,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "roffsec.in"
+
 struct	ohash;
 struct	mdoc_arg;
 union	mdoc_data;
@@ -26,33 +28,6 @@ enum	roff_macroset {
 	MACROSET_MAN
 };
 
-enum	roff_sec {
-	SEC_NONE = 0,
-	SEC_NAME,
-	SEC_LIBRARY,
-	SEC_SYNOPSIS,
-	SEC_DESCRIPTION,
-	SEC_CONTEXT,
-	SEC_IMPLEMENTATION,	/* IMPLEMENTATION NOTES */
-	SEC_RETURN_VALUES,
-	SEC_ENVIRONMENT,
-	SEC_FILES,
-	SEC_EXIT_STATUS,
-	SEC_EXAMPLES,
-	SEC_DIAGNOSTICS,
-	SEC_COMPATIBILITY,
-	SEC_ERRORS,
-	SEC_SEE_ALSO,
-	SEC_STANDARDS,
-	SEC_HISTORY,
-	SEC_AUTHORS,
-	SEC_CAVEATS,
-	SEC_BUGS,
-	SEC_SECURITY,
-	SEC_CUSTOM,
-	SEC__MAX
-};
-
 enum	roff_type {
 	ROFFT_ROOT,
 	ROFFT_BLOCK,
diff --git a/roffsec.in b/roffsec.in
new file mode 100644
index 0000000..6fd4172
--- /dev/null
+++ b/roffsec.in
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+enum    roff_sec {
+	SEC_NONE = 0,
+	SEC_NAME,
+	SEC_LIBRARY,
+	SEC_SYNOPSIS,
+	SEC_DESCRIPTION,
+	SEC_CONTEXT,
+	SEC_IMPLEMENTATION,     /* IMPLEMENTATION NOTES */
+	SEC_RETURN_VALUES,
+	SEC_ENVIRONMENT,
+	SEC_FILES,
+	SEC_EXIT_STATUS,
+	SEC_EXAMPLES,
+	SEC_DIAGNOSTICS,
+	SEC_COMPATIBILITY,
+	SEC_ERRORS,
+	SEC_SEE_ALSO,
+	SEC_STANDARDS,
+	SEC_HISTORY,
+	SEC_AUTHORS,
+	SEC_CAVEATS,
+	SEC_BUGS,
+	SEC_SECURITY,
+	SEC_CUSTOM,
+	SEC__MAX
+};
+
+static const char * const secnames[SEC__MAX] = {
+	NULL,
+	"NAME",
+	"LIBRARY",
+	"SYNOPSIS",
+	"DESCRIPTION",
+	"CONTEXT",
+	"IMPLEMENTATION NOTES",
+	"RETURN VALUES",
+	"ENVIRONMENT",
+	"FILES",
+	"EXIT STATUS",
+	"EXAMPLES",
+	"DIAGNOSTICS",
+	"COMPATIBILITY",
+	"ERRORS",
+	"SEE ALSO",
+	"STANDARDS",
+	"HISTORY",
+	"AUTHORS",
+	"CAVEATS",
+	"BUGS",
+	"SECURITY CONSIDERATIONS",
+	NULL
+};

             reply	other threads:[~2017-05-29 22:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 22:14 Yuri Pankov [this message]
2017-05-29 23:47 ` Ingo Schwarze
2017-05-30  0:09   ` Yuri Pankov
2017-05-30  1:15     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b34a95bc-8e9f-66b0-27d0-0fb01fed6ad1@gmx.com \
    --to=yuripv@gmx.com \
    --cc=discuss@mdocml.bsd.lv \
    --subject='Re: move roff sections to a separate file' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).