aboutsummaryrefslogtreecommitdiff
path: root/contrib/groff/src
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/src')
-rw-r--r--contrib/groff/src/devices/grotty/grotty.man85
-rw-r--r--contrib/groff/src/libs/libgroff/illegal.cc21
-rw-r--r--contrib/groff/src/preproc/eqn/neqn.sh3
-rw-r--r--contrib/groff/src/roff/groff/groff.man153
-rw-r--r--contrib/groff/src/roff/nroff/nroff.man81
-rwxr-xr-xcontrib/groff/src/roff/nroff/nroff.sh135
6 files changed, 305 insertions, 173 deletions
diff --git a/contrib/groff/src/devices/grotty/grotty.man b/contrib/groff/src/devices/grotty/grotty.man
index 4a109ced1034..00692404d91b 100644
--- a/contrib/groff/src/devices/grotty/grotty.man
+++ b/contrib/groff/src/devices/grotty/grotty.man
@@ -1,5 +1,6 @@
.ig \"-*- nroff -*-
-Copyright (C) 1989-1995 Free Software Foundation, Inc.
+$FreeBSD$
+Copyright (C) 1989-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -28,6 +29,10 @@ grotty \- groff driver for typewriter-like devices
] [
.IR files \|.\|.\|.
]
+.PP
+It is possible to have whitespace between the
+.B \-F
+option and its parameter.
.SH DESCRIPTION
.B grotty
translates the output of GNU
@@ -40,10 +45,13 @@ should invoked by using the
command
with a
.BR \-Tascii ,
-.B \-Tkoi8-r
-or
+.BR \-Tkoi8-r ,
.B \-Tlatin1
-option.
+or
+.B \-Tutf8
+option on ASCII based systems, and with
+.B \-Tcp1047
+on EBCDIC based hosts.
If no files are given,
.B grotty
will read the standard input.
@@ -120,9 +128,11 @@ for font and device description files;
.I name
is the name of the device, usually
.BR ascii ,
-.B koi8-r
+.BR koi8-r ,
+.BR latin1 ,
+.BR utf8 ,
or
-.BR latin1 .
+.BR cp1047 .
.TP
.B \-h
Use horizontal tabs in the output.
@@ -169,16 +179,64 @@ characters.
Print the version number.
.SH FILES
.TP
-.B @FONTDIR@/dev\fIname\fB/DESC
+.B @FONTDIR@/devascii/DESC
Device description file for
-.I name
+.B ascii
device.
.TP
-.BI @FONTDIR@/dev\fIname\fB/ F
+.BI @FONTDIR@/devascii/ F
Font description file for font
.I F
of
-.I name
+.B ascii
+device.
+.TP
+.B @FONTDIR@/devkoi8-r/DESC
+Device description file for
+.B koi8-r
+device.
+.TP
+.BI @FONTDIR@/devkoi8-r/ F
+Font description file for font
+.I F
+of
+.B koi8-r
+device.
+.TP
+.B @FONTDIR@/devlatin1/DESC
+Device description file for
+.B latin1
+device.
+.TP
+.BI @FONTDIR@/devlatin1/ F
+Font description file for font
+.I F
+of
+.B latin1
+device.
+.TP
+.B @FONTDIR@/devutf8/DESC
+Device description file for
+.B utf8
+device.
+.TP
+.BI @FONTDIR@/devutf8/ F
+Font description file for font
+.I F
+of
+.B utf8
+device.
+.TP
+.B @FONTDIR@/devcp1047/DESC
+Device description file for
+.B cp1047
+device.
+.TP
+.BI @FONTDIR@/devcp1047/ F
+Font description file for font
+.I F
+of
+.B cp1047
device.
.TP
.B @MACRODIR@/tmac.tty
@@ -188,6 +246,10 @@ Macros for use with
.B @MACRODIR@/tmac.tty-char
Additional klugey character definitions for use with
.BR grotty .
+.LP
+Note that on EBCDIC hosts, only files for the
+.B cp1047
+device will be installed.
.SH BUGS
.LP
.B grotty
@@ -209,4 +271,5 @@ cannot be printed.
.BR groff_font (@MAN5EXT@),
.BR groff_char (@MAN7EXT@),
.BR ul (1),
-.BR more (1)
+.BR more (1),
+.BR less (1)
diff --git a/contrib/groff/src/libs/libgroff/illegal.cc b/contrib/groff/src/libs/libgroff/illegal.cc
index ca9e0888e37c..6ab2a50090d4 100644
--- a/contrib/groff/src/libs/libgroff/illegal.cc
+++ b/contrib/groff/src/libs/libgroff/illegal.cc
@@ -1,8 +1,11 @@
+/* $FreeBSD$ */
+
#include "lib.h"
// Table of illegal input characters.
char illegal_char_table[256]= {
+#ifndef IS_EBCDIC_HOST
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,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 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,
+#endif
};
diff --git a/contrib/groff/src/preproc/eqn/neqn.sh b/contrib/groff/src/preproc/eqn/neqn.sh
index f33b68e3b350..1ae98e8fa8b8 100644
--- a/contrib/groff/src/preproc/eqn/neqn.sh
+++ b/contrib/groff/src/preproc/eqn/neqn.sh
@@ -1,6 +1,7 @@
#!/bin/sh
# Provision of this shell script should not be taken to imply that use of
-# GNU eqn with groff -Tascii|-Tlatin1 is supported.
+# GNU eqn with groff -Tascii|-Tlatin1|-Tutf8|-Tcp1047 is supported.
+# $FreeBSD$
# Default device.
locale=${LC_CTYPE:-$LANG}
diff --git a/contrib/groff/src/roff/groff/groff.man b/contrib/groff/src/roff/groff/groff.man
index 1f95a779f2d7..6244404fe29f 100644
--- a/contrib/groff/src/roff/groff/groff.man
+++ b/contrib/groff/src/roff/groff/groff.man
@@ -1,5 +1,5 @@
.ig \"-*- nroff -*-
-Copyright (C) 1999 Free Software Foundation, Inc.
+Copyright (C) 1989-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -34,55 +34,37 @@ the original English.
.SH NAME
groff \- front end for the groff document formatting system
.SH SYNOPSIS
+.nr a \n(.j
+.ad l
+.nr i \n(.i
+.in +\w'\fBgroff 'u
+.ti \niu
.B groff
-[
-.B \-abehilpstvzCENRSUVXZ
-]
-[
-.BI \-w name
-]
-[
-.BI \-W name
-]
-[
-.BI \-m name
-]
-[
-.BI \-F dir
-]
-[
-.BI \-I dir
-]
-[
-.BI \-T dev
-]
-[
-.BI \-f fam
-]
-[
-.BI \-M dir
-]
-[
-.BI \-d cs
-]
-[
-.BI \-r cn
-]
-[
-.BI \-n num
-]
-[
-.BI \-o list
-]
-[
-.BI \-P arg
-]
-[
-.BI \-L arg
-]
-[
-.IR files \|.\|.\|.\|
-]
+.de OP
+.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+.el .RB "[\ " "\\$1" "\ ]"
+..
+.OP \-abeghilpstvzCEGNRSUVXZ
+.OP \-w name
+.OP \-W name
+.OP \-m name
+.OP \-F dir
+.OP \-I dir
+.OP \-T dev
+.OP \-f fam
+.OP \-M dir
+.OP \-d cs
+.OP \-r cn
+.OP \-n num
+.OP \-o list
+.OP \-P arg
+.OP \-L arg
+.RI "[\ " files\|.\|.\|. "\ ]"
+.br
+.ad \na
+.PP
+It is possible to have whitespace between a command line option and its
+parameter.
.SH DESCRIPTION
.B groff
is a front-end to the groff document formatting system.
@@ -108,13 +90,24 @@ For a 100dpi X11 previewer.
For typewriter-like devices.
.TP
.B latin1
-For typewriter-like devices using the ISO Latin-1 character set.
+For typewriter-like devices using the ISO Latin-1 (ISO 8859-1) character set.
+.TP
+.B koi8-r
+For typewriter-like devices using the Russian KOI8-R character set.
+.TP
+.B utf8
+For typewriter-like devices using the Unicode (ISO 10646) character set with
+UTF-8 encoding.
+.TP
+.B cp1047
+For typewriter-like devices which use the EBCDIC code page IBM cp1047
+(e.g. OS/390 Unix).
.TP
.B lj4
For an HP LaserJet4-compatible (or other PCL5-compatible) printer.
.TP
-.B koi8-r
-For typewriter-like devices using the russian KOI8-R character set.
+.B lbp
+For Canon CAPSL printers (LBP-4 and LBP-8 series laser printers).
.TP
.B html
To produce HTML output.
@@ -131,6 +124,8 @@ The default device is
It can optionally preprocess with any of
.BR @g@pic ,
.BR @g@eqn ,
+.BR @g@grn ,
+.BR grap ,
.BR @g@tbl ,
.BR @g@refer ,
or
@@ -157,6 +152,12 @@ Preprocess with @g@eqn.
.B \-t
Preprocess with @g@tbl.
.TP
+.B \-g
+Preprocess with @g@grn.
+.TP
+.B \-G
+Preprocess with grap.
+.TP
.B \-p
Preprocess with @g@pic.
.TP
@@ -165,7 +166,7 @@ Preprocess with @g@soelim.
.TP
.BI \-I dir
This option is as described in
-.BR @g@soelim (@MAN1EXT@) .
+.BR @g@soelim (@MAN1EXT@).
This option implies the
.B \-s
option.
@@ -276,8 +277,8 @@ option to
and use the
.B \%\-msafer
macros with
-.BR @g@troff .
-(enabled by default)
+.B @g@troff
+(enabled by default).
.TP
.B \-U
Unsafe mode. Reverts to the old unsafe behaviour.
@@ -329,10 +330,12 @@ This also applies to
.BR tbl ,
.BR pic ,
.BR eqn ,
+.BR grn ,
.BR refer ,
and
.BR soelim .
It does not apply to
+.BR grap ,
.BR grops ,
.BR grodvi ,
.BR grotty ,
@@ -386,6 +389,28 @@ Font file for font
.I F
of device
.IR name .
+.LP
+Note that on EBCDIC hosts, output devices
+.BR ascii ,
+.BR latin1 ,
+and
+.B utf8
+aren't available.
+Similarly,
+.B cp1047
+is not available on ASCII based operating systems.
+.SH EXAMPLE
+To print the man page
+.B foo.1
+to the standard output using the latin-1 output device and
+.B less
+as the pager, the following command can be used:
+.IP
+.B groff -mandoc -Tlatin1 foo.1 | less
+.PP
+Alternatively, you can say
+.IP
+.B groff -m mandoc -Tlatin1 foo.1 | less
.SH AUTHOR
James Clark <jjc@jclark.com>
.SH BUGS
@@ -394,7 +419,7 @@ Include a complete, self-contained example
that will allow the bug to be reproduced,
and say which version of groff you are using.
.SH COPYRIGHT
-Copyright \(co 1989, 1990, 1991, 1992, 1999 Free Software Foundation, Inc.
+Copyright \(co 1989-2000 Free Software Foundation, Inc.
.LP
groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@ -412,19 +437,31 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.SH AVAILABILITY
The most recent released version of groff is always available for
anonymous ftp from ftp.gnu.org in the directory gnu/groff.
+.LP
+.B groff
+only supports the freely available
+.B grap
+implementation written by Ted Faber <faber@lunabase.org>.
+The actual version can be found at
+.IP
+\%http://www.lunabase.org/~faber/Vault/software/grap/
.SH "SEE ALSO"
.BR grog (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
.BR @g@tbl (@MAN1EXT@),
.BR @g@pic (@MAN1EXT@),
.BR @g@eqn (@MAN1EXT@),
-.BR @g@soelim (@MAN1EXT@) ,
+.BR @g@grn (@MAN1EXT@),
+.BR grap (1),
+.BR @g@soelim (@MAN1EXT@),
.BR @g@refer (@MAN1EXT@),
.BR grops (@MAN1EXT@),
.BR grodvi (@MAN1EXT@),
.BR grotty (@MAN1EXT@),
+.BR grolj4 (@MAN1EXT@),
+.BR grolbp (@MAN1EXT@),
.BR grohtml (@MAN1EXT@),
-.BR grohtml (@MAN1EXT@),
+.BR gxditview (@MAN1EXT@),
.BR groff_font (@MAN5EXT@),
.BR groff_out (@MAN5EXT@),
.BR groff_man (@MAN7EXT@),
diff --git a/contrib/groff/src/roff/nroff/nroff.man b/contrib/groff/src/roff/nroff/nroff.man
index d8d981626ddf..e33feb94dccd 100644
--- a/contrib/groff/src/roff/nroff/nroff.man
+++ b/contrib/groff/src/roff/nroff/nroff.man
@@ -1,5 +1,5 @@
.ig \"-*- nroff -*-
-Copyright (C) 1989-1999 Free Software Foundation, Inc.
+Copyright (C) 1989-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -23,37 +23,28 @@ the original English.
.SH NAME
@g@nroff \- emulate nroff command with groff
.SH SYNOPSIS
+.nr a \n(.j
+.ad l
+.nr i \n(.i
+.in +\w'\fB@g@nroff 'u
+.ti \niu
.B @g@nroff
-[
-.B \-h
-]
-[
-.B \-i
-]
-[
-.BI \-m name
-]
-[
-.BI \-n num
-]
-[
-.BI \-o list
-]
-[
-.BI \-p
-]
-[
-.BI \-r cn
-]
-[
-.BI \-t
-]
-[
-.BI \-T name
-]
-[
-.I file\|.\|.\|.
-]
+.de OP
+.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+.el .RB "[\ " "\\$1" "\ ]"
+..
+.OP \-h
+.OP \-i
+.OP \-m name
+.OP \-n num
+.OP \-o list
+.OP \-p
+.OP \-r cn
+.OP \-t
+.OP \-T name
+.RI "[\ " file\|.\|.\|. "\ ]"
+.br
+.ad \na
.SH DESCRIPTION
The
.B @g@nroff
@@ -63,11 +54,12 @@ command using groff.
The
.B \-T
option with an argument other than
-.B ascii
-and
-.B latin1
-and
-.B koi8-r
+.BR ascii ,
+.BR latin1 ,
+.BR koi8-r ,
+.BR utf8 ,
+or
+.B cp1047
will be ignored.
The
.B \-h
@@ -80,11 +72,9 @@ The
.BR \-i ,
.BR \-n ,
.BR \-m ,
-.BR \-p ,
-.BR \-o ,
-.B \-r
+.B \-o
and
-.B \-t
+.B \-r
options have the effect described in
.BR @g@troff (@MAN1EXT@).
In addition
@@ -95,12 +85,21 @@ silently ignores options of
or
.BR \-s .
Options
+.BR \-p ,
+.BR \-t ,
.B \-S
(safer) and
.B \-U
-(unsafe) are passed to groff.
+(unsafe) are passed to
+.BR groff .
.B \-S
is passed by default.
+.SH NOTES
+This shell script is basically intended for use with
+.BR man (1),
+so warnings are suppressed.
+nroff-style character definitions (in the file tmac.tty-char) are also
+loaded to emulate unrepresentable glyphs.
.SH "SEE ALSO"
.BR groff (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
diff --git a/contrib/groff/src/roff/nroff/nroff.sh b/contrib/groff/src/roff/nroff/nroff.sh
index 12f3fd16a2c1..d6586572727a 100755
--- a/contrib/groff/src/roff/nroff/nroff.sh
+++ b/contrib/groff/src/roff/nroff/nroff.sh
@@ -4,72 +4,83 @@
prog="$0"
# Default device.
-locale=${LC_CTYPE:-$LANG}
-if test `expr "$locale" : ".*\.ISO_8859-1"` -gt 0
-then
- T=-Tlatin1
-else
-if test `expr "$locale" : ".*\.KOI8-R"` -gt 0
-then
- T=-Tkoi8-r
-else
- T=-Tascii
-fi
-fi
+# First try the "locale charmap" command, because it's most reliable.
+# On systems where it doesn't exist, look at the environment variables.
+case "`#locale charmap 2>/dev/null`" in
+ UTF-8)
+ T=-Tutf8 ;;
+ ISO-8859-1)
+ T=-Tlatin1 ;;
+ IBM-1047)
+ T=-Tcp1047 ;;
+ *)
+ case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
+ *.UTF-8)
+ T=-Tutf8 ;;
+ iso_8859_1 | *.ISO-8859-1 | *.ISO_8859-1)
+ T=-Tlatin1 ;;
+ *.IBM-1047)
+ T=-Tcp1047 ;;
+ *.KOI8-R)
+ T=-Tkoi8-r ;;
+ *)
+ case "$LESSCHARSET" in
+ utf-8)
+ T=-Tutf8 ;;
+ latin1)
+ T=-Tlatin1 ;;
+ cp1047)
+ T=-Tcp1047 ;;
+ *)
+ T=-Tascii ;;
+ esac ;;
+ esac ;;
+esac
opts=
safer=-S
-for i
-do
- case $1 in
- -h)
- opts="$opts -P-h"
- ;;
- -[eq]|-s*)
- # ignore these options
- ;;
- -[mrnoT])
- echo "$prog: option $1 requires an argument" >&2
- exit 1
- ;;
- -[iStp]|-[mrno]*)
- opts="$opts $1";
- ;;
+# `for i; do' doesn't work with some versions of sh
- -Tascii|-Tlatin1|-Tkoi8-r)
- T=$1
- ;;
- -T*)
- # ignore other devices
- ;;
- -S)
- # safer behaviour
- safer=-S
- ;;
- -U)
- # unsafe behaviour
- safer=-U
- ;;
- -u*)
- # Solaris 2.2 `man' uses -u0; ignore it,
- # since `less' and `more' can use the emboldening info.
- ;;
- --)
- shift
- break
- ;;
- -)
- break
- ;;
- -*)
- echo "$prog: invalid option $1" >&2
- exit 1
- ;;
- *)
- break
- ;;
- esac
- shift
+for i
+ do
+ case $1 in
+ -h)
+ opts="$opts -P-h" ;;
+ -[eq] | -s*)
+ # ignore these options
+ ;;
+ -[mrnoT])
+ echo "$prog: option $1 requires an argument" >&2
+ exit 1 ;;
+ -[itp] | -[mrno]*)
+ opts="$opts $1" ;;
+ -Tascii | -Tlatin1 | -Tkoi8-r | -Tutf8 | -Tcp1047)
+ T=$1 ;;
+ -T*)
+ # ignore other devices
+ ;;
+ -S)
+ # safer behaviour
+ safer=-S ;;
+ -U)
+ # unsafe behaviour
+ safer=-U ;;
+ -u*)
+ # Solaris 2.2 `man' uses -u0; ignore it,
+ # since `less' and `more' can use the emboldening info.
+ ;;
+ --)
+ shift
+ break ;;
+ -)
+ break ;;
+ -*)
+ echo "$prog: invalid option $1" >&2
+ exit 1 ;;
+ *)
+ break ;;
+ esac
+ shift
done
# This shell script is intended for use with man, so warnings are