gbranden pushed a commit to branch master
in repository groff.

commit e3edfbf7b0738a659530f78222fd4a4beb406aef
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Aug 19 17:03:52 2024 -0500

    [troff]: Drop EBCDIC character definitions.
    
    * src/roff/troff/input.h: Drop input character definitions for CCSID
      (code page) 1047 (EBCDIC).
    
    Continues fixing <https://savannah.gnu.org/bugs/?65724>.
    
    Also add editor aid comments; drop old-style Emacs file-local variable
    setting.
---
 ChangeLog                     | 18 ++++++++++++++
 src/devices/grops/psrm.cpp    | 22 +----------------
 src/devices/grotty/tty.cpp    |  8 +------
 src/libs/libgroff/invalid.cpp | 27 ++++++---------------
 src/preproc/pic/lex.cpp       | 13 +++++-----
 src/roff/troff/input.h        | 55 ++++---------------------------------------
 6 files changed, 37 insertions(+), 106 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5577979b0..7ca88be20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2024-08-19  G. Branden Robinson <[email protected]>
+
+       [grops, grotty, libgroff, pic]: Drop EBCDIC support.
+
+       * src/devices/grops/psrm.cpp:
+       * src/devices/grotty/tty.cpp:
+       * src/libs/libgroff/invalid.cpp:
+       * src/preproc/pic/lex.cpp: Do it.
+
+       Continues fixing <https://savannah.gnu.org/bugs/?65724>.
+
+2024-08-19  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.h: Drop input character definitions for
+       CCSID (code page) 1047 (EBCDIC).
+
+       Continues fixing <https://savannah.gnu.org/bugs/?65724>.
+
 2024-08-19  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp: Revise `\A` and `\B` escape
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 5d3905761..1948a0807 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.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 ([email protected])
 
 This file is part of groff.
@@ -38,7 +38,6 @@ cset white_space("\n\r \t\f");
 string an_empty_string;
 
 char valid_input_table[256]= {
-#ifndef IS_EBCDIC_HOST
   0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -56,25 +55,6 @@ char valid_input_table[256]= {
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-#else
-  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,
-  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-#endif
 };
 
 const char *extension_table[] = {
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index c9f386e37..8ec8cd3b7 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
      Written by James Clark ([email protected])
      OSC 8 support by G. Branden Robinson
 
@@ -78,15 +78,9 @@ enum {
 static unsigned char bold_underline_mode_option = BOLD_MODE|UNDERLINE_MODE;
 static unsigned char bold_underline_mode;
 
-#ifndef IS_EBCDIC_HOST
 #define CSI "\033["
 #define OSC8 "\033]8"
 #define ST "\033\\"
-#else
-#define CSI "\047["
-#define OSC8 "\047]8"
-#define ST "\047\\"
-#endif
 
 // SGR handling (ISO 6429)
 #define SGR_BOLD CSI "1m"
diff --git a/src/libs/libgroff/invalid.cpp b/src/libs/libgroff/invalid.cpp
index 59e46196c..247e1c702 100644
--- a/src/libs/libgroff/invalid.cpp
+++ b/src/libs/libgroff/invalid.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
      Written by James Clark ([email protected])
 
 This file is part of groff.
@@ -21,7 +21,6 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 // Table of invalid input characters.
 
 char invalid_char_table[256]= {
-#ifndef IS_EBCDIC_HOST
   1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1,
   1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0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#endif
 };
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/preproc/pic/lex.cpp b/src/preproc/pic/lex.cpp
index e59801baa..91802f595 100644
--- a/src/preproc/pic/lex.cpp
+++ b/src/preproc/pic/lex.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 ([email protected])
 
 This file is part of groff.
@@ -29,13 +28,8 @@ PTABLE(char) macro_table;
 
 // First character of the range representing $1-$<MAX_ARG>.
 // All of them must be invalid input characters.
-#ifndef IS_EBCDIC_HOST
 #define ARG1 0x80
 #define MAX_ARG 32
-#else
-#define ARG1 0x30
-#define MAX_ARG 16
-#endif
 
 class macro_input : public input {
   char *s;
@@ -2037,3 +2031,8 @@ void yyerror(const char *s)
   }
 }
 
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/roff/troff/input.h b/src/roff/troff/input.h
index 10b337f1e..32b3421a6 100644
--- a/src/roff/troff/input.h
+++ b/src/roff/troff/input.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2024 Free Software Foundation, Inc.
      Written by James Clark ([email protected])
 
 This file is part of groff.
@@ -17,9 +17,9 @@ You should have received a copy of the GNU General Public 
License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 
-/* special character codes */
-
-#ifndef IS_EBCDIC_HOST
+// GNU troff uses these character codes for its own purposes.
+//
+// Except for the ones named `INPUT_`, they are not valid as input.
 
 const int ESCAPE_QUESTION = 015;
 const int BEGIN_TRAP = 016;
@@ -63,53 +63,6 @@ const int DOUBLE_QUOTE = 0216;
 const int INPUT_NO_BREAK_SPACE = 0240;
 const int INPUT_SOFT_HYPHEN= 0255;
 
-#else /* IS_EBCDIC_HOST */
-
-const int INPUT_DELETE = 007;
-
-const int ESCAPE_QUESTION = 010;
-const int BEGIN_TRAP = 011;
-const int END_TRAP = 013;
-const int PAGE_EJECTOR = 015;
-const int ESCAPE_NEWLINE = 016;
-const int ESCAPE_AMPERSAND = 017;
-const int ESCAPE_UNDERSCORE = 020;
-const int ESCAPE_BAR = 021;
-const int ESCAPE_CIRCUMFLEX = 022;
-const int ESCAPE_LEFT_BRACE = 023;
-const int ESCAPE_RIGHT_BRACE = 024;
-const int ESCAPE_LEFT_QUOTE = 027;
-const int ESCAPE_RIGHT_QUOTE = 030;
-const int ESCAPE_HYPHEN = 031;
-const int ESCAPE_BANG = 032;
-const int ESCAPE_c = 033;
-const int ESCAPE_e = 034;
-const int ESCAPE_PERCENT = 035;
-const int ESCAPE_SPACE = 036;
-
-const int TITLE_REQUEST = 060;
-const int COPY_FILE_REQUEST = 061;
-const int TRANSPARENT_FILE_REQUEST = 062;
-#ifdef COLUMN
-const int VJUSTIFY_REQUEST = 063;
-#endif /* COLUMN */
-const int ESCAPE_E = 064;
-const int LAST_PAGE_EJECTOR = 065;
-const int ESCAPE_RIGHT_PARENTHESIS = 066;
-const int ESCAPE_TILDE = 067;
-const int ESCAPE_COLON = 070;
-const int PUSH_GROFF_MODE = 071;
-const int PUSH_COMP_MODE = 072;
-const int POP_GROFFCOMP_MODE = 073;
-const int BEGIN_QUOTE = 074;
-const int END_QUOTE = 075;
-const int DOUBLE_QUOTE = 076;
-
-const int INPUT_NO_BREAK_SPACE = 0101;
-const int INPUT_SOFT_HYPHEN= 0312;
-
-#endif /* IS_EBCDIC_HOST */
-
 extern void do_glyph_color(symbol);
 extern void do_fill_color(symbol);
 

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to