summaryrefslogtreecommitdiff
path: root/src/roff
diff options
context:
space:
mode:
Diffstat (limited to 'src/roff')
-rw-r--r--src/roff/groff/Makefile.sub2
-rw-r--r--src/roff/groff/groff.cpp25
-rw-r--r--src/roff/groff/groff.man35
-rw-r--r--src/roff/groff/pipeline.h4
-rw-r--r--src/roff/grog/grog.man49
-rw-r--r--src/roff/grog/grog.pl21
-rw-r--r--src/roff/grog/grog.sh21
-rw-r--r--src/roff/troff/env.cpp9
-rw-r--r--src/roff/troff/input.cpp10
-rw-r--r--src/roff/troff/mtsm.cpp15
10 files changed, 97 insertions, 94 deletions
diff --git a/src/roff/groff/Makefile.sub b/src/roff/groff/Makefile.sub
index c0ea081b..798f2d8a 100644
--- a/src/roff/groff/Makefile.sub
+++ b/src/roff/groff/Makefile.sub
@@ -1,6 +1,6 @@
PROG=groff$(EXEEXT)
MAN1=groff.n
-XLIBS=$(LIBGROFF) $(LIBGNU)
+XLIBS=$(LIBGROFF)
MLIB=$(LIBM)
OBJS=groff.$(OBJEXT) pipeline.$(OBJEXT)
CCSRCS=$(srcdir)/groff.cpp
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 8eef10e6..7921d1de 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-2011
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -50,15 +51,11 @@ extern "C" {
#endif /* NEED_DECLARATION_PUTENV */
// The number of commands must be in sync with MAX_COMMANDS in pipeline.h
-
-// grap and chem 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 PIC_INDEX = GRAP_INDEX + 1;
const int TBL_INDEX = PIC_INDEX + 1;
const int GRN_INDEX = TBL_INDEX + 1;
const int EQN_INDEX = GRN_INDEX + 1;
@@ -125,7 +122,6 @@ int main(int argc, char **argv)
int safer_flag = 1;
int is_xhtml = 0;
int eflag = 0;
- int need_pic = 0;
int opt;
const char *command_prefix = getenv("GROFF_COMMAND_PREFIX");
const char *encoding = getenv("GROFF_ENCODING");
@@ -139,7 +135,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:lkK:L:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ",
long_options, NULL))
!= EOF) {
char buf[3];
@@ -174,10 +170,6 @@ int main(int argc, char **argv)
case 't':
commands[TBL_INDEX].set_name(command_prefix, "tbl");
break;
- case 'j':
- commands[CHEM_INDEX].set_name(command_prefix, "chem");
- need_pic = 1;
- break;
case 'p':
commands[PIC_INDEX].set_name(command_prefix, "pic");
break;
@@ -186,7 +178,6 @@ int main(int argc, char **argv)
break;
case 'G':
commands[GRAP_INDEX].set_name(command_prefix, "grap");
- need_pic = 1;
break;
case 'e':
eflag = 1;
@@ -215,7 +206,7 @@ int main(int argc, char **argv)
vflag = 1;
printf("GNU groff version %s\n", Version_string);
printf(
- "Copyright (C) 2011 Free Software Foundation, Inc.\n"
+ "Copyright (C) 2009 Free Software Foundation, Inc.\n"
"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"
@@ -268,6 +259,7 @@ int main(int argc, char **argv)
if (strcmp(optarg, "html") == 0)
// force soelim to aid the html preprocessor
commands[SOELIM_INDEX].set_name(command_prefix, "soelim");
+
if (strcmp(optarg, "Xps") == 0) {
warning("-TXps option is obsolete: use -X -Tps instead");
device = "ps";
@@ -321,8 +313,6 @@ int main(int argc, char **argv)
break;
}
}
- if (need_pic)
- commands[PIC_INDEX].set_name(command_prefix, "pic");
if (encoding) {
commands[PRECONV_INDEX].set_name("preconv");
if (!Kflag && *encoding)
@@ -755,7 +745,7 @@ char **possible_command::get_argv()
void synopsis(FILE *stream)
{
fprintf(stream,
-"usage: %s [-abceghijklpstvzCENRSUVXZ] [-Fdir] [-mname] [-Tdev] [-ffam]\n"
+"usage: %s [-abceghiklpstvzCENRSUVXZ] [-Fdir] [-mname] [-Tdev] [-ffam]\n"
" [-wname] [-Wname] [-Mdir] [-dcs] [-rcn] [-nnum] [-olist] [-Parg]\n"
" [-Darg] [-Karg] [-Larg] [-Idir] [files...]\n",
program_name);
@@ -772,7 +762,6 @@ void help()
"-e\tpreprocess with eqn\n"
"-g\tpreprocess with grn\n"
"-G\tpreprocess with grap\n"
-"-j\tpreprocess with chem\n"
"-s\tpreprocess with soelim\n"
"-R\tpreprocess with refer\n"
"-Tdev\tuse device dev\n"
diff --git a/src/roff/groff/groff.man b/src/roff/groff/groff.man
index 50c2bf6a..38ebbb0b 100644
--- a/src/roff/groff/groff.man
+++ b/src/roff/groff/groff.man
@@ -1,7 +1,7 @@
.ig
groff.man
-Copyright (C) 1989, 2002-2009, 2011
+Copyright (C) 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Rewritten in 2002 by Bernd Warken <bwarken@mayn.de>
@@ -44,7 +44,7 @@ groff \- front-end for the groff document formatting system
.\" --------------------------------------------------------------------
.
.SY groff
-.OP \-abcegijklpstzCEGNRSUVXZ
+.OP \-abcegiklpstzCEGNRSUVXZ
.OP \-d cs
.OP \-D arg
.OP \-f fam
@@ -187,9 +187,6 @@ Preprocess with
Preprocess with
.BR grap .
.
-Implies
-.BR \-p .
-.
.
.TP
.B \-h
@@ -220,15 +217,6 @@ option.
.
.
.TP
-.B \-j
-Preprocess with
-.BR @g@chem .
-.
-Implies
-.BR \-p .
-.
-.
-.TP
.B \-k
Preprocess with
.BR preconv .
@@ -456,11 +444,6 @@ is
ps
PostScript output (postprocessor is
.BR grops ).
-.
-.TP
-pdf
-Portable Document Format (PDF) output (postprocessor is
-.BR gropdf ).
.RE
.RE
.
@@ -1111,13 +1094,6 @@ PostScript output; suitable for printers and previewers like
.BR gv (1).
.
.TP
-.B pdf
-PDF files; suitable for viewing with tools such as
-.BR evince (1)
-and
-.BR okular (1).
-.
-.TP
.B utf8
Text output using the Unicode (ISO 10646) character set with \%UTF-8
encoding; see
@@ -1207,10 +1183,6 @@ for HTML and XHTML formats,
.BR grops (@MAN1EXT@)
for PostScript.
.
-.TP
-.BR gropdf (@MAN1EXT@)
-for PDF.
-.
.P
Combined with the many existing free conversion tools this should
be sufficient to convert a
@@ -1741,7 +1713,7 @@ This is the only grap version supported by
.SH AUTHORS
.\" --------------------------------------------------------------------
.
-Copyright \(co 2011
+Copyright \(co 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
.
.P
@@ -1861,7 +1833,6 @@ Postprocessors for the output devices:
.BR \%grolj4 (@MAN1EXT@),
.BR \%lj4_font (@MAN5EXT@),
.BR \%grops (@MAN1EXT@),
-.BR \%gropdf (@MAN1EXT@),
.BR \%grotty (@MAN1EXT@).
.
.TP
diff --git a/src/roff/groff/pipeline.h b/src/roff/groff/pipeline.h
index 2795b53d..20e775ac 100644
--- a/src/roff/groff/pipeline.h
+++ b/src/roff/groff/pipeline.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-1992, 2000, 2002, 2005, 2009, 2011
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2005, 2009
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -24,7 +24,7 @@ extern "C" {
#endif
/* run_pipeline can handle at most this many commands */
-#define MAX_COMMANDS 14
+#define MAX_COMMANDS 13
/* Children exit with this status if execvp fails. */
#define EXEC_FAILED_EXIT_STATUS 0xff
diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man
index 49d00f2a..0cbd4c42 100644
--- a/src/roff/grog/grog.man
+++ b/src/roff/grog/grog.man
@@ -10,10 +10,10 @@ grog.1 - man page for grog (section 1)
Source file position: <groff_source_top>/src/roff/grog/grog.man
Installed position: $prefix/share/man/man1/grog.1
-Last Update: 22 Jan 2011
+Last Update: 2 Jun 2010
..
.de co
-Copyright (C) 1989-2003, 2006, 2007, 2009-2011
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2006, 2007, 2009, 2010
Free Software Foundation, Inc.
.
Written by James Clark.
@@ -466,6 +466,50 @@ was found by
this file does not use a macro package.
.
.
+.IP \(bu
+.B grog
+can also handle files using the
+.I chem
+language.
+.
+The example
+.
+.RS
+.IP
+.EX
+grog chAh_brackets.chem
+.EE
+.RE
+.
+.IP
+outputs
+.
+.RS
+.IP
+.EX
+chem chAh_brackets.chem | groff \-pe
+.EE
+.RE
+.
+.IP
+So
+.B chem
+is run first and
+.B groff
+is appended.
+.
+The option
+.B \-p
+for
+.B pic
+is implied automatically by
+.BR chem .
+Additionally, the file uses
+.I eqn
+with
+.BR \-e .
+.
+.
.\" --------------------------------------------------------------------
.SH "SEE ALSO"
.
@@ -473,7 +517,6 @@ this file does not use a macro package.
.BR @g@troff (@MAN1EXT@),
.BR @g@tbl (@MAN1EXT@),
.BR @g@pic (@MAN1EXT@),
-.BR @g@chem (@MAN1EXT@),
.BR @g@eqn (@MAN1EXT@),
.BR @g@refer (@MAN1EXT@),
.BR @g@grn (@MAN1EXT@),
diff --git a/src/roff/grog/grog.pl b/src/roff/grog/grog.pl
index ff830153..24a4090f 100644
--- a/src/roff/grog/grog.pl
+++ b/src/roff/grog/grog.pl
@@ -6,7 +6,7 @@
# Source file position: <groff-source>/src/roff/grog/grog.pl
# Installed position: <prefix>/bin/grog
-# Copyright (C) 1993, 2006, 2009, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1993, 2006, 2009 Free Software Foundation, Inc.
# Written by James Clark, maintained by Werner Lemberg.
# Rewritten and put under GPL by Bernd Warken.
@@ -26,7 +26,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
########################################################################
-my $Last_Update = '22 Jan 2011';
+my $Last_Update = '5 Jan 2009';
########################################################################
require v5.6;
@@ -128,7 +128,7 @@ sub process {
if (/^(.cstart)|(begin\s+chem)$/) {
$Groff{'chem'}++;
- $Groff{'soelim'}++ if $level;
+ $Groff{'pic'}++;
} elsif (/^\.TS$Sp/) {
$_ = <FILE>;
if (!/^\./) {
@@ -151,6 +151,7 @@ sub process {
$_ = <FILE>;
if (!/^\./) {
$Groff{'grap'}++;
+ $Groff{'pic'}++;
$Groff{'soelim'}++ if $level;
}
# } elsif (/^\.PS\Sp([ 0-9.<].*)?$/) {
@@ -285,13 +286,12 @@ sub version {
$Groff{'refer'} ||= $Groff{'refer_open'} && $Groff{'refer_close'};
if ( $Groff{'pic'} || $Groff{'tbl'} || $Groff{'eqn'} ||
- $Groff{'grn'} || $Groff{'grap'} || $Groff{'refer'} ||
- $Groff{'chem'} ) {
+ $Groff{'grn'} || $Groff{'grap'} || $Groff{'refer'} ) {
my $s = "-";
$s .= "s" if $Groff{'soelim'};
$s .= "R" if $Groff{'refer'};
+ # grap must be run before pic
$s .= "G" if $Groff{'grap'};
- $s .= "j" if $Groff{'chem'};
$s .= "p" if $Groff{'pic'};
$s .= "g" if $Groff{'grn'};
$s .= "t" if $Groff{'tbl'};
@@ -331,8 +331,13 @@ sub version {
push(@Command, $s);
}
- unshift @Command, 'groff';
- push(@Command, @ARGV);
+ if ($Groff{'chem'}) {
+ my @chem = ('chem', @ARGV, '|', 'groff');
+ unshift(@Command, @chem);
+ } else {
+ unshift @Command, 'groff';
+ push(@Command, @ARGV);
+ }
foreach (@Command) {
next unless /\s/;
diff --git a/src/roff/grog/grog.sh b/src/roff/grog/grog.sh
index d4763b54..8f17078d 100644
--- a/src/roff/grog/grog.sh
+++ b/src/roff/grog/grog.sh
@@ -5,7 +5,7 @@
# Source file position: <groff-source>/src/roff/grog/grog.sh
# Installed position: <prefix>/bin/grog
-# Copyright (C) 1993, 2006, 2009, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1993, 2006, 2009 Free Software Foundation, Inc.
# Written by James Clark, maintained by Werner Lemberg.
# Rewritten by and put under GPL Bernd Warken.
@@ -25,7 +25,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
########################################################################
-Last_Update='22 Jan 2011'
+Last_Update='5 Jan 2009'
########################################################################
soelim=@g@soelim
@@ -161,16 +161,16 @@ eval sed "'s/[ ]*$//'" '--' "${filespec}" \
| awk '
/^\.SO_START$/ { so = 1 }
/^\.SO_END$/ { so = 0 }
-/^\.cstart$/ { chem++; if (so > 0) soelim++ }
+/^\.cstart$/ { chem++ }
/^\.TS/ { tbl++; in_tbl = 1; if (so > 0) soelim++; }
/^\.TE/ { in_tbl = 0 }
/^\.PS([ 0-9.<].*)?$/ { pic++; if (so > 0) soelim++ }
/^\.EQ/ { eqn++; if (so > 0) soelim++ }
/^\.R1/ { refer++; if (so > 0) soelim++ }
-/^\.\[/ { refer_start++; if (so > 0) soelim++ }
-/^\.\]/ { refer_end++; if (so > 0) soelim++ }
+/^\.\[/ {refer_start++; if (so > 0) soelim++ }
+/^\.\]/ {refer_end++; if (so > 0) soelim++ }
/^\.GS/ { grn++; if (so > 0) soelim++ }
-/^\.G1/ { grap++; if (so > 0) soelim++ }
+/^\.G1/ { grap++; pic++; if (so > 0) soelim++ }
/^\.TH/ { if (in_tbl != 1) TH++ }
/^\.PP/ { PP++ }
/^\.TL/ { TL++ }
@@ -202,15 +202,18 @@ eval sed "'s/[ ]*$//'" '--' "${filespec}" \
/^\.(PRINTSTYLE|START)/ { mom++ }
END {
+ if (chem > 0) {
+ printf "chem %s | ", files
+ pic++
+ files = ""
+ }
printf "groff"
refer = refer || (refer_start && refer_end)
- if (pic > 0 || tbl > 0 || grn > 0 || grap > 0 ||
- eqn > 0 || refer > 0 || chem > 0) {
+ if (pic > 0 || tbl > 0 || grn > 0 || grap > 0 || eqn > 0 || refer > 0) {
printf " -"
if (soelim > 0) printf "s"
if (refer > 0) printf "R"
if (grn > 0) printf "g"
- if (chem > 0) printf "j"
if (grap > 0) printf "G"
if (pic > 0) printf "p"
if (tbl > 0) printf "t"
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6d722f5c..13672cc5 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000-2006, 2009, 2011
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2009
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -3210,7 +3211,7 @@ const char *sptoa(int sp)
double factor = 10.0;
double val = s;
int decimal_point = 0;
- do {
+ do {
double v = ceil(s*factor);
if (v > INT_MAX)
break;
@@ -3313,8 +3314,8 @@ void environment::print_env()
? "on"
: margin_character_flags == MARGIN_CHARACTER_NEXT
? "next"
- : margin_character_flags == (MARGIN_CHARACTER_ON
- | MARGIN_CHARACTER_NEXT)
+ : margin_character_flags == MARGIN_CHARACTER_ON
+ | MARGIN_CHARACTER_NEXT
? "on, next"
: "none");
errprint(" margin character distance: %1u\n",
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index b71f27e0..7a0f46ce 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000-2011
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -155,9 +156,6 @@ static symbol get_delim_name();
static void init_registers();
static void trapping_blank_line();
-// this is for gcc 2.95 with old versions of libstdc++
-#define input_iterator my_input_iterator
-
class input_iterator;
input_iterator *make_temp_iterator(const char *);
const char *input_char_description(int);
@@ -2358,10 +2356,6 @@ int token::delimiter(int err)
return 1;
}
case TOKEN_NODE:
- // the user doesn't know what a node is
- if (err)
- error("missing argument or invalid starting delimiter");
- return 0;
case TOKEN_SPACE:
case TOKEN_STRETCHABLE_SPACE:
case TOKEN_UNSTRETCHABLE_SPACE:
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index f13a6be1..79e2f78f 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2003, 2004, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk)
This file is part of groff.
@@ -479,24 +479,21 @@ void mtsm::flush(FILE *fp, statem *s, string tag_list)
void statem::display_state()
{
fprintf(stderr, " <state ");
- if (bool_values[MTSM_BR].is_known) {
+ if (bool_values[MTSM_BR].is_known)
if (bool_values[MTSM_BR].value)
fprintf(stderr, "[br]");
else
fprintf(stderr, "[!br]");
- }
- if (bool_values[MTSM_EOL].is_known) {
+ if (bool_values[MTSM_EOL].is_known)
if (bool_values[MTSM_EOL].value)
fprintf(stderr, "[eol]");
else
fprintf(stderr, "[!eol]");
- }
- if (int_values[MTSM_SP].is_known) {
+ if (int_values[MTSM_SP].is_known)
if (int_values[MTSM_SP].value)
fprintf(stderr, "[sp %d]", int_values[MTSM_SP].value);
else
fprintf(stderr, "[!sp]");
- }
fprintf(stderr, ">");
fflush(stderr);
}
@@ -613,12 +610,12 @@ int state_set::is_in(int_value_state i)
int state_set::is_in(units_value_state u)
{
- return (unitsset & (1 << (int)u)) != 0;
+ return (unitsset & (1 << (int)u) != 0);
}
int state_set::is_in(string_value_state s)
{
- return (stringset & (1 << (int)s)) != 0;
+ return (stringset & (1 << (int)s) != 0);
}
void state_set::add(units_value_state, int n)