groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: groff.cpp and grog: add option -J for preproc gideal


From: Bernd Warken
Subject: [groff] 01/01: groff.cpp and grog: add option -J for preproc gideal
Date: Tue, 17 Jun 2014 14:49:49 +0000

bwarken pushed a commit to branch master
in repository groff.

commit f5f5788e5d8b74f3f28857b2f02ac2e12a796664
Author: Bernd Warken <address@hidden>
Date:   Tue Jun 17 16:49:40 2014 +0200

    groff.cpp and grog: add option -J for preproc gideal
---
 ChangeLog                 |    5 +++++
 src/roff/groff/groff.cpp  |   17 +++++++++++++----
 src/roff/groff/pipeline.h |    9 ++++++---
 src/roff/grog/subs.pl     |   16 +++++++---------
 4 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b636c1c..cd06d0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-17  Bernd Warken  <address@hidden>
+
+       * src/roff/groff/groff.cpp, src/roff/groff/pipeline.h,
+       * src/roff/grog/subs.pl: Add `groff' option `-J' for `gideal'.
+
 2014-06-16  Bernd Warken  <address@hidden>
 
        * src/roff/grog/subs.pl: Remove too early listing of 3 `groff'
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 9ea8f71..38b221f 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -3,6 +3,8 @@
    Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
+Latest update: 17 Jun 2014
+
 This file is part of groff.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -51,14 +53,15 @@ extern "C" {
 
 // The number of commands must be in sync with MAX_COMMANDS in pipeline.h
 
-// grap and chem must come before pic;
+// grap, chem, and ideal must come before pic;
 // tbl must come before eqn
 const int PRECONV_INDEX = 0;
 const int SOELIM_INDEX = PRECONV_INDEX + 1;
 const int REFER_INDEX = SOELIM_INDEX + 1;
 const int GRAP_INDEX = REFER_INDEX + 1;
 const int CHEM_INDEX = GRAP_INDEX + 1;
-const int PIC_INDEX = CHEM_INDEX + 1;
+const int IDEAL_INDEX = CHEM_INDEX + 1;
+const int PIC_INDEX = IDEAL_INDEX + 1;
 const int TBL_INDEX = PIC_INDEX + 1;
 const int GRN_INDEX = TBL_INDEX + 1;
 const int EQN_INDEX = GRN_INDEX + 1;
@@ -139,7 +142,7 @@ int main(int argc, char **argv)
   };
   while ((opt = getopt_long(
                  argc, argv,
-                 "abcCd:D:eEf:F:gGhiI:jkK:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ",
+                 "abcCd:D:eEf:F:gGhiI:jJkK:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ",
                  long_options, NULL))
         != EOF) {
     char buf[3];
@@ -174,6 +177,10 @@ int main(int argc, char **argv)
     case 't':
       commands[TBL_INDEX].set_name(command_prefix, "tbl");
       break;
+    case 'J':
+      commands[_INDEX].set_name(command_prefix, "gideal");
+      // need_pic = 1;
+      break;
     case 'j':
       commands[CHEM_INDEX].set_name(command_prefix, "chem");
       need_pic = 1;
@@ -219,7 +226,8 @@ int main(int argc, char **argv)
        "GNU groff comes with ABSOLUTELY NO WARRANTY.\n"
        "You may redistribute copies of groff and its subprograms\n"
        "under the terms of the GNU General Public License.\n"
-       "For more information about these matters, see the file named 
COPYING.\n");
+       "For more information about these matters, see the file\n"
+       "named COPYING.\n");
       printf("\ncalled subprograms:\n\n");
       fflush(stdout);
       commands[POST_INDEX].append_arg(buf);
@@ -773,6 +781,7 @@ void help()
 "-g\tpreprocess with grn\n"
 "-G\tpreprocess with grap\n"
 "-j\tpreprocess with chem\n"
+"-J\tpreprocess with gideal\n"
 "-s\tpreprocess with soelim\n"
 "-R\tpreprocess with refer\n"
 "-Tdev\tuse device dev\n"
diff --git a/src/roff/groff/pipeline.h b/src/roff/groff/pipeline.h
index 2795b53..19c93ef 100644
--- a/src/roff/groff/pipeline.h
+++ b/src/roff/groff/pipeline.h
@@ -1,7 +1,9 @@
-/* Copyright (C) 1989-1992, 2000, 2002, 2005, 2009, 2011
+/* Copyright (C) 1989-1992, 2000, 2002, 2005, 2009, 2011, 2014
    Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
+Latest update: 17 Jun 2014
+
 This file is part of groff.
 
 groff is free software; you can redistribute it and/or modify it under
@@ -23,8 +25,9 @@ extern "C" {
 }
 #endif
 
-/* run_pipeline can handle at most this many commands */
-#define MAX_COMMANDS 14
+/* run_pipeline can handle at most this many commands,
+   see the const numbers in groff.cpp */
+#define MAX_COMMANDS 15
 
 /* Children exit with this status if execvp fails. */
 #define EXEC_FAILED_EXIT_STATUS 0xff
diff --git a/src/roff/grog/subs.pl b/src/roff/grog/subs.pl
index 991ebaf..ce32f79 100644
--- a/src/roff/grog/subs.pl
+++ b/src/roff/grog/subs.pl
@@ -30,7 +30,7 @@
 # <http://www.gnu.org/licenses/gpl-2.0.html>.
 
 ########################################################################
-# Last_Update = '16 Jun 2014';
+# Last_Update = '17 Jun 2014';
 ########################################################################
 
 require v5.6;
@@ -369,7 +369,7 @@ sub do_line {
     return;
   }
   if ( $command =~ /^\.PF$/ ) {
-    $Groff{'PF'}++;            # alternative opening for pic
+    $Groff{'PF'}++;            # alternate opening for pic
     return;
   }
   if ( $command =~ /^\.PE$/ ) {
@@ -667,24 +667,22 @@ EOF
   if ( $Groff{'gperl'} ) {
     push @preprograms, 'gperl';
   }
-  if ( $Groff{'ideal'} ) {
-    push @preprograms, 'gideal';
-    # || $Groff{'ideal'}
-    # $s .= "J" if $Groff{'ideal'};
-  }
 
   # preprocessors with `groff' option
   if ( ( $Groff{'PS'} ||  $Groff{'PF'} ) &&  $Groff{'PE'} ) {
     $Groff{'pic'} = 1;
   }
+
   $Groff{'refer'} ||= $Groff{'refer_open'} && $Groff{'refer_close'};
-  if ( $Groff{'chem'} || $Groff{'eqn'} || $Groff{'grap'} ||
-       $Groff{'grn'} || $Groff{'pic'} ||
+
+  if ( $Groff{'chem'} || $Groff{'eqn'} ||  $Groff{'ideal'} ||
+       $Groff{'grap'} || $Groff{'grn'} || $Groff{'pic'} ||
        $Groff{'refer'} || $Groff{'tbl'} ) {
     my $s = "-";
     $s .= "e" if $Groff{'eqn'};
     $s .= "G" if $Groff{'grap'};
     $s .= "g" if $Groff{'grn'};
+    $s .= "J" if $Groff{'ideal'};
     $s .= "j" if $Groff{'chem'};
     $s .= "p" if $Groff{'pic'};
     $s .= "R" if $Groff{'refer'};



reply via email to

[Prev in Thread] Current Thread [Next in Thread]