[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 40/80: [libgroff]: Align with modern groff conventions.
From: |
G. Branden Robinson |
Subject: |
[groff] 40/80: [libgroff]: Align with modern groff conventions. |
Date: |
Sat, 30 Nov 2024 04:02:20 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit a7870dba9b5378384b4edf9630015891d442e37d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 21:25:24 2024 -0600
[libgroff]: Align with modern groff conventions.
* src/libs/libgroff/make-uniuni.cpp: Update script that generates
"uniuni.cpp" to add Autoconf "<config.h>"-inclusion boilerplate.
* src/libs/libgroff/curtime.cpp:
* src/libs/libgroff/glyphuni.cpp:
* src/libs/libgroff/htmlhint.cpp:
* src/libs/libgroff/iftoa.cpp:
* src/libs/libgroff/invalid.cpp:
* src/libs/libgroff/itoa.cpp:
* src/libs/libgroff/lf.cpp:
* src/libs/libgroff/macropath.cpp:
* src/libs/libgroff/maxfilename.cpp:
* src/libs/libgroff/maxpathname.cpp:
* src/libs/libgroff/paper.cpp:
* src/libs/libgroff/symbol.cpp:
* src/libs/libgroff/tmpfile.cpp:
* src/libs/libgroff/tmpname.cpp:
* src/libs/libgroff/unicode.cpp:
* src/libs/libgroff/uniglyph.cpp:
* src/libs/libgroff/uniuni.cpp: Add Autoconf "<config.h>"-inclusion
boilerplate to these translation units.
* src/libs/libgroff/color.cpp:
* src/libs/libgroff/curtime.cpp:
* src/libs/libgroff/font.cpp:
* src/libs/libgroff/fontfile.cpp:
* src/libs/libgroff/htmlhint.cpp:
* src/libs/libgroff/lf.cpp:
* src/libs/libgroff/maxfilename.cpp:
* src/libs/libgroff/maxpathname.cpp:
* src/libs/libgroff/nametoindex.cpp:
* src/libs/libgroff/relocate.cpp:
* src/libs/libgroff/tmpfile.cpp:
* src/libs/libgroff/tmpname.cpp: Include system library headers before
local ones.
---
ChangeLog | 41 +++++++++++++++++++++++++++++++++++++++
src/libs/libgroff/color.cpp | 10 +++++-----
src/libs/libgroff/cset.cpp | 1 +
src/libs/libgroff/curtime.cpp | 6 +++++-
src/libs/libgroff/font.cpp | 4 ++--
src/libs/libgroff/fontfile.cpp | 6 +++---
src/libs/libgroff/glyphuni.cpp | 8 ++++++--
src/libs/libgroff/htmlhint.cpp | 8 ++++++--
src/libs/libgroff/iftoa.c | 6 +++++-
src/libs/libgroff/invalid.cpp | 4 ++++
src/libs/libgroff/itoa.c | 6 +++++-
src/libs/libgroff/lf.cpp | 11 ++++++++---
src/libs/libgroff/macropath.cpp | 14 +++++++++++--
src/libs/libgroff/make-uniuni | 12 ++++++++----
src/libs/libgroff/maxfilename.cpp | 15 +++++++++++---
src/libs/libgroff/maxpathname.cpp | 17 ++++++++++++----
src/libs/libgroff/nametoindex.cpp | 6 +++---
src/libs/libgroff/paper.cpp | 14 +++++++++++--
src/libs/libgroff/relocate.cpp | 6 +++---
src/libs/libgroff/searchpath.cpp | 4 ++--
src/libs/libgroff/symbol.cpp | 18 ++++++++++-------
src/libs/libgroff/tmpfile.cpp | 8 ++++++--
src/libs/libgroff/tmpname.cpp | 14 ++++++++++---
src/libs/libgroff/unicode.cpp | 6 +++++-
src/libs/libgroff/uniglyph.cpp | 15 +++++++++++---
src/libs/libgroff/uniuni.cpp | 12 ++++++++----
26 files changed, 209 insertions(+), 63 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d48019e19..6deaee8b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2024-11-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [libgroff]: Align with modern groff conventions.
+
+ * src/libs/libgroff/make-uniuni.cpp: Update script that
+ generates "uniuni.cpp" to add Autoconf "<config.h>"-inclusion
+ boilerplate.
+
+ * src/libs/libgroff/curtime.cpp:
+ * src/libs/libgroff/glyphuni.cpp:
+ * src/libs/libgroff/htmlhint.cpp:
+ * src/libs/libgroff/iftoa.cpp:
+ * src/libs/libgroff/invalid.cpp:
+ * src/libs/libgroff/itoa.cpp:
+ * src/libs/libgroff/lf.cpp:
+ * src/libs/libgroff/macropath.cpp:
+ * src/libs/libgroff/maxfilename.cpp:
+ * src/libs/libgroff/maxpathname.cpp:
+ * src/libs/libgroff/paper.cpp:
+ * src/libs/libgroff/symbol.cpp:
+ * src/libs/libgroff/tmpfile.cpp:
+ * src/libs/libgroff/tmpname.cpp:
+ * src/libs/libgroff/unicode.cpp:
+ * src/libs/libgroff/uniglyph.cpp:
+ * src/libs/libgroff/uniuni.cpp: Add Autoconf "<config.h>"-
+ inclusion boilerplate to these translation units.
+
+ * src/libs/libgroff/color.cpp:
+ * src/libs/libgroff/curtime.cpp:
+ * src/libs/libgroff/font.cpp:
+ * src/libs/libgroff/fontfile.cpp:
+ * src/libs/libgroff/htmlhint.cpp:
+ * src/libs/libgroff/lf.cpp:
+ * src/libs/libgroff/maxfilename.cpp:
+ * src/libs/libgroff/maxpathname.cpp:
+ * src/libs/libgroff/nametoindex.cpp:
+ * src/libs/libgroff/relocate.cpp:
+ * src/libs/libgroff/tmpfile.cpp:
+ * src/libs/libgroff/tmpname.cpp: Include system library headers
+ before local ones.
+
2024-11-27 G. Branden Robinson <g.branden.robinson@gmail.com>
[libdriver]: Align with modern groff conventions.
diff --git a/src/libs/libgroff/color.cpp b/src/libs/libgroff/color.cpp
index 426b2bca9..7361826ca 100644
--- a/src/libs/libgroff/color.cpp
+++ b/src/libs/libgroff/color.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2024 Free Software Foundation, Inc.
Written by Gaius Mulley <gaius@glam.ac.uk>
This file is part of groff.
@@ -16,10 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
-#include "color.h"
-#include "cset.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -32,6 +28,10 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif
+#include "lib.h"
+
+#include "color.h"
+#include "cset.h"
#include "errarg.h"
#include "error.h"
diff --git a/src/libs/libgroff/cset.cpp b/src/libs/libgroff/cset.cpp
index 309e6109b..03dc5cf19 100644
--- a/src/libs/libgroff/cset.cpp
+++ b/src/libs/libgroff/cset.cpp
@@ -23,6 +23,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <ctype.h>
#include "lib.h"
+
#include "cset.h"
cset csalpha(CSET_BUILTIN);
diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp
index 4623ad9a0..45ee70206 100644
--- a/src/libs/libgroff/curtime.cpp
+++ b/src/libs/libgroff/curtime.cpp
@@ -15,7 +15,9 @@ for more details.
The GNU General Public License version 2 (GPL2) is available in the
internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
-#include "lib.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <errno.h>
#include <limits.h>
@@ -23,6 +25,8 @@ internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
#include <string.h>
#include <time.h>
+#include "lib.h"
+
#include "curtime.h"
#include "errarg.h"
#include "error.h"
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index ef98e01e9..f70c9d9c7 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -16,8 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -28,6 +26,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <wchar.h>
+#include "lib.h"
+
#include "errarg.h"
#include "error.h"
#include "cset.h"
diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp
index aa4f32eca..a25118b06 100644
--- a/src/libs/libgroff/fontfile.cpp
+++ b/src/libs/libgroff/fontfile.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,8 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -26,6 +24,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <stdio.h> // snprintf()
#include <string.h> // strchr(), strlen()
+#include "lib.h"
+
#include "font.h"
#include "searchpath.h"
#include "device.h"
diff --git a/src/libs/libgroff/glyphuni.cpp b/src/libs/libgroff/glyphuni.cpp
index cad59b858..9b3e54c3d 100644
--- a/src/libs/libgroff/glyphuni.cpp
+++ b/src/libs/libgroff/glyphuni.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2024 Free Software Foundation, Inc.
Written by Werner Lemberg <wl@gnu.org>
This file is part of groff.
@@ -16,10 +16,14 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
+
#include "stringclass.h"
#include "ptable.h"
-
#include "unicode.h"
struct glyph_to_unicode_map {
diff --git a/src/libs/libgroff/htmlhint.cpp b/src/libs/libgroff/htmlhint.cpp
index 8ebb84e22..78a4d7eb6 100644
--- a/src/libs/libgroff/htmlhint.cpp
+++ b/src/libs/libgroff/htmlhint.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk)
This file is part of groff.
@@ -16,11 +16,15 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stddef.h>
#include <stdlib.h>
+#include "lib.h"
+
#include "nonposix.h"
#include "stringclass.h"
#include "html-strings.h"
diff --git a/src/libs/libgroff/iftoa.c b/src/libs/libgroff/iftoa.c
index 87aec5854..6d89ad736 100644
--- a/src/libs/libgroff/iftoa.c
+++ b/src/libs/libgroff/iftoa.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
#ifdef __cplusplus
diff --git a/src/libs/libgroff/invalid.cpp b/src/libs/libgroff/invalid.cpp
index 247e1c702..24d36aa5a 100644
--- a/src/libs/libgroff/invalid.cpp
+++ b/src/libs/libgroff/invalid.cpp
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
// Table of invalid input characters.
diff --git a/src/libs/libgroff/itoa.c b/src/libs/libgroff/itoa.c
index a573b2c61..7620382de 100644
--- a/src/libs/libgroff/itoa.c
+++ b/src/libs/libgroff/itoa.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
#ifdef __cplusplus
diff --git a/src/libs/libgroff/lf.cpp b/src/libs/libgroff/lf.cpp
index 239ca8901..766e4c3a2 100644
--- a/src/libs/libgroff/lf.cpp
+++ b/src/libs/libgroff/lf.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,13 +16,18 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <ctype.h>
+
#include "lib.h"
+
#include "cset.h"
#include "stringclass.h"
#include "lf.h"
-#include <ctype.h>
-
extern void change_filename(const char *);
extern void change_lineno(int);
diff --git a/src/libs/libgroff/macropath.cpp b/src/libs/libgroff/macropath.cpp
index a9c9b35df..84a713a8c 100644
--- a/src/libs/libgroff/macropath.cpp
+++ b/src/libs/libgroff/macropath.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -17,7 +16,12 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
+
#include "searchpath.h"
#include "macropath.h"
#include "defs.h"
@@ -27,3 +31,9 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
search_path macro_path(MACROPATH_ENVVAR, MACROPATH, 1, 1);
search_path safer_macro_path(MACROPATH_ENVVAR, MACROPATH, 1, 0);
search_path config_macro_path(MACROPATH_ENVVAR, MACROPATH, 0, 0);
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/make-uniuni b/src/libs/libgroff/make-uniuni
index a136eb2db..8d12d6104 100755
--- a/src/libs/libgroff/make-uniuni
+++ b/src/libs/libgroff/make-uniuni
@@ -85,16 +85,20 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-// This code has been algorithmically derived from the file
-// UnicodeData.txt, version $version_string, available from unicode.org,
-// on `date '+%Y-%m-%d'`.
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include "lib.h"
+
#include "stringclass.h"
#include "ptable.h"
-
#include "unicode.h"
+// This code has been algorithmically derived from the file
+// UnicodeData.txt, version $version_string, available from unicode.org,
+// on `date '+%Y-%m-%d'`.
+
struct unicode_decompose {
char *value;
};
diff --git a/src/libs/libgroff/maxfilename.cpp
b/src/libs/libgroff/maxfilename.cpp
index 5e1defeaa..2028dd904 100644
--- a/src/libs/libgroff/maxfilename.cpp
+++ b/src/libs/libgroff/maxfilename.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,9 +16,11 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* file_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
-#include "lib.h"
+/* file_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
#include <sys/types.h>
@@ -27,6 +28,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#include "lib.h"
+
#ifdef _POSIX_VERSION
size_t file_name_max(const char *fname)
@@ -73,3 +76,9 @@ size_t file_name_max(const char *)
}
#endif /* not _POSIX_VERSION */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/maxpathname.cpp
b/src/libs/libgroff/maxpathname.cpp
index 8041eeb2e..110c53545 100644
--- a/src/libs/libgroff/maxpathname.cpp
+++ b/src/libs/libgroff/maxpathname.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2005-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2024 Free Software Foundation, Inc.
Written by Werner Lemberg (wl@gnu.org)
This file is part of groff.
@@ -17,9 +16,11 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* path_name_max(dir) does the same as pathconf(dir, _PC_PATH_MAX) */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
-#include "lib.h"
+/* path_name_max(dir) does the same as pathconf(dir, _PC_PATH_MAX) */
#include <sys/types.h>
@@ -27,6 +28,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#include "lib.h"
+
#ifdef _POSIX_VERSION
size_t path_name_max()
@@ -68,3 +71,9 @@ size_t path_name_max()
}
#endif /* not _POSIX_VERSION */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/nametoindex.cpp
b/src/libs/libgroff/nametoindex.cpp
index 89cf34aee..fe654d763 100644
--- a/src/libs/libgroff/nametoindex.cpp
+++ b/src/libs/libgroff/nametoindex.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,8 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -26,6 +24,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <ctype.h>
#include <stdlib.h>
+#include "lib.h"
+
#include "errarg.h"
#include "error.h"
#include "font.h"
diff --git a/src/libs/libgroff/paper.cpp b/src/libs/libgroff/paper.cpp
index 842f3690c..e14b0dd14 100644
--- a/src/libs/libgroff/paper.cpp
+++ b/src/libs/libgroff/paper.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2024 Free Software Foundation, Inc.
Written by Werner Lemberg (wl@gnu.org)
This file is part of groff.
@@ -17,7 +16,12 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
+
#include "paper.h"
paper papersizes[NUM_PAPERSIZES];
@@ -80,3 +84,9 @@ papersize_init::papersize_init()
// this is an ISO format, but it easier to use add_american_paper
add_american_paper("dl", 40, 220/25.4, 110/25.4);
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 59dd90a7b..af84911a1 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -1,5 +1,5 @@
/* Provide relocation for macro and font files.
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -16,8 +16,6 @@
// Made after relocation code in kpathsea and gettext.
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -26,6 +24,8 @@
#include <errno.h>
#include <stdlib.h>
+#include "lib.h"
+
#include "defs.h"
#include "posix.h"
#include "nonposix.h"
diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp
index f11ef2295..d5c02ed3f 100644
--- a/src/libs/libgroff/searchpath.cpp
+++ b/src/libs/libgroff/searchpath.cpp
@@ -16,8 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -31,6 +29,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <sys/stat.h>
#include <unistd.h>
+#include "lib.h"
+
#include "searchpath.h"
#include "nonposix.h"
diff --git a/src/libs/libgroff/symbol.cpp b/src/libs/libgroff/symbol.cpp
index 085f2acda..a550d8158 100644
--- a/src/libs/libgroff/symbol.cpp
+++ b/src/libs/libgroff/symbol.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,6 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
#include "errarg.h"
@@ -39,9 +43,9 @@ const int BLOCK_SIZE = 1024;
// the table will increase in size as necessary
// the size will be chosen from the following array
// add some more if you want
-static const unsigned int table_sizes[] = {
+static const unsigned int table_sizes[] = {
101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021,
- 160001, 500009, 1000003, 1500007, 2000003, 0
+ 160001, 500009, 1000003, 1500007, 2000003, 0
};
const double FULL_MAX = 0.3; // don't let the table get more than this full
@@ -91,8 +95,8 @@ symbol::symbol(const char *p, int how)
}
unsigned int hc = hash_string(p);
const char **pp;
- for (pp = table + hc % table_size;
- *pp != 0;
+ for (pp = table + hc % table_size;
+ *pp != 0;
(pp == table ? pp = table + table_size - 1 : --pp))
if (strcmp(p, *pp) == 0) {
s = *pp;
@@ -114,7 +118,7 @@ symbol::symbol(const char *p, int how)
table = (const char **)new char*[table_size];
for (i = 0; i < table_size; i++)
table[i] = 0;
- for (pp = old_table + old_table_size - 1;
+ for (pp = old_table + old_table_size - 1;
pp >= old_table;
--pp) {
symbol temp(*pp, 1); /* insert it into the new table */
@@ -122,7 +126,7 @@ symbol::symbol(const char *p, int how)
}
delete[] old_table;
for (pp = table + hc % table_size;
- *pp != 0;
+ *pp != 0;
(pp == table ? pp = table + table_size - 1 : --pp))
;
}
diff --git a/src/libs/libgroff/tmpfile.cpp b/src/libs/libgroff/tmpfile.cpp
index fb43cf00f..18eed2738 100644
--- a/src/libs/libgroff/tmpfile.cpp
+++ b/src/libs/libgroff/tmpfile.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,11 +16,15 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "lib.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <errno.h>
#include <stdlib.h>
+#include "lib.h"
+
#include "posix.h"
#include "errarg.h"
#include "error.h"
diff --git a/src/libs/libgroff/tmpname.cpp b/src/libs/libgroff/tmpname.cpp
index 69dc9a45e..53c1d2754 100644
--- a/src/libs/libgroff/tmpname.cpp
+++ b/src/libs/libgroff/tmpname.cpp
@@ -16,18 +16,20 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
/* This file is heavily based on the function __gen_tempname() in the
file tempname.c which is part of the fileutils package. */
-
-#include "lib.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
+#include "lib.h"
+
#include "posix.h"
#include "nonposix.h"
@@ -115,3 +117,9 @@ int gen_tempname(char *tmpl, int dir)
/* We got out of the loop because we ran out of combinations to try. */
return -1; /* EEXIST */
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/unicode.cpp b/src/libs/libgroff/unicode.cpp
index dc7a1baed..a0057f1e3 100644
--- a/src/libs/libgroff/unicode.cpp
+++ b/src/libs/libgroff/unicode.cpp
@@ -16,10 +16,14 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
+
#include "cset.h"
#include "stringclass.h"
-
#include "unicode.h"
const char *valid_unicode_code_sequence(const char *u, char *errbuf)
diff --git a/src/libs/libgroff/uniglyph.cpp b/src/libs/libgroff/uniglyph.cpp
index bab2bc4ee..25480cc1f 100644
--- a/src/libs/libgroff/uniglyph.cpp
+++ b/src/libs/libgroff/uniglyph.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2024 Free Software Foundation, Inc.
Written by Werner Lemberg <wl@gnu.org>
This file is part of groff.
@@ -17,10 +16,14 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "lib.h"
+
#include "stringclass.h"
#include "ptable.h"
-
#include "unicode.h"
struct unicode_to_glyph {
@@ -495,3 +498,9 @@ const char *unicode_to_glyph_name(const char *s)
unicode_to_glyph *result = unicode_to_glyph_table.lookup(s);
return result ? result->value : 0;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/uniuni.cpp b/src/libs/libgroff/uniuni.cpp
index a60a0ee33..5863028fe 100644
--- a/src/libs/libgroff/uniuni.cpp
+++ b/src/libs/libgroff/uniuni.cpp
@@ -16,16 +16,20 @@ for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-// This code has been algorithmically derived from the file
-// UnicodeData.txt, version 15.1.0, available from unicode.org,
-// on 2024-08-29.
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include "lib.h"
+
#include "stringclass.h"
#include "ptable.h"
-
#include "unicode.h"
+// This code has been algorithmically derived from the file
+// UnicodeData.txt, version 15.1.0, available from unicode.org,
+// on 2024-08-29.
+
struct unicode_decompose {
char *value;
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 40/80: [libgroff]: Align with modern groff conventions.,
G. Branden Robinson <=